Method: projects.locations.repositories.workspaces.checkout

Checkout a branch in a workspace.

HTTP request


POST https://dataform.googleapis.com/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:checkout

The URLs use gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. The workspace resource name. Format: projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}

Request body

The request body contains data with the following structure:

JSON representation
{
  "branch": string,
  "createIfNotExists": boolean,
  "sourceBranch": string
}
Fields
branch

string

Required. The name of the branch in the Git repository to which the workspace should be checked out.

createIfNotExists

boolean

Optional. If set to true and the branch does not exist, the branch is created. Otherwise, an error is thrown.

sourceBranch

string

Optional. The name of the branch in the Git repository from which the new branch should be created. If left unset, the workspace's current branch name is used. Accepts only branch names from the workspaces.fetchBranches response, and can only be set if createIfNotExists is true. Otherwise, an error is thrown.

Response body

If successful, the response body is an empty JSON object.

Authorization scopes

Requires one of the following OAuth scopes:

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

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the name resource:

  • dataform.workspaces.checkoutBranch

For more information, see the IAM documentation.