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,28 @@
# -*- 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.
"""Command group for Security Health Analytics custom modules."""
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 SecurityHealthAnalyticsCustomModules(base.Group):
"""Manage Security Health Analytics custom modules."""
category = base.SECURITY_CATEGORY

View File

@@ -0,0 +1,79 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: Create a Security Health Analytics custom module.
description: Create a Security Health Analytics custom module.
examples: |
To create a Security Health Analytics custom module for given organization `123`, run:
$ {command} --organization=organizations/123 \
--display-name="test_display_name" \
--enablement-state="ENABLED" \
--custom-config-from-file=custom_config.yaml
To create a Security Health Analytics custom module for given folder `456`, run:
$ {command} --folder=folders/456 \
--display-name="test_display_name" \
--enablement-state="ENABLED"
--custom-config-from-file=custom_config.yaml
To create a Security Health Analytics custom module for given project `789`, run:
$ {command} --project=projects/789 \
--display-name="test_display_name" \
--enablement-state="ENABLED"
--custom-config-from-file=custom_config.yaml
request:
collection: securitycenter.organizations.securityHealthAnalyticsSettings.customModules
disable_resource_check: true
api_version: v1
modify_request_hooks:
- googlecloudsdk.command_lib.scc.custom_modules.sha.request_hooks:CreateSecurityHealthAnalyticsCustomModuleReqHook
arguments:
params:
- group:
mutex: true
params:
- arg_name: organization
api_field: parent
help_text: |
Organization where the Security Health Analytics custom module resides. Formatted as `organizations/123` or just `123`.
- arg_name: folder
api_field: parent
help_text: |
Folder where the Security Health Analytics custom module resides. Formatted as `folders/456` or just `456`.
- arg_name: project
api_field: parent
help_text: |
ID or number of the project where the Security Health Analytics custom module resides. Formatted as `projects/789` or just `789`.
- arg_name: display-name
api_field: googleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.displayName
is_positional: false
required: true
help_text: |
Sets the display name of the Security Health Analytics custom module. This display name becomes the finding category for all findings that are returned by this custom module. The display name must be between 1 and 128 characters, start with a lowercase letter, and contain alphanumeric characters or underscores only.
- arg_name: enablement-state
api_field: googleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.enablementState
is_positional: false
required: true
help_text: |
Sets the enablement state of the Security Health Analytics custom module. From the following list of possible enablement states, specify either enabled or disabled only
- arg_name: custom-config-from-file
api_field: googleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.customConfig
type: "googlecloudsdk.calliope.arg_parsers:FileContents:"
processor: googlecloudsdk.command_lib.scc.hooks:ProcessCustomConfigFile
is_positional: false
required: true
help_text: |
Path to a YAML file that contains the configuration for the Security Health Analytics custom module.
output:
format: yaml

View File

@@ -0,0 +1,56 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: Delete a Security Health Analytics custom module.
description: Delete a Security Health Analytics custom module.
examples: |
To delete a Security Health Analytics custom module with ID `123456` for organization `123`, run:
$ {command} 123456 --organization=organizations/123
To delete a Security Health Analytics custom module with ID `123456` for folder `456`, run:
$ {command} 123456 --folder=folders/456
To delete a Security Health Analytics custom module with ID `123456` for project `789`, run:
$ {command} 123456 --project=projects/789
request:
collection: securitycenter.organizations.securityHealthAnalyticsSettings.customModules
disable_resource_check: true
api_version: v1
modify_request_hooks:
- googlecloudsdk.command_lib.scc.custom_modules.sha.request_hooks:DeleteSecurityHealthAnalyticsCustomModuleReqHook
arguments:
params:
- arg_name: custom_module
api_field: name
is_positional: true
required: true
help_text: |
ID or the full resource name of the Security Health Analytics custom module. If you specify the full resource name, you do not need to specify the --organization, --folder, or --project flags.
- group:
mutex: true
params:
- arg_name: organization
api_field: name
help_text: |
Organization where the Security Health Analytics custom module resides. Formatted as `organizations/123` or just `123`.
- arg_name: folder
api_field: name
help_text: |
Folder where the Security Health Analytics custom module resides. Formatted as `folders/456` or just `456`.
- arg_name: project
api_field: name
help_text: |
ID or number of the project where the Security Health Analytics custom module resides. Formatted as `projects/789` or just `789`.
input:
confirmation_prompt: |
Are you sure you want to delete a Security Health Analytics custom module?

View File

