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,31 @@
# -*- coding: utf-8 -*- #
# Copyright 2019 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.
"""DICOM stores command group for the Cloud Healthcare API 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)
class DicomStores(base.Group):
"""Manage Cloud Healthcare API DICOM stores.
Commands for managing Google Cloud Healthcare API DICOM stores.
"""

View File

@@ -0,0 +1,31 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Add an IAM policy binding to a Cloud Healthcare API DICOM store.
description: |
Adds an IAM policy binding to a Cloud Healthcare API DICOM store.
examples: |
To add an IAM policy binding for the role of 'roles/editor' for the user 'test-user@gmail.com'
on the dicom store 'test-dicom-store', run:
$ {command} test-dicom-store --dataset=test-dataset --member='user:test-user@gmail.com' --role='roles/editor'
See https://cloud.google.com/iam/docs/managing-policies for details of
policy role and member types.
request:
collection: healthcare.projects.locations.datasets.dicomStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API DICOM store to add an IAM policy binding to.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dicom_store
iam:
enable_condition: true

View File

@@ -0,0 +1,59 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Create a Cloud Healthcare API DICOM store.
description: |
Create a Cloud Healthcare API DICOM store.
examples: |
To create a dicom store called 'test-dicom-store', run:
$ {command} test-dicom-store --dataset=test-dataset
To create a dicom store with the Cloud Pub/Sub topic 'test-pubsub-topic', run:
$ {command} test-dicom-store --dataset=test-dataset --pubsub-topic=projects/my-project/topics/test-pubsub-topic
request:
collection: healthcare.projects.locations.datasets.dicomStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API DICOM store to create.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dicom_store
params:
- api_field: dicomStore.notificationConfig.pubsubTopic
arg_name: pubsub-topic
help_text: |
Google Cloud Pub/Sub topic to send updates to.
Note: A topic must be created before publishing or subscribing to it. For instructions
on creating topics, refer to: https://cloud.google.com/pubsub/docs/admin#create_a_topic
- api_field: dicomStore.notificationConfig.sendForBulkImport
arg_name: send-for-bulk-import
type: bool
default: false
help_text: |
Indicates whether or not to send Cloud Pub/Sub notifications on bulk import.
Only supported for DICOM imports.
- api_field: dicomStore.streamConfigs
arg_name: stream-configs
repeated: false
ALPHA:
processor: googlecloudsdk.command_lib.healthcare.util:InsertDicomStreamConfig:api_version=v1alpha2
BETA:
processor: googlecloudsdk.command_lib.healthcare.util:InsertDicomStreamConfig:api_version=v1beta1
GA:
processor: googlecloudsdk.command_lib.healthcare.util:InsertDicomStreamConfig:api_version=v1
help_text:
Configuration that indicates the BigQuery destinations for streaming instances of a DICOM store.
To specify StreamConfigs, list all BigQuery destinations into one string separated by comma.
(e.g., --stream-configs bq://{bigqueryProjectId1}.{bigqueryDatasetId1}.{bigqueryTableId1},bq://{bigqueryProjectId2}.{bigqueryDatasetId2}.{bigqueryTableId2}).

View File

@@ -0,0 +1,53 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
De-identify data from the source store and write it to the destination store.
description: |
De-identify data from the source store and write it to the destination store.
examples: |
To generate a de-identified version of the DICOM store 'test-dicom-store', run the command below.
$ {command} test-dicom-store --destination-store=projects/{projectId}/locations/us-central1/datasets/{datasetId}/dicomStores/test-deid-dicom-store --dicom-filter-tags=MediaStorageSOPClassUID,SeriesInstanceUID,StudyInstanceUID
request:
collection: healthcare.projects.locations.datasets.dicomStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
method: deidentify
arguments:
resource:
help_text: Source Cloud Healthcare API DICOM store to deidentify.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dicom_store
params:
- arg_name: destination-store
api_field: deidentifyDicomStoreRequest.destinationStore
required: true
help_text: |
The name of the DICOM store to which the redacted data should be written
(e.g., projects/{projectId}/locations/{locationId}/datasets/{datasetId}/dicomStores/{dicomStoreId}).
The destination DICOM store must already exist, or the request will fail.
- arg_name: dicom-filter-tags
api_field: deidentifyDicomStoreRequest.config.dicom.keepList.tags
help_text: |
Tags to be filtered. Tags must be DICOM Data Elements, File Meta Elements, or
Directory Structuring Elements, as defined at:
http://dicom.nema.org/medical/dicom/current/output/html/part06.html#table_6-1,.
They may be provided by "Keyword" or "Tag". For example "PatientID", "0010,0010".
- arg_name: text-redaction-mode
api_field: deidentifyDicomStoreRequest.config.image.textRedactionMode
choices:
- arg_value: all
enum_value: REDACT_ALL_TEXT
help_text: |
Redact all text.
help_text: |
Determines how to redact text from image.
async:
collection: healthcare.projects.locations.datasets.operations

View File

@@ -0,0 +1,23 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Delete a Cloud Healthcare API DICOM store.
description: Delete a Cloud Healthcare API DICOM store.
examples: |
To delete the dicom-store 'test-dicom-store', run:
$ {command} test-dicom-store --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.dicomStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API DICOM store to delete.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dicom_store

View File

@@ -0,0 +1,23 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Describe a Cloud Healthcare API DICOM store.
description: Describe a Cloud Healthcare API DICOM store.
examples: |
To describe the dicom-store 'test-dicom-store', run:
$ {command} test-dicom-store --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.dicomStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API DICOM store to describe.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dicom_store

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*- #
# Copyright 2019 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.
"""DICOM store exports command group for the Cloud Healthcare API 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)
class DicomStoreExports(base.Group):
"""Manage Cloud Healthcare API DICOM store exports.
Commands for exporting Google Cloud Healthcare API DICOM stores.
"""

