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.

1. Get the list of service accounts

HTTP method Path

GET

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

curl example
curl --location --request GET '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>'
Input

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.

1. Get the list of service accounts

HTTP method Path

GET

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

curl example
curl --location --request GET '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>'
Input

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
    }
]
}