@@ -0,0 +1,60 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: Get the details of a Security Health Analytics custom module.
description: |
Get the details of a Security Health Analytics custom module. It does not resolve INHERITED enablement states
to ENABLED or DISABLED for modules created at ancestor levels. For example, if the module is enabled
at the ancestor level, modules for all child resources will have the enablement state set to
INHERITED. Use `gcloud scc custom-modules sha get-effective` to retrieve a custom module with its effective enablement state.
examples: |
To get the details of a Security Health Analytics custom module with ID `123456` for organization `123`, run:
$ {command} 123456 --organization=organizations/123
To get the details of a Security Health Analytics custom module with ID `123456` for folder `456`, run:
$ {command} 123456 --folder=folders/456
To get the details of a Security Health Analytics custom module with ID `123456` for project `789`, run:
$ {command} 123456 --project=projects/789
request:
collection: securitycenter.organizations.securityHealthAnalyticsSettings.customModules
disable_resource_check: true
api_version: v1
method: get
modify_request_hooks:
- googlecloudsdk.command_lib.scc.custom_modules.sha.request_hooks:GetSecurityHealthAnalyticsCustomModuleReqHook
arguments:
params:
- arg_name: custom_module
api_field: name
is_positional: true
required: true
help_text: |
ID or the full resource name of the Security Health Analytics custom module. If you specify the full resource name, you do not need to specify the --organization, --folder, or --project flags.
- group:
mutex: true
params:
- arg_name: organization
api_field: name
help_text: |
Organization from which to get the custom module details. Formatted as
`organizations/123` or just `123`.
- arg_name: folder
api_field: name
help_text: |
Folder from which to get the custom module details. Formatted as `folders/456`
or just `456`.
- arg_name: project
api_field: name
help_text: |
ID or number of the project from which to get the custom module details. Formatted as
`projects/789` or just `789`.

View File

@@ -0,0 +1,64 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: Get the details of a Security Health Analytics custom module with effective enablement state.
description: |
Get the details of a Security Health Analytics custom module. For inherited custom modules,
the get-effective command resolves INHERITED enablement states to ENABLED or DISABLED.
For example, if an inherited custom module is enabled at the ancestor level, then the
get-effective command displays the enablement state as ENABLED instead of INHERITED in a
child folder or project.
examples: |
To get the details of a Security Health Analytics custom module 123456 with its effective enablement state
from organization `123`, run:
$ {command} 123456 --organization=organizations/123
To get the details of a Security Health Analytics custom module 123456 with its effective enablement state
from folder `456`, run:
$ {command} 123456 --folder=folders/456
To get the details of a Security Health Analytics custom module 123456 with its effective enablement state
from project `789`, run:
$ {command} 123456 --project=projects/789
request:
collection: securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules
disable_resource_check: true
api_version: v1
method: get
modify_request_hooks:
- googlecloudsdk.command_lib.scc.custom_modules.sha.request_hooks:GetEffectiveSecurityHealthAnalyticsCustomModuleReqHook
arguments:
params:
- arg_name: custom_module
api_field: name
is_positional: true
required: true
help_text: |
ID or the full resource name of the effective Security Health Analytics custom module. If you specify the full resource name, you do not need to specify the --organization, --folder, or --project flags.
- group:
mutex: true
params:
- arg_name: organization
api_field: name
help_text: |
Organization from which to get the custom module details. Formatted as
`organizations/123` or just `123`.
- arg_name: folder
api_field: name
help_text: |
Folder from which to get the custom module details. Formatted as `folders/456`
or just `456`.
- arg_name: project
api_field: name
help_text: |
ID or number of the project from which to get the custom module details. Formatted as
`projects/789` or just `789`.

View File

