### Launch Interactive Getting Started Workflow Source: https://docs.cloud.google.com/sdk/gcloud/reference/beta/init Run this command to start the interactive setup process for gcloud. ```bash gcloud beta init ``` -------------------------------- ### Create GitHub Enterprise Connection (Initiate Installation) Source: https://docs.cloud.google.com/sdk/gcloud/reference/builds/connections/create/github-enterprise Use this command to start the creation of a GitHub Enterprise connection. It generates a URL that you must open in a browser to complete the GitHub App installation. This is useful when the connection is not yet fully configured. ```bash gcloud builds connections create github-enterprise my-ghe-conn --project=myproj --region=us-central1 --host-uri=https://my.ghe-server.net --service-directory-service=projects/myproj/namespaces/x/services/mysds ``` -------------------------------- ### gcloud beta workstations start Source: https://docs.cloud.google.com/sdk/gcloud/reference/beta/workstations Start a workstation. ```APIDOC ## gcloud beta workstations start ### Description Start a workstation. ### Command `gcloud beta workstations start` ### Parameters This command does not explicitly list parameters in the provided text. Refer to `gcloud help workstations start` for detailed parameter information. ``` -------------------------------- ### Create GitHub Connection via Installation Process Source: https://docs.cloud.google.com/sdk/gcloud/reference/builds/connections/create/github Use this command to start the GitHub connection creation process. It will output a URL to authorize Cloud Build in your web browser. ```bash gcloud builds connections create github myconn --project=myproj --region=us-central1 ``` -------------------------------- ### Start a Bare Metal Solution Instance Source: https://docs.cloud.google.com/sdk/gcloud/reference/bms/instances/start Use this command to start a specific Bare Metal Solution instance. Ensure the instance name is provided. ```bash gcloud bms instances start test-instance ``` -------------------------------- ### Actions config file example Source: https://docs.cloud.google.com/sdk/gcloud/reference/apihub/plugins/create This is a file example for configuring actions, allowing configuration from a YAML or JSON file. ```bash --actions-config=path_to_file.(yaml|json) ``` -------------------------------- ### Actions config shorthand example Source: https://docs.cloud.google.com/sdk/gcloud/reference/apihub/plugins/create This is a shorthand example for configuring actions. ```bash --actions-config=description=string,displayName=string,id=string,triggerMode=string --actions-config=description=string,displayName=string,id=string,triggerMode=string ``` -------------------------------- ### Actions config JSON example Source: https://docs.cloud.google.com/sdk/gcloud/reference/apihub/plugins/create This is a JSON example for configuring actions. ```bash --actions-config='[{"description": "string", "displayName": "string", "id": "string", "triggerMode": "string"}]' ``` -------------------------------- ### gcloud workstations start Source: https://docs.cloud.google.com/sdk/gcloud/reference/workstations Start a workstation. Initiate the startup process for a stopped workstation. ```APIDOC ## gcloud workstations start ### Description Start a workstation. Initiate the startup process for a stopped workstation. ### Method `gcloud workstations start` ### Command `gcloud workstations start` ### Parameters This command does not explicitly list parameters in the provided text, but typically requires a workstation identifier. ``` -------------------------------- ### Attribute Example: URI Values Source: https://docs.cloud.google.com/sdk/gcloud/reference/apihub/external-apis/create This shorthand example demonstrates setting URI values for an attribute. ```bash --attributes=uriValues={values=[string]} ``` -------------------------------- ### Start a Specific Version Source: https://docs.cloud.google.com/sdk/gcloud/reference/app/versions/start Use this command to start a single version across all services. Ensure your service is configured for manual scaling. ```bash gcloud app versions start v1 ``` -------------------------------- ### Start Multiple Versions Source: https://docs.cloud.google.com/sdk/gcloud/reference/app/versions/start Use this command to start multiple specific versions across all services. This is useful for rolling out updates or managing several active versions. ```bash gcloud app versions start v1 v2 ``` -------------------------------- ### Shorthand Example for Actions Source: https://docs.cloud.google.com/sdk/gcloud/reference/apihub/plugins/instances/create This shorthand example demonstrates how to specify multiple actions for a plugin instance, including curation configuration, schedule, and service account. ```bash --actions=actionId=string,curationConfig={curationType=string,customCuration={curation=string}},scheduleCronExpression=string,scheduleTimeZone=string,serviceAccount=string --actions=actionId=string,curationConfig={curationType=string,customCuration={curation=string}},scheduleCronExpression=string,scheduleTimeZone=string,serviceAccount=string ``` -------------------------------- ### Create instance template with a startup script from a file Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/instance-templates/create-with-container This example demonstrates how to create an instance template and specify a startup script by reading its content from a local file using the --metadata-from-file flag. ```bash gcloud compute instance-templates create-with-container INSTANCE_TEMPLATE --machine-type=MACHINE_TYPE \ --metadata-from-file startup-script=STARTUP_SCRIPT_PATH \ --container-image=IMAGE ``` -------------------------------- ### Start a Bare Metal Solution Instance (Alpha) Source: https://docs.cloud.google.com/sdk/gcloud/reference/bms/instances/start This is an alternative command for starting a Bare Metal Solution instance using the alpha version of the gcloud CLI. ```bash gcloud alpha bms instances start ``` -------------------------------- ### Create Instance Template with Container Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/instance-templates/create-with-container Creates an instance template named 'instance-template-1' that runs the 'busybox' container image. This is a basic example for getting started. ```bash gcloud compute instance-templates create-with-container instance-template-1 \ --container-image=gcr.io/google-containers/busybox ``` -------------------------------- ### Create a basic framework Source: https://docs.cloud.google.com/sdk/gcloud/reference/compliance-manager/frameworks/create Use this command to create a framework with essential details like organization, location, description, and display name. It also includes a sample cloud control configuration. ```bash gcloud compliance-manager frameworks create my-framework-id --organization=my-organization-id --location=global --description="My framework description" --display-name="My framework display name" --controls='[{"name": "organizations/my-organization-id/locations/global/cloudControls/my\n-control-1", "majorRevisionId": "1", "parameters": []}]' ``` -------------------------------- ### List packages with a partial name starting with a prefix Source: https://docs.cloud.google.com/sdk/gcloud/reference/artifacts/packages/list This example demonstrates using the '*' wildcard to filter packages whose names start with 'my'. ```bash gcloud artifacts packages list --filter='name="projects/my-project/locations/us/repositories/my-repo/packages/my*"' ``` -------------------------------- ### Get Help for gcloud transfer Jobs Create Source: https://docs.cloud.google.com/sdk/gcloud/reference/transfer Use this command to get help on creating a transfer job. This is a starting point for managing transfer jobs. ```bash gcloud transfer jobs create --help ``` -------------------------------- ### Get Help Listing Services Source: https://docs.cloud.google.com/sdk/gcloud/reference/services Run this command to view detailed help on how to list available services for your project. ```bash gcloud services list --help ``` -------------------------------- ### Ops Agent Policy Configuration Example Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/instances/ops-agents/policies/describe This is an example of an Ops Agent policy configuration. It specifies that the agent package should be installed with the latest version and includes inclusion labels for filtering instances. ```yaml agentsRule: packageState: installed version: latest instanceFilter: inclusionLabels: - labels: env: prod ``` -------------------------------- ### Example of using substitutions Source: https://docs.cloud.google.com/sdk/gcloud/reference/builds/triggers/create/cloud-source-repositories This example demonstrates how to use substitutions to pass dynamic values into your build. Variables starting with an underscore are user-defined, and built-in variables like REPO_NAME and BRANCH_NAME can also be used. ```bash gcloud builds triggers create cloud-source-repositories … --substitutions _FAVORITE_COLOR=blue,_NUM_CANDIES=10 ``` -------------------------------- ### Set up a local development environment Source: https://docs.cloud.google.com/sdk/gcloud/reference/beta/code Use this command to initiate a local development environment for Cloud Run services. Ensure you have the necessary beta components installed. ```bash gcloud beta code dev ``` -------------------------------- ### List Available Components Source: https://docs.cloud.google.com/sdk/gcloud/reference/components/install Run this command to see all components that can be installed with the Google Cloud CLI. ```bash gcloud components list ``` -------------------------------- ### Launch Workflow Without Diagnostics Source: https://docs.cloud.google.com/sdk/gcloud/reference/init Launches the interactive Getting Started workflow while skipping diagnostic checks. ```bash gcloud init --skip-diagnostics ``` -------------------------------- ### Set Service Discovery - Shorthand Example Source: https://docs.cloud.google.com/sdk/gcloud/reference/beyondcorp/security-gateways/update Configure Service Discovery settings using shorthand, specifying the API Gateway and resource override path. ```bash --service-discovery=apiGateway={resourceOverride={path=string}} ``` -------------------------------- ### Get effective IAM policies for 2 resources in a project using project number Source: https://docs.cloud.google.com/sdk/gcloud/reference/asset/get-effective-iam-policy This example demonstrates how to get effective IAM policies for multiple resources in a project, using the project's numerical identifier. Ensure the provided resource names are correctly formatted. ```bash gcloud asset get-effective-iam-policy --scope=projects/YOUR_PROJECT_NUMBER --names=RESOURCE_NAME1,RESOURCE_NAME2 ``` -------------------------------- ### Create an instance template with a specific container image and command Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/instance-templates/create-with-container This example demonstrates creating an instance template with a specific container image, overriding its default command and arguments, and setting environment variables. ```bash gcloud compute instance-templates create-with-container TEMPLATE_NAME \ --project=PROJECT_ID \ --machine-type=MACHINE_TYPE \ --image-project=cos-cloud \ --image-family=cos-stable \ --container-image=gcr.io/google-containers/hello-app \ --container-command="/bin/sh" \ --container-arg="-c" \ --container-arg="echo 'Hello World!' & sleep 3600" \ --container-env=MY_VAR=my_value ``` -------------------------------- ### List Interconnect Groups Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/interconnects/groups/list Use this command to list all available interconnect groups. No specific setup is required beyond having the gcloud CLI installed and authenticated. ```bash gcloud compute interconnects groups list ``` -------------------------------- ### Get gcloud SDK root directory Source: https://docs.cloud.google.com/sdk/gcloud/reference/certificate-manager/trust-configs/import This command helps retrieve the root directory of your Google Cloud SDK installation, which might be needed for schema references. ```bash gcloud info --format='value(installation.sdk_root)' ``` -------------------------------- ### Create a per-instance config for preview version Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/instance-groups/managed/instance-configs/create Use the preview version of the command to create a per-instance configuration. ```bash gcloud preview compute instance-groups managed instance-configs create ``` -------------------------------- ### Describe an App Engine Operation Source: https://docs.cloud.google.com/sdk/gcloud/reference/app/operations/describe Use this command to get details about a specific App Engine operation by providing its ID. Ensure you have the gcloud CLI installed and authenticated. ```bash gcloud app operations describe o1 ``` -------------------------------- ### Get IAM Policy for a Bigtable Instance Source: https://docs.cloud.google.com/sdk/gcloud/reference/bigtable/instances/get-iam-policy This example demonstrates how to retrieve the IAM policy for a Cloud Bigtable instance. Replace 'my-instance-id' with the actual ID of your Bigtable instance. ```APIDOC ## gcloud bigtable instances get-iam-policy INSTANCE ### Description Get the IAM policy for a Cloud Bigtable instance. ### Method GET (Implicit) ### Endpoint Not applicable for gcloud commands. The command interacts with the Cloud Bigtable API. ### Parameters #### Positional Arguments * **INSTANCE** (string) - Required - ID of the instance or fully qualified identifier for the instance. #### List Command Flags * **--filter**=`EXPRESSION` (string) - Optional - Apply a Boolean filter `EXPRESSION` to each resource item to be listed. For more details and examples of filter expressions, run $ gcloud topic filters. * **--limit**=`LIMIT` (integer) - Optional - Maximum number of resources to list. The default is `unlimited`. * **--page-size**=`PAGE_SIZE` (integer) - Optional - Specifies the maximum number of resources per page. The default is determined by the service if it supports paging, otherwise it is `unlimited` (no paging). * **--sort-by**=[`FIELD`,…] (list of strings) - Optional - Comma-separated list of resource field key names to sort by. Prefix a field with ``~´´ for descending order on that field. #### Gcloud Wide Flags These flags are available to all commands: `--access-token-file`, `--account`, `--billing-project`, `--configuration`, `--flags-file`, `--flatten`, `--format`, `--help`, `--impersonate-service-account`, `--log-http`, `--project`, `--quiet`, `--trace-token`, `--user-output-enabled`, `--verbosity`. ### Request Example ```bash gcloud bigtable instances get-iam-policy my-instance-id ``` ### Response #### Success Response The response will contain the IAM policy for the specified instance, including roles and members. #### Response Example ```json { "bindings": [ { "role": "roles/bigtable.user", "members": [ "user:test-user@example.com" ] } ], "etag": "BwWJj4z7", "version": 1 } ``` ``` -------------------------------- ### Create instance using preview version Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/instance-groups/managed/create-instance This command is available in the preview version of the Google Cloud SDK. ```bash gcloud preview compute instance-groups managed create-instance ``` -------------------------------- ### List all Compute Engine reservations Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/reservations/list Use this command to list all Compute Engine reservations in your project. No special setup is required beyond having the gcloud SDK installed and authenticated. ```bash gcloud compute reservations list ``` -------------------------------- ### Create an instance template with a specific service account Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/instance-templates/create This example demonstrates creating an instance template and assigning a specific service account to it. The instance will use this service account's identity and permissions. ```bash gcloud compute instance-templates create template-name \ --service-account=my-service-account@my-project.iam.gserviceaccount.com ``` -------------------------------- ### Print settings for default repository Source: https://docs.cloud.google.com/sdk/gcloud/reference/artifacts/print-settings/python Use this command to get the configuration snippet for the repository currently set in your `artifacts/repository` property. This is useful for quick setup in the default location. ```bash gcloud artifacts print-settings python ``` -------------------------------- ### Get Help for Listing Services Source: https://docs.cloud.google.com/sdk/gcloud/reference/beta/services To learn how to list available services, use the --help flag with the list command. ```bash gcloud beta services list --help ``` -------------------------------- ### Create a Plugin Instance Source: https://docs.cloud.google.com/sdk/gcloud/reference/apihub/plugins/instances/create Use this command to create a plugin instance with a specified ID, plugin, display name, project, and location. ```bash gcloud apihub plugins instances create --plugin-instance=my-instance --plugin=my-plugin --display-name="My Instance" --project=my-project --location=us-central1 ``` -------------------------------- ### List all machine images in a project Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/machine-images/list Use this command to display all machine images in your project in a table format. No special setup is required beyond having the gcloud CLI installed and authenticated. ```bash gcloud compute machine-images list ``` -------------------------------- ### Get Help for Project Info Source: https://docs.cloud.google.com/sdk/gcloud/reference/beta/dns Run this command to view help information for describing Cloud DNS related information for your project. ```bash gcloud beta dns project-info describe --help ``` -------------------------------- ### List Backup and DR Locations Source: https://docs.cloud.google.com/sdk/gcloud/reference/backup-dr/locations/list Use this command to list all available Backup and DR service locations. No specific setup is required beyond having the gcloud SDK installed and authenticated. ```bash gcloud backup-dr locations list ``` -------------------------------- ### Get Server Configuration for Attached Clusters Source: https://docs.cloud.google.com/sdk/gcloud/reference/container/attached/get-server-config Use this command to retrieve the supported Attached cluster valid platform versions for a specific location. Ensure you have the `gcloud` CLI installed and authenticated. ```bash gcloud container attached get-server-config --location=us-west1 ``` -------------------------------- ### Create a per-instance config for beta version Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/instance-groups/managed/instance-configs/create Use the beta version of the command to create a per-instance configuration. ```bash gcloud beta compute instance-groups managed instance-configs create ``` -------------------------------- ### Describe GitHub Enterprise Connection Status Source: https://docs.cloud.google.com/sdk/gcloud/reference/builds/connections/create/github-enterprise After initiating the connection creation, use this command to check the installation status. It may provide a link to continue the setup if the connection is not yet COMPLETE. ```bash gcloud alpha builds connections describe my-ghe-conn --region=us-central1 ``` -------------------------------- ### Create instance using beta version Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/instance-groups/managed/create-instance This command is available in the beta version of the Google Cloud SDK. ```bash gcloud beta compute instance-groups managed create-instance ``` -------------------------------- ### Get IAM Policy for a Cloud Bigtable Backup Source: https://docs.cloud.google.com/sdk/gcloud/reference/bigtable/backups/get-iam-policy This example demonstrates how to retrieve the IAM policy for a Cloud Bigtable Backup. You need to specify the backup ID, the instance ID, and the cluster ID. ```APIDOC ## gcloud bigtable backups get-iam-policy ### Description Get an IAM policy on a Cloud Bigtable Backup. ### Method GET ### Endpoint `gcloud bigtable backups get-iam-policy BACKUP --instance=INSTANCE --cluster=CLUSTER` ### Parameters #### Path Parameters - **BACKUP** (string) - Required - ID of the backup or fully qualified identifier for the backup. #### Query Parameters - **--instance** (string) - Required - Name of the Bigtable instance. - **--cluster** (string) - Required - Name of the Bigtable cluster. - **--filter** (EXPRESSION) - Optional - Apply a Boolean filter EXPRESION to each resource item to be listed. - **--limit** (LIMIT) - Optional - Maximum number of resources to list. - **--page-size** (PAGE_SIZE) - Optional - Maximum number of resources per page. - **--sort-by** (FIELD,...) - Optional - Comma-separated list of resource field key names to sort by. ### Request Example ```bash gcloud bigtable backups get-iam-policy my-backup --instance=my-instance --cluster=my-cluster ``` ### Response #### Success Response (200) (Response details not explicitly provided in the source, but typically includes IAM policy information like bindings and etag.) #### Response Example (Example response not explicitly provided in the source.) ``` -------------------------------- ### Create an API Hub instance with labels Source: https://docs.cloud.google.com/sdk/gcloud/reference/apihub/api-hub-instances/create This example demonstrates how to create an API Hub instance and apply user-defined labels for metadata organization. Labels can be provided in shorthand, JSON, or file format. ```bash --labels=string=string ``` ```bash --labels='{"string": "string"}' ``` ```bash --labels=path_to_file.(yaml|json) ``` -------------------------------- ### List all Apphub locations Source: https://docs.cloud.google.com/sdk/gcloud/reference/apphub/locations/list Use this command to retrieve a list of all available Apphub locations within your Google Cloud project. No additional setup is required beyond having the gcloud CLI installed and authenticated. ```bash gcloud apphub locations list ``` -------------------------------- ### Create instance template with multiple network interfaces Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/instance-templates/create-with-container This example shows how to create an instance template with multiple network interfaces, each configured with specific network tier and subnet. ```bash gcloud compute instance-templates create-with-container INSTANCE_TEMPLATE \ --network-interface "network=NETWORK_1,subnet=SUBNET_1,network-tier=PREMIUM" \ --network-interface "network=NETWORK_2,subnet=SUBNET_2,network-tier=STANDARD" \ --container-image=IMAGE ``` -------------------------------- ### gcloud transfer Source: https://docs.cloud.google.com/sdk/gcloud/reference/transfer The gcloud transfer command group lets you create and manage Transfer Service jobs, operations, and agents. To get started, run: `gcloud transfer jobs create --help` ```APIDOC ## gcloud transfer ### Description The gcloud transfer command group lets you create and manage Transfer Service jobs, operations, and agents. ### Synopsis `gcloud transfer` `GROUP` | `COMMAND` [`GCLOUD_WIDE_FLAG …`] ### Groups ``GROUP`` is one of the following: `agent-pools` Manage on-premise transfer agent pools. `agents` Manage Transfer Service agents. `jobs` Manage transfer jobs. `operations` Manage transfer operations. ### Commands ``COMMAND`` is one of the following: `authorize` Authorize an account for all Transfer Service features. ### Gcloud Wide Flags These flags are available to all commands: `--help`. Run `$ gcloud help` for details. ``` -------------------------------- ### Update Trigger with Substitutions Source: https://docs.cloud.google.com/sdk/gcloud/reference/builds/triggers/update/manual This example demonstrates how to update or add substitutions for a build trigger. Substitutions are parameters used within the build configuration. Keys must start with an underscore. Only specific built-in variables can be used. ```bash gcloud builds triggers update … --update-substitutions _FAVORITE_COLOR=blue,_NUM_CANDIES=10 ``` -------------------------------- ### Example cloud-control-details parameter formats Source: https://docs.cloud.google.com/sdk/gcloud/reference/compliance-manager/frameworks/create Demonstrates various ways to specify cloud control details, including shorthand, JSON, and file-based input. ```bash --cloud-control-details=majorRevisionId=int,name=string,parameters=[{name=string}] --cloud-control-details=majorRevisionId=int,name=string,parameters=[{name=string}] ``` ```bash --cloud-control-details='[{"majorRevisionId": int, "name": "string", "parameters": [{"name": "string"}]}]' ``` ```bash --cloud-control-details=path_to_file.(yaml|json) ``` -------------------------------- ### Initialize with Preview Version Source: https://docs.cloud.google.com/sdk/gcloud/reference/init Initializes the gcloud CLI using the preview version. ```bash gcloud preview init ``` -------------------------------- ### List App Engine Regional Availability Source: https://docs.cloud.google.com/sdk/gcloud/reference/app/regions Use this command to view the availability of App Engine standard and flexible runtime environments in all geographic regions. No specific setup is required beyond having the gcloud CLI installed. ```bash gcloud app regions list ``` -------------------------------- ### Request advice for VM reservation Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/advice/calendar-mode Use this command to get advice for a future reservation of specific VM instances. Ensure you specify the region, machine type, VM count, duration range, and start time range. ```bash gcloud compute advice calendar-mode --region=fake-region --machine-type=a3-megagpu-8g --vm-count=8 --duration-range=min=7d,max=14d --start-time-range=from=2025-02-20,to=2025-03-25 ``` -------------------------------- ### Update a future reservation's count and time range Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/future-reservations/update This example demonstrates how to update the total count, start time, and end time of a Compute Engine future reservation. It targets a specific reservation named 'my-future-reservation' in the 'us-central1-a' zone. ```APIDOC ## gcloud compute future-reservations update ### Description Update Compute Engine future reservations. ### Method `gcloud compute future-reservations update` ### Endpoint Not applicable (gcloud CLI command) ### Parameters #### Positional Arguments * **FUTURE_RESERVATION** (string) - Required - Name of the future reservation to update. #### Flags * **--auto-delete-auto-created-reservations** | **--no-auto-delete-auto-created-reservations** (boolean) - If specified, the auto-created reservations for a future reservation are deleted at the end time (default) or at a specified delete time. * **--deployment-type**=`DEPLOYMENT_TYPE` (string) - The deployment type for the reserved capacity. Must be one of: `DENSE`, `FLEXIBLE`. * **--description**=`DESCRIPTION` (string) - An optional description of the future reservation to create. * **--enable-emergent-maintenance** | **--no-enable-emergent-maintenance** (boolean) - Emergent maintenance flag for the reservation. * **--planning-status**=`PLANNING_STATUS` (string) - The planning status of the future reservation. Must be one of: `DRAFT`, `SUBMITTED`. * **--require-specific-reservation** | **--no-require-specific-reservation** (boolean) - Indicate whether the auto-created reservations can be consumed by VMs with "any reservation" defined. * **--reservation-name**=`RESERVATION_NAME` (string) - Name of reservations where the capacity is provisioned. * **--scheduling-type**=`SCHEDULING_TYPE` (string) - Maintenance for the reserved capacity. Must be one of: `GROUPED`, `INDEPENDENT`. * **--total-count**=`TOTAL_COUNT` (integer) - The total number of instances for which capacity assurance is requested. * **--zone**=`ZONE` (string) - The zone of the future reservation. * **--auto-created-reservations-delete-time**=`AUTO_CREATED_RESERVATIONS_DELETE_TIME` (string) - Specifies the time to delete auto-created reservations. * **--auto-created-reservations-duration**=`AUTO_CREATED_RESERVATIONS_DURATION` (string) - Specifies the duration for which auto-created reservations are kept. * **--clear-name-prefix** | **--name-prefix**=`NAME_PREFIX` (string) - Sets or clears a name prefix for the reservation. * **--share-setting**=`SHARE_SETTING` --share-with=`PROJECT`,[`PROJECT`,…] | **--clear-share-settings** - Configures sharing settings for the reservation. * **--commitment-name**=`COMMITMENT_NAME` --commitment-plan=`COMMITMENT_PLAN` --previous-commitment-terms=`PREVIOUS_COMMITMENT_TERMS` - Options related to commitment terms. * **--machine-type**=`MACHINE_TYPE` - Specifies the machine type for the reservation. * **--min-cpu-platform**=`MIN_CPU_PLATFORM` - Specifies the minimum CPU platform for the reservation. * **--accelerator**=[`count`=`COUNT`],[`type`=`TYPE`] | **--clear-accelerator** - Configures accelerator settings for the reservation. * **--local-ssd**=[`count`=`COUNT`],[`interface`=`INTERFACE`],[`size`=`SIZE`] | **--clear-local-ssd** - Configures local SSD settings for the reservation. * **--start-time**=`START_TIME` --duration=`DURATION` | **--end-time**=`END_TIME` - Specifies the start time and duration, or end time, for the reservation. ### Request Example ```bash gcloud compute future-reservations update my-future-reservation --total-count=1000 --start-time=2021-11-10T07:00:00Z --end-time=2021-12-10T07:00:00Z --zone=us-central1-a ``` ### Response (No specific response schema provided in the source text, but typically a success message or updated reservation details would be returned.) ``` -------------------------------- ### View help for Data Fusion instances Source: https://docs.cloud.google.com/sdk/gcloud/reference/beta/data-fusion Run this command to see how to create and manage Data Fusion instances. ```bash gcloud beta data-fusion instances --help ``` -------------------------------- ### Get Help Enabling a Service Source: https://docs.cloud.google.com/sdk/gcloud/reference/services Run this command to view detailed help on how to enable a service for your project. ```bash gcloud services enable --help ``` -------------------------------- ### List packages with partial annotation key or value using wildcard Source: https://docs.cloud.google.com/sdk/gcloud/reference/artifacts/packages/list Use the '*' wildcard with the --filter flag to match partial annotation keys or values. This example filters for annotation keys starting with 'my_' and values ending with '.value'. ```bash gcloud artifacts packages list --filter='annotations.my_*:`*.value`' ``` -------------------------------- ### Get asset metadata history for a specific instance Source: https://docs.cloud.google.com/sdk/gcloud/reference/asset/get-history Use this command to retrieve the history of metadata for a Compute Engine instance within a given time range. Ensure you specify the project, asset name, start time, end time, and content type as 'resource'. ```bash gcloud asset get-history --project='test-project' --asset-names='//compute.googleapis.com/projects/test-project/zones/us-central1-f/instances/instance1' --start-time='2018-10-02T15:01:23.045Z' --end-time='2018-12-05T13:01:21.045Z' --content-type='resource' ``` -------------------------------- ### gcloud preview compute backend-services add-backend Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/backend-services/add-backend Example of using the preview version of the command. ```bash gcloud preview compute backend-services add-backend ``` -------------------------------- ### Set Service Discovery - JSON Example Source: https://docs.cloud.google.com/sdk/gcloud/reference/beyondcorp/security-gateways/update Configure Service Discovery settings by providing a JSON object, including API Gateway and resource override path. ```bash --service-discovery='{"apiGateway": {"resourceOverride": {"path": "string"}}}' ``` -------------------------------- ### Request advice for TPU reservation Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/advice/calendar-mode Use this command to get advice for a future reservation of TPUs. Specify the region, TPU version, chip count, workload type, duration range, and start time range. Location policies can also be set to allow or deny specific zones. ```bash gcloud compute advice calendar-mode --region=fake-region --location-policy=fake-zone-1=DENY,fake-zone-2=ALLOW --tpu-version=V5E --chip-count=16 --workload-type=BATCH --duration-range=min=30d,max=90d --start-time-range=from=2025-02-25,to=2025-06-25 ``` -------------------------------- ### Install a Google Cloud CLI Component Source: https://docs.cloud.google.com/sdk/gcloud/reference/components Install a specific component that is not currently present in your Google Cloud CLI installation. Replace COMPONENT with the name of the component you wish to install. ```bash gcloud components install COMPONENT ``` -------------------------------- ### Describe Backend Bucket (Preview) Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/backend-buckets/describe This command is a preview version for describing backend buckets. ```bash gcloud preview compute backend-buckets describe ``` -------------------------------- ### Describe Backend Bucket (Beta) Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/backend-buckets/describe This command is a beta version for describing backend buckets. ```bash gcloud beta compute backend-buckets describe ``` -------------------------------- ### Get Operation Source: https://docs.cloud.google.com/sdk/gcloud/reference/artifacts/docker/images Gets an On-Demand Scanning operation. ```APIDOC ## GET OPERATION ### Description Gets an On-Demand Scanning operation. ### Method `gcloud artifacts docker images get-operation` ### Parameters #### Path Parameters - `operation` (string) - Required - The name of the operation to get. ``` -------------------------------- ### Install Specific Components Source: https://docs.cloud.google.com/sdk/gcloud/reference/components/install This command installs the specified components (e.g., COMPONENT-1, COMPONENT-2) and any components they depend on. The CLI will list the components to be installed and prompt for confirmation. ```bash gcloud components install COMPONENT-1 COMPONENT-2 ``` -------------------------------- ### Get Help for Composer Environments Source: https://docs.cloud.google.com/sdk/gcloud/reference/composer Run this command to see how to create and manage Cloud Composer environments. ```bash gcloud composer environments --help ``` -------------------------------- ### Start a stopped instance Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/instances/start Use this command to start a specific Compute Engine instance in a given zone. Ensure the instance is in a stopped state before attempting to start it. ```bash gcloud compute instances start example-instance --zone=us-central1-a ``` -------------------------------- ### Create a deployment with basic details Source: https://docs.cloud.google.com/sdk/gcloud/reference/apihub/deployments/create Use this snippet to create a deployment with a specified ID, display name, deployment type, project, and location. ```bash gcloud apihub deployments create --deployment=my-deployment --display-name="My Deployment" --deployment-type=apigee --project=my-project --location=us-central1 ``` -------------------------------- ### gcloud beta compute backend-services add-backend Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/backend-services/add-backend Example of using the beta version of the command. ```bash gcloud beta compute backend-services add-backend ``` -------------------------------- ### List All Available Configurations Source: https://docs.cloud.google.com/sdk/gcloud/reference/config/configurations/list Use this command to display all named configurations currently set up in your Google Cloud SDK environment. No special setup is required. ```bash gcloud config configurations list ``` -------------------------------- ### Configure network interface properties Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/instances/bulk/create This example shows how to configure a network interface for an instance. It demonstrates specifying the network, network tier, subnet, NIC type, and whether to assign an external IP address. ```bash --network-interface=network=NETWORK,network-tier=PREMIUM,subnet=SUBNET,nic-type=GVNIC,no-address ``` -------------------------------- ### gcloud composer environments Source: https://docs.cloud.google.com/sdk/gcloud/reference/composer/environments The gcloud composer environments command group lets you create Cloud Composer environments containing an Apache Airflow setup. Additionally, the command group supports environment updates including varying number of machines used to run Airflow, setting Airflow configs, or installing Python dependencies used in Airflow DAGs. The command group can also be used to delete Composer environments. ```APIDOC ## gcloud composer environments ### Description The `gcloud composer environments` command group manages Cloud Composer environments, which include an Apache Airflow setup. It supports creating, updating (e.g., machine count, Airflow configs, Python dependencies), and deleting these environments. ### Groups - `snapshots`: Save and load snapshots of the environment. - `storage`: Manage Cloud Storage objects stored as part of Cloud Composer environments. - `user-workloads-config-maps`: Create and manage user workloads ConfigMaps of the environment. - `user-workloads-secrets`: Create and manage user workloads Secrets of the environment. ### Commands - `check-upgrade`: Check that upgrading a Cloud Composer environment does not result in PyPI module conflicts. - `create`: Create and initialize a Cloud Composer environment. - `database-failover`: Run a database failover operation. - `delete`: Delete one or more Cloud Composer environments. - `describe`: Get details about a Cloud Composer environment. - `fetch-database-properties`: Fetch database properties. - `list`: List the Cloud Composer environments under a project and location. - `list-packages`: List all PyPI modules installed in an Airflow worker. - `list-upgrades`: List the Cloud Composer image version upgrades for a specific environment. - `list-workloads`: List Composer workloads, supported in Composer 3 environments or greater. - `restart-web-server`: Restart web server for a Cloud Composer environment. - `run`: Run an Airflow sub-command remotely in a Cloud Composer environment. - `update`: Update properties of a Cloud Composer environment. ``` -------------------------------- ### Create an API product with a quota Source: https://docs.cloud.google.com/sdk/gcloud/reference/apigee/products/create This example demonstrates creating an API product that allows 50 requests every twelve hours to all environments and all proxies, with public access. ```bash gcloud apigee products create PRODUCT --all-environments --all-proxies --public-access --quota=50 --quota-interval=12 --quota-unit=hour ``` -------------------------------- ### Start asynchronous replication Source: https://docs.cloud.google.com/sdk/gcloud/reference/compute/disks/start-async-replication Starts replication from a primary disk to a secondary disk, specifying zones for both. ```bash gcloud compute disks start-async-replication my-disk-1 --zone=us-east1-a --secondary-disk=my-disk-2 --secondary-disk-zone=us-west1-a ``` -------------------------------- ### Set Service Discovery - File Example Source: https://docs.cloud.google.com/sdk/gcloud/reference/beyondcorp/security-gateways/update Specify a YAML or JSON file containing Service Discovery configuration, including API Gateway and resource override path. ```bash --service-discovery=path_to_file.(yaml|json) ```