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 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