Method: projects.locations.repositories.commit

Applies a Git commit to a Repository. The Repository must not have a value for gitRemoteSettings.url.

HTTP request

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

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. The repository's name.

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

  • dataform.repositories.commit

Request body

The request body contains data with the following structure:

JSON representation
{
  "commitMetadata": {
    object (CommitMetadata)
  },
  "requiredHeadCommitSha": string,
  "fileOperations": {
    string: {
      object (FileOperation)
    },
    ...
  }
}
Fields
commitMetadata

object (CommitMetadata)

Required. The changes to commit to the repository.

requiredHeadCommitSha

string

Optional. The commit SHA which must be the repository's current HEAD before applying this commit; otherwise this request will fail. If unset, no validation on the current HEAD commit SHA is performed.

fileOperations

map (key: string, value: object (FileOperation))

A map to the path of the file to the operation. The path is the full file path including filename, from repository root.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

Response body

repositories.commit response message.

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

JSON representation
{
  "commitSha": string
}
Fields
commitSha

string

The commit SHA of the current commit.

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 name resource:

  • dataform.repositories.commit

For more information, see the IAM documentation.

CommitMetadata

Represents a Dataform Git commit.

JSON representation
{
  "author": {
    object (CommitAuthor)
  },
  "commitMessage": string
}
Fields
author

object (CommitAuthor)

Required. The commit's author.

commitMessage

string

Optional. The commit's message.

FileOperation

Represents a single file operation to the repository.

JSON representation
{

  // Union field operation can be only one of the following:
  "writeFile": {
    object (WriteFile)
  },
  "deleteFile": {
    object (DeleteFile)
  }
  // End of list of possible types for union field operation.
}
Fields

Union field operation.

operation can be only one of the following:

writeFile

object (WriteFile)

Represents the write operation.

deleteFile

object (DeleteFile)

Represents the delete operation.

WriteFile

Represents the write file operation (for files added or modified).

JSON representation
{
  "contents": string
}
Fields
contents

string (bytes format)

The file's contents.

A base64-encoded string.

DeleteFile

This type has no fields.

Represents the delete file operation.