GCP

Managing GCP organisations.

Create A GCP Organisation

post/gcp/organisations

This endpoint allows you to onboard a new GCP organisation into conformity via a serviceAccount key as a managed group.

Onboard a new GCP organisation

The expected behavior of this request is to create a new GCP organisation.

Example request for creating a new GCP organisation:

curl -X POST -H "Content-Type: application/vnd.api+json" \
-H "Authorization: ApiKey YOUR-API-KEY" \
-d '
{
  "data": {
    "serviceAccountName": "GCP organisation",
    "serviceAccountKeyJson": {
      "type": "service_account",
      "project_id": "project_id",
      "private_key_id": "private_key_id",
      "private_key": "private_key",
      "client_email": "client_email",
      "client_id": "client_id",
      "auth_uri": "auth_uri",
      "token_uri": "token_uri",
      "auth_provider_x509_cert_url": "auth_provider_x509_cert_url",
      "client_x509_cert_url": "client_x509_cert_url"
    }
  }
}' \
https://us-west-2-api.cloudconformity.com/v1/gcp/organisations

Example Response:

{
  "data": {
    "type": "gcp-organisations",
    "id": {organisation-id},
    "attributes": {
      "serviceAccountName": "GCP organisation",
      "serviceAccountUniqueId": "service account unique id"
    }
  }
}
SecurityApiKeyAuth
Request
Request Body schema: application/json
object
Responses
200

OK

403

Unauthorized. The requesting user does not have enough privilege.

422

Unprocessed Entity. Validation error.

Request samples
application/json
{
  • "data": {
    }
}
Response samples
application/json
{
  • "data": {
    }
}

List all GCP projects for an organisation

get/gcp/organisations/{organisationId}/projects

This endpoint allows you to list all GCP projects associated with an organisation.

List all GCP projects associated with an organisation

Example request for creating a new GCP organisation:

curl -X GET -H "Content-Type: application/vnd.api+json" \
-H "Authorization: ApiKey YOUR-API-KEY" \
https://us-west-2-api.cloudconformity.com/v1/gcp/organisations/abcdefgh-1234-5678-9012-e248072e96a2/projects

Example Response:

{
  "data": [
    {
      "type": "projects",
      "attributes": {
        "project-number": "111111111111",
        "project-id": "project-id-1",
        "lifecycle-state": "ACTIVE",
        "name": "Project Name 1",
        "create-time": "2021-05-17T11:21:58.012Z",
        "parent": {
          "type": "folder",
          "id": "333333333333"
        },
        "added-to-conformity": true
      }
    },
    {
      "type": "projects",
      "attributes": {
        "project-number": "222222222222",
        "project-id": "project-id-2",
        "lifecycle-state": "ACTIVE",
        "name": "Project Name 2",
        "create-time": "2021-01-11T03:19:17.326Z",
        "parent": {
          "type": "folder",
          "id": "444444444444"
        },
        "added-to-conformity": true
      }
    }
  ]
}
SecurityApiKeyAuth
Request
path Parameters
organisationId
required
string

The id of the Conformity GCP organisation.

Responses
200

OK

403

Unauthorized. The requesting user does not have enough privilege.

404

Group not found.

500

Internal Server Error.

Response samples
application/json
{
  • "data": [
    ]
}