-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsap-integration-suite-deploy-flow-from-package-workflow.yml
More file actions
159 lines (159 loc) · 5.39 KB
/
Copy pathsap-integration-suite-deploy-flow-from-package-workflow.yml
File metadata and controls
159 lines (159 loc) · 5.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
arazzo: 1.0.1
info:
title: SAP Integration Suite Deploy Flow From Package
summary: Discover an integration flow inside a package, deploy it, and poll the runtime until it starts.
description: >-
The core Cloud Integration deployment loop. The workflow resolves a target
integration package, lists the design-time artifacts it contains, reads the
specific integration flow artifact to confirm its version, triggers a
deployment of that artifact to the runtime, and then polls the runtime
artifact until it reports a STARTED status (or surfaces an ERROR). Because
Cloud Integration exposes an OData V2 surface, the deploy POST carries an
X-CSRF-Token header that must be obtained from a prior token-fetch call;
that token is supplied as a workflow input. Every step spells out its
request inline so the flow can be read and executed without opening the
underlying OpenAPI description.
version: 1.0.0
sourceDescriptions:
- name: cloudIntegrationApi
url: ../openapi/sap-integration-suite-cloud-integration-openapi.yml
type: openapi
workflows:
- workflowId: deploy-flow-from-package
summary: Locate an integration flow in a package, deploy it, and wait for it to start.
description: >-
Resolves a package, finds the named design-time integration flow artifact
within it, deploys that artifact, and polls the runtime artifact until it
reaches a STARTED status.
inputs:
type: object
required:
- packageId
- artifactId
- artifactVersion
- csrfToken
properties:
packageId:
type: string
description: Identifier of the integration package that holds the flow.
artifactId:
type: string
description: Identifier of the design-time integration flow artifact to deploy.
artifactVersion:
type: string
description: Version of the artifact to deploy (e.g. "active" or a semantic version).
csrfToken:
type: string
description: X-CSRF-Token value fetched ahead of time for the OData write call.
steps:
- stepId: getPackage
description: Confirm the target integration package exists before inspecting its contents.
operationId: getIntegrationPackage
parameters:
- name: Id
in: path
value: $inputs.packageId
successCriteria:
- condition: $statusCode == 200
outputs:
packageName: $response.body#/d/Name
- stepId: listArtifacts
description: List the design-time artifacts in the package to verify the flow is present.
operationId: listIntegrationDesigntimeArtifacts
parameters:
- name: Id
in: path
value: $inputs.packageId
successCriteria:
- condition: $statusCode == 200
outputs:
artifacts: $response.body#/d/results
- stepId: getArtifact
description: Read the specific design-time artifact to confirm its version before deploying.
operationId: getIntegrationDesigntimeArtifact
parameters:
- name: Id
in: path
value: $inputs.artifactId
- name: Version
in: path
value: $inputs.artifactVersion
successCriteria:
- condition: $statusCode == 200
outputs:
artifactName: $response.body#/d/Name
resolvedVersion: $response.body#/d/Version
- stepId: deployArtifact
description: >-
Trigger deployment of the design-time artifact to the runtime. The OData
write requires the X-CSRF-Token header supplied as an input.
operationId: deployIntegrationDesigntimeArtifact
parameters:
- name: Id
in: query
value: $inputs.artifactId
- name: Version
in: query
value: $inputs.artifactVersion
- name: X-CSRF-Token
in: header
value: $inputs.csrfToken
successCriteria:
- condition: $statusCode == 202
outputs:
taskId: $response.body#/d/TaskId
- stepId: pollRuntime
description: >-
Poll the runtime artifact until it reports STARTED. A status of ERROR ends
the poll and routes to the failure branch.
operationId: getRuntimeArtifact
parameters:
- name: Id
in: path
value: $inputs.artifactId
successCriteria:
- condition: $statusCode == 200
outputs:
runtimeStatus: $response.body#/d/Status
errorInformation: $response.body#/d/ErrorInformation
onSuccess:
- name: started
type: end
criteria:
- context: $response.body
condition: $.d.Status == "STARTED"
type: jsonpath
- name: deployFailed
type: goto
stepId: reportError
criteria:
- context: $response.body
condition: $.d.Status == "ERROR"
type: jsonpath
- name: keepPolling
type: retry
stepId: pollRuntime
retryAfter: 10
retryLimit: 30
criteria:
- context: $response.body
condition: $.d.Status == "STARTING"
type: jsonpath
- stepId: reportError
description: >-
Re-read the runtime artifact to capture the final error details when the
deployment lands in an ERROR state.
operationId: getRuntimeArtifact
parameters:
- name: Id
in: path
value: $inputs.artifactId
successCriteria:
- condition: $statusCode == 200
outputs:
failureStatus: $response.body#/d/Status
failureInformation: $response.body#/d/ErrorInformation
outputs:
taskId: $steps.deployArtifact.outputs.taskId
runtimeStatus: $steps.pollRuntime.outputs.runtimeStatus
failureInformation: $steps.reportError.outputs.failureInformation