@@ -0,0 +1,56 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: List the details of Security Health Analytics custom modules.
description: |
List the details of the resident and inherited Security Health Analytics custom modules for
the specified folder or project. For an organization, this command lists only the custom
modules that are created at the organization level. Custom modules created in child folders
or projects are not included in the list. To list the resident custom modules and the modules
that are created in child folders or projects, use `gcloud scc custom-modules sha list-descendant`.
examples: |
To list resident and inherited Security Health Analytics custom modules for organization `123`, run:
$ {command} --organization=organizations/123
To list resident and inherited Security Health Analytics custom modules for folder `456`, run:
$ {command} --folder=folders/456
To list resident and inherited Security Health Analytics custom modules for project `789`, run:
$ {command} --project=projects/789
request:
collection: securitycenter.organizations.securityHealthAnalyticsSettings.customModules
disable_resource_check: true
api_version: v1
modify_request_hooks:
- googlecloudsdk.command_lib.scc.custom_modules.sha.request_hooks:ListSecurityHealthAnalyticsCustomModulesReqHook
arguments:
params:
- group:
required: true
mutex: true
params:
- arg_name: organization
api_field: parent
help_text: |
Organization for listing the Security Health Analytics custom modules created at the
organization level. Formatted as `organizations/123` or just `123`.
- arg_name: folder
api_field: parent
help_text: |
Folder for listing the Security Health Analytics custom modules created at the current
folder level and inherited modules from CRM ancestors. Formatted as `folders/456` or
just `456`.
- arg_name: project
api_field: parent
help_text: |
ID or number of the project for listing the Security Health Analytics custom modules created
at current project level and inherited modules from CRM ancestors. Formatted as
`projects/789` or just `789`.

View File

@@ -0,0 +1,59 @@
- release_tracks: [ALPHA, GA]
command_type: LIST
help_text:
brief: List the details of the resident and descendant Security Health Analytics custom modules.
description: |
List the details of the resident and descendant Security Health Analytics custom modules for a
specified organization or folder. For a project, this command lists only the custom modules
that are created in the project. Modules created in a parent organization or folder are
excluded from the list. To list the resident custom modules and the modules that are inherited
from a parent organization and folder, use `gcloud scc custom-modules sha list`.
examples: |
To list resident and descendant Security Health Analytics custom modules for organization `123`, run:
$ {command} --organization=organizations/123
To list resident and descendant Security Health Analytics custom modules for folder `456`, run:
$ {command} --folder=folders/456
To list resident and descendant Security Health Analytics custom modules for project `789`, run:
$ {command} --project=projects/789
request:
collection: securitycenter.organizations.securityHealthAnalyticsSettings.customModules
disable_resource_check: true
api_version: v1
method: listDescendant
disable_pagination: true
modify_request_hooks:
- googlecloudsdk.command_lib.scc.custom_modules.sha.request_hooks:ListDescendantSecurityHealthAnalyticsCustomModulesReqHook
arguments:
params:
- group:
required: true
mutex: true
params:
- arg_name: organization
api_field: parent
help_text: |
Organization for listing the Security Health Analytics custom modules created at
the organization level and its child resources. Formatted as `organizations/123`
or just `123`.
- arg_name: folder
api_field: parent
help_text: |
Folder for listing the Security Health Analytics custom modules created at the current
folder level and its child resources. Formatted as `folders/456` or just `456`.
- arg_name: project
api_field: parent
help_text: |
ID or number of the project for listing the Security Health Analytics custom modules
at current project level. Formatted as `projects/789` or just `789`.

View File

@@ -0,0 +1,58 @@
- release_tracks: [ALPHA, GA]
command_type: LIST
help_text:
brief: List the details of Security Health Analytics custom modules with effective enablement states.
description: |
List the details of resident and inherited Security Health Analytics custom modules for the specified folder
or project with their effective enablement states. For an organization, this command lists only the
custom modules that are created at the organization level. Custom modules created in child
folders or projects are not included in the list.
examples: |
To list resident and inherited Security Health Analytics custom modules with effective enablement states for organization `123`, run:
$ {command} --organization=organizations/123
To list resident and inherited effective Security Health Analytics custom modules with effective enablement states for folder `456`, run:
$ {command} --folder=folders/456
To list resident and inherited effective Security Health Analytics custom modules with effective enablement states for project `789`, run:
$ {command} --project=projects/789
request:
collection: securitycenter.organizations.securityHealthAnalyticsSettings.effectiveCustomModules
disable_resource_check: true
api_version: v1
method: list
modify_request_hooks:
- googlecloudsdk.command_lib.scc.custom_modules.sha.request_hooks:ListEffectiveSecurityHealthAnalyticsCustomModulesReqHook
arguments:
params:
- group:
required: true
mutex: true
params:
- arg_name: organization
api_field: parent
help_text: |
Organization for listing the effective Security Health Analytics custom modules created
at the organization level. Formatted as `organizations/123` or just `123`.
- arg_name: folder
api_field: parent
help_text: |
Folder for listing the effective Security Health Analytics custom modules created at the
current folder level and inherited modules from CRM ancestors. Formatted as `folders/456`
or just `456`.
- arg_name: project
api_field: parent
help_text: |
ID or number of the project for listing the effective Security Health Analytics custom modules
for the current project level and inherited modules from CRM ancestors. Formatted as
`projects/789` or just `789`.

