tools/rest-scripts/workflow.http (87 lines of code) (raw):
# -------HTTP REST CLIENT -------
# https://marketplace.visualstudio.com/items?itemName=humao.rest-client
## This script provides a few samples for calling unit.
# -----------------------
# OAUTH (Variables)
# -----------------------
###
@login_base = login.microsoftonline.com/{{TENANT_ID}}
@oauth_token_host = {{login_base}}/oauth2/v2.0/token
@scopes = {{CLIENT_ID}}/.default openid profile offline_access
# -----------------------
# OAUTH refresh_token
# -----------------------
###
# @name refresh
POST https://{{oauth_token_host}} HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token
&client_id={{CLIENT_ID}}
&client_secret={{CLIENT_SECRET}}
&refresh_token={{REFRESH_TOKEN}}
&scope={{scopes}}
# -----------------------
# API (Variables)
# -----------------------
###
@access_token = {{refresh.response.body.access_token}}
@SERVICE_HOST = {{HOST}}/api/workflow/v1
@data_partition_id = opendes
@workflow_name = test_bash_operator
# -----------------------
# API: Version
# -----------------------
###
# @name info
GET {{SERVICE_HOST}}/info
Authorization: Bearer {{access_token}}
Accept: application/json
# -----------------------
# API: Ingestion Workflow
# -----------------------
###
# @name getAllWorkflow
GET {{SERVICE_HOST}}/workflow
Authorization: Bearer {{access_token}}
Content-Type: application/json
data-partition-id: {{data_partition_id}}
###
# @name createWorkflow
POST {{SERVICE_HOST}}/workflow
Authorization: Bearer {{access_token}}
Content-Type: application/json
data-partition-id: {{data_partition_id}}
{
"workflowName": "{{workflow_name}}",
"description": "Test Register a Workflow",
"registrationInstructions": {
"active": true,
"dagName": "{{workflow_name}}",
"concurrentWorkflowRun": 5,
"concurrentTaskRun": 5,
"workflowDetailContent": "",
"etc": "autotest"
}
}
###
# @name getWorkflow
GET {{SERVICE_HOST}}/workflow/{{workflow_name}}
Authorization: Bearer {{access_token}}
Content-Type: application/json
data-partition-id: {{data_partition_id}}
###
# @name runWorkflowExecution
POST {{SERVICE_HOST}}/workflow/{{workflow_name}}/workflowRun
Authorization: Bearer {{access_token}}
Content-Type: application/json
data-partition-id: {{data_partition_id}}
{
"executionContext": {
}
}
###
# @name deleteWorkflow
DELETE {{SERVICE_HOST}}/workflow/{{workflow_name}}
Authorization: Bearer {{access_token}}
Content-Type: application/json
data-partition-id: {{data_partition_id}}