feat: Add new gcloud commands, API clients, and third-party libraries across various services.

This commit is contained in:
2026-01-01 20:26:35 +01:00
parent 5e23cbece0
commit a19e592eb7
25221 changed files with 8324611 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*- #
# Copyright 2022 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The command group for Google Cloud Build's Connections."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(
base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA, base.ReleaseTrack.GA
)
class Connections(base.Group):
"""Manage connections for Google Cloud Build."""
category = base.CI_CD_CATEGORY

View File

@@ -0,0 +1,21 @@
- help_text:
brief: Add IAM policy binding to a Cloud Build connection.
description: |
Add IAM policy binding to a Cloud Build connection.
One binding consists of a member and a role.
examples: |
To add an IAM policy binding for the role of 'roles/cloudbuild.connectionViewer'
for the user 'test-user@gmail.com' on a Connection named 'my-conn',
run:
$ {command} my-conn --region=us-central1 \
--member='user:test-user@gmail.com' --role='roles/cloudbuild.connectionViewer'
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
arguments:
resource:
help_text: Cloud Build Connection for which to add the IAM policy binding.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection

View File

@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*- #
# Copyright 2022 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The command group for Google Cloud Build's Connections."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(
base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA, base.ReleaseTrack.GA
)
class Create(base.Group):
"""Create Connections in Google Cloud Build."""
category = base.CI_CD_CATEGORY

View File

@@ -0,0 +1,47 @@
- help_text:
brief: Create a Cloud Build Connection for Bitbucket Cloud.
description: |
Create a Cloud Build Connection for Bitbucket Cloud.
A Bitbucket Cloud Connection can be created by using a repository/project/workspace access token with `repository_read`,`repository_admin`, `pullrequest_read`, `webhook`
scope permission and a repository/project/workspace access token with `repository_read` scope permission.
examples: |
To create a Bitbucket Cloud connection, provide all the required parameters:
$ {command} my-bitbucket-conn \
--project=myproj --region=us-central1 \
--workspace=my-workspace \
--read-authorizer-token-secret-version=projects/myproj/secrets/read-pat/versions/1 \
--authorizer-token-secret-version=projects/myproj/secrets/admin-pat/versions/1 \
--webhook-secret-secret-version=projects/myproj/secrets/whsecret/versions/1
command_type: CREATE
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
arguments:
resource:
help_text: Connection to create.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection
params:
- api_field: connection.bitbucketCloudConfig.workspace
arg_name: workspace
help_text: Workspace of the Bitbucket Cloud instance.
required: true
- api_field: connection.bitbucketCloudConfig.authorizerCredential.userTokenSecretVersion
arg_name: authorizer-token-secret-version
help_text: Secret containing the `repository_read`,`repository_admin`, `pullrequest_read`, `webhook` repository/project/workspace access token.
required: true
- api_field: connection.bitbucketCloudConfig.readAuthorizerCredential.userTokenSecretVersion
arg_name: read-authorizer-token-secret-version
help_text: Secret containing the `repository_read` repository/project/workspace access token.
required: true
- api_field: connection.bitbucketCloudConfig.webhookSecretSecretVersion
arg_name: webhook-secret-secret-version
required: true
help_text: |-
Secret containing the webhook secret string for validating webhook events sent by
Bitbucket Cloud.
async:
collection: cloudbuild.projects.locations.operations

View File

