diff --git a/vars/pulp.groovy b/vars/pulp.groovy index 3b923d8..9cc7b33 100644 --- a/vars/pulp.groovy +++ b/vars/pulp.groovy @@ -3,13 +3,20 @@ import groovy.json.JsonOutput def call() { pipeline { + parameters { + string( + name: 'pulpHost', + description: 'Nom de domaine pour le serveur Pulp', + defaultValue: '' + } + def getResourceHREF( String credentials, String resourceEndpoint, String resourceName, - String pulpHost + // String pulpHost ) { - def response = httpRequest authentication: credentials, url: "https://${pulpHost}/pulp/api/v3/${resourceEndpoint}", httpMode: 'GET', ignoreSslErrors: true, validResponseCodes: "200" + def response = httpRequest authentication: credentials, url: "https://${params.pulpHost}/pulp/api/v3/${resourceEndpoint}", httpMode: 'GET', ignoreSslErrors: true, validResponseCodes: "200" def jsonResponse = readJSON text: response.content def resource = jsonResponse.results.find { it -> it.name == resourceName} if (resource) {