Overview
Resources
Sync: Enable/Disable All GCP Accounts
Enable/Disable All GCP Accounts.
PUT https://{device}/api/npm.gcp_config/1.0/sync/statusAuthorization
This request requires authorization.
Request BodyProvide a request body with the following structure:
- JSON
{ "status": string } Example: { "status": "ENABLED" }
Property Name | Type | Description | Notes |
---|---|---|---|
SyncStatus | <object> | Object containing information to enable or disable the accounts. | |
SyncStatus.status | <string> | Value to enable or disable the accounts. | Values: ENABLED, DISABLED |
On success, the server does not provide any body in the responses.
Sync: Sync All GCP Accounts
Sync All GCP Accounts.
POST https://{device}/api/npm.gcp_config/1.0/syncAuthorization
This request requires authorization.
Request BodyDo not provide a request body.
Response BodyOn success, the server does not provide any body in the responses.
Auth_Codes: Delete GCP Accounts
Delete GCP Accounts.
DELETE https://{device}/api/npm.gcp_config/1.0/auth_codesAuthorization
This request requires authorization.
Request BodyProvide a request body with the following structure:
- JSON
[ { "project_id": string } ] Example: [ { "project_id": "project_id1" }, { "project_id": "project_id2" } ]
Property Name | Type | Description | Notes |
---|---|---|---|
Projectids | <array of <object>> | List of Projectid Objects. | |
Projectids[Projectid] | <object> | Object representing an account project ID. | Optional |
Projectids[Projectid].project_id | <string> | Account project ID. |
On success, the server does not provide any body in the responses.
Auth_Codes: Create/Update GCP Accounts
Delete GCP Accounts.
PUT https://{device}/api/npm.gcp_config/1.0/auth_codesAuthorization
This request requires authorization.
Request BodyProvide a request body with the following structure:
- JSON
[ { "client_email": string, "name": string, "private_key": string, "project_id": string } ] Example: [ { "private_key": "---BEGIN PRIVATE KEY abc END PRIVATE KEY---", "project_id": "project_id1", "client_email": "client_email1@a.com", "name": "name1" }, { "private_key": "---BEGIN PRIVATE KEY xyz END PRIVATE KEY---", "project_id": "project_id2", "client_email": "client_email2@x.com", "name": "name2" } ]
Property Name | Type | Description | Notes |
---|---|---|---|
AuthcodesGCPupd | <array of <object>> | List of Auth code Objects. | |
AuthcodesGCPupd[AuthcodeGCPupd] | <object> | Object representing an account project_id/ID, it's authorization information. | Optional |
AuthcodesGCPupd[AuthcodeGCPupd]. client_email |
<string> | Account client email. | |
AuthcodesGCPupd[AuthcodeGCPupd].name | <string> | Account name. | |
AuthcodesGCPupd[AuthcodeGCPupd]. private_key |
<string> | Account private key. | |
AuthcodesGCPupd[AuthcodeGCPupd]. project_id |
<string> | Account project_id. |
On success, the server does not provide any body in the responses.
Auth_Codes: Get the authorization information of the GCP Accounts
Delete GCP Accounts.
GET https://{device}/api/npm.gcp_config/1.0/auth_codesAuthorization
This request requires authorization.
Response BodyOn success, the server returns a response body with the following structure:
- JSON
[ { "client_email": string, "name": string, "project_id": string } ] Example: [ { "project_id": "project_id1", "client_email": "client_email1@a.com", "name": "name1" }, { "project_id": "project_id2", "client_email": "client_email2@x.com", "name": "name2" } ]
Status: GCP status
Get GCP Status.
GET https://{device}/api/npm.gcp_config/1.0/statusAuthorization
This request requires authorization.
Response BodyOn success, the server returns a response body with the following structure:
- JSON
{ "enabled": string, "error_text": string, "last_sync_ts": number, "last_success_ts": number, "error_id": number, "state": string } Example: { "last_sync_ts": 1606234492, "enabled": true, "last_success_ts": 1606234492, "state": "SYNC_SUCCEEDED", "error_id": 0, "error_text": "OK" }
Property Name | Type | Description | Notes |
---|---|---|---|
CloudStatus | <object> | Object containing synchronization information. | |
CloudStatus.enabled | <string> | Flag indicating if synchronization is enabled. | |
CloudStatus.error_text | <string> | Error description. | |
CloudStatus.last_sync_ts | <number> | Last attempted synchronization time. | |
CloudStatus.last_success_ts | <number> | Last successful synchronization time. | |
CloudStatus.error_id | <number> | Error ID. | |
CloudStatus.state | <string> | Synchronization status. | Values: SYNC_INITIALIZING, SYNC_FAILED, SYNC_SUCCEEDED, SYNC_SUCCEEDED_WITH_WARNING, SYNC_DISABLED, SYNC_NA |
Error Codes
In the event that an error occurs while processing a request, the server will respond with appropriate HTTP status code and additional information in the response body:
{ "error_id": "{error identifier}", "error_text": "{error description}", "error_info": {error specific data structure, optional} }
The table below lists the possible errors and the associated HTTP status codes that may returned.
Error ID | HTTP Status | Comments |
---|---|---|
INTERNAL_ERROR | 500 | Internal server error. |
AUTH_REQUIRED | 401 | The requested resource requires authentication. |
AUTH_INVALID_CREDENTIALS | 401 | Invalid username and/or password. |
AUTH_INVALID_SESSION | 401 | Session ID is invalid. |
AUTH_EXPIRED_PASSWORD | 403 | The password must be changed. Access only to password change resources. |
AUTH_DISABLED_ACCOUNT | 403 | Account is either temporarily or permanently disabled. |
AUTH_FORBIDDEN | 403 | User is not authorized to access the requested resource. |
AUTH_INVALID_TOKEN | 401 | OAuth access token is invalid. |
AUTH_EXPIRED_TOKEN | 401 | OAuth access token is expired. |
AUTH_INVALID_CODE | 401 | OAuth access code is invalid. |
AUTH_EXPIRED_CODE | 401 | OAuth access code is expired. |
RESOURCE_NOT_FOUND | 404 | Requested resource was not found. |
HTTP_INVALID_METHOD | 405 | Requested method is not available for this resource. |
HTTP_INVALID_HEADER | 400 | An HTTP header was malformed. |
REQUEST_INVALID_INPUT | 400 | Malformed input structure. |
URI_INVALID_PARAMETER | 400 | URI parameter is not supported or malformed. |
URI_MISSING_PARAMETER | 400 | Missing required parameter. |