@@ -0,0 +1,72 @@
- help_text:
brief: Create a Cloud Build Connection for Bitbucket Data Center.
description: |
Create a Cloud Build Connection for Bitbucket Data Center.
A Bitbucket Data Center Connection can be created by using a personal access token with `REPO_ADMIN`
scope permission. A `REPO_READ` scoped personal access token will also be required.
If the Bitbucket Data Center can only be accessed within a VPC, a Service Directory
service resource can be provided for connecting to it.
examples: |
To create a Bitbucket Data Center connection, provide all the required parameters:
$ {command} my-bitbucket-conn \
--project=myproj --region=us-central1 \
--host-uri=https://bitbucket-server.net \
--read-authorizer-token-secret-version=projects/myproj/secrets/read-pat/versions/1 \
--authorizer-token-secret-version=projects/myproj/secrets/admin-pat/versions/1 \
--webhook-secret-secret-version=projects/myproj/secrets/whsecret/versions/1
To create a Bitbucket Data Center connection for a private Bitbucket Data Center server.
Provide the service-directory-service and ssl-ca-file as well:
$ {command} my-private-bitbucket-conn \
--host-uri=https://my.private-bitbucket-server.net \
--project=myproj --region=us-central1 \
--service-directory-service=projects/myproj/namespaces/x/services/mysds \
--ssl-ca-file=mycertificate.crt \
--authorizer-token-secret-version=projects/myproj/secrets/admin-pat/versions/1 \
--read-authorizer-token-secret-version=projects/myproj/secrets/read-pat/versions/1 \
--webhook-secret-secret-version=projects/myproj/secrets/whsecret/versions/1
command_type: CREATE
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
arguments:
resource:
help_text: Connection to create.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection
params:
- api_field: connection.bitbucketDataCenterConfig.hostUri
arg_name: host-uri
help_text: URI of the Bitbucket Data Center instance.
- api_field: connection.bitbucketDataCenterConfig.authorizerCredential.userTokenSecretVersion
arg_name: authorizer-token-secret-version
help_text: Secret containing the REPO_ADMIN personal access token.
required: true
- api_field: connection.bitbucketDataCenterConfig.readAuthorizerCredential.userTokenSecretVersion
arg_name: read-authorizer-token-secret-version
help_text: Secret containing the REPO_READ personal access token.
required: true
- api_field: connection.bitbucketDataCenterConfig.webhookSecretSecretVersion
arg_name: webhook-secret-secret-version
required: true
help_text: |-
Secret containing the webhook secret string for validating webhook events sent by
Bitbucket Data Center.
- group:
help_text: Group of arguments for configuring access through Service Directory.
params:
- api_field: connection.bitbucketDataCenterConfig.serviceDirectoryConfig.service
arg_name: service-directory-service
required: true
help_text: Service Directory service resource to use for accessing the Bitbucket Data Center. Necessary only if the server has no public access from the internet.
- api_field: connection.bitbucketDataCenterConfig.sslCa
arg_name: ssl-ca-file
help_text: File containing the SSL_CA to be used.
processor: googlecloudsdk.core.util.files:ReadFileContents
async:
collection: cloudbuild.projects.locations.operations

View File

@@ -0,0 +1,69 @@
- help_text:
brief: Create a Cloud Build Connection of type GitHub.
description: |
Create a Cloud Build Connection of type GitHub (for github.com).
Connections for github.com can be created either by following an installation process (that
requires manual steps in a web browser) or by providing the properties of an already-installed
application (installation ID and a user token) as arguments to this command.
examples: |
To create a connection by following the installation process, provide only the connection name:
$ {command} myconn \
--project=myproj --region=us-central1
The command will print a URL to be opened in a web browser in order to authorize Cloud Build
(i.e. Cloud Build gets an OAuth token for the github account that you use). After doing this
authorization, you can get the connection's installation state with the describe command:
$ gcloud alpha builds connections describe myconn
The output will include a second link to install the Cloud Build GitHub App. After doing this,
the connection will be in installation state COMPLETE and repositories can be added to it (see
``gcloud'' alpha builds repositories create).
--
To create a complete connection (e.g. based on an existing user token and installation),
provide both the authorizer secret token and the app installation id:
$ {command} myconn \
--project=myproj --region=us-central1 \
--authorizer-token-secret-version=projects/myproj/secrets/mytoken/versions/1 \
--app-installation-id=1234
Above command creates the connection in installation state COMPLETE, ready for adding
repositories.
command_type: CREATE
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
# If no arguments are provided, create an empty connection.
static_fields:
"connection.githubConfig": {}
arguments:
resource:
help_text: Connection to create.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection
params:
- group:
help_text: Group of arguments for configuring a complete connnection.
# if app-installation-id is provided, authorizer-token has to be provided too.
params:
- api_field: connection.githubConfig.authorizerCredential.oauthTokenSecretVersion
arg_name: authorizer-token-secret-version
help_text: Secret containing the authorizer user's token.
required: true
- api_field: connection.githubConfig.appInstallationId
arg_name: app-installation-id
help_text: Installation ID of the Cloud Build GitHub App.
output:
# Print the installation instruction and link (if any) after creation.
format: 'csv[no-heading,separator="\\n"](installationState.stage,installationState.message,installationState.actionUri)'
async:
collection: cloudbuild.projects.locations.operations

