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 SetUp(self): self.api_version = workflows.ReleaseTrackToApiVersion(self.track) self.messages = apis.GetMessagesModule('workflowexecutions', self.api_version) self.mock_client = mock.Client( apis.GetClientClass('workflowexecutions', self.api_version), real_client=apis.GetClientInstance( 'workflowexecutions', self.api_version, no_http=True)) self.mock_client.Mock() self.addCleanup(self.mock_client.Unmock)
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.""" api_version = workflows.ReleaseTrackToApiVersion(self.ReleaseTrack()) client = workflows.WorkflowsClient(api_version) workflow_ref = flags.ParseWorkflow(args) 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)
def SetUp(self): self.api_version = workflows.ReleaseTrackToApiVersion(self.track) self.messages = core_apis.GetMessagesModule('workflows', self.api_version)
def Run(self, args): api_version = workflows.ReleaseTrackToApiVersion(self.ReleaseTrack()) client = workflows.WorkflowExecutionClient(api_version) return client.Get(None)
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)