apiProviderDownload¶
Download a specific API Provider from the API Portal
Description¶
With this step you can download a specific API Provider from the API Portal, which returns a JSON file with the api provider contents in to current workspace using the OData API. Learn more about the SAP API Management API for downloading an api provider artifact here.
Usage¶
We recommend to define values of step parameters via .pipeline/config.yml file.
In this case, calling the step is essentially reduced to defining the step name.
Calling the step can be done either in an orchestrator specific way (e.g. via a Jenkins library step) or on the command line.
library('piper-lib-os')
apiProviderDownload script: this
piper apiProviderDownload
- API Provider defines the connection details for services running on specific hosts.
- This function returns the APIProvider entity and stores it in the file system.
Prerequisites¶
API Provider artifact to be downloaded should exist in the API Portal.
Parameters¶
Overview - Step¶
Name | Mandatory | Additional information |
---|---|---|
apiProviderName | yes | |
apiServiceKey | (yes) | pass via ENV or Jenkins credentials (apimApiServiceKeyCredentialsId ) |
downloadPath | yes | |
script | (yes) | reference to Jenkins main pipeline script |
verbose | no | activates debug output |
Overview - Execution Environment¶
Orchestrator-specific only
These parameters are relevant for orchestrator usage and not considered when using the command line option.
Name | Mandatory | Additional information |
---|---|---|
Details¶
apiProviderName¶
Specifies the name of the API Provider.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | yes |
Default | $PIPER_apiProviderName (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
apiServiceKey¶
Service key JSON string to access the API Management Runtime service instance of plan 'api'
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | yes |
Default | $PIPER_apiServiceKey (if set) |
Secret | yes |
Configuration scope |
|
Resource references | Jenkins credential id: id: apimApiServiceKeyCredentialsId reference to: apiServiceKey |
downloadPath¶
Specifies api provider download directory location. The file name must not be included in the path.
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | yes |
Default | $PIPER_downloadPath (if set) |
Secret | no |
Configuration scope |
|
Resource references | none |
script¶
Jenkins-specific: Used for proper environment setup.
The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the this
parameter, as in script: this
. This allows the function to access the commonPipelineEnvironment
for retrieving, e.g. configuration parameters.
Scope | Details |
---|---|
Aliases | - |
Type | Jenkins Script |
Mandatory | yes |
Default | |
Secret | no |
Configuration scope |
|
Resource references | none |
verbose¶
verbose output
Scope | Details |
---|---|
Aliases | - |
Type | bool |
Mandatory | no |
Default | false |
Possible values | - true - false |
Secret | no |
Configuration scope |
|
Resource references | none |
apimApiServiceKeyCredentialsId¶
Jenkins-specific: Used for proper environment setup. See using credentials for details.
Jenkins secret text credential ID containing the service key to the API Management Runtime service instance of plan 'api'
Scope | Details |
---|---|
Aliases | - |
Type | string |
Configuration scope |
|
Example¶
Example configuration for the use in a Jenkinsfile
.
apiProviderDownload script: this
Example for the use in a YAML configuration file (such as .pipeline/config.yaml
).
steps:
<...>
apiProviderDownload:
apimApiServiceKeyCredentialsId: 'MY_API_SERVICE_KEY'
apiProviderName: 'MY_API_PROVIDER_NAME'
downloadPath: MY_API_PROVIDER_JSON_FILE_DOWNLOAD_PATH