View File

@@ -0,0 +1,111 @@
- help_text:
brief: Create a Cloud Build Connection of type GitHub Enterprise.
description: |
Create a Cloud Build Connection of type GitHub Enterprise.
Connections for GitHub Enterprise can be created either by following an intallation process
(that requires manual steps in a web browser) or by providing all the properties of an
already-installed application as arguments to this command.
If the GitHub Enterprise server can only be accessed within a VPC, a Service Directory
service resource can be provided for connecting to it.
examples: |
To create a connection by following the installation process, provide only the connection
name and the host URI. If the server can only be accessed within a VPC, provide also the
Service Directory service resource:
$ {command} my-ghe-conn \
--project=myproj --region=us-central1
--host-uri=https://my.ghe-server.net
--service-directory-service=projects/myproj/namespaces/x/services/mysds
The command will print a URL to be opened in a web browser in order create and install a
GitHub App in that server. After following the URL, you can get the connection's installation
state with The ``describe'' command:
$ gcloud alpha builds connections describe my-ghe-conn --region=us-central1
If the connection's installation state is not COMPLETE yet, it will provide a link to continue
the installation process. Once the connection is in installation state COMPLETE, repositories
can be added to it (see ``gcloud'' alpha builds repositories create).
--
To create a complete connection (e.g. based on an existing installation),
provide all the parameters:
$ {command} my-ghe-conn \
--project=myproj --region=us-central1 \
--app-id=111 --app-slug=gcb-app \
--service-directory-service=projects/myproj/namespaces/x/services/mysds \
--private-key-secret-version=projects/myproj/secrets/pk/versions/1 \
--webhook-secret-secret-version=projects/myproj/secrets/whsecret/versions/1 \
--app-slug=myapp \
--app-installation-id=1234
Above command creates the connection in installation state COMPLETE, ready for adding
repositories.
command_type: CREATE
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
static_fields:
"connection.githubEnterpriseConfig": {}
arguments:
resource:
help_text: Connection to create.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection
params:
- api_field: connection.githubEnterpriseConfig.hostUri
arg_name: host-uri
required: true
help_text: URI of the GitHub Enterprise server.
- group:
help_text: Group of arguments for configuring access through Service Directory.
params:
- api_field: connection.githubEnterpriseConfig.serviceDirectoryConfig.service
arg_name: service-directory-service
required: true
help_text: Service Directory service resource to use for accessing the GitHub Enterprise
Server. Necessary only if the server has no public access from the internet.
- api_field: connection.githubEnterpriseConfig.sslCa
arg_name: ssl-ca-file
help_text: File containing the SSL_CA to be used.
processor: googlecloudsdk.core.util.files:ReadFileContents
- group:
help_text: Group of arguments for the GitHub App properties.
params:
- api_field: connection.githubEnterpriseConfig.appId
arg_name: app-id
required: true
help_text: App ID of the GitHub App in the GitHub Enterprise server.
- api_field: connection.githubEnterpriseConfig.appSlug
arg_name: app-slug
required: true
help_text: |-
App slug (url-friendly name) of the GitHub App. When seeing the configuration
page of the App (e.g. in https://my-ghe-server.net/settings/apps/my-app), the app-slug
is the last component of the URL path ("my-app" in that example).
- api_field: connection.githubEnterpriseConfig.privateKeySecretVersion
arg_name: private-key-secret-version
required: true
help_text: Secret containing the private key of the GitHub App.
- api_field: connection.githubEnterpriseConfig.webhookSecretSecretVersion
arg_name: webhook-secret-secret-version
required: true
help_text: |-
Secret containing the webhook secret string for validating webhook events generated by
the GitHub App.
- api_field: connection.githubEnterpriseConfig.appInstallationId
arg_name: app-installation-id
help_text: Installation ID of the Cloud Build GitHub App.
output:
# Print the installation instruction and link (if any) after creation.
format: 'csv[no-heading,separator="\\n"](installationState.stage,installationState.message,installationState.actionUri)'
async:
collection: cloudbuild.projects.locations.operations

View File

@@ -0,0 +1,85 @@
- help_text:
brief: Create a Cloud Build Connection for gitlab.com or GitLab Enterprise.
description: |
Create a Cloud Build Connection for gitlab.com or GitLab Enterprise.
A gitlab.com or GitLab Enterprise Connection can be created by using a personal access token with `api`
scope permission. A `read_repository` scoped personal access token will also be required on gitlab.com or if
the self-hosted GitLab server doesn't support project access token (GitLab Enterprise server version <
13.10).
If the GitLab Enterprise server can only be accessed within a VPC, a Service Directory
service resource can be provided for connecting to it.
examples: |
To create a GitLab connection for gitlab.com,
provide all the required parameters:
$ {command} my-gitlab-conn \
--project=myproj --region=us-central1 \
--read-authorizer-token-secret-version=projects/myproj/secrets/read-pat/versions/1 \
--authorizer-token-secret-version=projects/myproj/secrets/api-pat/versions/1 \
--webhook-secret-secret-version=projects/myproj/secrets/whsecret/versions/1
To create a GitLab connection for a GitLab server,
provide host-uri parameter as well:
$ {command} my-gle-conn \
--host-uri=https://my.gle-server.net \
--project=myproj --region=us-central1 \
--authorizer-token-secret-version=projects/myproj/secrets/api-pat/versions/1 \
--read-authorizer-token-secret-version=projects/myproj/secrets/read-pat/versions/1 \
--webhook-secret-secret-version=projects/myproj/secrets/whsecret/versions/1
To create a GitLab connection for a private GitLab server.
provide the service-directory-service and ssl-ca-file as well:
$ {command} my-gle-conn \
--host-uri=https://my.private-gle-server.net \
--project=myproj --region=us-central1 \
--service-directory-service=projects/myproj/namespaces/x/services/mysds \
--ssl-ca-file=mycertificate.crt \
--authorizer-token-secret-version=projects/myproj/secrets/api-pat/versions/1 \
--read-authorizer-token-secret-version=projects/myproj/secrets/read-pat/versions/1 \
--webhook-secret-secret-version=projects/myproj/secrets/whsecret/versions/1
command_type: CREATE
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
arguments:
resource:
help_text: Connection to create.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection
params:
- api_field: connection.gitlabConfig.hostUri
arg_name: host-uri
help_text: URI of the GitLab instance.
- api_field: connection.gitlabConfig.authorizerCredential.userTokenSecretVersion
arg_name: authorizer-token-secret-version
help_text: Secret containing the api personal access token.
required: true
- api_field: connection.gitlabConfig.readAuthorizerCredential.userTokenSecretVersion
arg_name: read-authorizer-token-secret-version
help_text: Secret containing the read_api personal access token.
required: true
- api_field: connection.gitlabConfig.webhookSecretSecretVersion
arg_name: webhook-secret-secret-version
required: true
help_text: |-
Secret containing the webhook secret string for validating webhook events sent by
GitLab.
- group:
help_text: Group of arguments for configuring access through Service Directory.
params:
- api_field: connection.gitlabConfig.serviceDirectoryConfig.service
arg_name: service-directory-service
required: true
help_text: Service Directory service resource to use for accessing the gitlab.com or GitLab Enterprise
Server. Necessary only if the server has no public access from the internet.
- api_field: connection.gitlabConfig.sslCa
arg_name: ssl-ca-file
help_text: File containing the SSL_CA to be used.
processor: googlecloudsdk.core.util.files:ReadFileContents
async:
collection: cloudbuild.projects.locations.operations

