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/v1/{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
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 ))

Optional. 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 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.repositories.commit

For more information, see the IAM documentation .

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 . The operation to perform on the file. 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.

Design a Mobile Site
View Site in Mobile | Classic
Share by: