API Documentation
Documentation for the IP4G Swagger API
You can use the IBM Power for Google Cloud API to easily deploy and configure virtual servers that are running AIX or IBM i workloads.
Swagger Documentation
The interactive Swagger API documentation is available at the following endpoints:
Testing API Methods in Swagger
You can test API methods directly in the Swagger UI interface:
- Login: Click on the login button in the top right corner of the Swagger interface
- Authentication: Sign in using your Google account
- API Testing: Once authenticated, you can call any API method directly from the Swagger interface
- Automatic Token Handling: Your authentication token will be automatically attached to all API calls
This allows you to test and validate API functionality without needing to set up separate authentication or manage tokens manually.
1 - API Authentication
IBM Power for Google Cloud API Authentication
To work with the API, you must log in and authenticate yourself. Take note of your Authorization: Bearer <token> and Cloud ID. The Authorization: Bearer <token> is short lived. It will need to be refreshed. Enter the following commands to log in and obtain the necessary information:
pcloud auth loginpcloud auth print-access-tokenpcloud compute clouds list
You can also enter the following URL into any browser to obtain your accessToken: https://service-broker-api.gpcloudtest.com/auth/v1/login. Select your Google account and copy the accessToken.
2 - API Error Handling
IBM Power for Google Cloud API Error Handling
This API uses standard HTTP response codes to indicate whether a method completed successfully. A 200 response indicates success. A 400 type response indicates a failure, and a 500 type response indicates an internal system error.
| HTTP error code | Description | Recovery |
|---|
| 200 | Success | The request was successful. |
| 400 | Bad Request | The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request. |
| 401 | Unauthorized | You are not authorized to make this request. Log in to IBM Cloud and try again. If this error persists, contact the account owner to check your permissions. |
| 403 | Forbidden | The supplied authentication is not authorized to access this resource. |
| 404 | Not Found | The requested resource could not be found. |
| 408 | Request Timeout | The connection to the server timed out. Wait a few minutes, then try again. |
| 409 | Conflict | The entity is already in the requested state. |
| 500 | Internal Server Error | Power Systems Virtual Server is currently unavailable. Your request could not be processed. Wait a few minutes and try again. |