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,26 @@
# -*- coding: utf-8 -*- #
# Copyright 2023 Google Inc. 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 reCAPTCHA Firewall Policies CLI."""
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.GA)
class RecaptchaFirewallPolicy(base.Group):
"""Managed reCAPTCHA Firewall Policies."""

View File

@@ -0,0 +1,57 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: Create a Firewall Policy.
description: Create a reCAPTCHA Firewall Policy.
examples: |
To create a new reCAPTCHA firewall policy covering the path "/login/*" for all requests with a
reCAPTCHA Lite score of >= 0.5 to allow the requests and set the header 'foo' to the value
'bar':
$ {command} --path='/login/*' --condition='recaptcha.assessment_type == AssessmentType.LITE
&& recaptcha.score >= 0.5' --actions=allow,set_header=foo=bar
request:
collection: recaptchaenterprise.projects.firewallpolicies
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.recaptcha.resources:project
is_parent_resource: true
help_text: |
The cloud project in which the reCAPTCHA Firewall Policy is created.
params:
- arg_name: description
api_field: googleCloudRecaptchaenterpriseV1FirewallPolicy.description
help_text: |
A description of what this policy aims to achieve, for convenience purposes. The description
can at most include 256 UTF-8 characters.
- arg_name: path
api_field: googleCloudRecaptchaenterpriseV1FirewallPolicy.path
help_text: |
The path for which this policy applies, specified as a glob pattern. For more information on
glob, see the manual page: https://man7.org/linux/man-pages/man7/glob.7.html.
- arg_name: condition
api_field: googleCloudRecaptchaenterpriseV1FirewallPolicy.condition
help_text: |
A CEL (Common Expression Language) conditional expression that specifies if this policy
applies to an incoming user request. If this condition evaluates to true and the requested
path matched the path pattern, the associated actions should be executed by the caller. The
condition string is checked for CEL syntax correctness on creation. For more information,
see the CEL spec: https://github.com/google/cel-spec and its language definition:
https://github.com/google/cel-spec/blob/master/doc/langdef.md
- arg_name: actions
api_field: googleCloudRecaptchaenterpriseV1FirewallPolicy.actions
processor: googlecloudsdk.command_lib.recaptcha.firewall_policies_util:ParseFirewallActions
help_text: |
The actions that the caller should take regarding the user. There should be at most 1
terminal action. A terminal action is any action that forces a response, such as Allow,
Block or Substitute. If it makes sense for it to happen multple times, such as SetHeader,
the action is non-terminal.
Examples:
* Block and set the header with key foo to value bar
** --actions=block,set_header=foo=bar
* Substitute with path google.com and set two headers, one with key key1 to value value1 and
one with key key2 to value value2
** --actions=substitute=google.com,set_header=key1=value1,set_header=key2=value2

View File

@@ -0,0 +1,17 @@
- release_tracks: [ALPHA, GA]
help_text:
description: Delete one or more reCAPTCHA Firewall Policies from a given cloud project.
brief: Delete one or more reCAPTCHA Firewall Policies.
examples: |
To delete a reCAPTCHA firewall policies, run:
$ {command} policy-id
request:
collection: recaptchaenterprise.projects.firewallpolicies
arguments:
resource:
help_text: The reCAPTCHA firewall policy to delete.
spec: !REF googlecloudsdk.command_lib.recaptcha.resources:firewall_policies

View File

@@ -0,0 +1,17 @@
- release_tracks: [ALPHA, GA]
help_text:
description: Get the details of a reCAPTCHA Firewall Policy.
brief: Describe reCAPTCHA Firewall Policy.
examples: |
To get details on a reCAPTCHA firewall policy, run:
$ {command} policy-id
request:
collection: recaptchaenterprise.projects.firewallpolicies
arguments:
resource:
help_text: The reCAPTCHA firewall policy to describe.
spec: !REF googlecloudsdk.command_lib.recaptcha.resources:firewall_policies

View File

@@ -0,0 +1,30 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: List reCAPTCHA Firewall Policies.
description: List all of the reCAPTCHA Firewall Policies that exist in a given project.
examples: |
To list all the reCAPTCHA firewall policies existing for your project, run:
$ {command}
request:
collection: recaptchaenterprise.projects.firewallpolicies
response:
id_field: name
arguments:
resource:
help_text: The project name where to list the indexes.
spec: !REF googlecloudsdk.command_lib.recaptcha.resources:project
output:
format: |
table(
name.basename():label=POLICY_ID,
description:label=DESCRIPTION,
path:label=PATH,
condition:label=CONDITION,
actions:label=ACTIONS
)

View File

@@ -0,0 +1,27 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: Reorder all Firewall Policies.
description: Reorder all reCAPTCHA Firewall Policies.
examples: |
To reorder the list of reCAPTCHA firewall policies, run:
$ {command} --names=policy-name,policy-name,policy-name
request:
method: reorder
collection: recaptchaenterprise.projects.firewallpolicies
arguments:
resource:
help_text: The project name for which to reorder firewall policies.
spec: !REF googlecloudsdk.command_lib.recaptcha.resources:project
is_parent_resource: true
params:
- arg_name: names
api_field: googleCloudRecaptchaenterpriseV1ReorderFirewallPoliciesRequest.names
type: 'googlecloudsdk.calliope.arg_parsers:ArgList:'
required: true
help_text: |
Names of all firewall policies in desired order.
output:
format: none

View File

@@ -0,0 +1,55 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: Update a Firewall Policy.
description: Update a reCAPTCHA Firewall Policy.
examples: |
To update the information of a reCAPTCHA firewall policy, run:
$ {command} policy-id --description='updated description' --actions=block
request:
collection: recaptchaenterprise.projects.firewallpolicies
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.recaptcha.resources:firewall_policies
help_text: |
The reCAPTCHA firewall policy to update.
params:
- arg_name: description
api_field: googleCloudRecaptchaenterpriseV1FirewallPolicy.description
help_text: |
A description of what this policy aims to achieve, for convenience purposes. The description
can at most include 256 UTF-8 characters.
- arg_name: path
api_field: googleCloudRecaptchaenterpriseV1FirewallPolicy.path
help_text: |
The path for which this policy applies, specified as a glob pattern. For more information on
glob, see the manual page: https://man7.org/linux/man-pages/man7/glob.7.html.
- arg_name: condition
api_field: googleCloudRecaptchaenterpriseV1FirewallPolicy.condition
help_text: |
A CEL (Common Expression Language) conditional expression that specifies if this policy
applies to an incoming user request. If this condition evaluates to true and the requested
path matched the path pattern, the associated actions should be executed by the caller. The
condition string is checked for CEL syntax correctness on creation. For more information,
see the CEL spec: https://github.com/google/cel-spec and its language definition:
https://github.com/google/cel-spec/blob/master/doc/langdef.md
- arg_name: actions
api_field: googleCloudRecaptchaenterpriseV1FirewallPolicy.actions
processor: googlecloudsdk.command_lib.recaptcha.firewall_policies_util:ParseFirewallActions
help_text: |
The actions that the caller should take regarding the user. There should be at most 1
terminal action. A terminal action is any action that forces a response, such as Allow,
Block or Substitute. If it makes sense for it to happen multple times, such as SetHeader,
the action is non-terminal.
Examples:
* Block and set the header with key foo to value bar
** --actions=block,set_header=foo=bar
* Substitute with path google.com and set two headers, one with key key1 to value value1 and
one with key key2 to value value2
** --actions=substitute=google.com,set_header=key1=value1,set_header=key2=value2
output:
format: none