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,43 @@
# -*- 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.
"""The main command group for Cloud Workflow executions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.GA)
class Executions(base.Group):
"""Manage your Cloud Workflow execution resources."""
category = base.TOOLS_CATEGORY
@base.ReleaseTracks(base.ReleaseTrack.BETA)
class ExecutionsBeta(base.Group):
"""Manage your Cloud Workflow execution resources."""
category = base.TOOLS_CATEGORY
@base.Hidden
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class ExecutionsAlpha(base.Group):
"""Manage your Cloud Workflow execution resources."""
category = base.TOOLS_CATEGORY

View File

@@ -0,0 +1,33 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Cancel a workflow execution
description: |
Cancel a workflow execution.
examples: |
To cancel an execution with ID 'my-workflow-execution-ID' from a
workflow named 'my-workflow', run:
$ {command} my-workflow-execution-ID --workflow=my-workflow
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.workflows.resources:execution
help_text: |
The name of the workflow execution to cancel.
input:
confirmation_prompt: |
You are about to cancel execution [{__name__}] of workflow [{workflowsId}].
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta
GA:
api_version: v1
method: cancel
collection: workflowexecutions.projects.locations.workflows.executions
modify_request_hooks:
- googlecloudsdk.command_lib.workflows.hooks:print_default_location_warning

View File

@@ -0,0 +1,28 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
Show metadata for a workflow execution
description: |
Display all metadata associated with a workflow execution of given ID.
examples: |
To describe an execution with ID 'my-workflow-execution-ID' from a
workflow named 'my-workflow', run:
$ {command} my-workflow-execution-ID --workflow=my-workflow
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.workflows.resources:execution
help_text: |
The name of the workflow execution to describe.
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta
GA:
api_version: v1
collection: workflowexecutions.projects.locations.workflows.executions
modify_request_hooks:
- googlecloudsdk.command_lib.workflows.hooks:print_default_location_warning

View File

@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*- #
# Copyright 2020 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.
"""Show metadata for the last cached workflow execution."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.api_lib.workflows import workflows
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA,
base.ReleaseTrack.GA)
class DescribeLast(base.DescribeCommand):
"""Show metadata for the last cached workflow execution."""
detailed_help = {
'DESCRIPTION':
'{description}',
'EXAMPLES':
"""\
To show metadata for the last cached workflow execution, run:
$ {command}
""",
}
def Run(self, args):
api_version = workflows.ReleaseTrackToApiVersion(self.ReleaseTrack())
client = workflows.WorkflowExecutionClient(api_version)
return client.Get(None)

View File

@@ -0,0 +1,40 @@
- release_tracks: [ALPHA, BETA, GA]
help_text:
brief: |
List workflow executions
description: |
List workflow executions for a given workflow.
examples: |
To list executions of a workflow named 'my-workflow', run:
$ {command} my-workflow
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.workflows.resources:workflow_for_executions
is_positional: true
help_text: |
The workflow name.
request:
ALPHA:
api_version: v1alpha1
BETA:
api_version: v1beta
GA:
api_version: v1
collection: workflowexecutions.projects.locations.workflows.executions
modify_request_hooks:
- googlecloudsdk.command_lib.workflows.hooks:print_default_location_warning
response:
id_field: name
output:
format: |
table(
name,
state,
startTime,
endTime
)

View File

@@ -0,0 +1,55 @@
# -*- coding: utf-8 -*- #
# Copyright 2020 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.
"""Wait for an execution to complete."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.api_lib.workflows import workflows
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.workflows import flags
from googlecloudsdk.command_lib.workflows import hooks
@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA,
base.ReleaseTrack.GA)
class Wait(base.DescribeCommand):
"""Wait for an execution to complete."""
detailed_help = {
'DESCRIPTION':
'{description}',
'EXAMPLES':
"""\
To wait for an execution with ID 'my-workflow-execution-ID' from a
workflow named 'my-workflow' to finish, run:
$ {command} my-workflow-execution-ID --workflow=my-workflow
""",
}
@staticmethod
def Args(parser):
flags.AddExecutionResourceArg(parser, verb='to wait on')
def Run(self, args):
"""Starts the wait on the completion of the execution."""
hooks.print_default_location_warning(None, args, None)
api_version = workflows.ReleaseTrackToApiVersion(self.ReleaseTrack())
execution_ref = flags.ParseExecution(args)
client = workflows.WorkflowExecutionClient(api_version)
return client.WaitForExecution(execution_ref)

View File

@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*- #
# Copyright 2020 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.
"""Wait for the last cached workflow execution to complete."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.api_lib.workflows import workflows
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA,
base.ReleaseTrack.GA)
class WaitLast(base.DescribeCommand):
"""Wait for the last cached workflow execution to complete."""
detailed_help = {
'DESCRIPTION':
'{description}',
'EXAMPLES':
"""\
To wait for the last cached workflow execution to complete, run:
$ {command}
""",
}
def Run(self, args):
"""Starts the wait on the completion of the execution."""
api_version = workflows.ReleaseTrackToApiVersion(self.ReleaseTrack())
client = workflows.WorkflowExecutionClient(api_version)
return client.WaitForExecution(None)