View File

@@ -0,0 +1,20 @@
- help_text:
brief: Delete a Cloud Build Connection
description: Delete a Cloud Build Connection.
examples: |
To delete Cloud Build connection ``my-conn'' in region ``us-central1'',
run the following command:
$ {command} my-conn --region=us-central1
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
arguments:
resource:
help_text: Cloud Build connection to delete.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection
async:
collection: cloudbuild.projects.locations.operations

View File

@@ -0,0 +1,17 @@
- help_text:
brief: Describe a Cloud Build Connection
description: Describe a Cloud Build Connection.
examples: |
To describe a Connection ``my-conn'' in region ``us-central1'',
run the following command:
$ {command} my-conn --region=us-central1
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
arguments:
resource:
help_text: Cloud Build Connection to describe.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection

View File

@@ -0,0 +1,18 @@
- help_text:
brief: Get the IAM policy for a Cloud Build connection.
description: |
Get the IAM policy for a Cloud Build connection.
examples: |
To print the IAM policy for a Connection named 'my-conn',
run the following command:
$ {command} my-conn --region=us-central1
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
arguments:
resource:
help_text: Cloud Build Connection from which to get IAM policy.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection

View File

@@ -0,0 +1,23 @@
- help_text:
brief: List all Cloud Build connections for a project and region.
description: List all Cloud Build connections for a project and region.
examples: |
To list all the Cloud Build connections in region ``us-central1'',
run the following command:
$ {command} --region=us-central1
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
arguments:
resource:
help_text: Cloud Build location to list all contained connections.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:region
response:
id_field: name
output:
format: table(name.segment(-1):label=NAME, installation_state.stage:label=INSTALLATION_STATE, disabled.yesno("Disabled","Enabled"):label=DISABLED)

