-
Notifications
You must be signed in to change notification settings - Fork 2
/
catalog.json
368 lines (368 loc) · 14.1 KB
/
catalog.json
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
{
"id": "examples-<<<TENANT_ID>>>",
"technicalName": "examples",
"name": "Automation Pilot Examples",
"description": "Source: https://github.com/SAP-samples/automation-pilot-examples",
"owner": "<<<TENANT_ID>>>",
"inputs": [],
"commands": [
{
"configuration": {
"values": [],
"output": {
"isHanaCloudAvailable": "$(.pingHanaCloud.output.body | toArray | [.[0] ,.[1] ,.[2]] | any(.value == 1) )",
"resultHanaStart": "$(.startHanaCloud.executed)",
"checkPing": "$(.pingHanaCloud.output.body)"
},
"executors": [
{
"execute": "http-sapcp:SensitiveHttpRequest:1",
"input": {
"password": "$(.execution.input.hanaClientSecret)",
"method": "GET",
"user": "$(.execution.input.hanaClientID)",
"url": "$(.execution.input.hanaClientTokenURL)"
},
"alias": "getToken",
"progressMessage": null,
"initialDelay": null,
"pause": null,
"when": null,
"validate": null,
"autoRetry": null,
"repeat": null,
"errorMessages": []
},
{
"execute": "http-sapcp:HttpRequest:1",
"input": {
"responseBodyTransformer": "toObject.data[0].values | reverse",
"method": "GET",
"authorizationHeader": "Bearer $(.getToken.output.body | toObject.access_token)",
"url": "https://api.gateway.orchestration.$(.execution.input.hanaCluster)-$(.execution.input.hanaDatacenter).hanacloud.ondemand.com/metrics/v1/serviceInstances/$(.execution.input.hanaServiceInstance)/values?names=HDBAccessible"
},
"alias": "pingHanaCloud",
"progressMessage": null,
"initialDelay": null,
"pause": null,
"when": null,
"validate": null,
"autoRetry": null,
"repeat": null,
"errorMessages": []
},
{
"execute": "ans-sapcp:SendAnsEvent:1",
"input": {
"severity": "ERROR",
"subject": "Failed HANA Cloud Availability Check $(nowMillis | toDate(\"yyyy-MM-dd\"))",
"resourceName": "hana",
"eventType": "FailedHCAvailabilityCheck",
"serviceKey": "$(.execution.input.AnsServiceKey)",
"body": "The availability check for HANA Cloud with Service Instance ID $(.execution.input.hanaServiceInstance) has failed. Now the Automation Pilot proceeds with an automated START for this HANA Cloud instance.",
"category": "ALERT",
"resourceType": "database"
},
"alias": "notifyANS",
"progressMessage": null,
"initialDelay": null,
"pause": null,
"when": {
"semantic": "OR",
"conditions": [
{
"semantic": "OR",
"cases": [
{
"expression": "$(.pingHanaCloud.output.body | toArray | [.[0] ,.[1] ,.[2]] | any(.value == 1) )",
"operator": "EQUALS",
"semantic": "OR",
"values": [
"false"
]
}
]
}
]
},
"validate": null,
"autoRetry": null,
"repeat": null,
"errorMessages": []
},
{
"execute": "dblm-sapcp:StartHanaCloudInstance:1",
"input": {
"resourceGroup": "$(.execution.input.hanaCloudResourceGroup)",
"password": "$(.execution.input.BtpTechnicalUserPassword)",
"resourceName": "$(.execution.input.hanaCloudResourceName)",
"region": "$(.execution.input.hanaCloudRegion)",
"user": "$(.execution.input.BtpTechnicalUserUsername)",
"subAccount": "$(.execution.input.hanaCloudSubAccount)"
},
"alias": "startHanaCloud",
"progressMessage": null,
"initialDelay": null,
"pause": null,
"when": {
"semantic": "OR",
"conditions": [
{
"semantic": "OR",
"cases": [
{
"expression": "$(.pingHanaCloud.output.body | toArray | [.[0] ,.[1] ,.[2]] | any(.value == 1) )",
"operator": "EQUALS",
"semantic": "OR",
"values": [
"false"
]
}
]
}
]
},
"validate": null,
"autoRetry": null,
"repeat": null,
"errorMessages": []
}
],
"listeners": []
},
"id": "examples-<<<TENANT_ID>>>:CheckHanaCloudAvailabilitySample:1",
"name": "CheckHanaCloudAvailabilitySample",
"description": "check availability for HANA Cloud",
"catalog": "examples-<<<TENANT_ID>>>",
"version": 1,
"inputKeys": {
"hanaClientSecret": {
"type": "string",
"sensitive": true,
"required": false,
"minSize": null,
"maxSize": null,
"minValue": null,
"maxValue": null,
"allowedValues": null,
"allowedValuesFromInputKeys": null,
"suggestedValues": null,
"suggestedValuesFromInputKeys": null,
"defaultValue": null,
"defaultValueFromInput": null,
"description": "HANA Client Secret ID - available in your HANA Cloud service key file, look for \"client secret\"."
},
"hanaCluster": {
"type": "string",
"sensitive": false,
"required": false,
"minSize": null,
"maxSize": null,
"minValue": null,
"maxValue": null,
"allowedValues": null,
"allowedValuesFromInputKeys": null,
"suggestedValues": null,
"suggestedValuesFromInputKeys": null,
"defaultValue": null,
"defaultValueFromInput": null,
"description": "Needed to access to the HANA Cloud API gateway, where 'cluster' typically identifies either a production, pre-production or trial environment"
},
"hanaDatacenter": {
"type": "string",
"sensitive": false,
"required": false,
"minSize": null,
"maxSize": null,
"minValue": null,
"maxValue": null,
"allowedValues": null,
"allowedValuesFromInputKeys": null,
"suggestedValues": null,
"suggestedValuesFromInputKeys": null,
"defaultValue": null,
"defaultValueFromInput": null,
"description": "Needed to access to the HANA Cloud API gateway, where 'datacenter' is the datacenter where your HANA Cloud is deployed, i.e. eu10, us10, etc."
},
"AnsServiceKey": {
"type": "object",
"sensitive": true,
"required": false,
"minSize": null,
"maxSize": null,
"minValue": null,
"maxValue": null,
"allowedValues": null,
"allowedValuesFromInputKeys": null,
"suggestedValues": null,
"suggestedValuesFromInputKeys": null,
"defaultValue": null,
"defaultValueFromInput": null,
"description": "Service Key for your Alert Notification service instance"
},
"hanaCloudRegion": {
"type": "string",
"sensitive": false,
"required": false,
"minSize": null,
"maxSize": null,
"minValue": null,
"maxValue": null,
"allowedValues": null,
"allowedValuesFromInputKeys": null,
"suggestedValues": null,
"suggestedValuesFromInputKeys": null,
"defaultValue": null,
"defaultValueFromInput": null,
"description": "The region where your SAP BTP sub-account is located at, e.g. \"cf-eu10\"."
},
"hanaClientTokenURL": {
"type": "string",
"sensitive": false,
"required": false,
"minSize": null,
"maxSize": null,
"minValue": null,
"maxValue": null,
"allowedValues": null,
"allowedValuesFromInputKeys": null,
"suggestedValues": null,
"suggestedValuesFromInputKeys": null,
"defaultValue": null,
"defaultValueFromInput": null,
"description": "The URL needed to be called in order to generate a token to access your HANA Cloud instance. The URL is build as it follows: in the HANA Cloud service key file look for the specified \"url\" + add to it {/oauth/token?grant_type=client_credentials}."
},
"hanaServiceInstance": {
"type": "string",
"sensitive": false,
"required": false,
"minSize": null,
"maxSize": null,
"minValue": null,
"maxValue": null,
"allowedValues": null,
"allowedValuesFromInputKeys": null,
"suggestedValues": null,
"suggestedValuesFromInputKeys": null,
"defaultValue": null,
"defaultValueFromInput": null,
"description": "The Instance ID for your HANA Cloud - it can be found from the provisioned service in BTP Cockpit, look for \"Instance ID\". "
},
"hanaCloudResourceGroup": {
"type": "string",
"sensitive": false,
"required": false,
"minSize": null,
"maxSize": null,
"minValue": null,
"maxValue": null,
"allowedValues": null,
"allowedValuesFromInputKeys": null,
"suggestedValues": null,
"suggestedValuesFromInputKeys": null,
"defaultValue": null,
"defaultValueFromInput": null,
"description": "The name of the CF Space where your HANA Cloud is located at, e.g. \"dev\", \"prod\", etc."
},
"BtpTechnicalUserPassword": {
"type": "string",
"sensitive": true,
"required": false,
"minSize": null,
"maxSize": null,
"minValue": null,
"maxValue": null,
"allowedValues": null,
"allowedValuesFromInputKeys": null,
"suggestedValues": null,
"suggestedValuesFromInputKeys": null,
"defaultValue": null,
"defaultValueFromInput": null,
"description": "Password for the SAP BTP technical user you have created and currently maintain active."
},
"hanaCloudSubAccount": {
"type": "string",
"sensitive": false,
"required": false,
"minSize": null,
"maxSize": null,
"minValue": null,
"maxValue": null,
"allowedValues": null,
"allowedValuesFromInputKeys": null,
"suggestedValues": null,
"suggestedValuesFromInputKeys": null,
"defaultValue": null,
"defaultValueFromInput": null,
"description": "The exact \"Org Name\" for your SAP BTP sub-account where your HANA Cloud instance is located at."
},
"hanaClientID": {
"type": "string",
"sensitive": false,
"required": false,
"minSize": null,
"maxSize": null,
"minValue": null,
"maxValue": null,
"allowedValues": null,
"allowedValuesFromInputKeys": null,
"suggestedValues": null,
"suggestedValuesFromInputKeys": null,
"defaultValue": null,
"defaultValueFromInput": null,
"description": "HANA Client ID - available in your HANA Cloud service key file, look for \"clientid\"."
},
"hanaCloudResourceName": {
"type": "string",
"sensitive": false,
"required": false,
"minSize": null,
"maxSize": null,
"minValue": null,
"maxValue": null,
"allowedValues": null,
"allowedValuesFromInputKeys": null,
"suggestedValues": null,
"suggestedValuesFromInputKeys": null,
"defaultValue": null,
"defaultValueFromInput": null,
"description": "The exact name for your HANA Cloud instance, e.g. \"hanaDemo\", \"hanaProd\", etc."
},
"BtpTechnicalUserUsername": {
"type": "string",
"sensitive": false,
"required": false,
"minSize": null,
"maxSize": null,
"minValue": null,
"maxValue": null,
"allowedValues": null,
"allowedValuesFromInputKeys": null,
"suggestedValues": null,
"suggestedValuesFromInputKeys": null,
"defaultValue": null,
"defaultValueFromInput": null,
"description": "Username for the SAP BTP technical user you have created and currently maintain active."
}
},
"outputKeys": {
"isHanaCloudAvailable": {
"type": "string",
"sensitive": false,
"description": "Check on whether or not the HANA Cloud instance is available, where: \"true\" = HANA Cloud is available; \"false\" = HANA Cloud is not available."
},
"resultHanaStart": {
"type": "string",
"sensitive": false,
"description": "Check on whether or not the HANA Cloud instance has been started successfully, where: \"true\" = HANA Cloud has been started ; \"false\" = HANA Cloud was not started'."
},
"checkPing": {
"type": "string",
"sensitive": false,
"description": "The entire response for the metric \"HDBAccessible\" returned by HANA Cloud Metrics Service REST API."
}
},
"tags": {}
}
]
}