Add function to get checksum of artifact
Related-PROD: PRODX-486
Change-Id: I2c5c1327a8ed9a4fb1e30be5391bb6b6ffef6a89
diff --git a/src/com/mirantis/mk/Artifactory.groovy b/src/com/mirantis/mk/Artifactory.groovy
index 84eb143..824ba4f 100644
--- a/src/com/mirantis/mk/Artifactory.groovy
+++ b/src/com/mirantis/mk/Artifactory.groovy
@@ -429,6 +429,22 @@
}
/**
+ * Get checksums of artifact
+ *
+ * @param art Artifactory connection object
+ * @param artifactName Artifactory object name
+ * @param checksum Type of checksum (default md5)
+ * @param repoName Artifact repository name
+ */
+
+def getArtifactChecksum(art, repoName, artifactName, checksum = 'md5'){
+ def artifactory = new com.mirantis.mk.Artifactory()
+ def uri = "/storage/${repoName}/${artifactName}"
+ def output = artifactory.restGet(art, uri)
+ return output['checksums']["${checksum}"]
+}
+
+/**
* Create Helm repo for Artifactory
*
* @param art Artifactory connection object