Updating a Workflow

API Description

You can use this API to update a workflow.

Method Definition

WorkflowClient.updateWorkflow(graphName, parameters=None, description=None)

Request Parameters

Parameter

Mandatory or Optional

Type

Description

Constraint

graphName

Mandatory

str

Workflow name

The name should start with a letter or digit, and contain a maximum of 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

parameters

Optional

Array Input JSON structure

Structures

Parameters that can be modified for each action in a workflow

-

description

Optional

str

Workflow description

The description contains 0 to 256 characters. Only letters, digits, commas (,), periods (.), colons (:), hyphens (-), underscores (_), and spaces are allowed.

Returned Results

Type

Description

GetResult

SDK common result object

GetResult.body Type

Description

Response Result of the Request for Updating a Workflow

Response result

Sample Code

# Import the module.
from obs import WorkflowClient

# Create a WorkflowClient instance.
workflowClient = WorkflowClient(
    access_key_id='*** Provide your Access Key ***',
    secret_access_key='*** Provide your Secret Key ***',
    server='https://your-endpoint'
)

# Update a workflow.
try:
    resp = workflowClient.updateWorkflow('graphName', parameters='parameters', description='description')
      
    if resp.status < 300: 
        print('requestId:', resp.requestId) 
    else: 
        print('errorCode:', resp.errorCode) 
        print('errorMessage:', resp.errorMessage)
except:
    import traceback
    print(traceback.format_exc())

# Close workflowClient.
workflowClient.close()