View File

@@ -0,0 +1,78 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: Validates a Security Health Analytics custom module.
description: Validates a given Security Health Analytics custom module and resource.
examples: |
To validate a Security Health Analytics custom module against a custom resource for
organization `123`, run:
$ {command} \
--organization=organizations/123 \
--custom-config-from-file=/tmp/custom_config.yaml \
--resource-from-file=/tmp/resource.yaml
To validate a Security Health Analytics custom module against a custom resource for
folder `456`, run:
$ {command} \
--folder=folders/456 \
--custom-config-from-file=/tmp/custom_config.yaml \
--resource-from-file=/tmp/resource.yaml
To validate a Security Health Analytics custom module against a custom resource for
project `789`, run:
$ {command} \
--project=projects/789 \
--custom-config-from-file=/tmp/custom_config.yaml \
--resource-from-file=/tmp/resource.yaml
request:
collection: securitycenter.organizations.securityHealthAnalyticsSettings.customModules
disable_resource_check: true
api_version: v1
method: simulate
modify_request_hooks:
- googlecloudsdk.command_lib.scc.custom_modules.sha.request_hooks:SimulateSecurityHealthAnalyticsCustomModulesReqHook
arguments:
params:
- group:
required: true
mutex: true
params:
- arg_name: organization
api_field: parent
help_text: |
Organization that will own the Security Health Analytics custom module. Formatted as `organizations/123` or just `123`.
- arg_name: folder
api_field: parent
help_text: |
Folder that will own the Security Health Analytics custom module. Formatted as `folders/456` or just `456`.
- arg_name: project
api_field: parent
help_text: |
ID or number of the project that will own the Security Health Analytics custom module. Formatted as `projects/789` or just `789`.
- arg_name: custom-config-from-file
api_field: simulateSecurityHealthAnalyticsCustomModuleRequest.customConfig
type: "googlecloudsdk.calliope.arg_parsers:FileContents:"
processor: googlecloudsdk.command_lib.scc.hooks:ProcessCustomConfigFile
is_positional: false
required: true
repeated: false
help_text: |
Path to a YAML file that contains the configuration for the Security Health Analytics custom module.
- arg_name: resource-from-file
api_field: simulateSecurityHealthAnalyticsCustomModuleRequest.resource
type: "googlecloudsdk.calliope.arg_parsers:FileContents:"
processor: googlecloudsdk.command_lib.scc.hooks:ProcessSimulatedResourceFile
is_positional: false
required: true
repeated: false
help_text: |
Path to a YAML file that contains the resource data to validate the Security Health Analytics custom module against.

View File

