Skip to main content

Get service accounts

Contributors netapp-ranuk

This workflow retrieves a list of service accounts from the specified project.

Choose the workflow to use based on the type of Cloud Volumes ONTAP deployment:

Get service accounts for single node

You can use this workflow to retrieve the service accounts in a single node working environment.

HTTP method and endpoint

This REST API call uses the following method and endpoint.

HTTP method Path

GET

/occm/api/gcp/vsa/metadata/service-accounts

Curl example
curl --request GET \
--location "https://cloudmanager.cloud.netapp.com/occm/api/gcp/vsa/metadata/service-accounts" \
--header "Content-Type: application/json" \
--header "x-agent-id: <AGENT_ID>" \
--header "Authorization: Bearer <ACCESS_TOKEN>"
Additional input parameters

None

Output

The JSON output retrieves a list of service accounts from the project.

JSON output example
{
"accounts": [
    {
        "name": "projects/occm-dev/serviceAccounts/00000-compute@serviceaccount.com",
        "projectId": "occm-dev",
        "email": "00000-compute@serviceaccount.com",
        "displayName": "Compute Engine default service account",
        "isEnabled": false
    },
    {
        "name": "projects/occm-dev/serviceAccounts/xxx-000@occmaccount.com",
        "projectId": "occm-dev",
        "email": "xxxx-000@occmaccount.com",
        "displayName": "admin",
        "isEnabled": false
    }
]
}

Get service accounts for high availability pair

You can use this workflow to retrieve the service accounts in an HA working environment.

HTTP method and endpoint

This REST API call uses the following method and endpoint.

HTTP method Path

GET

/occm/api/gcp/ha/metadata/service-accounts

Curl example
curl --request GET \
--location "https://cloudmanager.cloud.netapp.com/occm/api/gcp/ha/metadata/service-accounts" \
--header "Content-Type: application/json" \
--header "x-agent-id: <AGENT_ID>" \
--header "Authorization: Bearer <ACCESS_TOKEN>"
Additional input parameters

None

Output

The JSON output retrieves a list of service accounts from the project.

JSON output example
{
"accounts": [
    {
        "name": "projects/occm-dev/serviceAccounts/00000-compute@serviceaccount.com",
        "projectId": "occm-dev",
        "email": "00000-compute@serviceaccount.com",
        "displayName": "Compute Engine default service account",
        "isEnabled": false
    },
    {
        "name": "projects/occm-dev/serviceAccounts/xxx-000@occmaccount.com",
        "projectId": "occm-dev",
        "email": "xxxx-000@occmaccount.com",
        "displayName": "admin",
        "isEnabled": false
    }
]
}