View File

@@ -0,0 +1,76 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Export a Cloud Healthcare API API DICOM store to BigQuery.
description: Export a Cloud Healthcare API API DICOM store to BigQuery.
examples: |
To export the dicom-store ``test-dicom-store'' to the BigQuery table ``testtable'' in the dataset ``testdataset'', overwriting any existing table, run:
$ {command} test-dicom-store --bq-table=bq://my-project.testdataset.testtable --dataset=test-dataset --write-disposition=write-truncate
To export the dicom-store ``test-dicom-store'' to the BigQuery table ``testtable'' in the dataset ``testdataset'', appending any existing table, run:
$ {command} test-dicom-store --bq-table=bq://my-project.testdataset.testtable --dataset=test-dataset --write-disposition=write-append
request:
collection: healthcare.projects.locations.datasets.dicomStores
method: export
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API DICOM store to export.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dicom_store
params:
- arg_name: bq-table
api_field: exportDicomDataRequest.bigqueryDestination.tableUri
required: true
help_text: |
The BigQuery table where the DICOM store should
be written. If this table does not exist, a new table with the given
name will be created.
- arg_name: overwrite-table
api_field: exportDicomDataRequest.bigqueryDestination.force
default: null
help_text: |
If the destination table already exists and this flag is
`TRUE`, the table will be overwritten by the contents of the DICOM
store. If the flag is not set and the destination table already exists,
the export call returns an error.
- arg_name: write-disposition
api_field: exportDicomDataRequest.bigqueryDestination.writeDisposition
help_text: |
Determines whether the existing table in the destination is to be overwritten or appended to.
type: str
choices:
- arg_value: write-empty
enum_value: WRITE_EMPTY
help_text: |
Only export data if the destination table is empty.
- arg_value: write-truncate
enum_value: WRITE_TRUNCATE
help_text: |
Erase all existing data in a table before writing the instances.
- arg_value: write-append
enum_value: WRITE_APPEND
help_text: |
Append data to the existing table.
- arg_name: filter-config-gcs-uri
release_tracks: [ALPHA, BETA]
api_field: exportDicomDataRequest.filterConfig.resourcePathsGcsUri
help_text: |
Cloud Storage location of the filter configuration file. The FILTER_CONFIG_GCS_URI must
be in the format gs://bucket/path/to/object. The filter configuration file must contain a
list of resource paths separated by newline characters (\n or \r\n). Each resource path must
be in the format "/studies/{studyUID}[/series/{seriesUID}[/instances/{instanceUID}]]"
Cloud Healthcare API service account must have the roles/storage.objectViewer Cloud IAM
role for this Cloud Storage location.
async:
collection: healthcare.projects.locations.datasets.operations

View File

