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,188 @@
# -*- coding: utf-8 -*- #
# Copyright 2024 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 the PAM Entitlements 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.BETA,
base.ReleaseTrack.GA)
@base.UniverseCompatible
class Entitlements(base.Group):
r"""Manage Privileged Access Manager (PAM) entitlements.
The `gcloud pam entitlements` command group lets you manage Privileged Access
Manager (PAM) entitlements.
## EXAMPLES
To create a new entitlement with a name of `sample-entitlement`, in a project
named `sample-project`, in location `global`, and the entitlement
configuration stored in a file named `sample-entitlement.yaml`, run:
$ {command} create sample-entitlement --project=sample-project
--location=global --entitlement-file=sample-entitlement.yaml
To create a new entitlement with a name of `sample-entitlement`, in a folder
with ID ``FOLDER_ID'', in location `global`, and the entitlement
configuration stored in a file named `sample-entitlement.yaml`, run:
$ {command} create sample-entitlement --folder=FOLDER_ID
--location=global --entitlement-file=sample-entitlement.yaml
To create a new entitlement with a name of `sample-entitlement`, in an
organization with ID ``ORGANIZATION_ID'', in location `global`, and the
entitlement configuration stored in a file named `sample-entitlement.yaml`,
run:
$ {command} create sample-entitlement --organization=ORGANIZATION_ID
--location=global --entitlement-file=sample-entitlement.yaml
To update an entitlement with a name of `sample-entitlement`, in a project
named `sample-project`, in location `global`, and the new entitlement
configuration stored in a file named `sample-entitlement.yaml`, run:
$ {command} update sample-entitlement --project=sample-project
--location=global --entitlement-file=sample-entitlement.yaml
To update an entitlement with a name of `sample-entitlement`, in a folder
with ID ``FOLDER_ID'', in location `global`, and the new entitlement
configuration stored in a file named `sample-entitlement.yaml`, run:
$ {command} update sample-entitlement --folder=FOLDER_ID
--location=global --entitlement-file=sample-entitlement.yaml
To update an entitlement with a name of `sample-entitlement`, in an
organization with ID ``ORGANIZATION_ID'', in location `global`, and the new
entitlement configuration stored in a file named `sample-entitlement.yaml`,
run:
$ {command} update sample-entitlement --organization=ORGANIZATION_ID
--location=global --entitlement-file=sample-entitlement.yaml
To describe an entitlement with a name of `sample-entitlement`, in a project
named `sample-project`, and in location `global`, run:
$ {command} describe sample-entitlement --project=sample-project
--location=global
To describe an entitlement with a name of `sample-entitlement`, in a folder
with ID ``FOLDER_ID'', and in location `global`, run:
$ {command} describe sample-entitlement --folder=FOLDER_ID
--location=global
To describe an entitlement with a name of `sample-entitlement`, in an
organization with ID ``ORGANIZATION_ID'', and in location `global`, run:
$ {command} describe sample-entitlement --organization=ORGANIZATION_ID
--location=global
To search for and list all entitlements for which you are a requester, in a
project named `sample-project`, and in location `global`, run:
$ {command} search --project=sample-project --location=global
--caller-access-type=grant-requester
To search for and list all entitlements for which you are an approver, in a
project named `sample-project`, and in location `global`, run:
$ {command} search --project=sample-project --location=global
--caller-access-type=grant-approver
To search for and list all entitlements for which you are a requester, in a
folder with ID ``FOLDER_ID'', and in location `global`, run:
$ {command} search --folder=FOLDER_ID --location=global
--caller-access-type=grant-requester
To search for and list all entitlements for which you are an approver, in a
folder with ID ``FOLDER_ID'', and in location `global`, run:
$ {command} search --folder=FOLDER_ID --location=global
--caller-access-type=grant-approver
To search for and list all entitlements for which you are a requester, in an
organization with ID ``ORGANIZATION_ID'', and in location `global`, run:
$ {command} search --organization=ORGANIZATION_ID --location=global
--caller-access-type=grant-requester
To search for and list all entitlements for which you are an approver, in an
organization with ID ``ORGANIZATION_ID'', and in location `global`, run:
$ {command} search --organization=ORGANIZATION_ID --location=global
--caller-access-type=grant-approver
To list all entitlements in a project named `sample-project` and in location
`global`, run:
$ {command} list --project=sample-project --location=global
To list all entitlements in a folder with ID ``FOLDER_ID'' and in location
`global`, run:
$ {command} list --folder=FOLDER_ID --location=global
To list all entitlements in an organization with ID ``ORGANIZATION_ID'' and
in location `global`, run:
$ {command} list --organization=ORGANIZATION_ID --location=global
To delete an entitlement with a name of `sample-entitlement`, in a project
named `sample-project`, and in location `global`, run:
$ {command} delete sample-entitlement --project=sample-project
--location=global
To delete an entitlement with a name of `sample-entitlement`, in a folder
with ID ``FOLDER_ID'', and in location `global`, run:
$ {command} delete sample-entitlement --folder=FOLDER_ID
--location=global
To delete an entitlement with a name of `sample-entitlement`, in an
organization with ID ``ORGANIZATION_ID'', and in location `global`, run:
$ {command} delete sample-entitlement --organization=ORGANIZATION_ID
--location=global
To export an entitlement with a name of `sample-entitlement`, in a project
named `sample-project`, and in location `global` to a local YAML file named
`sample-entitlement.yaml`, run:
$ {command} export sample-entitlement --project=sample-project
--location=global --destination=sample-entitlement.yaml
To export an entitlement with a name of `sample-entitlement`, in a folder
with ID ``FOLDER_ID'', and in location `global` to a local YAML file named
`sample-entitlement.yaml`, run:
$ {command} export sample-entitlement --folder=FOLDER_ID
--location=global --destination=sample-entitlement.yaml
To export an entitlement with a name of `sample-entitlement`, in an
organization with ID ``ORGANIZATION_ID'', and in location `global` to a local
YAML file named `sample-entitlement.yaml`, run:
$ {command} export sample-entitlement --organization=ORGANIZATION_ID
--location=global --destination=sample-entitlement.yaml
"""

View File

@@ -0,0 +1,64 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Create a new Privileged Access Manager (PAM) entitlement.
description: Create a new Privileged Access Manager (PAM) entitlement in a project/folder/organization location.
examples: |
The following command creates a new entitlement with a name of `sample-entitlement`, in a
project named `sample-project`, in location `global`, and the entitlement configuration stored
in a file named `sample-entitlement.yaml`:
$ {command} sample-entitlement --project=sample-project --location=global --entitlement-file=sample-entitlement.yaml
The following command creates a new entitlement with a name of `sample-entitlement`, in a
folder with ID ``FOLDER_ID'', in location `global`, and the entitlement configuration stored
in a file named `sample-entitlement.yaml`:
$ {command} sample-entitlement --folder=FOLDER_ID --location=global --entitlement-file=sample-entitlement.yaml
The following command creates a new entitlement with a name of `sample-entitlement`, in an
organization with ID ``ORGANIZATION_ID'', in location `global`, and the entitlement
configuration stored in a file named `sample-entitlement.yaml`:
$ {command} sample-entitlement --organization=ORGANIZATION_ID --location=global --entitlement-file=sample-entitlement.yaml
request:
ALPHA:
api_version: v1alpha
BETA:
api_version: v1beta
GA:
api_version: v1
collection:
- privilegedaccessmanager.projects.locations.entitlements
- privilegedaccessmanager.folders.locations.entitlements
- privilegedaccessmanager.organizations.locations.entitlements
modify_request_hooks:
- googlecloudsdk.command_lib.pam.util:ParseEntitlementNameIntoCreateEntitlementRequest
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.pam.resources:entitlement
help_text: |
Name of the entitlement to create.
params:
- arg_name: entitlement-file
api_field: entitlement
required: true
type: "googlecloudsdk.calliope.arg_parsers:FileContents:"
processor: googlecloudsdk.core.yaml:load
help_text: |
YAML file containing the configuration of the entitlement.
async:
ALPHA:
api_version: v1alpha
BETA:
api_version: v1beta
collection:
- privilegedaccessmanager.projects.locations.operations
- privilegedaccessmanager.folders.locations.operations
- privilegedaccessmanager.organizations.locations.operations
output:
format: yaml

View File

