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)
def Run(self, args): """Execute a workflow and wait for the completion of the execution.""" hooks.print_default_location_warning(None, args, None) api_version = workflows.ReleaseTrackToApiVersion(self.ReleaseTrack()) workflow_ref = flags.ParseWorkflow(args) client = workflows.WorkflowExecutionClient(api_version) execution = client.Create(workflow_ref, args.data) cache.cache_execution_id(execution.name) execution_ref = resources.REGISTRY.Parse( execution.name, collection=EXECUTION_COLLECTION) return client.WaitForExecution(execution_ref)
def Run(self, args): """Deploy a workflow.""" hooks.print_default_location_warning(None, args, None) api_version = workflows.ReleaseTrackToApiVersion(self.ReleaseTrack()) client = workflows.WorkflowsClient(api_version) workflow_ref = flags.ParseWorkflow(args) validate.WorkflowNameConforms(workflow_ref.Name()) old_workflow = client.Get(workflow_ref) first_deployment = old_workflow is None workflow, updated_fields = client.BuildWorkflowFromArgs(args) validate.ValidateWorkflow(workflow, first_deployment=first_deployment) if first_deployment: operation = client.Create(workflow_ref, workflow) else: if not updated_fields: log.status.Print('No updates provided, quitting as a no-op.') return None operation = client.Patch(workflow_ref, workflow, updated_fields) if args.async_: return operation else: return client.WaitForOperation(operation, workflow_ref)