The Axway Central CLI can be used to interact with your Central Environment to create, view, and modify various resources such as environments, service accounts, APIs, and much more.
In this blog post, we’ll modify an API Service’s description. This is an example of item #6 of the 10 things you may not know about the CLI blog post.
You will need to have the Axway Central CLI installed. Additionally, you need to have API Services in an Amplify Central Environment.
My existing API Service, translate, in environment v7b, is shown below:
Let’s get started.
Get Resource YAML
The first step is to authenticate using:
axway auth login
This will bring up your browser and you will have to enter your Axway Platform credentials (or IdP credentials, if IdP is enabled).
Then you can get a list of existing API Services using:
axway central get apiservices
Note that you can listing of all resource types using
axway central get
A sample response is shown below:
NAME AGE TITLE RESOURCE KIND SCOPE KIND SCOPE NAME
76e36ebc-7e0e-11eb-b160-005056acbe54 3 months ago Stockquote APIService Environment v7a
42e7ba2e-b463-11eb-a18c-0242ac110002 12 days ago PetStore APIService Environment aws
d47c1a63-8d7d-11eb-99ea-0242ac110003 2 months ago weather APIService Environment v7b
421dddfe-b463-11eb-a18c-0242ac110002 12 days ago ZooStore APIService Environment aws
2503419d-8cea-11eb-9e62-0242ac110003 2 months ago translate APIService Environment v7b
c3507ab2-b8e1-11eb-a9da-005056acbe54 6 days ago comprehend APIService Environment v7a
petstore a year ago Petstore APIService Environment mulesoft
- Get specific API Service as YAML:
axway central get apiservices 2503419d-8cea-11eb-9e62-0242ac110003 -s v7b -o yaml
The response was:
description: API From Edge APIManager
Save the YAML in a file. I called mine resources.yaml.
Let’s first modify the description and save the icon for later. I edited my YAML file and changed the last line as follows:
description: API to translate between languages
The following CLI command will apply the YAML file to the API Service:
axway central apply -f resources.yaml
✔ "apiservice/2503419d-8cea-11eb-9e62-0242ac110003" has successfully been updated.
Note the revised description
In this blog post, we saw how we can use the Axway Central CLI to modify Amplify Central Resources. We modified an API Service Description with two CLI commands.
Learn more about Amplify Central Integration Webhooks — API Publish Approval.