Method: projects.locations.connections.repositories.fetchGitRefs

Fetch the list of branches or tags for a given repository.

HTTP request

GET https://cloudbuild.googleapis.com/v2/{repository=projects/*/locations/*/connections/*/repositories/*}:fetchGitRefs

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
repository

string

Required. The resource name of the repository in the format projects/*/locations/*/connections/*/repositories/*.

Query parameters

Parameters
refType

enum (RefType)

Type of refs to fetch

pageSize

integer

Optional. Number of results to return in the list. Default to 20.

pageToken

string

Optional. Page start.

Request body

The request body must be empty.

Response body

Response for fetching git refs

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

JSON representation
{
  "refNames": [
    string
  ],
  "nextPageToken": string
}
Fields
refNames[]

string

Name of the refs fetched.

nextPageToken

string

A token identifying a page of results the server should return.

Authorization scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the repository resource:

  • cloudbuild.repositories.fetchGitRefs

For more information, see the IAM documentation.

RefType

Type of refs

Enums
REF_TYPE_UNSPECIFIED No type specified.
TAG To fetch tags.
BRANCH To fetch branches.