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,27 @@
# -*- 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.
"""The command group for osconfig inventory CLI."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.DefaultUniverseOnly
@base.ReleaseTracks(base.ReleaseTrack.GA, base.ReleaseTrack.ALPHA)
class OsconfigInventory(base.Group):
"""Display inventory of a Compute Engine VM."""

View File

@@ -0,0 +1,114 @@
- release_tracks: [GA, ALPHA]
help_text:
brief: Describe the inventory data for a Compute Engine VM instance.
description: |
Describe the inventory data for a Compute Engine VM instance.
examples: |
To describe the inventory of an instance `my-instance`
that has the instance ID `5678` in the current project
and location 'us-central1-a', run:
$ {command} my-instance --location=us-central1-a
request:
collection: osconfig.projects.locations.instances.inventories
# This command is implemented manually (without resources) so that
# its help documentation specifically allows instance IDs as the first
# positional paramater.
#
# Without this, a presubmit check will block this yaml file.
disable_resource_check: true
ALPHA:
api_version: v1alpha
GA:
api_version: v1
modify_request_hooks:
- googlecloudsdk.command_lib.compute.os_config.inventories.declarative:SetNameOnDescribeRequestHook
response:
id_field: name
modify_response_hooks:
- googlecloudsdk.command_lib.compute.os_config.inventories.declarative:CreateDescribeTableViewResponseHook
arguments:
params:
- arg_name: instance
is_positional: true
help_text: |
ID or name of the Compute Engine VM instance to describe. For details on valid instance IDs,
refer to the criteria documented under the field `id` at:
https://cloud.google.com/compute/docs/reference/rest/v1/instances
- arg_name: location
help_text: |
Location of the Compute Engine VM instance to describe. If not specified, the property
`compute/zone` is used. For details on setting properties,
see: https://cloud.google.com/sdk/docs/properties
- api_field: view
help_text: |
Specifies what information should be included in the
output. If unspecified, the default view is `basic`.
choices:
- arg_value: basic
enum_value: BASIC
help_text: Output is limited to operating system details.
- arg_value: full
enum_value: FULL
help_text: Output includes operating system details and package information.
output:
format: |
multi(
installed_packages.yumPackage:format=
"table[box,title='Installed Packages (Yum)']
(package_name:sort=1,architecture,version)",
installed_packages.aptPackage:format=
"table[box,title='Installed Packages (Apt)']
(package_name:sort=1,architecture,version)",
installed_packages.zypperPackage:format=
"table[box,title='Installed Packages (Zypper)']
(package_name:sort=1,architecture,version)",
installed_packages.googetPackage:format=
"table[box,title='Installed Packages (GooGet)']
(package_name:sort=1,architecture,version)",
installed_packages.cosPackage:format=
"table[box,title='Installed Packages (COS)']
(package_name:sort=1,architecture,version)",
installed_packages.zypperPatch:format=
"table[box,title='Installed Patches (Zypper Patch)']
(patch_name:sort=1,category,severity,summary)",
installed_packages.wuaPackage:format=
"table[all-box,title='Installed Packages (Windows Update Agent)']
(title:sort=1:wrap,categories.extract(name).flatten(separator=', '):wrap,kb_article_ids.list(),support_url)",
installed_packages.qfePackage:format=
"table[box,title='Installed Packages (Quick Fix Engineering)']
(caption:sort=1,description,hot_fix_id,install_time)",
installed_packages.windowsApplication:format=
"table[box,title='Installed Packages (Windows Application)']
(displayName:sort=1,displayVersion,publisher,installDate.date('%Y-%m-%d'))",
updatedable_packages.yumPackage:format=
"table[box,title='Package Updates Available (Yum)']
(package_name:sort=1,architecture,version)",
updatedable_packages.aptPackage:format=
"table[box,title='Package Updates Available (Apt)']
(package_name:sort=1,architecture,version)",
updatedable_packages.zypperPackage:format=
"table[box,title='Package Updates Available (Zypper)']
(package_name:sort=1,architecture,version)",
updatedable_packages.googetPackage:format=
"table[box,title='Package Updates Available (GooGet)']
(package_name:sort=1,architecture,version)",
updatedable_packages.cosPackage:format=
"table[box,title='Package Updates Available (COS)']
(package_name:sort=1,architecture,version)",
updatedable_packages.zypperPatch:format=
"table[box,title='Patches Available (Zypper Patch)']
(patch_name:sort=1,category,severity,summary)",
updatedable_packages.wuaPackage:format=
"table[all-box,title='Package Updates Available (Windows Update Agent)']
(title:sort=1:wrap,categories.extract(name).flatten(separator=', '):wrap,kb_article_ids.list(),support_url)",
updatedable_packages.qfePackage:format=
"table[box,title='Package Updates Available (Quick Fix Engineering)']
(caption:sort=1,description,hot_fix_id,install_time)",
system_information:format="default
(architecture,hostname,kernelRelease,kernelVersion,longName,osconfigAgentVersion,shortName,updateTime.date('%Y-%m-%dT%H:%M:%SZ'),version)"
)

View File

@@ -0,0 +1,73 @@
- release_tracks: [GA, ALPHA]
help_text:
brief: List inventory data for all Compute Engine VM instances in a specified location.
description: |
List inventory data for all Compute Engine VM instances in a specified location.
The default page size is 25. To modify this, use the `--page-size` flag.
examples: |
To list the inventory of VMs in `my-project` and location `us-central1-a`, run:
$ {command} --project=my-project --location=us-central1-a
request:
collection: osconfig.projects.locations.instances.inventories
ALPHA:
api_version: v1alpha
GA:
api_version: v1
disable_resource_check: true
modify_request_hooks:
- googlecloudsdk.command_lib.compute.os_config.inventories.declarative:SetParentOnListRequestHook
- googlecloudsdk.command_lib.compute.os_config.declarative:SetDefaultPageSizeRequestHook:default_page_size=25
response:
id_field: name
modify_response_hooks:
- googlecloudsdk.command_lib.compute.os_config.inventories.declarative:CreateTableViewResponseHook
arguments:
params:
- arg_name: location
help_text: |
Location of the Compute Engine VM instances to list. If not specified, the property
`compute/zone` is used. For details on setting properties,
see: https://cloud.google.com/sdk/docs/properties
- api_field: view
help_text: |
Specifies what information should be included in the
output. If unspecified, the default view is `basic`.
choices:
- arg_value: basic
enum_value: BASIC
help_text: Output is limited to operating system details.
- arg_value: full
enum_value: FULL
help_text: Output includes operating system details and package information.
- arg_name: unmodified-api-response
hidden: true
default: false
help_text: |
Do not transform the response from API. Warning: the amount of data returned can be very
large.
output:
format: |
multi(
basic:format="table(
instance_id,
instance_name,
os,
osconfig_agent_version,
update_time.date('%Y-%m-%dT%H:%M:%SZ')
)",
full:format="table(
instance_id,
instance_name,
os,
installed_packages,
available_packages,
osconfig_agent_version,
update_time.date('%Y-%m-%dT%H:%M:%SZ')
)"
)