View File

@@ -0,0 +1,22 @@
- help_text:
brief: Set the IAM policy for a Cloud Build connection.
description: |
Set the IAM policy for a Cloud Build connection as defined in a JSON or YAML file.
See https://cloud.google.com/iam/docs/managing-policies for details of
the policy file format and contents.
examples: |
The following command will read an IAM policy defined in a JSON file
'policy.json' and set it for the Connection named 'my-conn':
$ {command} my-conn policy.json --region=us-central1
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
arguments:
resource:
help_text: Cloud Build Connection for which to set IAM policy.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection

View File

@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*- #
# Copyright 2022 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The command group for Google Cloud Build's Connections."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(
base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA, base.ReleaseTrack.GA
)
class Update(base.Group):
"""Update Connections in Google Cloud Build."""
category = base.CI_CD_CATEGORY

View File

@@ -0,0 +1,40 @@
- help_text:
brief: Update a Cloud Build Connection of type Bitbucket Cloud.
description: |
Update a Cloud Build Connection of type Bitbucket Cloud.
examples: |
To update the workspace, provide the connection name and the workspace name:
$ {command} my-bbc-conn --region=us-west1
--workspace=my-workspace
To update the authorization token, provide the connection name and the new authorization token
secret version.
$ {command} my-bbc-conn --region=us-west1
--authorizer-token-secret-version=projects/myproj/secrets/admin-pat/versions/1
command_type: UPDATE
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
arguments:
resource:
help_text: Connection to update.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection
params:
- api_field: connection.bitbucketCloudConfig.workspace
arg_name: workspace
help_text: Workspace of the Bitbucket Cloud instance.
- api_field: connection.bitbucketCloudConfig.authorizerCredential.userTokenSecretVersion
arg_name: authorizer-token-secret-version
help_text: Secret containing the `repository_read`,`repository_admin`, `pullrequest_read`, `webhook` access token. It can be a repository, project or workspace access token.
- api_field: connection.bitbucketCloudConfig.readAuthorizerCredential.userTokenSecretVersion
arg_name: read-authorizer-token-secret-version
help_text: Secret containing the `repository_read` access token. It can be a repository, project or workspace access token.
- api_field: connection.bitbucketCloudConfig.webhookSecretSecretVersion
arg_name: webhook-secret-secret-version
help_text: Secret containing the webhook secret string for validating webhook events sent by Bitbucket Cloud.
async:
collection: cloudbuild.projects.locations.operations

