What Happened?
This is a guide on how to configure and test the API of Distributed Cloud.
Environment
- XC SaaS
- XC API
Resolution/Answer
In order to make an API call to XC services, you would need the following information:
- Request URL
- Authorization header/API Token
To retrieve your API token:
- Navigate to Administration > Personal Management
- If an API token has not already been created, please follow the Generate API Tokens part of this doc: https://docs.cloud.f5.com/docs/how-to/user-mgmt/credentials
- Copy the API token from Credentials or Service Credentials list:
How to test API using curl
- Find the API you want to test or execute, for example, if we want to get the Load Balancer list of our namespace refer to https://docs.cloud.f5.com/docs/api/views-http-loadbalancer#operation/ves.io.schema.views.http_loadbalancer.API.List
- There are the descriptions of this API
- The host is the host of your portal like {teant-name}.console.ves.volterra.io
- Add the API token to the header and the curl command is like the below:
curl --location 'https://{teant-name}.console.ves.volterra.io/api/config/namespaces/{namespace_name}/http_loadbalancers' \
--header 'Authorization: APIToken {API_Token}'
How to test API using Postman
- Find the API you want to test or execute, for example, if we want to get the Load Balancer list of our namespace refer to https://docs.cloud.f5.com/docs/api/views-http-loadbalancer#operation/ves.io.schema.views.http_loadbalancer.API.List
- Build your request like the below:
Additional Information
- F5 also provides API Developer Portal to test or execute API using the token, you can use it through the below way or just visit the URL: https://{tenant name}.console.ves.volterra.io/web/devportal/apidocs/address_allocator
- You can use Postman as a GUI to test your API calls:
Download Postman - Here is a collection you can import to Postman for testing (potentially outdated)
XC API Examples | Github