Package google.devtools.sourcerepo.v1

Index

SourceRepo

The Source Repo API service.

CreateRepo

rpc CreateRepo(CreateRepoRequest) returns (Repo)

Creates a repo in the given project with the given name.

If the named repository already exists, CreateRepo returns ALREADY_EXISTS.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

DeleteRepo

rpc DeleteRepo(DeleteRepoRequest) returns (Empty)

Deletes a repo.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

GetIamPolicy

rpc GetIamPolicy(GetIamPolicyRequest) returns (Policy)

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

GetProjectConfig

rpc GetProjectConfig(GetProjectConfigRequest) returns (ProjectConfig)

Returns the Cloud Source Repositories configuration of the project.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

GetRepo

rpc GetRepo(GetRepoRequest) returns (Repo)

Returns information about a repo.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

ListRepos

rpc ListRepos(ListReposRequest) returns (ListReposResponse)

Returns all repos belonging to a project. The sizes of the repos are not set by ListRepos. To get the size of a repo, use GetRepo.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

SetIamPolicy

rpc SetIamPolicy(SetIamPolicyRequest) returns (Policy)

Sets the access control policy on the specified resource. Replaces any existing policy.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

TestIamPermissions

rpc TestIamPermissions(TestIamPermissionsRequest) returns (TestIamPermissionsResponse)

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

UpdateProjectConfig

rpc UpdateProjectConfig(UpdateProjectConfigRequest) returns (ProjectConfig)

Updates the Cloud Source Repositories configuration of the project.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

UpdateRepo

rpc UpdateRepo(UpdateRepoRequest) returns (Repo)

Updates information about a repo.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

CreateRepoRequest

Request for CreateRepo

Fields
parent

string

The project in which to create the repo. Values are of the form projects/<project>.

Authorization requires the following Google IAM permission on the specified resource parent:

  • source.repos.create

repo

Repo

The repo to create. Only name should be set; setting other fields is an error. The project in the name should match the parent field.

DeleteRepoRequest

Request for DeleteRepo.

Fields
name

string

The name of the repo to delete. Values are of the form projects/<project>/repos/<repo>.

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

  • source.repos.delete

GetProjectConfigRequest

Request for GetProjectConfig.

Fields
name

string

The name of the requested project. Values are of the form projects/<project>.

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

  • source.repos.getProjectConfig

GetRepoRequest

Request for GetRepo.

Fields
name

string

The name of the requested repository. Values are of the form projects/<project>/repos/<repo>.

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

  • source.repos.get

ListReposRequest

Request for ListRepos.

Fields
name

string

The project ID whose repos should be listed. Values are of the form projects/<project>.

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

  • source.repos.list

page_size

int32

Maximum number of repositories to return; between 1 and 500. If not set or zero, defaults to 100 at the server.

page_token

string

Resume listing repositories where a prior ListReposResponse left off. This is an opaque token that must be obtained from a recent, prior ListReposResponse's next_page_token field.

ListReposResponse

Response for ListRepos. The size is not set in the returned repositories.

Fields
repos[]

Repo

The listed repos.

next_page_token

string

If non-empty, additional repositories exist within the project. These can be retrieved by including this value in the next ListReposRequest's page_token field.

MirrorConfig

Configuration to automatically mirror a repository from another hosting service, for example GitHub or Bitbucket.

Fields
url

string

URL of the main repository at the other hosting service.

webhook_id

string

ID of the webhook listening to updates to trigger mirroring. Removing this webhook from the other hosting service will stop Google Cloud Source Repositories from receiving notifications, and thereby disabling mirroring.

deploy_key_id

string

ID of the SSH deploy key at the other hosting service. Removing this key from the other service would deauthorize Google Cloud Source Repositories from mirroring.

ProjectConfig

Cloud Source Repositories configuration of a project.

Fields
name

string

The name of the project. Values are of the form projects/<project>.

pubsub_configs

map<string, PubsubConfig>

How this project publishes a change in the repositories through Cloud Pub/Sub. Keyed by the topic names.

enable_private_key_check

bool

Reject a Git push that contains a private key.

PubsubConfig

Configuration to publish a Cloud Pub/Sub message.

Fields
topic

string

A topic of Cloud Pub/Sub. Values are of the form projects/<project>/topics/<topic>. The project needs to be the same project as this config is in.

message_format

MessageFormat

The format of the Cloud Pub/Sub messages.

service_account_email

string

Email address of the service account used for publishing Cloud Pub/Sub messages. This service account needs to be in the same project as the PubsubConfig. When added, the caller needs to have iam.serviceAccounts.actAs permission on this service account. If unspecified, it defaults to the compute engine default service account.

MessageFormat

The format of the Cloud Pub/Sub messages.

Enums
MESSAGE_FORMAT_UNSPECIFIED Unspecified.
PROTOBUF The message payload is a serialized protocol buffer of SourceRepoEvent.
JSON The message payload is a JSON string of SourceRepoEvent.

Repo

A repository (or repo) is a Git repository storing versioned source content.

Fields
name

string

Resource name of the repository, of the form projects/<project>/repos/<repo>. The repo name may contain slashes. eg, projects/myproject/repos/name/with/slash

size

int64

The disk usage of the repo, in bytes. Read-only field. Size is only returned by GetRepo.

url

string

URL to clone the repository from Google Cloud Source Repositories. Read-only field.

mirror_config

MirrorConfig

How this repository mirrors a repository managed by another service. Read-only field.

pubsub_configs

map<string, PubsubConfig>

How this repository publishes a change in the repository through Cloud Pub/Sub. Keyed by the topic names.

UpdateProjectConfigRequest

Request for UpdateProjectConfig.

Fields
name

string

The name of the requested project. Values are of the form projects/<project>.

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

  • source.repos.updateProjectConfig

project_config

ProjectConfig

The new configuration for the project.

update_mask

FieldMask

A FieldMask specifying which fields of the project_config to modify. Only the fields in the mask will be modified. If no mask is provided, this request is no-op.

UpdateRepoRequest

Request for UpdateRepo.

Fields
name

string

The name of the requested repository. Values are of the form projects/<project>/repos/<repo>.

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

  • source.repos.updateRepoConfig

repo

Repo

The new configuration for the repository.

update_mask

FieldMask

A FieldMask specifying which fields of the repo to modify. Only the fields in the mask will be modified. If no mask is provided, this request is no-op.

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Source Repositories