@@ -0,0 +1,64 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Export a Cloud Healthcare API DICOM store to Google Cloud Storage.
description: Export a Cloud Healthcare API DICOM store to Google Cloud Storage.
examples: |
To export the dicom-store 'test-dicom-store' to the existing bucket 'testGcsBucket' in the folder 'someFolder', with the mime-type 'application/dicom', run:
$ {command} test-dicom-store --gcs-uri-prefix=gs://testGcsBucket/someFolder --mime-type=application/dicom --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.dicomStores
method: export
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API DICOM store to export.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dicom_store
params:
- arg_name: gcs-uri-prefix
api_field: exportDicomDataRequest.gcsDestination.uriPrefix
required: true
help_text: |
URI for a Google Cloud Storage directory to which result
files should be written (for example, `gs://bucket-id/path/to/destination/dir`).
If there is no trailing slash, the service will append one when composing
the object path. The user is responsible for creating the Google Cloud
Storage bucket referenced in `uri_prefix`.
- arg_name: mime-type
api_field: exportDicomDataRequest.gcsDestination.mimeType
help_text: |
'MIME types supported by DICOM spec. Each file will be
written in the following format:
`.../{study_id}/{series_id}/{instance_id}[/{frame_number}].{extension}`
The frame_number component will exist only for multi-frame instances.
Refer to the DICOM conformance statement for permissible MIME types:
https://cloud.google.com/healthcare/docs/dicom#wado-rs The following
extensions will be used for output files:
* application/dicom -> .dcm
* image/jpeg -> .jpg
* image/png -> .png
If unspecified, the instances
will be exported in their original DICOM format.'
- arg_name: filter-config-gcs-uri
release_tracks: [ALPHA, BETA]
api_field: exportDicomDataRequest.filterConfig.resourcePathsGcsUri
help_text: |
Cloud Storage location of the filter configuration file. The FILTER_CONFIG_GCS_URI must be
in the format gs://bucket/path/to/object. The filter configuration file must contain a list
of resource paths separated by newline characters (\n or \r\n). Each resource path must be in
the format "/studies/{studyUID}[/series/{seriesUID}[/instances/{instanceUID}]]"
Cloud Healthcare API service account must have the roles/storage.objectViewer Cloud IAM
role for this Cloud Storage location.
async:
collection: healthcare.projects.locations.datasets.operations

View File