View File

@@ -0,0 +1,44 @@
- help_text:
brief: Update a Cloud Build Connection of type Bitbucket Data Center.
description: |
Update a Cloud Build Connection of type Bitbucket Data Center.
examples: |
To update the ssl_ca, provide the connection name and the ssl_ca file:
$ {command} my-gle-conn --region=us-west1
--ssl-ca-file=mycertificate.crt
To update the authorization token, provide the connection name and the new authorization token secret version name.
$ {command} my-gle-conn --region=us-west1
--authorizer-token-secret-version=projects/myproj/secrets/admin-pat/versions/1
command_type: UPDATE
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
arguments:
resource:
help_text: Connection to update.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection
params:
- api_field: connection.bitbucketDataCenterConfig.hostUri
arg_name: host-uri
help_text: URI of the Bitbucket Data Center instance.
- api_field: connection.bitbucketDataCenterConfig.authorizerCredential.userTokenSecretVersion
arg_name: authorizer-token-secret-version
help_text: Secret containing the REPO_ADMIN personal access token.
- api_field: connection.bitbucketDataCenterConfig.readAuthorizerCredential.userTokenSecretVersion
arg_name: read-authorizer-token-secret-version
help_text: Secret containing the REPO_READ personal access token.
- api_field: connection.bitbucketDataCenterConfig.serviceDirectoryConfig.service
arg_name: service-directory-service
help_text: Service Directory service resource to use for accessing the Bitbucket Data Center. Necessary only if the server has no public access from the internet.
- api_field: connection.bitbucketDataCenterConfig.sslCa
arg_name: ssl-ca-file
help_text: File containing the SSL_CA to be used.
processor: googlecloudsdk.core.util.files:ReadFileContents
async:
collection: cloudbuild.projects.locations.operations

View File

@@ -0,0 +1,41 @@
- help_text:
brief: Update a Cloud Build Connection of type GitHub.
description: |
Update a Cloud Build Connection of type GitHub (for github.com).
examples: |
To update the authorizer token, provide the connection name and the authorizer token secret:
$ {command} myconn --region=us-central1 \
--authorizer-token-secret-version=projects/myproj/secrets/mytoken/versions/1
To update the installation id, provide the connection name and the installation id of the
Cloud Build GitHub app.
$ {command} myconn --region=us-central1 --app-installation-id=1234
command_type: UPDATE
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
static_fields:
"connection.githubConfig": {}
arguments:
resource:
help_text: Connection to update.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection
params:
- api_field: connection.githubConfig.authorizerCredential.oauthTokenSecretVersion
arg_name: authorizer-token-secret-version
help_text: Secret containing the authorizer user's token.
- api_field: connection.githubConfig.appInstallationId
arg_name: app-installation-id
help_text: Installation ID of the Cloud Build GitHub App.
output:
# Print the installation instruction and link (if any) after updating.
format: 'csv[no-heading,separator="\\n"](installationState.stage,installationState.message,installationState.actionUri)'
async:
collection: cloudbuild.projects.locations.operations

View File

