This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

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:

  1. Login: Click on the login button in the top right corner of the Swagger interface
  2. Authentication: Sign in using your Google account
  3. API Testing: Once authenticated, you can call any API method directly from the Swagger interface
  4. 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:

  1. pcloud auth login
  2. pcloud auth print-access-token
  3. pcloud 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 codeDescriptionRecovery
200SuccessThe request was successful.
400Bad RequestThe input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request.
401UnauthorizedYou 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.
403ForbiddenThe supplied authentication is not authorized to access this resource.
404Not FoundThe requested resource could not be found.
408Request TimeoutThe connection to the server timed out. Wait a few minutes, then try again.
409ConflictThe entity is already in the requested state.
500Internal Server ErrorPower Systems Virtual Server is currently unavailable. Your request could not be processed. Wait a few minutes and try again.