@@ -0,0 +1,90 @@
- release_tracks: [ALPHA]
help_text:
brief: Test a Security Health Analytics custom module.
description: Test a Security Health Analytics custom module.
examples: |
To test a Security Health Analytics custom module with ID `123456` for organization `123`, run:
$ {command} 123456 \
--organization=organizations/123 \
--display-name="test_display_name" \
--custom-config-from-file=/tmp/custom_config.yaml \
--test-data-from-file=/tmp/test_data.yaml
To test a Security Health Analytics custom module with ID `123456` for folder `456`, run:
$ {command} 123456 \
--folder=folders/456 \
--display-name="test_display_name" \
--custom-config-from-file=/tmp/custom_config.yaml \
--test-data-from-file=/tmp/test_data.yaml
To test a Security Health Analytics custom module with ID `123456` for project `789`, run:
$ {command} 123456 \
--project=projects/789 \
--display-name="test_display_name" \
--custom-config-from-file=/tmp/custom_config.yaml \
--test-data-from-file=/tmp/test_data.yaml
request:
collection: securitycenter.organizations.securityHealthAnalyticsSettings.customModules
disable_resource_check: true
api_version: v1
method: test
modify_request_hooks:
- googlecloudsdk.command_lib.scc.custom_modules.sha.request_hooks:TestSecurityHealthAnalyticsCustomModulesReqHook
arguments:
params:
- arg_name: custom_module
api_field: name
is_positional: true
required: false
help_text: |
ID or the full resource name of the Security Health Analytics custom module. If you specify the full resource name, you do not need to specify the --organization, --folder, or --project flags.
- group:
mutex: true
params:
- arg_name: organization
api_field: name
help_text: |
Organization where the Security Health Analytics custom module resides. Formatted as `organizations/123` or just `123`.
- arg_name: folder
api_field: name
help_text: |
Folder where the Security Health Analytics custom module resides. Formatted as `folders/456` or just `456`.
- arg_name: project
api_field: name
help_text: |
ID or number of the project where the Security Health Analytics custom module resides. Formatted as `projects/789` or just `789`.
- arg_name: display-name
api_field: testSecurityHealthAnalyticsCustomModuleRequest.securityHealthAnalyticsCustomModule.displayName
is_positional: false
required: false
help_text: |
Sets the display name of the Security Health Analytics custom module. This display name becomes the finding category for all findings that are returned by this the custom module. The display name must be between 1 and 128 characters, start with a lowercase letter, and contain alphanumeric characters or underscores only. Only relevant when `--custom-config-from-file` is also specified.
- arg_name: custom-config-from-file
api_field: testSecurityHealthAnalyticsCustomModuleRequest.securityHealthAnalyticsCustomModule.customConfig
type: "googlecloudsdk.calliope.arg_parsers:FileContents:"
processor: googlecloudsdk.command_lib.scc.hooks:ProcessCustomConfigFile
is_positional: false
required: false
help_text: |
Path to a YAML file that contains the configuration for the Security Health Analytics custom module. If not specified, the existing module with the given ID or resource name is used.
- arg_name: test-data-from-file
api_field: testSecurityHealthAnalyticsCustomModuleRequest.testData
type: "googlecloudsdk.calliope.arg_parsers:FileContents:"
processor: googlecloudsdk.command_lib.scc.hooks:ProcessTestResourceDataFile
is_positional: false
required: true
repeated: false
help_text: |
Path to a YAML file that contains the resource data to test the Security Health Analytics custom module against.

View File

@@ -0,0 +1,83 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: Update a Security Health Analytics custom module.
description: Update a Security Health Analytics custom module.
examples: |
To update a Security Health Analytics custom module with ID `123456` for organization `123, run`:
$ {command} 123456 \
--organization=organizations/123 \
--enablement-state="ENABLED" \
--custom-config-from-file=custom_config.yaml
To update a Security Health Analytics custom module with ID `123456` for folder `456`, run:
$ {command} 123456 \
--folder=folders/456 \
--enablement-state="ENABLED" \
--custom-config-from-file=custom_config.yaml
To update a Security Health Analytics custom module with ID `123456` for project `789`, run:
$ {command} 123456 \
--project=projects/789 \
--enablement-state="ENABLED" \
--custom-config-from-file=custom_config.yaml
request:
collection: securitycenter.organizations.securityHealthAnalyticsSettings.customModules
disable_resource_check: true
api_version: v1
modify_request_hooks:
- googlecloudsdk.command_lib.scc.custom_modules.sha.request_hooks:UpdateSecurityHealthAnalyticsCustomModuleReqHook
arguments:
params:
- arg_name: custom_module
api_field: name
is_positional: true
required: true
help_text: |
ID or the full resource name of the Security Health Analytics custom module. If you specify the full resource name, you do not need to specify the --organization, --folder, or --project flags.
- group:
mutex: true
params:
- arg_name: organization
api_field: name
help_text: |
Organization where the Security Health Analytics custom module resides. Formatted as `organizations/123` or just `123`.
- arg_name: folder
api_field: name
help_text: |
Folder where the Security Health Analytics custom module resides. Formatted as `folders/456` or just `456`.
- arg_name: project
api_field: name
help_text: |
ID or number of the project where the Security Health Analytics custom module resides. Formatted as `projects/789` or just `789`.
- arg_name: enablement-state
api_field: googleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.enablementState
is_positional: false
required: false
help_text: |
Sets the enablement state of the Security Health Analytics custom module. From the following list of possible enablement states, specify either enabled, disabled or inherited only
- arg_name: custom-config-from-file
api_field: googleCloudSecuritycenterV1SecurityHealthAnalyticsCustomModule.customConfig
type: "googlecloudsdk.calliope.arg_parsers:FileContents:"
processor: googlecloudsdk.command_lib.scc.hooks:ProcessCustomConfigFile
is_positional: false
help_text: |
Path to a YAML file that contains the configuration for the Security Health Analytics custom module.
- arg_name: update-mask
api_field: updateMask
help_text: |
Optional: If left unspecified (default), an update-mask is automatically created using the
flags specified in the command and only those values are updated.