Querying the Workflow List
API Description
You can use this API to query the workflow list.
Method Definition
WorkflowClient.listWorkflow(graphNamePrefix=None, start=None, limit=None)
Request Parameters
| Parameter | Mandatory or Optional | Type | Description | Constraint |
|---|---|---|---|---|
| graphNamePrefix | Optional | str | Workflow name prefix | The name should start with a letter or digit, and contain a maximum of 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
| start | Optional | int | Start position of a query | The value is greater than or equal to 1. The maximum value is 1000. If this parameter is not specified, the default value 1 is used. |
| limit | Optional | int | Maximum number of returned records | The value ranges from 1 to 1000. If this parameter is not specified, the default value 10 is used. |
Returned Results
| Type | Description |
|---|---|
| SDK common result object |
| GetResult.body Type | Description |
|---|---|
| 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'
)
# Query the workflow list.
try:
resp = workflowClient.listWorkflow(graphNamePrefix='graphNamePrefix', start='start', limit='limit')
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() Last Article: Updating a Workflow
Next Article: Calling an API to Trigger a Workflow
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.