// ApiProviderDownloadCommand Download a specific API Provider from the API Portal
funcApiProviderDownloadCommand()*cobra.Command{
constSTEP_NAME="apiProviderDownload"
metadata:=apiProviderDownloadMetadata()
varstepConfigapiProviderDownloadOptions
varstartTimetime.Time
varlogCollector*log.CollectorHook
varsplunkClient*splunk.Splunk
telemetryClient:=&telemetry.Telemetry{}
varcreateApiProviderDownloadCmd=&cobra.Command{
Use:STEP_NAME,
Short:"Download a specific API Provider from the API Portal",
Long:`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](https://api.sap.com/api/APIPortal_CF/overview).`,
cmd.Flags().StringVar(&stepConfig.APIServiceKey,"apiServiceKey",os.Getenv("PIPER_apiServiceKey"),"Service key JSON string to access the API Management Runtime service instance of plan 'api'")
cmd.Flags().StringVar(&stepConfig.APIProviderName,"apiProviderName",os.Getenv("PIPER_apiProviderName"),"Specifies the name of the API Provider.")
cmd.Flags().StringVar(&stepConfig.DownloadPath,"downloadPath",os.Getenv("PIPER_downloadPath"),"Specifies api provider download directory location. The file name must not be included in the path.")
cmd.MarkFlagRequired("apiServiceKey")
cmd.MarkFlagRequired("apiProviderName")
cmd.MarkFlagRequired("downloadPath")
}
// retrieve step metadata
funcapiProviderDownloadMetadata()config.StepData{
vartheMetaData=config.StepData{
Metadata:config.StepMetadata{
Name:"apiProviderDownload",
Aliases:[]config.Alias{},
Description:"Download a specific API Provider from the API Portal",
},
Spec:config.StepSpec{
Inputs:config.StepInputs{
Secrets:[]config.StepSecrets{
{Name:"apimApiServiceKeyCredentialsId",Description:"Jenkins secret text credential ID containing the service key to the API Management Runtime service instance of plan 'api'",Type:"jenkins"},