@@ -0,0 +1,58 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Delete a Privileged Access Manager (PAM) entitlement.
description: |
Delete a Privileged Access Manager (PAM) entitlement along with all grants associated with it.
This command can fail for the following reasons:
* There are non-terminal grants under the entitlement.
examples: |
The following command deletes an entitlement with a name of `sample-entitlement`, in a
project named `sample-project`, and in location `global`:
$ {command} sample-entitlement --project=sample-project --location=global
The following command deletes an entitlement with a name of `sample-entitlement`, in a folder
with ID ``FOLDER_ID'', and in location `global`:
$ {command} sample-entitlement --folder=FOLDER_ID --location=global
The following command deletes an entitlement with a name of `sample-entitlement`, in an
organization with ID ``ORGANIZATION_ID'', and in location `global`:
$ {command} sample-entitlement --organization=ORGANIZATION_ID --location=global
request:
ALPHA:
api_version: v1alpha
BETA:
api_version: v1beta
GA:
api_version: v1
collection:
- privilegedaccessmanager.projects.locations.entitlements
- privilegedaccessmanager.folders.locations.entitlements
- privilegedaccessmanager.organizations.locations.entitlements
modify_request_hooks:
- googlecloudsdk.command_lib.pam.util:SetForceFieldInDeleteEntitlementRequest
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.pam.resources:entitlement
help_text: |
Name of the entitlement to delete.
async:
ALPHA:
api_version: v1alpha
BETA:
api_version: v1beta
collection:
- privilegedaccessmanager.projects.locations.operations
- privilegedaccessmanager.folders.locations.operations
- privilegedaccessmanager.organizations.locations.operations
input:
confirmation_prompt: |
All grants associated with the entitlement are also deleted upon deleting the entitlement.

View File

@@ -0,0 +1,38 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Show details of a Privileged Access Manager (PAM) entitlement.
description: Show details of a Privileged Access Manager (PAM) entitlement.
examples: |
The following command describes an entitlement with a name of `sample-entitlement`, in a
project named `sample-project`, and in location `global`:
$ {command} sample-entitlement --project=sample-project --location=global
The following command describes an entitlement with a name of `sample-entitlement`, in a folder
with ID ``FOLDER_ID'', and in location `global`:
$ {command} sample-entitlement --folder=FOLDER_ID --location=global
The following command describes an entitlement with a name of `sample-entitlement`, in an
organization with ID ``ORGANIZATION_ID'', and in location `global`:
$ {command} sample-entitlement --organization=ORGANIZATION_ID --location=global
request:
ALPHA:
api_version: v1alpha
BETA:
api_version: v1beta
GA:
api_version: v1
collection:
- privilegedaccessmanager.projects.locations.entitlements
- privilegedaccessmanager.folders.locations.entitlements
- privilegedaccessmanager.organizations.locations.entitlements
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.pam.resources:entitlement
help_text: |
Name of the entitlement to describe.

View File

@@ -0,0 +1,41 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Export a Privileged Access Manager (PAM) entitlement into a local YAML file.
description: Export a Privileged Access Manager (PAM) entitlement into a local YAML file.
examples: |
The following command exports an entitlement with a name of `sample-entitlement`, in a
project named `sample-project`, and in location `global` to a local YAML file named
`sample-entitlement.yaml`:
$ {command} sample-entitlement --project=sample-project --location=global --destination=sample-entitlement.yaml
The following command exports an entitlement with a name of `sample-entitlement`, in a folder
with ID ``FOLDER_ID'', and in location `global` to a local YAML file named
`sample-entitlement.yaml`:
$ {command} sample-entitlement --folder=FOLDER_ID --location=global --destination=sample-entitlement.yaml
The following command exports an entitlement with a name of `sample-entitlement`, in an
organization with ID ``ORGANIZATION_ID'', and in location `global` to a local YAML file named
`sample-entitlement.yaml`:
$ {command} sample-entitlement --organization=ORGANIZATION_ID --location=global --destination=sample-entitlement.yaml
request:
ALPHA:
api_version: v1alpha
BETA:
api_version: v1beta
GA:
api_version: v1
collection:
- privilegedaccessmanager.projects.locations.entitlements
- privilegedaccessmanager.folders.locations.entitlements
- privilegedaccessmanager.organizations.locations.entitlements
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.pam.resources:entitlement
help_text: |
Name of the entitlement to export.

View File

@@ -0,0 +1,38 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: List all Privileged Access Manager (PAM) entitlements under a parent.
description: List all Privileged Access Manager (PAM) entitlements in a project/folder/organization location.
examples: |
The following command lists all entitlements in a project named `sample-project` and in
location `global`:
$ {command} --project=sample-project --location=global
The following command lists all entitlements in a folder with ID ``FOLDER_ID'' and in
location `global`:
$ {command} --folder=FOLDER_ID --location=global
The following command lists all entitlements in an organization with ID ``ORGANIZATION_ID''
and in location `global`:
$ {command} --organization=ORGANIZATION_ID --location=global
request:
ALPHA:
api_version: v1alpha
BETA:
api_version: v1beta
GA:
api_version: v1
collection:
- privilegedaccessmanager.projects.locations.entitlements
- privilegedaccessmanager.folders.locations.entitlements
- privilegedaccessmanager.organizations.locations.entitlements
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.pam.resources:location
help_text: |
Location of the entitlements.

View File