@@ -0,0 +1,24 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Retrieve the IAM policy for a Cloud Healthcare API DICOM store.
description: Retrieve the IAM policy for a Cloud Healthcare API DICOM store.
examples: |
To print the IAM policy for the dicom store 'test-dicom-store', run:
$ {command} test-dicom-store --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.dicomStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API DICOM store whose IAM policy to fetch.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dicom_store

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*- #
# Copyright 2019 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.
"""DICOM store imports command group for the Cloud Healthcare API 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)
class DicomStoreImports(base.Group):
"""Manage Cloud Healthcare API DICOM store imports.
Commands for importing Google Cloud Healthcare API DICOM stores.
"""

View File

@@ -0,0 +1,50 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Import DICOM objects into a Cloud Healthcare API DICOM store.
description: Import DICOM objects into a Cloud Healthcare API DICOM store.
examples: |
To import the DICOM objects from the existing bucket 'testGcsBucket' in the folder 'someFolder' into the DICOM store 'test-dicom-store', run:
$ {command} test-dicom-store --gcs-uri="gs://testGcsBucket/someFolder/*" --dataset=test-dataset
Note that '*' matches any files within a folder, and '**' also recursively matches files within sub-folders.
request:
collection: healthcare.projects.locations.datasets.dicomStores
method: import
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API DICOM store into which the data is imported.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dicom_store
params:
- arg_name: gcs-uri
api_field: importDicomDataRequest.gcsSource.uri
required: true
help_text: |
Google Cloud Storage URI containing DICOM object data. It must match
individual DICOM files or use wildcards to import multiple files
from one or more directories.
* Use * to match 0 or more non-separator characters. For example,
`gs://BUCKET/DIRECTORY/Example*.dcm` matches Example.dcm and
Example22.dcm in DIRECTORY.
* Use ** to match 0 or more characters (including separators). Must
be used at the end of a path and with no other wildcards in the path.
Can also be used with a filename extension (such as .dcm), which
imports all files with the filename extension in the specified
directory and its subdirectories. For example,
gs://BUCKET/DIRECTORY/**.dcm imports all files with the .dcm
filename extension in DIRECTORY and its subdirectories.
* Use ? to match 1 character. For example,
gs://BUCKET/DIRECTORY/Example?.dcm matches Example1.dcm but
does not match Example.dcm or Example01.dcm.
async:
collection: healthcare.projects.locations.datasets.operations

View File

@@ -0,0 +1,37 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: List Cloud Healthcare API DICOM stores.
description: List Cloud Healthcare API DICOM stores.
examples: |
To list the dicom stores in 'test-dataset', run:
$ {command} --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.dicomStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
response:
id_field: name
arguments:
resource:
help_text: |
Parent Cloud Healthcare API dataset to list all contained Cloud Healthcare API DICOM stores.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dataset
output:
format: |
table(
name.scope("dicomStores"):label=ID,
name.scope("locations").segment(0):label=LOCATION,
notificationConfig.pubsubTopic:label=TOPIC,
notificationConfig.sendForBulkImport:label=BULKIMPORT,
streamConfigs.bigqueryDestination.tableUri:label=BQDESTINATION
)

View File

@@ -0,0 +1,24 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Get the metrics for a Cloud Healthcare API DICOM store.
description: Gets the metrics for a Cloud Healthcare API DICOM store.
examples: |
To get metrics for the DICOM store 'test-dicom-store', run:
$ {command} test-dicom-store --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.dicomStores
method: getDICOMStoreMetrics
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API DICOM store to get metrics for.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dicom_store

View File

@@ -0,0 +1,31 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Remove an IAM policy binding from a Cloud Healthcare API DICOM store.
description: |
Removes an IAM policy binding from a Cloud Healthcare API DICOM store.
examples: |
To remove an IAM policy binding for the role of 'roles/editor' for the user
'test-user@gmail.com' on the dicom store 'test-dicom-store', run:
$ {command} test-dicom-store --dataset=test-dataset --member='user:test-user@gmail.com' --role='roles/editor'
See https://cloud.google.com/iam/docs/managing-policies for details of
policy role and member types.
request:
collection: healthcare.projects.locations.datasets.dicomStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API DICOM store to remove an IAM policy binding from.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dicom_store
iam:
enable_condition: true

View File

@@ -0,0 +1,28 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Set the IAM policy for a Cloud Healthcare API DICOM store.
description: Set the IAM policy for a Cloud Healthcare API DICOM store.
examples: |
The following command will read am IAM policy defined in a JSON file
'policy.json' and set it for the dicom store 'test-dicom-store':
$ {command} test-dicom-store policy.json --dataset=test-dataset
See https://cloud.google.com/iam/docs/managing-policies for details of the
policy file format and contents.
request:
collection: healthcare.projects.locations.datasets.dicomStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API DICOM store whose IAM policy to set.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dicom_store

View File

@@ -0,0 +1,53 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: Update a Cloud Healthcare API DICOM store.
description: Update a Cloud Healthcare API DICOM store.
examples: |
To update the Cloud Pub/Sub topic on a dicom store 'test-dicom-store', run:
$ {command} test-dicom-store --pubsub-topic=projects/my-project/topics/test-pubsub-topic --dataset=test-dataset
request:
collection: healthcare.projects.locations.datasets.dicomStores
ALPHA:
api_version: v1alpha2
BETA:
api_version: v1beta1
GA:
api_version: v1
arguments:
resource:
help_text: Cloud Healthcare API DICOM to update.
spec: !REF googlecloudsdk.command_lib.healthcare.resources:dicom_store
params:
- api_field: dicomStore.notificationConfig.pubsubTopic
arg_name: pubsub-topic
help_text: |
Google Cloud Pub/Sub topic to send updates to.
Note: A topic must be created before publishing or subscribing to it. For instructions
on creating topics, refer to: https://cloud.google.com/pubsub/docs/admin#create_a_topic
- api_field: dicomStore.notificationConfig.sendForBulkImport
arg_name: send-for-bulk-import
type: bool
help_text: |
Indicates whether or not to send Cloud Pub/Sub notifications on bulk import.
Only supported for DICOM imports.
- api_field: dicomStore.streamConfigs
arg_name: stream-configs
repeated: false
ALPHA:
processor: googlecloudsdk.command_lib.healthcare.util:InsertDicomStreamConfig:api_version=v1alpha2
BETA:
processor: googlecloudsdk.command_lib.healthcare.util:InsertDicomStreamConfig:api_version=v1beta1
GA:
processor: googlecloudsdk.command_lib.healthcare.util:InsertDicomStreamConfig:api_version=v1
help_text:
Configuration that indicates the BigQuery destinations for streaming instances of a DICOM store.
To specify StreamConfigs, list all BigQuery destinations into one string separated by comma.
(e.g., --stream-configs bq://{bigqueryProjectId1}.{bigqueryDatasetId1}.{bigqueryTableId1},bq://{bigqueryProjectId2}.{bigqueryDatasetId2}.{bigqueryTableId2}).