apiProviderUpload¶
this steps creates an API provider artifact in the API Portal.
Description¶
This steps creates an API provider artifact in the API Portal using the OData API. Learn more about API Management api for creating 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')
apiProviderUpload script: this
piper apiProviderUpload
With this step, you can add a new entity to the API Providers. An API Provider is a concept in API Management, capability of SAP Integration Suite, which defines the connection details for services running on specific hosts whose details you want to access.
You use an API provider to define not only the details of the host you want an application to reach, but also to define any further details that are necessary to establish the connection, for example, proxy settings.For more details, see the blog API Providers
To consume the ApiProviderUpload step, proceed as follows:
- Copy the SAP API management service key from the SAP BTP cockpit. Go to instance and subscriptions → service API Management, API portal, which was created under apiportal-apiaccess plan.
- Store your service key created for API Management in the Jenkins server as a secret text.
- Create a new Jenkins pipeline designated for the ApiKeyValueMapUpload step.
- Create a api provider json file in the jenkins worksapce relative file path, as an input for ApiKeyValueMapUpload step.
- Execute the pipeline and validate the step exection results as explained in the blog Integration Suite Piper commands
- Use the ApiProviderUpload step to create a new API provider in the API portal.
- If API provider already exists, then delete it and execute the piper step again, which will create a new API provider.
- ApiProviderUpload only supports create operation.
Prerequisites¶
Parameters¶
Overview - Step¶
Name | Mandatory | Additional information |
---|---|---|
apiServiceKey | (yes) | pass via ENV or Jenkins credentials (apimApiServiceKeyCredentialsId ) |
filePath | 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¶
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 |
filePath¶
Specifies api provider json file relative path
Scope | Details |
---|---|
Aliases | - |
Type | string |
Mandatory | yes |
Default | $PIPER_filePath (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¶
Configuration example for a Jenkinsfile
:
apiProviderUpload script: this
Configuration example for a YAML file(for example .pipeline/config.yaml
):
steps:
<...>
apiKeyValueMapUpload:
apimApiServiceKeyCredentialsId: 'MY_API_SERVICE_KEY'
filePath: MY_API_PROVIDER_JSON_FILE_PATH