@@ -0,0 +1,71 @@
- release_tracks: [ALPHA, BETA, GA]
command_type: LIST
help_text:
brief: Search and list all Privileged Access Manager (PAM) entitlements in a parent for which you are a requester/approver.
description: Search and list all Privileged Access Manager (PAM) entitlements in a project/folder/organization location for which you are a requester/approver.
examples: |
The following command searches for and lists all entitlements for which you are a requester,
in a project named `sample-project`, and in location `global`:
$ {command} --project=sample-project --location=global --caller-access-type=grant-requester
The following command searches for and lists all entitlements for which you are an approver,
in a project named `sample-project`, and in location `global`:
$ {command} --project=sample-project --location=global --caller-access-type=grant-approver
The following command searches for and lists all entitlements for which you are a requester,
in a folder with ID ``FOLDER_ID'', and in location `global`:
$ {command} --folder=FOLDER_ID --location=global --caller-access-type=grant-requester
The following command searches for and lists all entitlements for which you are an approver,
in a folder with ID ``FOLDER_ID'', and in location `global`:
$ {command} --folder=FOLDER_ID --location=global --caller-access-type=grant-approver
The following command searches for and lists all entitlements for which you are a requester,
in an organization with ID ``ORGANIZATION_ID'', and in location `global`:
$ {command} --organization=ORGANIZATION_ID --location=global --caller-access-type=grant-requester
The following command searches for and lists all entitlements for which you are an approver,
in an organization with ID ``ORGANIZATION_ID'', and in location `global`:
$ {command} --organization=ORGANIZATION_ID --location=global --caller-access-type=grant-approver
request:
ALPHA:
api_version: v1alpha
BETA:
api_version: v1beta
GA:
api_version: v1
method: search
collection:
- privilegedaccessmanager.projects.locations.entitlements
- privilegedaccessmanager.folders.locations.entitlements
- privilegedaccessmanager.organizations.locations.entitlements
arguments:
params:
- arg_name: location
resource_spec: !REF googlecloudsdk.command_lib.pam.resources:location
is_parent_resource: true
is_primary_resource: true
is_positional: false
required: true
help_text: |
Location of the entitlements.
- api_field: callerAccessType
arg_name: caller-access-type
required: true
choices:
- arg_value: grant-requester
enum_value: GRANT_REQUESTER
- arg_value: grant-approver
enum_value: GRANT_APPROVER
help_text: |
Search for entitlements based on whether you are a requester or approver.

View File

@@ -0,0 +1,68 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Update an existing Privileged Access Manager (PAM) entitlement.
description: Update an existing Privileged Access Manager (PAM) entitlement.
examples: |
The following command updates an entitlement with a name of `sample-entitlement`, in a
project named `sample-project`, in location `global`, and the new entitlement configuration
stored in a file named `sample-entitlement.yaml`:
$ {command} sample-entitlement --project=sample-project --location=global --entitlement-file=sample-entitlement.yaml
The following command updates an entitlement with a name of `sample-entitlement`, in a folder
with ID ``FOLDER_ID'', in location `global`, and the new entitlement configuration stored in
a file named `sample-entitlement.yaml`:
$ {command} sample-entitlement --folder=FOLDER_ID --location=global --entitlement-file=sample-entitlement.yaml
The following command updates an entitlement with a name of `sample-entitlement`, in an
organization with ID ``ORGANIZATION_ID'', in location `global`, and the new entitlement
configuration stored in a file named `sample-entitlement.yaml`:
$ {command} sample-entitlement --organization=ORGANIZATION_ID --location=global --entitlement-file=sample-entitlement.yaml
request:
ALPHA:
api_version: v1alpha
BETA:
api_version: v1beta
GA:
api_version: v1
collection:
- privilegedaccessmanager.projects.locations.entitlements
- privilegedaccessmanager.folders.locations.entitlements
- privilegedaccessmanager.organizations.locations.entitlements
modify_request_hooks:
- googlecloudsdk.command_lib.pam.util:SetUpdateMaskInUpdateEntitlementRequest
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.pam.resources:entitlement
help_text: |
Name of the entitlement to update.
params:
- arg_name: entitlement-file
api_field: entitlement
required: true
type: "googlecloudsdk.calliope.arg_parsers:FileContents:"
processor: googlecloudsdk.core.yaml:load
help_text: |
YAML file containing the new configuration of the entitlement.
async:
ALPHA:
api_version: v1alpha
BETA:
api_version: v1beta
collection:
- privilegedaccessmanager.projects.locations.operations
- privilegedaccessmanager.folders.locations.operations
- privilegedaccessmanager.organizations.locations.operations
output:
format: yaml
input:
confirmation_prompt: |
Only new grants created against the entitlement are affected by the changes.