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,29 @@
# -*- coding: utf-8 -*- #
# Copyright 2021 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.
"""Command group for Network Security Address Groups."""
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 AddressGroups(base.Group):
"""Manage Network Security AddressGroups."""
category = base.NETWORK_SECURITY_CATEGORY

View File

@@ -0,0 +1,38 @@
release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Add items to an address group.
description: |
Add items to an existing address group.
examples: |
Add an item to an address group named ``my-address-group''.
$ {command} my-address-group --items=192.168.1.1
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_security.resources:addressGroup
help_text: Name of the address group to be updated.
params:
- arg_name: items
api_field: addAddressGroupItemsRequest.items
help_text: Items to be added to the address group.
async:
collection: networksecurity.projects.locations.operations
request: &request
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
method: addItems
collection: networksecurity.projects.locations.addressGroups
response:
modify_response_hooks:
- googlecloudsdk.command_lib.network_security.util:LogAddItemsSuccess

View File

@@ -0,0 +1,40 @@
release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Clone items from source address group.
description: |
Clone items from source address group.
examples: |
Clone items from source address group named ``other-address-group''.
$ {command} my-address-group --source=projects/other/locations/global/other-address-group
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_security.resources:addressGroup
help_text: Name of the address group to be updated.
params:
- arg_name: source
api_field: cloneAddressGroupItemsRequest.sourceAddressGroup
help_text: Source address group to be cloned from.
async:
collection: networksecurity.projects.locations.operations
request: &request
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
method: cloneItems
modify_request_hooks:
- googlecloudsdk.command_lib.network_security.util:FormatSourceAddressGroup
collection: networksecurity.projects.locations.addressGroups
response:
modify_response_hooks:
- googlecloudsdk.command_lib.network_security.util:LogCloneItemsSuccess

View File

@@ -0,0 +1,69 @@
release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Create an address group.
description: |
Create a new address group with the given name.
examples: |
Create an address group with the name ``my-address-group'', type ``IPV4'', capacity ``100'' and the description ``optional description''.
$ {command} my-address-group --type=IPV4 --capacity=100 --description="optional description"
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_security.resources:addressGroup
help_text: |
Name of the address group to be created.
params:
- arg_name: description
api_field: addressGroup.description
help_text: Description of the address group.
- arg_name: type
api_field: addressGroup.type
help_text: Type of the address group.
required: true
choices:
- arg_value: ipv4
enum_value: ipv4
- arg_value: ipv6
enum_value: ipv6
- arg_name: capacity
api_field: addressGroup.capacity
help_text: Capacity of the address group.
required: true
- arg_name: items
api_field: addressGroup.items
help_text: Items of the address group.
- arg_name: purpose
api_field: addressGroup.purpose
help_text: |
List of Address Group purposes.
choices:
- arg_value: DEFAULT
enum_value: DEFAULT
- arg_value: CLOUD-ARMOR
enum_value: CLOUD_ARMOR
- arg_name: labels
api_field: addressGroup.labels.additionalProperties
metavar: KEY=VALUE
help_text: |
List of label KEY=VALUE pairs to add.
type:
arg_dict:
flatten: true
spec:
- api_field: key
- api_field: value
async:
collection: networksecurity.projects.locations.operations
request: &request
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: networksecurity.projects.locations.addressGroups
method: create

View File

@@ -0,0 +1,29 @@
release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Delete address group.
description: |
Delete the specified address group.
examples: |
To delete an address group called 'my-address-group', run:
$ {command} my-address-group --location=global
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_security.resources:addressGroup
help_text: |
Name of the address group you want to delete.
async:
collection: networksecurity.projects.locations.operations
request: &request
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: networksecurity.projects.locations.addressGroups

View File

@@ -0,0 +1,25 @@
release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Describe an address group.
description: Show details of an address group.
examples: |
Show details about an address group named ``my-address-group''.
$ {command} my-address-group
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_security.resources:addressGroup
help_text: Name of the address group to be described.
request: &request
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: networksecurity.projects.locations.addressGroups

View File

@@ -0,0 +1,38 @@
release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
List address groups.
description: |
List all address groups in the specified location of the current project.
examples: |
To list address groups in the current project, run:
$ {command} --location=global
request: &request
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: networksecurity.projects.locations.addressGroups
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_security.resources:location
help_text: |
The project of the address groups to display.
response:
id_field: name
output:
format: |
table(
name.basename():label=NAME,
type:label=TYPE,
capacity:label=CAPACITY,
items.len():label=USAGE
)

View File

@@ -0,0 +1,62 @@
# -*- 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.
"""ListReference command for the AddressGroup under Project."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.network_security import flags
from googlecloudsdk.command_lib.network_security import util
@base.DefaultUniverseOnly
@base.ReleaseTracks(base.ReleaseTrack.GA)
class ListReferences(base.ListCommand):
"""Lists References of an Address Group."""
_release_track = base.ReleaseTrack.GA
detailed_help = {
'EXAMPLES':
"""\
To list References of address group named my-address-group.
$ {command} my-address-group
"""
}
@classmethod
def Args(cls, parser):
flags.AddProjectAddressGroupToParser(cls._release_track, parser)
flags.AddListReferencesFormat(parser)
def Run(self, args):
return util.ListProjectAddressGroupReferences(self._release_track, args)
@base.DefaultUniverseOnly
@base.ReleaseTracks(base.ReleaseTrack.BETA)
class ListReferencesBeta(ListReferences):
"""Lists References of an Address Group."""
_release_track = base.ReleaseTrack.BETA
@base.UniverseCompatible
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class ListReferencesAlpha(ListReferences):
"""Lists References of an Address Group."""
_release_track = base.ReleaseTrack.ALPHA

View File

@@ -0,0 +1,38 @@
release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Remove items from an address group.
description: |
Remove items from an existing address group.
examples: |
Remove an item from an address group named ``my-address-group''.
$ {command} my-address-group --items=192.168.1.1
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_security.resources:addressGroup
help_text: Name of the address group to be updated.
params:
- arg_name: items
api_field: removeAddressGroupItemsRequest.items
help_text: Items to be removed from the address group.
async:
collection: networksecurity.projects.locations.operations
request: &request
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
method: removeItems
collection: networksecurity.projects.locations.addressGroups
response:
modify_response_hooks:
- googlecloudsdk.command_lib.network_security.util:LogRemoveItemsSuccess

View File

@@ -0,0 +1,47 @@
release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Update an address group.
description: |
Update the details of an address group.
examples: |
Update description of an address group named ``my-address-group''.
$ {command} my-address-group --description="New description"
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_security.resources:addressGroup
help_text: Name of the address group to be updated.
params:
- arg_name: description
api_field: addressGroup.description
help_text: New description of the address group.
- arg_name: items
api_field: addressGroup.items
help_text: Items of the address group.
- arg_name: purpose
api_field: addressGroup.purpose
help_text: |
List of Address Group purposes.
choices:
- arg_value: DEFAULT
enum_value: DEFAULT
- arg_value: CLOUD-ARMOR
enum_value: CLOUD_ARMOR
labels:
api_field: addressGroup.labels
async:
collection: networksecurity.projects.locations.operations
request: &request
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: networksecurity.projects.locations.addressGroups