@@ -0,0 +1,66 @@
- help_text:
brief: Update a Cloud Build Connection of type GitHub Enterprise.
description: |
Update a Cloud Build Connection of type GitHub Enterprise.
examples: |
To update the ssl_ca, provide the connection name and the ssl_ca file:
$ {command} my-ghe-conn --region=us-west1
--ssl-ca-file=mycertificate.crt
To update the installation id, provide the connection name and the installation id of the
Cloud Build GitHub app.
$ {command} my-ghe-conn --region=us-west1 --app-installation-id=1234
command_type: UPDATE
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
static_fields:
"connection.githubEnterpriseConfig": {}
arguments:
resource:
help_text: Connection to update.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection
params:
- api_field: connection.githubEnterpriseConfig.appSlug
arg_name: app-slug
help_text: |-
App slug (url-friendly name) of the GitHub App. When seeing the configuration
page of the App (e.g. in https://my-ghe-server.net/settings/apps/my-app), the app-slug
is the last component of the URL path ("my-app" in that example).
- api_field: connection.githubEnterpriseConfig.hostUri
arg_name: host-uri
help_text: URI of the GitHub Enterprise server.
- api_field: connection.githubEnterpriseConfig.serviceDirectoryConfig.service
arg_name: service-directory-service
help_text: Service Directory service resource to use for accessing the GitHub Enterprise
Server. Necessary only if the server has no public access from the internet.
- api_field: connection.githubEnterpriseConfig.sslCa
arg_name: ssl-ca-file
help_text: File containing the SSL_CA to be used.
processor: googlecloudsdk.core.util.files:ReadFileContents
- api_field: connection.githubEnterpriseConfig.appId
arg_name: app-id
help_text: App ID of the GitHub App in the GitHub Enterprise server.
- api_field: connection.githubEnterpriseConfig.privateKeySecretVersion
arg_name: private-key-secret-version
help_text: Secret containing the private key of the GitHub App.
- api_field: connection.githubEnterpriseConfig.webhookSecretSecretVersion
arg_name: webhook-secret-secret-version
help_text: |-
Secret containing the webhook secret string for validating webhook events generated by
the GitHub App.
- api_field: connection.githubEnterpriseConfig.appInstallationId
arg_name: app-installation-id
help_text: Installation ID of the Cloud Build GitHub App.
output:
# Print the installation instruction and link (if any) after updating.
format: 'csv[no-heading,separator="\\n"](installationState.stage,installationState.message,installationState.actionUri)'
async:
collection: cloudbuild.projects.locations.operations

View File

@@ -0,0 +1,47 @@
- help_text:
brief: Update a Cloud Build Connection of type gitlab.com or GitLab Enterprise.
description: |
Update a Cloud Build Connection of type gitlab.com or GitLab Enterprise.
examples: |
To update the ssl_ca, provide the connection name and the ssl_ca file:
$ {command} my-gle-conn --region=us-west1
--ssl-ca-file=mycertificate.crt
To update the authorization token, provide the connection name and the new authorization token
secret version.
$ {command} my-gle-conn --region=us-west1
--authorizer-token-secret-version=projects/myproj/secrets/api-pat/versions/1
command_type: UPDATE
request:
collection: cloudbuild.projects.locations.connections
api_version: v2
arguments:
resource:
help_text: Connection to update.
spec: !REF googlecloudsdk.command_lib.cloudbuild.resources_v2:connection
params:
- api_field: connection.gitlabConfig.hostUri
arg_name: host-uri
help_text: URI of the GitLab instance.
- api_field: connection.gitlabConfig.authorizerCredential.userTokenSecretVersion
arg_name: authorizer-token-secret-version
help_text: Secret containing the api personal access token.
- api_field: connection.gitlabConfig.readAuthorizerCredential.userTokenSecretVersion
arg_name: read-authorizer-token-secret-version
help_text: Secret containing the read_repository personal access token. Required for GitLab
Enterprise versions older than 13.10.
- api_field: connection.gitlabConfig.serviceDirectoryConfig.service
arg_name: service-directory-service
help_text: Service Directory service resource to use for accessing the GitLab Enterprise
Server. Necessary only if the server has no public access from the internet.
- api_field: connection.gitlabConfig.sslCa
arg_name: ssl-ca-file
help_text: File containing the SSL_CA to be used.
processor: googlecloudsdk.core.util.files:ReadFileContents
async:
collection: cloudbuild.projects.locations.operations