Method: projects.locations.getDefaultServiceAccount

Returns the DefaultServiceAccount used by the project.

HTTP request

GET https://cloudbuild.googleapis.com/v1/{name=projects/*/locations/*/defaultServiceAccount}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. The name of the DefaultServiceAccount to retrieve. Format: projects/{project}/locations/{location}/defaultServiceAccount

Authorization requires the following IAM permission on the specified resource name:

  • cloudbuild.builds.get

Request body

The request body must be empty.

Response body

The default service account used for Builds.

If successful, the response body contains data with the following structure:

JSON representation
{
  "name": string,
  "serviceAccountEmail": string
}
Fields
name

string

Identifier. Format: `projects/{project}/locations/{location}/defaultServiceAccount

serviceAccountEmail

string

Output only. The email address of the service account identity that will be used for a build by default.

This is returned in the format projects/{project}/serviceAccounts/{serviceAccount} where {serviceAccount} could be the legacy Cloud Build SA, in the format [PROJECT_NUMBER]@cloudbuild.gserviceaccount.com or the Compute SA, in the format [PROJECT_NUMBER]-compute@developer.gserviceaccount.com.

If no service account will be used by default, this will be empty.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.