| 1 |
--- |
| 2 |
version: '2.0' |
| 3 |
|
| 4 |
infoblox.get_all_static_ips_dualstack: |
| 5 |
type: direct |
| 6 |
description: "Get all static IPv4/IPv6 addresses" |
| 7 |
input: |
| 8 |
- ipam_ipaddr |
| 9 |
- ipam_username |
| 10 |
- ipam_password |
| 11 |
- ipam_site |
| 12 |
- ipam_vnf_name |
| 13 |
- ipam_vnf_number |
| 14 |
|
| 15 |
output: |
| 16 |
output_full_resp: <% $.get_response %> |
| 17 |
output_cpd_map: <% $.output_cpd_map %> |
| 18 |
output_cpd_map6: <% $.output_cpd_map6 %> |
| 19 |
|
| 20 |
tasks: |
| 21 |
create_system_job: |
| 22 |
action: nfvo_actions.create_system_job |
| 23 |
input: |
| 24 |
env: "<% env() %>" |
| 25 |
job_description: "Querying IPAM for static IP addresses of VNF" |
| 26 |
job_status: RUNNING |
| 27 |
parent_job_id: '<% env().nfvo.system_job_id %>' |
| 28 |
publish: |
| 29 |
created_job: "<% task(create_system_job).result.content %>" |
| 30 |
on-error: |
| 31 |
- fail |
| 32 |
on-success: |
| 33 |
- get_ip_addresses |
| 34 |
|
| 35 |
get_ip_addresses: |
| 36 |
action: std.noop |
| 37 |
publish: |
| 38 |
get_response: 'get_response' |
| 39 |
on-success: |
| 40 |
- parse_response |
| 41 |
on-error: |
| 42 |
- update_system_job_failure |
| 43 |
|
| 44 |
parse_response: |
| 45 |
action: std.noop |
| 46 |
publish: |
| 47 |
output_cpd_map: {} |
| 48 |
on-success: |
| 49 |
- get_ip_addresses6 |
| 50 |
on-error: |
| 51 |
- update_system_job_failure |
| 52 |
|
| 53 |
get_ip_addresses6: |
| 54 |
action: std.noop |
| 55 |
publish: |
| 56 |
get_response6: 'get_response6' |
| 57 |
on-success: |
| 58 |
- parse_response6 |
| 59 |
on-error: |
| 60 |
- update_system_job_failure |
| 61 |
|
| 62 |
parse_response6: |
| 63 |
action: std.noop |
| 64 |
publish: |
| 65 |
output_cpd_map6: {} |
| 66 |
on-success: |
| 67 |
- update_system_job_success |
| 68 |
on-error: |
| 69 |
- update_system_job_failure |
| 70 |
|
| 71 |
update_system_job_success: |
| 72 |
action: nfvo_actions.update_system_job |
| 73 |
input: |
| 74 |
env: "<% env() %>" |
| 75 |
job_id: "<% $.created_job.id %>" |
| 76 |
job_description: "Done querying IPAM for static IP addresses of VNF" |
| 77 |
job_status: FINISHED |
| 78 |
|
| 79 |
update_system_job_failure: |
| 80 |
action: nfvo_actions.update_system_job |
| 81 |
input: |
| 82 |
env: "<% env() %>" |
| 83 |
job_id: "<% $.created_job.id %>" |
| 84 |
job_description: "Querying IPAM for static IP addresses of VNF failed" |
| 85 |
job_status: FAILED |
| 86 |
on-complete: |
| 87 |
- fail |
| 88 |
|
| 89 |
infoblox.get_plugin_config: |
| 90 |
description: "Get Infoblox plugin configuration values" |
| 91 |
output: |
| 92 |
ipam_ip: <% $.ipam_ip %> |
| 93 |
ipam_username: <% $.ipam_username %> |
| 94 |
ipam_password: <% $.ipam_password %> |
| 95 |
|
| 96 |
tasks: |
| 97 |
create_system_job: |
| 98 |
action: nfvo_actions.create_system_job |
| 99 |
input: |
| 100 |
env: "<% env() %>" |
| 101 |
job_description: "Fetching Infoblox plugin configuration" |
| 102 |
job_status: RUNNING |
| 103 |
parent_job_id: '<% env().nfvo.system_job_id %>' |
| 104 |
publish: |
| 105 |
created_job: "<% task(create_system_job).result.content %>" |
| 106 |
on-error: |
| 107 |
- fail |
| 108 |
on-success: |
| 109 |
- parse_plugin_config |
| 110 |
|
| 111 |
parse_plugin_config: |
| 112 |
publish: |
| 113 |
ipam_name: 'ipam_name' |
| 114 |
ipam_ip: 'ipam_ip' |
| 115 |
ipam_username: 'ipam_username' |
| 116 |
ipam_password: 'ipam_password' |
| 117 |
on-error: |
| 118 |
- update_system_job_failure |
| 119 |
on-success: |
| 120 |
- update_system_job_success |
| 121 |
|
| 122 |
update_system_job_success: |
| 123 |
action: nfvo_actions.update_system_job |
| 124 |
input: |
| 125 |
env: "<% env() %>" |
| 126 |
job_id: "<% $.created_job.id %>" |
| 127 |
job_description: "Infoblox plugin configuration successfully retrieved for <% $.ipam_name %>" |
| 128 |
job_status: FINISHED |
| 129 |
|
| 130 |
update_system_job_failure: |
| 131 |
action: nfvo_actions.update_system_job |
| 132 |
input: |
| 133 |
env: "<% env() %>" |
| 134 |
job_id: "<% $.created_job.id %>" |
| 135 |
job_description: "Querying Infoblox plugin configuration failed" |
| 136 |
job_status: FAILED |
| 137 |
on-complete: |
| 138 |
- fail |
| 139 |
|
| 140 |
infoblox.get_subnet: |
| 141 |
type: direct |
| 142 |
description: "Get subnet address from IPAM" |
| 143 |
input: |
| 144 |
- ipam_ipaddr |
| 145 |
- ipam_username |
| 146 |
- ipam_password |
| 147 |
- site_name |
| 148 |
- domain_name |
| 149 |
- subnet_name |
| 150 |
|
| 151 |
output: |
| 152 |
output_full_resp: 'output_full_resp' |
| 153 |
output_ref: 'output_ref' |
| 154 |
cidr: 'cidr' |
| 155 |
network: 'network' |
| 156 |
prefix: 'prefix' |
| 157 |
netmask: 'netmask' |
| 158 |
zone: 'zone' |
| 159 |
gateway: 'gateway' |
| 160 |
domain_type: 'domain_type' |
| 161 |
domain_name: 'domain_name' |
| 162 |
|
| 163 |
tasks: |
| 164 |
create_system_job: |
| 165 |
action: nfvo_actions.create_system_job |
| 166 |
input: |
| 167 |
env: "<% env() %>" |
| 168 |
job_description: "Querying IPAM for subnet <% $.site_name %>-<% $.domain_name %>-<% $.subnet_name %>" |
| 169 |
job_status: RUNNING |
| 170 |
parent_job_id: '<% env().nfvo.system_job_id %>' |
| 171 |
publish: |
| 172 |
created_job: "<% task(create_system_job).result.content %>" |
| 173 |
on-error: |
| 174 |
- fail |
| 175 |
on-success: |
| 176 |
- get_subnet |
| 177 |
|
| 178 |
get_subnet: |
| 179 |
action: std.noop |
| 180 |
publish: |
| 181 |
get_response: 'get_response' |
| 182 |
on-success: |
| 183 |
- parse_response |
| 184 |
on-error: |
| 185 |
- update_system_job_failure |
| 186 |
|
| 187 |
parse_response: |
| 188 |
action: std.noop |
| 189 |
publish: |
| 190 |
output_ref: 'output_ref' |
| 191 |
output_cidr: 'output_cidr' |
| 192 |
output_subnet_name: 'output_subnet_name' |
| 193 |
output_zone: 'output_zone' |
| 194 |
output_domain_type: 'output_domain_type' |
| 195 |
output_domain_name: 'output_domain_name' |
| 196 |
on-success: |
| 197 |
- update_system_job_success |
| 198 |
on-error: |
| 199 |
- update_system_job_failure |
| 200 |
|
| 201 |
update_system_job_success: |
| 202 |
action: nfvo_actions.update_system_job |
| 203 |
input: |
| 204 |
env: "<% env() %>" |
| 205 |
job_id: "<% $.created_job.id %>" |
| 206 |
job_description: "Done IPAM query for subnet <% $.site_name %>-<% $.domain_name %>-<% $.subnet_name %>" |
| 207 |
job_status: FINISHED |
| 208 |
|
| 209 |
update_system_job_failure: |
| 210 |
action: nfvo_actions.update_system_job |
| 211 |
input: |
| 212 |
env: "<% env() %>" |
| 213 |
job_id: "<% $.created_job.id %>" |
| 214 |
job_description: "IPAM query for subnet <% $.site_name %>-<% $.domain_name %>-<% $.subnet_name %> failed" |
| 215 |
job_status: FAILED |
| 216 |
on-complete: |
| 217 |
- fail |
| 218 |
|
| 219 |
my_fixed_workflow: |
| 220 |
input: |
| 221 |
- output: "DEFAULT" |
| 222 |
tasks: |
| 223 |
t1: |
| 224 |
action: std.noop |
| 225 |
output: |
| 226 |
output: <% $.output %> |
| 227 |
|
| 228 |
nfvo.update_dsl_runtime_model: |
| 229 |
input: |
| 230 |
- update_dsl_runtime_model_request |
| 231 |
- perform_update: true |
| 232 |
|
| 233 |
tasks: |
| 234 |
t1: |
| 235 |
action: std.noop |
| 236 |
|
| 237 |
vno.nsdata: |
| 238 |
description: Retrieving and exposing NS related information (e.g. NSR ID) |
| 239 |
|
| 240 |
type: direct |
| 241 |
|
| 242 |
input: |
| 243 |
- name: NSDataName |
| 244 |
- prefix: 'VNO_' |
| 245 |
- tosca_resource_id |
| 246 |
- tosca_name |
| 247 |
|
| 248 |
output: |
| 249 |
NSRID: <% $.nsrid %> |
| 250 |
Prefixed_NSRID: <% $.pref_nsrid %> |
| 251 |
|
| 252 |
tasks: |
| 253 |
get_nsrid: |
| 254 |
action: std.echo output=<% env().get('network_service', {}).get('id', {}) %> |
| 255 |
publish: |
| 256 |
nsrid: <% task(get_nsrid).result %> |
| 257 |
pref_nsrid: <% $.prefix %><% task(get_nsrid).result %> |
| 258 |
on-error: |
| 259 |
- system_log |
| 260 |
on-success: |
| 261 |
- system_log |
| 262 |
|
| 263 |
system_log: |
| 264 |
action: "std.echo" |
| 265 |
input: |
| 266 |
output: "<% $ %>" |
| 267 |
|
| 268 |
nuage.configure_object: |
| 269 |
description: "Configure network resources in Nuage." |
| 270 |
input: |
| 271 |
- tosca_name |
| 272 |
- tosca_resource_id |
| 273 |
- rest_resource_path_fragments |
| 274 |
- sdn |
| 275 |
- body: '' |
| 276 |
output: |
| 277 |
resource: <% $.nuage_get_api_result %> |
| 278 |
previous_config: <% $.nuage_current_config %> |
| 279 |
|
| 280 |
task-defaults: |
| 281 |
on-error: |
| 282 |
- update_system_job_failure |
| 283 |
|
| 284 |
tasks: |
| 285 |
create_system_job: |
| 286 |
action: nfvo_actions.create_system_job |
| 287 |
input: |
| 288 |
env: "<% env() %>" |
| 289 |
job_description: "Configuration started for network resource" |
| 290 |
job_status: RUNNING |
| 291 |
parent_job_id: '<% env().nfvo.system_job_id %>' |
| 292 |
on-error: |
| 293 |
- fail |
| 294 |
on-success: |
| 295 |
- get_nuage_api_key |
| 296 |
publish: |
| 297 |
created_job: "<% task(create_system_job).result.content %>" |
| 298 |
|
| 299 |
get_nuage_api_key: |
| 300 |
action: nokia.nuage.ensure_api_key |
| 301 |
input: |
| 302 |
nfvo: <% env().nfvo %> |
| 303 |
sdn_id: <% $.sdn %> |
| 304 |
publish: |
| 305 |
api_prefix: <% task(get_nuage_api_key).result.nuage_api_prefix %> |
| 306 |
api_key: <% task(get_nuage_api_key).result.api_key %> |
| 307 |
nuage_vsd_url: <% task(get_nuage_api_key).result.nuage_vsd_url %> |
| 308 |
nuage_org: <% task(get_nuage_api_key).result.nuage_org %> |
| 309 |
nuage_user: <% task(get_nuage_api_key).result.nuage_user %> |
| 310 |
on-success: |
| 311 |
- get_nuage_resource_path |
| 312 |
|
| 313 |
get_nuage_resource_path: |
| 314 |
publish: |
| 315 |
rest_resource_path: <% $.rest_resource_path_fragments.select(str($)).insert(0, $.api_prefix).join('/') %> |
| 316 |
nuage_update_choice_ok: null |
| 317 |
on-success: |
| 318 |
- call_nuage_get_current_api |
| 319 |
|
| 320 |
call_nuage_get_current_api: |
| 321 |
action: nokia.nuage.dummy_http |
| 322 |
input: |
| 323 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 324 |
method: GET |
| 325 |
headers: |
| 326 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 327 |
'Content-Type': 'application/json' |
| 328 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 329 |
verify: false |
| 330 |
result: { |
| 331 |
"status": 200, |
| 332 |
"content": [ |
| 333 |
{ |
| 334 |
"ID": "5333bc71-729f-4869-8e4a-8e6cf849e4d1", |
| 335 |
} |
| 336 |
] |
| 337 |
} |
| 338 |
publish: |
| 339 |
nuage_current_config: <% task(call_nuage_get_current_api).result.content.first() %> |
| 340 |
publish-on-error: |
| 341 |
nuage_error_result: <% task(call_nuage_get_current_api).result %> |
| 342 |
error_source: "call_nuage_get_current_api" |
| 343 |
on-success: |
| 344 |
- call_nuage_api |
| 345 |
|
| 346 |
call_nuage_api: |
| 347 |
action: nokia.nuage.dummy_http |
| 348 |
input: |
| 349 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 350 |
method: PUT |
| 351 |
params: |
| 352 |
'responseChoice': <% $.nuage_update_choice_ok %> |
| 353 |
headers: |
| 354 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 355 |
'Content-Type': 'application/json' |
| 356 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 357 |
verify: false |
| 358 |
body: <% $.body %> |
| 359 |
result: { |
| 360 |
"status": 300, |
| 361 |
"content": { |
| 362 |
"choices": [ |
| 363 |
{ |
| 364 |
"label": "OK", |
| 365 |
"id": "FAKE_CHOICE_ID" |
| 366 |
} |
| 367 |
] |
| 368 |
} |
| 369 |
} |
| 370 |
publish: |
| 371 |
nuage_api_result: <% task(call_nuage_api).result.content %> |
| 372 |
publish-on-error: |
| 373 |
nuage_error_result: <% task(call_nuage_api).result %> |
| 374 |
error_source: "call_nuage_api" |
| 375 |
on-success: |
| 376 |
- nuage_update_confirmation: <% task(call_nuage_api).result.status = 300 %> |
| 377 |
- call_nuage_get_api: <% task(call_nuage_api).result.status < 300 %> |
| 378 |
on-error: |
| 379 |
- handle_http_404_failure: <% |
| 380 |
task(call_nuage_api).get(result) != null |
| 381 |
and task(call_nuage_api).result.get(error) != null |
| 382 |
and task(call_nuage_api).result.error.httpStatusCode = 404 |
| 383 |
%> |
| 384 |
- handle_http_other_failure: <% |
| 385 |
task(call_nuage_api).get(result) = null |
| 386 |
or task(call_nuage_api).result.get(error) = null |
| 387 |
or task(call_nuage_api).result.error.httpStatusCode != 404 |
| 388 |
%> |
| 389 |
|
| 390 |
nuage_update_confirmation: |
| 391 |
publish: |
| 392 |
nuage_update_choice_ok: <% $.nuage_api_result.choices.first(label = 'OK').id %> |
| 393 |
on-success: |
| 394 |
- call_nuage_api_final |
| 395 |
|
| 396 |
call_nuage_api_final: |
| 397 |
action: nokia.nuage.dummy_http |
| 398 |
input: |
| 399 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 400 |
method: PUT |
| 401 |
params: |
| 402 |
'responseChoice': <% $.nuage_update_choice_ok %> |
| 403 |
headers: |
| 404 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 405 |
'Content-Type': 'application/json' |
| 406 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 407 |
verify: false |
| 408 |
body: <% $.body %> |
| 409 |
result: { |
| 410 |
"status": 200, |
| 411 |
"content": [ |
| 412 |
{ |
| 413 |
"ID": "5333bc71-729f-4869-8e4a-8e6cf849e4d1", |
| 414 |
} |
| 415 |
] |
| 416 |
} |
| 417 |
publish: |
| 418 |
nuage_api_result: <% task(call_nuage_api_final).result.content %> |
| 419 |
publish-on-error: |
| 420 |
nuage_error_result: <% task(call_nuage_api_final).result %> |
| 421 |
error_source: "call_nuage_api_final" |
| 422 |
on-success: |
| 423 |
- call_nuage_get_api: <% task(call_nuage_api_final).result.status < 300 %> |
| 424 |
on-error: |
| 425 |
- handle_http_404_failure: <% |
| 426 |
task(call_nuage_api_final).get(result) != null |
| 427 |
and task(call_nuage_api_final).result.get(error) != null |
| 428 |
and task(call_nuage_api_final).result.error.httpStatusCode = 404 |
| 429 |
%> |
| 430 |
- handle_http_other_failure: <% |
| 431 |
task(call_nuage_api_final).get(result) = null |
| 432 |
or task(call_nuage_api_final).result.get(error) = null |
| 433 |
or task(call_nuage_api_final).result.error.httpStatusCode != 404 |
| 434 |
%> |
| 435 |
|
| 436 |
|
| 437 |
call_nuage_get_api: |
| 438 |
action: nokia.nuage.dummy_http |
| 439 |
input: |
| 440 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 441 |
method: GET |
| 442 |
headers: |
| 443 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 444 |
'Content-Type': 'application/json' |
| 445 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 446 |
verify: false |
| 447 |
result: { |
| 448 |
"status": 200, |
| 449 |
"content": [ |
| 450 |
{ |
| 451 |
"ID": "5333bc71-729f-4869-8e4a-8e6cf849e4d1", |
| 452 |
} |
| 453 |
] |
| 454 |
} |
| 455 |
publish: |
| 456 |
nuage_get_api_result: <% task(call_nuage_get_api).result.content.first() %> |
| 457 |
publish-on-error: |
| 458 |
nuage_error_result: <% task(call_nuage_get_api).result %> |
| 459 |
error_source: "call_nuage_get_api" |
| 460 |
on-success: |
| 461 |
- update_system_job_success |
| 462 |
|
| 463 |
system_log: |
| 464 |
action: std.echo |
| 465 |
input: |
| 466 |
output: "<% $ %>" |
| 467 |
system_log_fail: |
| 468 |
action: std.echo |
| 469 |
input: |
| 470 |
output: "<% $ %>" |
| 471 |
on-complete: |
| 472 |
- fail |
| 473 |
|
| 474 |
update_system_job_failure: |
| 475 |
action: nfvo_actions.update_system_job |
| 476 |
input: |
| 477 |
job_description: 'Configuration failed for network resource' |
| 478 |
job_id: "<% $.created_job.id %>" |
| 479 |
job_status: FAILED |
| 480 |
env: <% env() %> |
| 481 |
on-error: |
| 482 |
- system_log_fail |
| 483 |
on-success: |
| 484 |
- system_log_fail |
| 485 |
|
| 486 |
update_system_job_success: |
| 487 |
action: nfvo_actions.update_system_job |
| 488 |
input: |
| 489 |
env: "<% env() %>" |
| 490 |
job_description: "Configuration successful for network resource" |
| 491 |
job_id: "<% $.created_job.id %>" |
| 492 |
job_status: FINISHED |
| 493 |
on-error: |
| 494 |
- system_log |
| 495 |
|
| 496 |
update_system_job_resource_not_found: |
| 497 |
action: nfvo_actions.update_system_job |
| 498 |
input: |
| 499 |
env: "<% env() %>" |
| 500 |
job_description: "Configuration of network resource does not exist" |
| 501 |
job_id: "<% $.created_job.id %>" |
| 502 |
job_status: FINISHED |
| 503 |
on-error: |
| 504 |
- system_log |
| 505 |
|
| 506 |
handle_http_404_failure: |
| 507 |
on-success: |
| 508 |
- update_system_job_resource_not_found |
| 509 |
|
| 510 |
handle_http_other_failure: |
| 511 |
on-success: |
| 512 |
- update_system_job_failure |
| 513 |
|
| 514 |
nuage.configure_restore: |
| 515 |
description: "Restore network resources in Nuage." |
| 516 |
input: |
| 517 |
- tosca_name |
| 518 |
- tosca_resource_id |
| 519 |
- rest_resource_path_fragments |
| 520 |
- sdn |
| 521 |
- restore_previous_config |
| 522 |
- body: '' |
| 523 |
|
| 524 |
task-defaults: |
| 525 |
on-error: |
| 526 |
- update_system_job_failure |
| 527 |
|
| 528 |
tasks: |
| 529 |
create_system_job: |
| 530 |
action: nfvo_actions.create_system_job |
| 531 |
input: |
| 532 |
env: "<% env() %>" |
| 533 |
job_description: "Configuration restore started for network resource name: <% $.tosca_name %>, id: <% $.tosca_resource_id %> " |
| 534 |
job_status: RUNNING |
| 535 |
parent_job_id: '<% env().nfvo.system_job_id %>' |
| 536 |
on-error: |
| 537 |
- fail |
| 538 |
on-success: |
| 539 |
- check_restore_required |
| 540 |
publish: |
| 541 |
created_job: "<% task(create_system_job).result.content %>" |
| 542 |
|
| 543 |
check_restore_required: |
| 544 |
on-success: |
| 545 |
- update_system_job_success: <% $.restore_previous_config = false %> |
| 546 |
- get_nuage_api_key: <% $.restore_previous_config = true %> |
| 547 |
|
| 548 |
get_nuage_api_key: |
| 549 |
action: nokia.nuage.ensure_api_key |
| 550 |
input: |
| 551 |
nfvo: <% env().nfvo %> |
| 552 |
sdn_id: <% $.sdn %> |
| 553 |
publish: |
| 554 |
api_prefix: <% task(get_nuage_api_key).result.nuage_api_prefix %> |
| 555 |
api_key: <% task(get_nuage_api_key).result.api_key %> |
| 556 |
nuage_vsd_url: <% task(get_nuage_api_key).result.nuage_vsd_url %> |
| 557 |
nuage_org: <% task(get_nuage_api_key).result.nuage_org %> |
| 558 |
nuage_user: <% task(get_nuage_api_key).result.nuage_user %> |
| 559 |
on-success: |
| 560 |
- get_nuage_resource_path |
| 561 |
|
| 562 |
get_nuage_resource_path: |
| 563 |
publish: |
| 564 |
rest_resource_path: <% $.rest_resource_path_fragments.select(str($)).insert(0, $.api_prefix).join('/') %> |
| 565 |
nuage_update_choice_ok: null |
| 566 |
on-success: |
| 567 |
- call_nuage_api |
| 568 |
|
| 569 |
call_nuage_api: |
| 570 |
action: nokia.nuage.dummy_http |
| 571 |
input: |
| 572 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 573 |
method: PUT |
| 574 |
params: |
| 575 |
'responseChoice': <% $.nuage_update_choice_ok %> |
| 576 |
headers: |
| 577 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 578 |
'Content-Type': 'application/json' |
| 579 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 580 |
verify: false |
| 581 |
body: <% $.body %> |
| 582 |
result: { |
| 583 |
"status": 300, |
| 584 |
"content": { |
| 585 |
"choices": [ |
| 586 |
{ |
| 587 |
"label": "OK", |
| 588 |
"id": "FAKE_CHOICE_ID" |
| 589 |
} |
| 590 |
] |
| 591 |
} |
| 592 |
} |
| 593 |
publish: |
| 594 |
nuage_api_result: <% task().result.content %> |
| 595 |
publish-on-error: |
| 596 |
nuage_error_result: <% task().result %> |
| 597 |
error_source: "call_nuage_api" |
| 598 |
on-success: |
| 599 |
- nuage_update_confirmation: <% task().result.status = 300 %> |
| 600 |
- update_system_job_success: <% task().result.status < 300 %> |
| 601 |
on-error: |
| 602 |
- handle_http_404_failure: <% |
| 603 |
task().get(result) != null |
| 604 |
and task().result.get(error) != null |
| 605 |
and task().result.error.httpStatusCode = 404 |
| 606 |
%> |
| 607 |
- handle_http_other_failure: <% |
| 608 |
task().get(result) = null |
| 609 |
or task().result.get(error) = null |
| 610 |
or task().result.error.httpStatusCode != 404 |
| 611 |
%> |
| 612 |
|
| 613 |
nuage_update_confirmation: |
| 614 |
publish: |
| 615 |
nuage_update_choice_ok: <% $.nuage_api_result.choices.first(label = 'OK').id %> |
| 616 |
on-success: |
| 617 |
- call_nuage_api_final |
| 618 |
|
| 619 |
call_nuage_api_final: |
| 620 |
action: nokia.nuage.dummy_http |
| 621 |
input: |
| 622 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 623 |
method: PUT |
| 624 |
params: |
| 625 |
'responseChoice': <% $.nuage_update_choice_ok %> |
| 626 |
headers: |
| 627 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 628 |
'Content-Type': 'application/json' |
| 629 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 630 |
verify: false |
| 631 |
body: <% $.body %> |
| 632 |
result: { |
| 633 |
"status": 200, |
| 634 |
"content": { |
| 635 |
} |
| 636 |
} |
| 637 |
publish: |
| 638 |
nuage_api_result: <% task().result.content %> |
| 639 |
publish-on-error: |
| 640 |
nuage_error_result: <% task().result %> |
| 641 |
error_source: "call_nuage_api_final" |
| 642 |
on-success: |
| 643 |
- update_system_job_success: <% task().result.status < 300 %> |
| 644 |
on-error: |
| 645 |
- handle_http_404_failure: <% |
| 646 |
task().get(result) != null |
| 647 |
and task().result.get(error) != null |
| 648 |
and task().result.error.httpStatusCode = 404 |
| 649 |
%> |
| 650 |
- handle_http_other_failure: <% |
| 651 |
task().get(result) = null |
| 652 |
or task().result.get(error) = null |
| 653 |
or task().result.error.httpStatusCode != 404 |
| 654 |
%> |
| 655 |
|
| 656 |
system_log: |
| 657 |
action: std.echo |
| 658 |
input: |
| 659 |
output: "<% $ %>" |
| 660 |
system_log_fail: |
| 661 |
action: std.echo |
| 662 |
input: |
| 663 |
output: "<% $ %>" |
| 664 |
on-complete: |
| 665 |
- fail |
| 666 |
|
| 667 |
update_system_job_failure: |
| 668 |
action: nfvo_actions.update_system_job |
| 669 |
input: |
| 670 |
job_description: 'Configuration failed for network resource' |
| 671 |
job_id: "<% $.created_job.id %>" |
| 672 |
job_status: FAILED |
| 673 |
env: <% env() %> |
| 674 |
on-error: |
| 675 |
- system_log_fail |
| 676 |
on-success: |
| 677 |
- system_log_fail |
| 678 |
|
| 679 |
update_system_job_success: |
| 680 |
action: nfvo_actions.update_system_job |
| 681 |
input: |
| 682 |
env: "<% env() %>" |
| 683 |
job_description: "Configuration successful for network resource" |
| 684 |
job_id: "<% $.created_job.id %>" |
| 685 |
job_status: FINISHED |
| 686 |
on-error: |
| 687 |
- system_log |
| 688 |
|
| 689 |
update_system_job_resource_not_found: |
| 690 |
action: nfvo_actions.update_system_job |
| 691 |
input: |
| 692 |
env: "<% env() %>" |
| 693 |
job_description: "Configuration of network resource" |
| 694 |
job_id: "<% $.created_job.id %>" |
| 695 |
job_status: FINISHED |
| 696 |
on-error: |
| 697 |
- system_log |
| 698 |
|
| 699 |
handle_http_404_failure: |
| 700 |
on-success: |
| 701 |
- update_system_job_resource_not_found |
| 702 |
|
| 703 |
handle_http_other_failure: |
| 704 |
on-success: |
| 705 |
- update_system_job_failure |
| 706 |
|
| 707 |
nuage.create_group: |
| 708 |
description: "Creates a group of Nuage network resources." |
| 709 |
|
| 710 |
input: |
| 711 |
- item_type |
| 712 |
- rest_url_fragments |
| 713 |
- del_url_fragments |
| 714 |
- item_params |
| 715 |
- sdn |
| 716 |
- prev_params |
| 717 |
- prev_IDs |
| 718 |
- prev_resources |
| 719 |
|
| 720 |
output: |
| 721 |
IDs: <% $.new_IDs %> |
| 722 |
resources: <% $.new_resources %> |
| 723 |
|
| 724 |
task-defaults: |
| 725 |
on-error: |
| 726 |
- fail |
| 727 |
|
| 728 |
tasks: |
| 729 |
create_system_job: |
| 730 |
action: nfvo_actions.create_system_job |
| 731 |
input: |
| 732 |
env: "<% env() %>" |
| 733 |
job_description: <% switch(env().operation_info.partOfUpdate => "Update started for node group.", $ => "Creation started for node group.") %> |
| 734 |
job_status: RUNNING |
| 735 |
parent_job_id: '<% env().nfvo.system_job_id %>' |
| 736 |
on-success: |
| 737 |
- prepare_items_create: <% env().operation_info.partOfUpdate = false or $.prev_params = null %> |
| 738 |
- prepare_items_update: <% env().operation_info.partOfUpdate = true and $.prev_params != null %> |
| 739 |
publish: |
| 740 |
created_job: "<% task(create_system_job).result.content %>" |
| 741 |
|
| 742 |
prepare_items_create: |
| 743 |
publish: |
| 744 |
del_list: [] |
| 745 |
del_index: [] |
| 746 |
ins_list: <% $.item_params %> |
| 747 |
ins_index: <% range($.item_params.len()) %> |
| 748 |
new_IDs: [] |
| 749 |
new_resources: [] |
| 750 |
on-success: |
| 751 |
- create_items |
| 752 |
|
| 753 |
prepare_items_update: |
| 754 |
action: std.javascript |
| 755 |
input: |
| 756 |
context: <% $ %> |
| 757 |
script: | |
| 758 |
function is_equal(a, b) { |
| 759 |
if (a === b) return true; |
| 760 |
|
| 761 |
if (typeof(a) == 'object' && typeof(a) == typeof(b)) { |
| 762 |
for (var p in a) { |
| 763 |
if (!b.hasOwnProperty(p)) return false; |
| 764 |
if (a[p] === b[p]) continue; |
| 765 |
if (typeof(a[p]) == 'object' && typeof(a[p]) == typeof(b[p]) && is_equal(a[p], b[p])) continue; |
| 766 |
return false; |
| 767 |
} |
| 768 |
for (var p in b) { |
| 769 |
if (!a.hasOwnProperty(p)) return false; |
| 770 |
} |
| 771 |
return true; |
| 772 |
} |
| 773 |
|
| 774 |
return false; |
| 775 |
} |
| 776 |
|
| 777 |
function index_of(a, item) { |
| 778 |
for (var i=0; i<a.length; i++) { |
| 779 |
if (is_equal(item, a[i])) return i; |
| 780 |
} |
| 781 |
return -1; |
| 782 |
} |
| 783 |
|
| 784 |
function contains(a, item) { |
| 785 |
return (index_of(a, item) >= 0); |
| 786 |
} |
| 787 |
|
| 788 |
function array_diff(a, b) { |
| 789 |
var diff = { |
| 790 |
elements: [], |
| 791 |
indices: [] |
| 792 |
} |
| 793 |
|
| 794 |
for (var i=0; i<a.length; i++) { |
| 795 |
if (!contains(b, a[i])) { |
| 796 |
diff.elements.push(a[i]); |
| 797 |
diff.indices.push(i); |
| 798 |
} |
| 799 |
} |
| 800 |
|
| 801 |
return diff; |
| 802 |
} |
| 803 |
|
| 804 |
function array_remove(a, indices) { |
| 805 |
var result = []; |
| 806 |
for (var i=0; i<a.length; i++) { |
| 807 |
if (!contains(indices, i)) result.push(a[i]); |
| 808 |
} |
| 809 |
return result; |
| 810 |
} |
| 811 |
|
| 812 |
function array_select(a, indices) { |
| 813 |
var result = []; |
| 814 |
for (var i=0; i<a.length; i++) { |
| 815 |
if (contains(indices, i)) result.push(a[i]); |
| 816 |
} |
| 817 |
return result; |
| 818 |
} |
| 819 |
|
| 820 |
function array_copy(a) { |
| 821 |
var result = []; |
| 822 |
for (var i=0; i<a.length; i++) result.push(a[i]); |
| 823 |
return result; |
| 824 |
} |
| 825 |
|
| 826 |
function array_inject(a, elements, indices) { |
| 827 |
var result = array_copy(a); |
| 828 |
for (var k=0; k<indices.length; k++) { |
| 829 |
result.splice(indices[k], 0, elements[k]); |
| 830 |
} |
| 831 |
return result; |
| 832 |
} |
| 833 |
|
| 834 |
function array_rearrange(a, indices) { |
| 835 |
var result = array_copy(a); |
| 836 |
for (var i=0; i<indices.length; i++) { |
| 837 |
result[i] = a[indices[i]]; |
| 838 |
} |
| 839 |
return result; |
| 840 |
} |
| 841 |
|
| 842 |
function index_map(a, b) { |
| 843 |
var result = []; |
| 844 |
for (var i=0; i<a.length; i++) { |
| 845 |
result.push(index_of(b, a[i])); |
| 846 |
} |
| 847 |
return result; |
| 848 |
} |
| 849 |
|
| 850 |
var to_del = array_diff($.prev_params, $.item_params); |
| 851 |
var to_ins = array_diff($.item_params, $.prev_params); |
| 852 |
var new_indices = index_map(array_remove($.prev_params, to_del.indices), array_remove($.item_params, to_ins.indices)); |
| 853 |
|
| 854 |
return { |
| 855 |
del_list: to_del.elements, |
| 856 |
del_index: to_del.indices, |
| 857 |
ins_list: to_ins.elements, |
| 858 |
ins_index: to_ins.indices, |
| 859 |
new_IDs: array_rearrange(array_remove($.prev_IDs, to_del.indices), new_indices), |
| 860 |
new_resources: array_rearrange(array_remove($.prev_resources, to_del.indices), new_indices), |
| 861 |
del_IDs: array_select($.prev_IDs, to_del.indices), |
| 862 |
} |
| 863 |
|
| 864 |
publish: |
| 865 |
del_list: <% task(prepare_items_update).result.del_list %> |
| 866 |
del_index: <% task(prepare_items_update).result.del_index %> |
| 867 |
ins_list: <% task(prepare_items_update).result.ins_list %> |
| 868 |
ins_index: <% task(prepare_items_update).result.ins_index %> |
| 869 |
new_IDs: <% task(prepare_items_update).result.new_IDs %> |
| 870 |
new_resources: <% task(prepare_items_update).result.new_resources %> |
| 871 |
del_IDs: <% task(prepare_items_update).result.del_IDs %> |
| 872 |
on-success: |
| 873 |
- delete_old_items |
| 874 |
|
| 875 |
delete_old_items: |
| 876 |
with-items: |
| 877 |
- item_index in <% $.del_index %> |
| 878 |
- ID in <% $.del_IDs %> |
| 879 |
- item_body in <% $.del_list %> |
| 880 |
workflow: nuage.delete_object |
| 881 |
input: |
| 882 |
tosca_resource_id: '<% $.item_index %>' |
| 883 |
tosca_name: '<% $.item_type %>' |
| 884 |
rest_resource_path_fragments: <% $.del_url_fragments.append($.ID) %> |
| 885 |
sdn: <% $.sdn %> |
| 886 |
tosca_reference_only: <% $.item_body.get('tosca_reference_only', false) %> |
| 887 |
on-success: |
| 888 |
- create_items |
| 889 |
|
| 890 |
create_items: |
| 891 |
with-items: |
| 892 |
- item_body in <% $.ins_list %> |
| 893 |
- item_index in <% $.ins_index %> |
| 894 |
workflow: nuage.create_object |
| 895 |
input: |
| 896 |
tosca_resource_id: '<% $.item_index %>' |
| 897 |
tosca_name: '<% $.item_type %>' |
| 898 |
tosca_reference_only: <% $.item_body.get('tosca_reference_only', false) %> |
| 899 |
tosca_reference_field: <% $.item_body.get('tosca_reference_field', 'name') %> |
| 900 |
sdn: '<% $.sdn %>' |
| 901 |
rest_resource_path_fragments: <% $.rest_url_fragments %> |
| 902 |
body: <% $.item_body %> |
| 903 |
publish: |
| 904 |
ins_resources: <% task(create_items).result.select($.resource) %> |
| 905 |
ins_IDs: <% task(create_items).result.select($.ID) %> |
| 906 |
on-success: |
| 907 |
- merge_old_and_new_items |
| 908 |
|
| 909 |
merge_old_and_new_items: |
| 910 |
publish: |
| 911 |
new_IDs: <% let(old=>$.new_IDs, new=>$.ins_IDs, idx=>$.ins_index) -> range($idx.len()).insert(0, $old).aggregate($1.insert($idx[$2], $new[$2])) %> |
| 912 |
new_resources: <% let(old=>$.new_resources, new=>$.ins_resources, idx=>$.ins_index) -> range($idx.len()).insert(0, $old).aggregate($1.insert($idx[$2], $new[$2])) %> |
| 913 |
on-success: |
| 914 |
- update_system_job_success |
| 915 |
|
| 916 |
update_system_job_success: |
| 917 |
action: nfvo_actions.update_system_job |
| 918 |
input: |
| 919 |
env: "<% env() %>" |
| 920 |
job_description: <% switch(env().operation_info.partOfUpdate => "Update successful for node group.", $ => "Creation successful for node group.") %> |
| 921 |
job_id: "<% $.created_job.id %>" |
| 922 |
job_status: FINISHED |
| 923 |
|
| 924 |
nuage.create_neutron_object_v2: |
| 925 |
description: create a VSD managed subnet in Neutron |
| 926 |
type: direct |
| 927 |
input: |
| 928 |
- neutron_type |
| 929 |
- tosca_resource_id |
| 930 |
- tosca_name |
| 931 |
- tosca_reference_only |
| 932 |
- body |
| 933 |
- placement |
| 934 |
output: |
| 935 |
ID: <% $.id %> |
| 936 |
|
| 937 |
task-defaults: |
| 938 |
on-error: |
| 939 |
- update_system_job_failure |
| 940 |
|
| 941 |
tasks: |
| 942 |
create_system_job: |
| 943 |
action: nfvo_actions.create_system_job |
| 944 |
input: |
| 945 |
env: "<% env() %>" |
| 946 |
job_description: "Creation started for Nuage object" |
| 947 |
job_status: RUNNING |
| 948 |
parent_job_id: '<% env().nfvo.system_job_id %>' |
| 949 |
on-error: |
| 950 |
- fail |
| 951 |
on-success: |
| 952 |
- get_vim_url |
| 953 |
publish: |
| 954 |
created_job: "<% task(create_system_job).result.content %>" |
| 955 |
|
| 956 |
get_vim_url: |
| 957 |
action: std.noop |
| 958 |
on-success: |
| 959 |
- get_openstack_token |
| 960 |
publish: |
| 961 |
vim_url: 'vim_url' |
| 962 |
admin_tenant_name: 'admin_tenant_name' |
| 963 |
username: 'username' |
| 964 |
password: 'password' |
| 965 |
|
| 966 |
get_openstack_token: |
| 967 |
action: std.noop |
| 968 |
on-success: |
| 969 |
- get_openstack_tenant_id |
| 970 |
publish: |
| 971 |
token: 'token' |
| 972 |
neutron_url: 'neutron_url' |
| 973 |
|
| 974 |
get_openstack_tenant_id: |
| 975 |
action: std.noop |
| 976 |
on-success: |
| 977 |
- switch_neutron_object |
| 978 |
publish: |
| 979 |
tenant_id: tenant_id |
| 980 |
|
| 981 |
switch_neutron_object: |
| 982 |
on-success: |
| 983 |
- switch_neutron_subnet |
| 984 |
- switch_neutron_vsd_managed_subnet |
| 985 |
- switch_neutron_network |
| 986 |
|
| 987 |
switch_neutron_subnet: |
| 988 |
on-success: |
| 989 |
- create_neutron_subnet |
| 990 |
- find_neutron_subnet |
| 991 |
|
| 992 |
create_neutron_subnet: |
| 993 |
action: std.noop |
| 994 |
publish: |
| 995 |
result: 'result' |
| 996 |
id: 'id' |
| 997 |
on-success: |
| 998 |
- update_system_job_success |
| 999 |
|
| 1000 |
switch_neutron_vsd_managed_subnet: |
| 1001 |
on-success: |
| 1002 |
- create_neutron_vsd_managed_subnet |
| 1003 |
- find_neutron_subnet |
| 1004 |
|
| 1005 |
create_neutron_vsd_managed_subnet: |
| 1006 |
action: std.noop |
| 1007 |
publish: |
| 1008 |
result: |
| 1009 |
content: 'create_neutron_vsd_managed_subnet_result_content' |
| 1010 |
id: 'id' |
| 1011 |
on-success: |
| 1012 |
- update_system_job_success |
| 1013 |
|
| 1014 |
find_neutron_subnet: |
| 1015 |
action: std.noop |
| 1016 |
publish: |
| 1017 |
result: 'result' |
| 1018 |
subnets: 'subnet' |
| 1019 |
on-success: |
| 1020 |
- get_subnet_id |
| 1021 |
|
| 1022 |
get_subnet_id: |
| 1023 |
publish: |
| 1024 |
id: 'id' |
| 1025 |
on-success: |
| 1026 |
- update_system_job_success |
| 1027 |
|
| 1028 |
switch_neutron_network: |
| 1029 |
on-success: |
| 1030 |
- switch_provider_extensions |
| 1031 |
- find_neutron_network |
| 1032 |
|
| 1033 |
switch_provider_extensions: |
| 1034 |
on-success: |
| 1035 |
- create_neutron_network |
| 1036 |
- create_neutron_provider_network |
| 1037 |
- create_neutron_flat_network |
| 1038 |
|
| 1039 |
create_neutron_network: |
| 1040 |
action: std.noop |
| 1041 |
publish: |
| 1042 |
result: 'result' |
| 1043 |
id: 'id' |
| 1044 |
on-success: |
| 1045 |
- update_system_job_success |
| 1046 |
|
| 1047 |
create_neutron_provider_network: |
| 1048 |
action: std.noop |
| 1049 |
publish: |
| 1050 |
result: 'result' |
| 1051 |
id: 'id' |
| 1052 |
on-success: |
| 1053 |
- update_system_job_success |
| 1054 |
|
| 1055 |
create_neutron_flat_network: |
| 1056 |
action: std.noop |
| 1057 |
publish: |
| 1058 |
result: 'result' |
| 1059 |
id: 'id' |
| 1060 |
on-success: |
| 1061 |
- update_system_job_success |
| 1062 |
|
| 1063 |
find_neutron_network: |
| 1064 |
action: std.noop |
| 1065 |
publish: |
| 1066 |
result: 'result' |
| 1067 |
id: 'id' |
| 1068 |
on-success: |
| 1069 |
- get_network_id |
| 1070 |
|
| 1071 |
get_network_id: |
| 1072 |
publish: |
| 1073 |
id: 'id' |
| 1074 |
on-success: |
| 1075 |
- update_system_job_success |
| 1076 |
|
| 1077 |
system_log: |
| 1078 |
action: std.echo |
| 1079 |
input: |
| 1080 |
output: "<% $ %>" |
| 1081 |
|
| 1082 |
system_log_fail: |
| 1083 |
action: std.echo |
| 1084 |
input: |
| 1085 |
output: "<% $ %>" |
| 1086 |
on-complete: |
| 1087 |
- fail |
| 1088 |
|
| 1089 |
|
| 1090 |
update_system_job_failure: |
| 1091 |
action: nfvo_actions.update_system_job |
| 1092 |
input: |
| 1093 |
job_description: 'Creation of Neutron object failed for network resource' |
| 1094 |
job_id: "<% $.created_job.id %>" |
| 1095 |
job_status: FAILED |
| 1096 |
env: "<% env() %>" |
| 1097 |
on-error: |
| 1098 |
- system_log_fail |
| 1099 |
on-success: |
| 1100 |
- system_log_fail |
| 1101 |
|
| 1102 |
update_system_job_success: |
| 1103 |
action: nfvo_actions.update_system_job |
| 1104 |
input: |
| 1105 |
env: "<% env() %>" |
| 1106 |
job_description: "Creation successful for network resource" |
| 1107 |
job_id: "<% $.created_job.id %>" |
| 1108 |
job_status: FINISHED |
| 1109 |
on-error: |
| 1110 |
- system_log |
| 1111 |
|
| 1112 |
nuage.create_neutron_object: |
| 1113 |
description: create a VSD managed subnet in Neutron |
| 1114 |
type: direct |
| 1115 |
input: |
| 1116 |
- neutron_type |
| 1117 |
- tosca_resource_id |
| 1118 |
- tosca_name |
| 1119 |
- tosca_reference_only |
| 1120 |
- body |
| 1121 |
- placement |
| 1122 |
output: |
| 1123 |
ID: 'id' |
| 1124 |
|
| 1125 |
task-defaults: |
| 1126 |
on-error: |
| 1127 |
- update_system_job_failure |
| 1128 |
|
| 1129 |
tasks: |
| 1130 |
create_system_job: |
| 1131 |
action: nfvo_actions.create_system_job |
| 1132 |
input: |
| 1133 |
env: "<% env() %>" |
| 1134 |
job_description: "Creation started for Nuage" |
| 1135 |
job_status: RUNNING |
| 1136 |
parent_job_id: '<% env().nfvo.system_job_id %>' |
| 1137 |
on-error: |
| 1138 |
- fail |
| 1139 |
on-success: |
| 1140 |
- get_vim_url |
| 1141 |
publish: |
| 1142 |
created_job: "<% task(create_system_job).result.content %>" |
| 1143 |
|
| 1144 |
get_vim_url: |
| 1145 |
action: std.noop |
| 1146 |
on-success: |
| 1147 |
- get_openstack_token |
| 1148 |
publish: |
| 1149 |
vim_url: 'vim_url' |
| 1150 |
admin_tenant_name: 'admin_tenant_name' |
| 1151 |
username: 'username' |
| 1152 |
password: 'password' |
| 1153 |
|
| 1154 |
get_openstack_token: |
| 1155 |
action: std.noop |
| 1156 |
on-success: |
| 1157 |
- get_openstack_tenant_id |
| 1158 |
publish: |
| 1159 |
token: 'token' |
| 1160 |
neutron_url: 'neutron_url' |
| 1161 |
|
| 1162 |
get_openstack_tenant_id: |
| 1163 |
action: std.noop |
| 1164 |
on-success: |
| 1165 |
- switch_neutron_object |
| 1166 |
publish: |
| 1167 |
tenant_id: 'tenant_id' |
| 1168 |
|
| 1169 |
switch_neutron_object: |
| 1170 |
on-success: |
| 1171 |
- switch_neutron_vsd_managed_subnet |
| 1172 |
- switch_neutron_network |
| 1173 |
|
| 1174 |
switch_neutron_vsd_managed_subnet: |
| 1175 |
on-success: |
| 1176 |
- create_neutron_vsd_managed_subnet: <% $.tosca_reference_only = false %> |
| 1177 |
- find_neutron_vsd_managed_subnet: <% $.tosca_reference_only = true %> |
| 1178 |
|
| 1179 |
create_neutron_vsd_managed_subnet: |
| 1180 |
action: std.noop |
| 1181 |
publish: |
| 1182 |
result: |
| 1183 |
content: 'create_neutron_vsd_managed_subnet_result_content' |
| 1184 |
id: 'id' |
| 1185 |
on-success: |
| 1186 |
- update_system_job_success |
| 1187 |
|
| 1188 |
find_neutron_vsd_managed_subnet: |
| 1189 |
action: std.noop |
| 1190 |
publish: |
| 1191 |
result: 'result' |
| 1192 |
subnets: 'subnets' |
| 1193 |
on-success: |
| 1194 |
- get_subnet_id |
| 1195 |
|
| 1196 |
get_subnet_id: |
| 1197 |
publish: |
| 1198 |
id: 'id' |
| 1199 |
on-success: |
| 1200 |
- update_system_job_success |
| 1201 |
|
| 1202 |
switch_neutron_network: |
| 1203 |
on-success: |
| 1204 |
- create_neutron_network |
| 1205 |
- find_neutron_network |
| 1206 |
|
| 1207 |
create_neutron_network: |
| 1208 |
action: std.noop |
| 1209 |
publish: |
| 1210 |
result: |
| 1211 |
content: 'create_neutron_network_result_content' |
| 1212 |
id: 'id' |
| 1213 |
on-success: |
| 1214 |
- update_system_job_success |
| 1215 |
|
| 1216 |
find_neutron_network: |
| 1217 |
action: std.noop |
| 1218 |
publish: |
| 1219 |
result: 'result' |
| 1220 |
networks: 'networks' |
| 1221 |
on-success: |
| 1222 |
- get_network_id |
| 1223 |
|
| 1224 |
get_network_id: |
| 1225 |
publish: |
| 1226 |
id: 'id' |
| 1227 |
on-success: |
| 1228 |
- update_system_job_success |
| 1229 |
|
| 1230 |
system_log: |
| 1231 |
action: std.echo |
| 1232 |
input: |
| 1233 |
output: "<% $ %>" |
| 1234 |
|
| 1235 |
system_log_fail: |
| 1236 |
action: std.echo |
| 1237 |
input: |
| 1238 |
output: "<% $ %>" |
| 1239 |
on-complete: |
| 1240 |
- fail |
| 1241 |
|
| 1242 |
update_system_job_failure: |
| 1243 |
action: nfvo_actions.update_system_job |
| 1244 |
input: |
| 1245 |
job_description: 'Creation of Neutron object failed' |
| 1246 |
job_id: "<% $.created_job.id %>" |
| 1247 |
job_status: FAILED |
| 1248 |
env: "<% env() %>" |
| 1249 |
on-error: |
| 1250 |
- system_log_fail |
| 1251 |
on-success: |
| 1252 |
- system_log_fail |
| 1253 |
|
| 1254 |
update_system_job_success: |
| 1255 |
action: nfvo_actions.update_system_job |
| 1256 |
input: |
| 1257 |
env: "<% env() %>" |
| 1258 |
job_description: "Creation successful for network resource" |
| 1259 |
job_id: "<% $.created_job.id %>" |
| 1260 |
job_status: FINISHED |
| 1261 |
on-error: |
| 1262 |
- system_log |
| 1263 |
|
| 1264 |
nuage.create_object: |
| 1265 |
description: "Create network resources in Nuage." |
| 1266 |
input: |
| 1267 |
- tosca_resource_id |
| 1268 |
- tosca_name |
| 1269 |
- tosca_reference_only |
| 1270 |
- tosca_reference_field |
| 1271 |
- create_condition: True |
| 1272 |
- result_if_not_created: {} |
| 1273 |
- sdn |
| 1274 |
- rest_resource_path_fragments |
| 1275 |
- body: '' |
| 1276 |
output: |
| 1277 |
ID: <% $.nuage_api_result.ID %> |
| 1278 |
resource: <% $.nuage_api_result %> |
| 1279 |
|
| 1280 |
task-defaults: |
| 1281 |
on-error: |
| 1282 |
- update_system_job_failure |
| 1283 |
|
| 1284 |
tasks: |
| 1285 |
check_create_condition: |
| 1286 |
publish: |
| 1287 |
nuage_api_result: <% $.result_if_not_created %> |
| 1288 |
on-success: |
| 1289 |
- create_system_job: <% $.create_condition = true %> |
| 1290 |
on-error: |
| 1291 |
- system_log_fail |
| 1292 |
|
| 1293 |
create_system_job: |
| 1294 |
action: nfvo_actions.create_system_job |
| 1295 |
input: |
| 1296 |
env: "<% env() %>" |
| 1297 |
job_description: "Creation started for Nuage object" |
| 1298 |
job_status: RUNNING |
| 1299 |
parent_job_id: '<% env().nfvo.system_job_id %>' |
| 1300 |
on-error: |
| 1301 |
- fail |
| 1302 |
on-success: |
| 1303 |
- get_nuage_api_key |
| 1304 |
publish: |
| 1305 |
created_job: "<% task(create_system_job).result.content %>" |
| 1306 |
|
| 1307 |
get_nuage_api_key: |
| 1308 |
action: nokia.nuage.ensure_api_key |
| 1309 |
input: |
| 1310 |
nfvo: <% env().nfvo %> |
| 1311 |
sdn_id: <% $.sdn %> |
| 1312 |
publish: |
| 1313 |
api_key: <% task().result.api_key %> |
| 1314 |
nuage_vsd_url: <% task().result.nuage_vsd_url %> |
| 1315 |
nuage_org: <% task().result.nuage_org %> |
| 1316 |
nuage_user: <% task().result.nuage_user %> |
| 1317 |
nuage_create_choice_ok: null |
| 1318 |
rest_resource_path: <% switch( |
| 1319 |
$.body.keys().contains('entityScope') and $.body.entityScope = "GLOBAL" and $.rest_resource_path_fragments.len() = 3 => $.rest_resource_path_fragments.select(str($)).delete(0, count=>2).insert(0, task().result.nuage_api_prefix).join('/'), |
| 1320 |
$ => $.rest_resource_path_fragments.select(str($)).insert(0, task().result.nuage_api_prefix).join('/') |
| 1321 |
)%> |
| 1322 |
on-success: |
| 1323 |
- call_nuage_create_api: <% $.tosca_reference_only = false %> |
| 1324 |
- call_nuage_get_api: <% $.tosca_reference_only = true %> |
| 1325 |
|
| 1326 |
call_nuage_create_api: |
| 1327 |
action: nokia.nuage.dummy_http |
| 1328 |
input: |
| 1329 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 1330 |
method: POST |
| 1331 |
params: |
| 1332 |
'responseChoice': <% $.nuage_create_choice_ok %> |
| 1333 |
headers: |
| 1334 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 1335 |
'Content-Type': 'application/json' |
| 1336 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 1337 |
verify: false |
| 1338 |
body: <% $.body %> |
| 1339 |
result: { |
| 1340 |
"status": 300, |
| 1341 |
"content": { |
| 1342 |
"choices": [ |
| 1343 |
{ |
| 1344 |
"label": "OK", |
| 1345 |
"id": "FAKE_CHOICE_ID" |
| 1346 |
} |
| 1347 |
] |
| 1348 |
} |
| 1349 |
} |
| 1350 |
publish: |
| 1351 |
nuage_api_result: <% switch( |
| 1352 |
task(call_nuage_create_api).result.status = 300 => task(call_nuage_create_api).result.content, |
| 1353 |
task(call_nuage_create_api).result.status < 300 => task(call_nuage_create_api).result.content.first() |
| 1354 |
) %> |
| 1355 |
nuage_api_full_result: <% task(call_nuage_create_api).result %> |
| 1356 |
on-success: |
| 1357 |
- nuage_create_confirmation: <% task(call_nuage_create_api).result.status = 300 %> |
| 1358 |
- update_system_job_success: <% task(call_nuage_create_api).result.status < 300 %> |
| 1359 |
|
| 1360 |
nuage_create_confirmation: |
| 1361 |
publish: |
| 1362 |
nuage_create_choice_ok: <% $.nuage_api_result.choices.first(label = 'OK').id %> |
| 1363 |
on-success: |
| 1364 |
- call_nuage_create_api_final |
| 1365 |
|
| 1366 |
call_nuage_create_api_final: |
| 1367 |
action: nokia.nuage.dummy_http |
| 1368 |
input: |
| 1369 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 1370 |
method: POST |
| 1371 |
params: |
| 1372 |
'responseChoice': <% $.nuage_create_choice_ok %> |
| 1373 |
headers: |
| 1374 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 1375 |
'Content-Type': 'application/json' |
| 1376 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 1377 |
verify: false |
| 1378 |
body: <% $.body %> |
| 1379 |
result: { |
| 1380 |
"status": 201, |
| 1381 |
"content": [ |
| 1382 |
{ |
| 1383 |
"ID": "5333bc71-729f-4869-8e4a-8e6cf849e4d1", |
| 1384 |
} |
| 1385 |
] |
| 1386 |
} |
| 1387 |
publish: |
| 1388 |
nuage_api_result: <% switch( |
| 1389 |
task(call_nuage_create_api_final).result.status < 300 => task(call_nuage_create_api_final).result.content.first() |
| 1390 |
) %> |
| 1391 |
nuage_api_full_result: <% task(call_nuage_create_api_final).result %> |
| 1392 |
on-success: |
| 1393 |
- update_system_job_success: <% task(call_nuage_create_api_final).result.status < 300 %> |
| 1394 |
on-error: |
| 1395 |
- update_system_job_failure_final |
| 1396 |
|
| 1397 |
|
| 1398 |
call_nuage_get_api: |
| 1399 |
action: nokia.nuage.dummy_http |
| 1400 |
input: |
| 1401 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 1402 |
method: GET |
| 1403 |
headers: |
| 1404 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 1405 |
'Content-Type': 'application/json' |
| 1406 |
'X-Nuage-Filter': '<% $.tosca_reference_field %>=="<% $.body.get($.tosca_reference_field) %>"' |
| 1407 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 1408 |
verify: false |
| 1409 |
body: <% $.body %> |
| 1410 |
result: { |
| 1411 |
"status": 200, |
| 1412 |
"content": [ |
| 1413 |
{ |
| 1414 |
"ID": "5333bc71-729f-4869-8e4a-8e6cf849e4d1", |
| 1415 |
} |
| 1416 |
], |
| 1417 |
"headers": { |
| 1418 |
"X-Nuage-Count": "1", |
| 1419 |
"Content-Type": "application/json" |
| 1420 |
} |
| 1421 |
} |
| 1422 |
publish: |
| 1423 |
nuage_api_result: <% switch(task(call_nuage_get_api).result.get(headers).get("X-Nuage-Count") = "1" => task(call_nuage_get_api).result.content.first()) %> |
| 1424 |
nuage_api_full_result: <% task(call_nuage_get_api).result %> |
| 1425 |
on-success: |
| 1426 |
- update_system_job_success: <% task(call_nuage_get_api).result.get(headers).get('X-Nuage-Count') = "1" %> |
| 1427 |
- update_system_job_not_found_failure: <% task(call_nuage_get_api).result.get(headers).get("X-Nuage-Count") = "0" %> |
| 1428 |
- update_system_job_not_unique_failure: <% task(call_nuage_get_api).result.get(headers).get("X-Nuage-Count") > "1" %> |
| 1429 |
|
| 1430 |
system_log: |
| 1431 |
action: std.echo |
| 1432 |
input: |
| 1433 |
output: "<% $ %>" |
| 1434 |
|
| 1435 |
system_log_fail: |
| 1436 |
action: std.echo |
| 1437 |
input: |
| 1438 |
output: "<% $ %>" |
| 1439 |
on-complete: |
| 1440 |
- fail |
| 1441 |
|
| 1442 |
update_system_job_failure: |
| 1443 |
action: nfvo_actions.update_system_job |
| 1444 |
input: |
| 1445 |
job_description: 'Creation failed for network resource' |
| 1446 |
job_id: "<% $.created_job.id %>" |
| 1447 |
job_status: FAILED |
| 1448 |
env: "<% env() %>" |
| 1449 |
on-error: |
| 1450 |
- system_log_fail |
| 1451 |
on-success: |
| 1452 |
- system_log_fail |
| 1453 |
|
| 1454 |
update_system_job_failure_final: |
| 1455 |
action: nfvo_actions.update_system_job |
| 1456 |
input: |
| 1457 |
job_description: 'Creation failed for network resource' |
| 1458 |
job_id: "<% $.created_job.id %>" |
| 1459 |
job_status: FAILED |
| 1460 |
env: "<% env() %>" |
| 1461 |
on-error: |
| 1462 |
- system_log_fail |
| 1463 |
on-success: |
| 1464 |
- system_log_fail |
| 1465 |
|
| 1466 |
update_system_job_not_found_failure: |
| 1467 |
action: nfvo_actions.update_system_job |
| 1468 |
input: |
| 1469 |
job_description: 'Creation of Tosca reference_only resource failed' |
| 1470 |
job_id: "<% $.created_job.id %>" |
| 1471 |
job_status: FAILED |
| 1472 |
env: "<% env() %>" |
| 1473 |
on-error: |
| 1474 |
- system_log_fail |
| 1475 |
on-success: |
| 1476 |
- system_log_fail |
| 1477 |
|
| 1478 |
update_system_job_not_unique_failure: |
| 1479 |
action: nfvo_actions.update_system_job |
| 1480 |
input: |
| 1481 |
job_description: 'Creation of Tosca reference_only resource failed' |
| 1482 |
job_id: "<% $.created_job.id %>" |
| 1483 |
job_status: FAILED |
| 1484 |
env: "<% env() %>" |
| 1485 |
on-error: |
| 1486 |
- system_log_fail |
| 1487 |
on-success: |
| 1488 |
- system_log_fail |
| 1489 |
|
| 1490 |
update_system_job_success: |
| 1491 |
action: nfvo_actions.update_system_job |
| 1492 |
input: |
| 1493 |
env: "<% env() %>" |
| 1494 |
job_description: "Creation successful for network resource name: <% $.tosca_name %>, id: <% $.tosca_resource_id %> " |
| 1495 |
job_id: "<% $.created_job.id %>" |
| 1496 |
job_status: FINISHED |
| 1497 |
on-error: |
| 1498 |
- system_log |
| 1499 |
|
| 1500 |
nuage.delete_group: |
| 1501 |
description: "Deletes a group of Nuage network resources." |
| 1502 |
|
| 1503 |
input: |
| 1504 |
- item_type |
| 1505 |
- rest_url_fragments |
| 1506 |
- item_params |
| 1507 |
- IDs |
| 1508 |
- sdn |
| 1509 |
|
| 1510 |
task-defaults: |
| 1511 |
on-error: |
| 1512 |
- fail |
| 1513 |
|
| 1514 |
tasks: |
| 1515 |
create_system_job: |
| 1516 |
action: nfvo_actions.create_system_job |
| 1517 |
input: |
| 1518 |
env: "<% env() %>" |
| 1519 |
job_description: <% switch(env().operation_info.partOfUpdate => "Update started for node group.", $ => "Deletion started for node group.") %> |
| 1520 |
job_status: RUNNING |
| 1521 |
parent_job_id: '<% env().nfvo.system_job_id %>' |
| 1522 |
on-success: |
| 1523 |
- delete_items: <% $.IDs != null and not env().operation_info.partOfUpdate %> |
| 1524 |
- update_system_job_success: <% $.IDs = null or env().operation_info.partOfUpdate %> |
| 1525 |
publish: |
| 1526 |
created_job: "<% task(create_system_job).result.content %>" |
| 1527 |
|
| 1528 |
delete_items: |
| 1529 |
with-items: |
| 1530 |
- item_index in <% range($.IDs.len()) %> |
| 1531 |
- ID in <% $.IDs %> |
| 1532 |
- item_body in <% $.item_params %> |
| 1533 |
workflow: nuage.delete_object |
| 1534 |
input: |
| 1535 |
tosca_resource_id: '<% $.item_index %>' |
| 1536 |
tosca_name: '<% $.item_type %>' |
| 1537 |
rest_resource_path_fragments: <% $.rest_url_fragments.append($.ID) %> |
| 1538 |
sdn: <% $.sdn %> |
| 1539 |
tosca_reference_only: <% $.item_body.get('tosca_reference_only', false) %> |
| 1540 |
on-success: |
| 1541 |
- update_system_job_success |
| 1542 |
|
| 1543 |
update_system_job_success: |
| 1544 |
action: nfvo_actions.update_system_job |
| 1545 |
input: |
| 1546 |
env: "<% env() %>" |
| 1547 |
job_description: <% switch(env().operation_info.partOfUpdate => "Update successful for node group.", $ => "Deletion successful for node group.") %> |
| 1548 |
job_id: "<% $.created_job.id %>" |
| 1549 |
job_status: FINISHED |
| 1550 |
|
| 1551 |
nuage.delete_neutron_object: |
| 1552 |
description: delete a VSD managed subnet in Neutron |
| 1553 |
type: direct |
| 1554 |
input: |
| 1555 |
- neutron_type |
| 1556 |
- tosca_resource_id |
| 1557 |
- tosca_name |
| 1558 |
- tosca_reference_only |
| 1559 |
- id |
| 1560 |
- placement |
| 1561 |
|
| 1562 |
task-defaults: |
| 1563 |
on-error: |
| 1564 |
- update_system_job_failure |
| 1565 |
|
| 1566 |
tasks: |
| 1567 |
create_system_job: |
| 1568 |
action: nfvo_actions.create_system_job |
| 1569 |
input: |
| 1570 |
env: "<% env() %>" |
| 1571 |
job_description: "Delete started for Nuage object Name: <% $.tosca_name %>, Tosca ID: <% $.tosca_resource_id %> " |
| 1572 |
job_status: RUNNING |
| 1573 |
parent_job_id: '<% env().nfvo.system_job_id %>' |
| 1574 |
on-error: |
| 1575 |
- fail |
| 1576 |
on-success: |
| 1577 |
- check_reference_only |
| 1578 |
publish: |
| 1579 |
created_job: "<% task(create_system_job).result.content %>" |
| 1580 |
|
| 1581 |
check_reference_only: |
| 1582 |
on-success: |
| 1583 |
- get_vim_url: <% $.tosca_reference_only = false %> |
| 1584 |
- update_system_job_success: <% $.tosca_reference_only = true %> |
| 1585 |
|
| 1586 |
get_vim_url: |
| 1587 |
action: nokia.nuage.dummy_http |
| 1588 |
input: |
| 1589 |
url: 'dummyurl' |
| 1590 |
method: GET |
| 1591 |
allow_redirects: true |
| 1592 |
headers: |
| 1593 |
"Content-Type": "application/json" |
| 1594 |
"Authorization": <% env().nfvo.authTokenType + ' ' + env().nfvo.authToken %> |
| 1595 |
verify: false |
| 1596 |
result: |
| 1597 |
content: |
| 1598 |
parameterGroups: { |
| 1599 |
"Target Details": { |
| 1600 |
"parameters": [ |
| 1601 |
{ |
| 1602 |
"identity_endpoint_url": { "value": "identity_endpoint_url_value" }, |
| 1603 |
"admin_tenant_name": { "value": "admin_tenant_name_value" } |
| 1604 |
} |
| 1605 |
] |
| 1606 |
}, |
| 1607 |
"Basic Credentials": { |
| 1608 |
"parameters": [ |
| 1609 |
{ |
| 1610 |
"username": { "value": "username_value" }, |
| 1611 |
"password": { "value": "password_value" } |
| 1612 |
} |
| 1613 |
] |
| 1614 |
} |
| 1615 |
} |
| 1616 |
|
| 1617 |
on-success: |
| 1618 |
- get_openstack_token |
| 1619 |
publish: |
| 1620 |
vim_url: <% task(get_vim_url).result.content.parameterGroups["Target Details"].parameters.first().identity_endpoint_url.value %> |
| 1621 |
admin_tenant_name: <% task(get_vim_url).result.content.parameterGroups["Target Details"].parameters.first().admin_tenant_name.value %> |
| 1622 |
username: <% task(get_vim_url).result.content.parameterGroups["Basic Credentials"].parameters.first().username.value %> |
| 1623 |
password: <% task(get_vim_url).result.content.parameterGroups["Basic Credentials"].parameters.first().password.value %> |
| 1624 |
|
| 1625 |
get_openstack_token: |
| 1626 |
action: nokia.nuage.dummy_http |
| 1627 |
input: |
| 1628 |
url: <% $.vim_url + '/auth/tokens' %> |
| 1629 |
method: POST |
| 1630 |
allow_redirects: true |
| 1631 |
headers: |
| 1632 |
"Content-Type": "application/json" |
| 1633 |
body: '{"auth": { "identity": { "methods": ["password"], "password": {"user": {"name": "<% $.username %>", "domain": { "name": "default" }, "password": "<% $.password %>" } } }, "scope": { "project": { "name": "<% $.admin_tenant_name %>", "domain": { "id": "default" } } } } }' |
| 1634 |
verify: false |
| 1635 |
result: |
| 1636 |
headers: { |
| 1637 |
"X-Subject-Token": "X-Subject-Token-Value" |
| 1638 |
} |
| 1639 |
content: |
| 1640 |
token: |
| 1641 |
catalog: [ |
| 1642 |
{ |
| 1643 |
"type": "network", |
| 1644 |
"endpoints": [ |
| 1645 |
{ |
| 1646 |
"interface": "public", |
| 1647 |
"url": "public_url_value" |
| 1648 |
} |
| 1649 |
] |
| 1650 |
} |
| 1651 |
] |
| 1652 |
on-success: |
| 1653 |
- switch_neutron_object |
| 1654 |
publish: |
| 1655 |
token: <% task(get_openstack_token).result.headers["X-Subject-Token"] %> |
| 1656 |
neutron_url: <% task(get_openstack_token).result.content.token.catalog.where($.type='network').first().endpoints.where($.interface='public').first().url %> |
| 1657 |
|
| 1658 |
switch_neutron_object: |
| 1659 |
on-success: |
| 1660 |
- delete_neutron_object: <% ["vsd_managed_subnet", "network"].contains( $.neutron_type) %> |
| 1661 |
- update_system_job_type_not_found_failure: <% not ["vsd_managed_subnet", "network"].contains( $.neutron_type) %> |
| 1662 |
|
| 1663 |
delete_neutron_object: |
| 1664 |
action: nokia.nuage.dummy_http |
| 1665 |
input: |
| 1666 |
url: <% $.neutron_url.replace("/v2.0","") + switch($.neutron_type = "vsd_managed_subnet" => '/v2.0/subnets/', $.neutron_type = "network" => '/v2.0/networks/') + 'id' %> |
| 1667 |
method: DELETE |
| 1668 |
allow_redirects: true |
| 1669 |
headers: |
| 1670 |
"X-Auth-Token": <% $.token %> |
| 1671 |
verify: false |
| 1672 |
result: |
| 1673 |
status: 200 |
| 1674 |
publish: |
| 1675 |
result: <% task(delete_neutron_object).result %> |
| 1676 |
on-success: |
| 1677 |
- update_system_job_success |
| 1678 |
on-error: |
| 1679 |
- handle_http_404_failure: <% |
| 1680 |
task(delete_neutron_object).get(result) != null |
| 1681 |
and task(delete_neutron_object).result.status != null |
| 1682 |
and task(delete_neutron_object).result.status = 404 |
| 1683 |
%> |
| 1684 |
|
| 1685 |
|
| 1686 |
system_log: |
| 1687 |
action: std.echo |
| 1688 |
input: |
| 1689 |
output: "<% $ %>" |
| 1690 |
|
| 1691 |
system_log_fail: |
| 1692 |
action: std.echo |
| 1693 |
input: |
| 1694 |
output: "<% $ %>" |
| 1695 |
on-complete: |
| 1696 |
- fail |
| 1697 |
|
| 1698 |
update_system_job_type_not_found_failure: |
| 1699 |
action: nfvo_actions.update_system_job |
| 1700 |
input: |
| 1701 |
job_description: 'Delete of Neutron object failed' |
| 1702 |
job_id: "<% $.created_job.id %>" |
| 1703 |
job_status: FAILED |
| 1704 |
env: "<% env() %>" |
| 1705 |
on-error: |
| 1706 |
- system_log_fail |
| 1707 |
on-success: |
| 1708 |
- system_log_fail |
| 1709 |
|
| 1710 |
|
| 1711 |
update_system_job_failure: |
| 1712 |
action: nfvo_actions.update_system_job |
| 1713 |
input: |
| 1714 |
job_description: 'Delete failed for network resource' |
| 1715 |
job_id: "<% $.created_job.id %>" |
| 1716 |
job_status: FAILED |
| 1717 |
env: "<% env() %>" |
| 1718 |
on-error: |
| 1719 |
- system_log_fail |
| 1720 |
on-success: |
| 1721 |
- system_log_fail |
| 1722 |
|
| 1723 |
update_system_job_success: |
| 1724 |
action: nfvo_actions.update_system_job |
| 1725 |
input: |
| 1726 |
env: "<% env() %>" |
| 1727 |
job_description: "Delete successful for network resource" |
| 1728 |
job_id: "<% $.created_job.id %>" |
| 1729 |
job_status: FINISHED |
| 1730 |
on-error: |
| 1731 |
- system_log |
| 1732 |
|
| 1733 |
update_system_job_resource_not_found: |
| 1734 |
action: nfvo_actions.update_system_job |
| 1735 |
input: |
| 1736 |
env: "<% env() %>" |
| 1737 |
job_description: "Deletion of network resource" |
| 1738 |
job_id: "<% $.created_job.id %>" |
| 1739 |
job_status: FINISHED |
| 1740 |
on-error: |
| 1741 |
- system_log |
| 1742 |
|
| 1743 |
|
| 1744 |
handle_http_404_failure: |
| 1745 |
on-success: |
| 1746 |
- update_system_job_resource_not_found |
| 1747 |
|
| 1748 |
nuage.delete_object: |
| 1749 |
description: "Delete the network resources in Nuage." |
| 1750 |
input: |
| 1751 |
- tosca_name |
| 1752 |
- tosca_resource_id |
| 1753 |
- rest_resource_path_fragments |
| 1754 |
- create_condition: True |
| 1755 |
- sdn |
| 1756 |
- tosca_reference_only |
| 1757 |
|
| 1758 |
task-defaults: |
| 1759 |
on-error: |
| 1760 |
- update_system_job_failure |
| 1761 |
|
| 1762 |
tasks: |
| 1763 |
check_create_condition: |
| 1764 |
on-success: |
| 1765 |
- create_system_job: <% $.create_condition = true %> |
| 1766 |
on-error: |
| 1767 |
- system_log_fail |
| 1768 |
|
| 1769 |
create_system_job: |
| 1770 |
action: nfvo_actions.create_system_job |
| 1771 |
input: |
| 1772 |
env: "<% env() %>" |
| 1773 |
job_description: "Deletion started for network resource" |
| 1774 |
job_status: RUNNING |
| 1775 |
parent_job_id: '<% env().nfvo.system_job_id %>' |
| 1776 |
on-error: |
| 1777 |
- fail |
| 1778 |
on-success: |
| 1779 |
- check_reference_only |
| 1780 |
publish: |
| 1781 |
created_job: "<% task(create_system_job).result.content %>" |
| 1782 |
|
| 1783 |
check_reference_only: |
| 1784 |
on-success: |
| 1785 |
- get_nuage_api_key: <% $.tosca_reference_only = false %> |
| 1786 |
- update_system_job_success: <% $.tosca_reference_only = true %> |
| 1787 |
|
| 1788 |
get_nuage_api_key: |
| 1789 |
action: nokia.nuage.ensure_api_key |
| 1790 |
input: |
| 1791 |
nfvo: <% env().nfvo %> |
| 1792 |
sdn_id: <% $.sdn %> |
| 1793 |
publish: |
| 1794 |
api_prefix: <% task(get_nuage_api_key).result.nuage_api_prefix %> |
| 1795 |
api_key: <% task(get_nuage_api_key).result.api_key %> |
| 1796 |
nuage_vsd_url: <% task(get_nuage_api_key).result.nuage_vsd_url %> |
| 1797 |
nuage_org: <% task(get_nuage_api_key).result.nuage_org %> |
| 1798 |
nuage_user: <% task(get_nuage_api_key).result.nuage_user %> |
| 1799 |
on-success: |
| 1800 |
- get_nuage_resource_path |
| 1801 |
|
| 1802 |
get_nuage_resource_path: |
| 1803 |
publish: |
| 1804 |
rest_resource_path: <% $.rest_resource_path_fragments.select(str($)).insert(0, $.api_prefix).join('/') %> |
| 1805 |
nuage_delete_choice_ok: null |
| 1806 |
on-success: |
| 1807 |
- call_nuage_api |
| 1808 |
|
| 1809 |
call_nuage_api: |
| 1810 |
action: nokia.nuage.dummy_http |
| 1811 |
input: |
| 1812 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 1813 |
method: DELETE |
| 1814 |
params: |
| 1815 |
'responseChoice': <% $.nuage_delete_choice_ok %> |
| 1816 |
headers: |
| 1817 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 1818 |
'Content-Type': 'application/json' |
| 1819 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 1820 |
verify: false |
| 1821 |
result: { |
| 1822 |
"status": 300, |
| 1823 |
"content": { |
| 1824 |
"choices": [ |
| 1825 |
{ |
| 1826 |
"label": "OK", |
| 1827 |
"id": "FAKE_CHOICE_ID" |
| 1828 |
} |
| 1829 |
] |
| 1830 |
} |
| 1831 |
} |
| 1832 |
publish: |
| 1833 |
nuage_api_result: <% task(call_nuage_api).result.content %> |
| 1834 |
publish-on-error: |
| 1835 |
nuage_error_cause: <% switch( |
| 1836 |
(task().result.get(content) = null and task().result.get(error) = null) => task().result, |
| 1837 |
task().result.get(error) != null => task().result.error.developerMessage, |
| 1838 |
task().result.content.get(error) = null => task().result.content, |
| 1839 |
task().result.content.get(error) != null => task().result.content.error.developerMessage) |
| 1840 |
%> |
| 1841 |
on-success: |
| 1842 |
- nuage_delete_confirmation: <% task(call_nuage_api).result.status = 300 %> |
| 1843 |
- update_system_job_success: <% task(call_nuage_api).result.status < 300 %> |
| 1844 |
on-error: |
| 1845 |
- handle_http_404_failure: <% |
| 1846 |
task(call_nuage_api).get(result) != null |
| 1847 |
and task(call_nuage_api).result.get(error) != null |
| 1848 |
and task(call_nuage_api).result.error.httpStatusCode = 404 |
| 1849 |
%> |
| 1850 |
- handle_http_other_failure: <% |
| 1851 |
task(call_nuage_api).get(result) = null |
| 1852 |
or task(call_nuage_api).result.get(error) = null |
| 1853 |
or task(call_nuage_api).result.error.httpStatusCode != 404 |
| 1854 |
%> |
| 1855 |
|
| 1856 |
nuage_delete_confirmation: |
| 1857 |
publish: |
| 1858 |
nuage_delete_choice_ok: <% $.nuage_api_result.choices.first(label = 'OK').id %> |
| 1859 |
on-success: |
| 1860 |
- call_nuage_api_final |
| 1861 |
|
| 1862 |
call_nuage_api_final: |
| 1863 |
action: nokia.nuage.dummy_http |
| 1864 |
input: |
| 1865 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 1866 |
method: DELETE |
| 1867 |
params: |
| 1868 |
'responseChoice': <% $.nuage_delete_choice_ok %> |
| 1869 |
headers: |
| 1870 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 1871 |
'Content-Type': 'application/json' |
| 1872 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 1873 |
verify: false |
| 1874 |
result: { |
| 1875 |
"status": 200, |
| 1876 |
"content": { |
| 1877 |
} |
| 1878 |
} |
| 1879 |
publish: |
| 1880 |
nuage_api_result: <% task(call_nuage_api_final).result.content %> |
| 1881 |
publish-on-error: |
| 1882 |
nuage_error_cause: <% switch( |
| 1883 |
(task().result.get(content) = null and task().result.get(error) = null) => task().result, |
| 1884 |
task().result.get(error) != null => task().result.error.developerMessage, |
| 1885 |
task().result.content.get(error) = null => task().result.content, |
| 1886 |
task().result.content.get(error) != null => task().result.content.error.developerMessage) |
| 1887 |
%> |
| 1888 |
on-success: |
| 1889 |
- update_system_job_success: <% task(call_nuage_api_final).result.status < 300 %> |
| 1890 |
on-error: |
| 1891 |
- handle_http_404_failure: <% |
| 1892 |
task(call_nuage_api_final).get(result) != null |
| 1893 |
and task(call_nuage_api_final).result.get(error) != null |
| 1894 |
and task(call_nuage_api_final).result.error.httpStatusCode = 404 |
| 1895 |
%> |
| 1896 |
- handle_http_other_failure: <% |
| 1897 |
task(call_nuage_api_final).get(result) = null |
| 1898 |
or task(call_nuage_api_final).result.get(error) = null |
| 1899 |
or task(call_nuage_api_final).result.error.httpStatusCode != 404 |
| 1900 |
%> |
| 1901 |
|
| 1902 |
system_log: |
| 1903 |
action: std.echo |
| 1904 |
input: |
| 1905 |
output: "<% $ %>" |
| 1906 |
system_log_fail: |
| 1907 |
action: std.echo |
| 1908 |
input: |
| 1909 |
output: "<% $ %>" |
| 1910 |
on-complete: |
| 1911 |
- fail |
| 1912 |
|
| 1913 |
update_system_job_failure: |
| 1914 |
action: nfvo_actions.update_system_job |
| 1915 |
input: |
| 1916 |
job_description: 'Deletion failed for network resource' |
| 1917 |
job_id: "<% $.created_job.id %>" |
| 1918 |
job_status: FAILED |
| 1919 |
env: <% env() %> |
| 1920 |
on-error: |
| 1921 |
- system_log_fail |
| 1922 |
on-success: |
| 1923 |
- system_log_fail |
| 1924 |
|
| 1925 |
update_system_job_success: |
| 1926 |
action: nfvo_actions.update_system_job |
| 1927 |
input: |
| 1928 |
env: "<% env() %>" |
| 1929 |
job_description: "Deletion successful for network resource name: <% $.tosca_name %>, id: <% $.tosca_resource_id %> " |
| 1930 |
job_id: "<% $.created_job.id %>" |
| 1931 |
job_status: FINISHED |
| 1932 |
on-error: |
| 1933 |
- system_log |
| 1934 |
|
| 1935 |
update_system_job_resource_not_found: |
| 1936 |
action: nfvo_actions.update_system_job |
| 1937 |
input: |
| 1938 |
env: "<% env() %>" |
| 1939 |
job_description: "Deletion of network resource" |
| 1940 |
job_id: "<% $.created_job.id %>" |
| 1941 |
job_status: FINISHED |
| 1942 |
on-error: |
| 1943 |
- system_log |
| 1944 |
|
| 1945 |
handle_http_404_failure: |
| 1946 |
on-success: |
| 1947 |
- update_system_job_resource_not_found |
| 1948 |
|
| 1949 |
handle_http_other_failure: |
| 1950 |
on-success: |
| 1951 |
- update_system_job_failure |
| 1952 |
|
| 1953 |
nuage.expression_eval: |
| 1954 |
description: Evaluates an expression at runtime |
| 1955 |
input: |
| 1956 |
- vars |
| 1957 |
- expr |
| 1958 |
output: |
| 1959 |
eval: <% $.eval %> |
| 1960 |
task-defaults: |
| 1961 |
on-error: |
| 1962 |
- fail |
| 1963 |
tasks: |
| 1964 |
evaluate: |
| 1965 |
action: std.javascript |
| 1966 |
input: |
| 1967 |
context: |
| 1968 |
expr: <% $.expr %> |
| 1969 |
vars: <% $.vars %> |
| 1970 |
script: return eval($.expr) |
| 1971 |
publish: |
| 1972 |
eval: |
| 1973 |
result: <% task(evaluate).result %> |
| 1974 |
|
| 1975 |
nuage.remove_object_membership: |
| 1976 |
description: "Update network resources in Nuage" |
| 1977 |
input: |
| 1978 |
- tosca_resource_id |
| 1979 |
- tosca_name |
| 1980 |
- rest_resource_path_fragments |
| 1981 |
- sdn |
| 1982 |
- body: '' |
| 1983 |
- source_exists: True |
| 1984 |
- target_exists: True |
| 1985 |
|
| 1986 |
task-defaults: |
| 1987 |
on-error: |
| 1988 |
- update_system_job_failure |
| 1989 |
|
| 1990 |
tasks: |
| 1991 |
check_execute_condition: |
| 1992 |
on-success: |
| 1993 |
- create_system_job: <% $.source_exists = true and $.target_exists = true %> |
| 1994 |
on-error: |
| 1995 |
- system_log_fail |
| 1996 |
|
| 1997 |
create_system_job: |
| 1998 |
action: nfvo_actions.create_system_job |
| 1999 |
input: |
| 2000 |
env: "<% env() %>" |
| 2001 |
job_description: "Update started on Nuage object" |
| 2002 |
job_status: RUNNING |
| 2003 |
parent_job_id: '<% env().nfvo.system_job_id %>' |
| 2004 |
on-error: |
| 2005 |
- fail |
| 2006 |
on-success: |
| 2007 |
- get_nuage_api_key |
| 2008 |
publish: |
| 2009 |
created_job: "<% task(create_system_job).result.content %>" |
| 2010 |
|
| 2011 |
get_nuage_api_key: |
| 2012 |
action: nokia.nuage.ensure_api_key |
| 2013 |
input: |
| 2014 |
nfvo: <% env().nfvo %> |
| 2015 |
sdn_id: <% $.sdn %> |
| 2016 |
publish: |
| 2017 |
api_prefix: <% task(get_nuage_api_key).result.nuage_api_prefix %> |
| 2018 |
api_key: <% task(get_nuage_api_key).result.api_key %> |
| 2019 |
nuage_vsd_url: <% task(get_nuage_api_key).result.nuage_vsd_url %> |
| 2020 |
nuage_org: <% task(get_nuage_api_key).result.nuage_org %> |
| 2021 |
nuage_user: <% task(get_nuage_api_key).result.nuage_user %> |
| 2022 |
on-success: |
| 2023 |
- get_nuage_resource_path |
| 2024 |
|
| 2025 |
get_nuage_resource_path: |
| 2026 |
publish: |
| 2027 |
rest_resource_path: <% $.rest_resource_path_fragments.select(str($)).insert(0, $.api_prefix).join('/') %> |
| 2028 |
on-success: |
| 2029 |
- get_nuage_current_members |
| 2030 |
|
| 2031 |
get_nuage_current_members: |
| 2032 |
action: nokia.nuage.dummy_http |
| 2033 |
input: |
| 2034 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 2035 |
method: GET |
| 2036 |
headers: |
| 2037 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 2038 |
'Content-Type': 'application/json' |
| 2039 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 2040 |
verify: false |
| 2041 |
result: { |
| 2042 |
"status": 200, |
| 2043 |
"content": [ |
| 2044 |
{ |
| 2045 |
"ID": "5333bc71-729f-4869-8e4a-8e6cf849e4d1", |
| 2046 |
} |
| 2047 |
], |
| 2048 |
"headers": { |
| 2049 |
"X-Nuage-Count": "1", |
| 2050 |
"Content-Type": "application/json" |
| 2051 |
} |
| 2052 |
} |
| 2053 |
publish: |
| 2054 |
current_members: <% switch( task().result.get(headers).get("X-Nuage-Count") != "0" => task().result.content.ID.toSet().difference($.body.toSet()).toList(), |
| 2055 |
task().result.get(headers).get("X-Nuage-Count") = "0" => [] |
| 2056 |
) %> |
| 2057 |
nuage_update_choice_ok: null |
| 2058 |
publish-on-error: |
| 2059 |
nuage_error_result: <% task().result %> |
| 2060 |
on-success: |
| 2061 |
- call_nuage_update_api |
| 2062 |
|
| 2063 |
call_nuage_update_api: |
| 2064 |
action: nokia.nuage.dummy_http |
| 2065 |
input: |
| 2066 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 2067 |
method: PUT |
| 2068 |
params: |
| 2069 |
'responseChoice': <% $.nuage_update_choice_ok %> |
| 2070 |
headers: |
| 2071 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 2072 |
'Content-Type': 'application/json' |
| 2073 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 2074 |
verify: false |
| 2075 |
body: <% str($.current_members).replace("(","[").replace(",)", "]").replace(")","]").replace("u'", "'") %> |
| 2076 |
result: { |
| 2077 |
"status": 300, |
| 2078 |
"content": { |
| 2079 |
"choices": [ |
| 2080 |
{ |
| 2081 |
"label": "OK", |
| 2082 |
"id": "FAKE_CHOICE_ID" |
| 2083 |
} |
| 2084 |
] |
| 2085 |
} |
| 2086 |
} |
| 2087 |
publish-on-error: |
| 2088 |
nuage_error_result: <% task().result %> |
| 2089 |
on-success: |
| 2090 |
- nuage_update_confirmation: <% task().result.status = 300 %> |
| 2091 |
- update_system_job_success: <% task().result.status < 300 %> |
| 2092 |
|
| 2093 |
nuage_update_confirmation: |
| 2094 |
publish: |
| 2095 |
nuage_update_choice_ok: <% task(call_nuage_update_api).result.content.choices.first(label = 'OK').id %> |
| 2096 |
on-success: |
| 2097 |
- call_nuage_update_api_final |
| 2098 |
|
| 2099 |
call_nuage_update_api_final: |
| 2100 |
action: nokia.nuage.dummy_http |
| 2101 |
input: |
| 2102 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 2103 |
method: PUT |
| 2104 |
params: |
| 2105 |
'responseChoice': <% $.nuage_update_choice_ok %> |
| 2106 |
headers: |
| 2107 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 2108 |
'Content-Type': 'application/json' |
| 2109 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 2110 |
verify: false |
| 2111 |
body: <% str($.current_members).replace("(","[").replace(",)", "]").replace(")","]").replace("u'", "'") %> |
| 2112 |
result: { |
| 2113 |
"status": 201, |
| 2114 |
"content": [ |
| 2115 |
{ |
| 2116 |
"ID": "5333bc71-729f-4869-8e4a-8e6cf849e4d1", |
| 2117 |
} |
| 2118 |
] |
| 2119 |
} |
| 2120 |
publish-on-error: |
| 2121 |
nuage_error_result: <% task().result %> |
| 2122 |
on-success: |
| 2123 |
- update_system_job_success: <% task().result.status < 300 %> |
| 2124 |
|
| 2125 |
system_log: |
| 2126 |
action: std.echo |
| 2127 |
input: |
| 2128 |
output: "<% $ %>" |
| 2129 |
|
| 2130 |
system_log_fail: |
| 2131 |
action: std.echo |
| 2132 |
input: |
| 2133 |
output: "<% $ %>" |
| 2134 |
on-complete: |
| 2135 |
- fail |
| 2136 |
|
| 2137 |
update_system_job_failure: |
| 2138 |
action: nfvo_actions.update_system_job |
| 2139 |
input: |
| 2140 |
job_description: 'De-association failed for network resource' |
| 2141 |
job_id: "<% $.created_job.id %>" |
| 2142 |
job_status: FAILED |
| 2143 |
env: "<% env() %>" |
| 2144 |
on-error: |
| 2145 |
- system_log_fail |
| 2146 |
on-success: |
| 2147 |
- system_log_fail |
| 2148 |
|
| 2149 |
update_system_job_success: |
| 2150 |
action: nfvo_actions.update_system_job |
| 2151 |
input: |
| 2152 |
env: "<% env() %>" |
| 2153 |
job_description: "Update successful for network resource name: <% $.tosca_name %>, id: <% $.tosca_resource_id %> " |
| 2154 |
job_id: "<% $.created_job.id %>" |
| 2155 |
job_status: FINISHED |
| 2156 |
on-error: |
| 2157 |
- system_log |
| 2158 |
|
| 2159 |
nuage.update_object_membership: |
| 2160 |
description: "Update network resources in Nuage." |
| 2161 |
input: |
| 2162 |
- tosca_resource_id |
| 2163 |
- tosca_name |
| 2164 |
- rest_resource_path_fragments |
| 2165 |
- sdn |
| 2166 |
- body: '' |
| 2167 |
- source_exists: True |
| 2168 |
- target_exists: True |
| 2169 |
|
| 2170 |
task-defaults: |
| 2171 |
on-error: |
| 2172 |
- update_system_job_failure |
| 2173 |
|
| 2174 |
tasks: |
| 2175 |
check_execute_condition: |
| 2176 |
on-success: |
| 2177 |
- create_system_job: <% $.source_exists = true and $.target_exists = true %> |
| 2178 |
on-error: |
| 2179 |
- system_log_fail |
| 2180 |
|
| 2181 |
create_system_job: |
| 2182 |
action: nfvo_actions.create_system_job |
| 2183 |
input: |
| 2184 |
env: "<% env() %>" |
| 2185 |
job_description: "Update started on Nuage object" |
| 2186 |
job_status: RUNNING |
| 2187 |
parent_job_id: '<% env().nfvo.system_job_id %>' |
| 2188 |
on-error: |
| 2189 |
- fail |
| 2190 |
on-success: |
| 2191 |
- get_nuage_api_key |
| 2192 |
publish: |
| 2193 |
created_job: "<% task(create_system_job).result.content %>" |
| 2194 |
|
| 2195 |
get_nuage_api_key: |
| 2196 |
action: nokia.nuage.ensure_api_key |
| 2197 |
input: |
| 2198 |
nfvo: <% env().nfvo %> |
| 2199 |
sdn_id: <% $.sdn %> |
| 2200 |
publish: |
| 2201 |
api_prefix: <% task(get_nuage_api_key).result.nuage_api_prefix %> |
| 2202 |
api_key: <% task(get_nuage_api_key).result.api_key %> |
| 2203 |
nuage_vsd_url: <% task(get_nuage_api_key).result.nuage_vsd_url %> |
| 2204 |
nuage_org: <% task(get_nuage_api_key).result.nuage_org %> |
| 2205 |
nuage_user: <% task(get_nuage_api_key).result.nuage_user %> |
| 2206 |
on-success: |
| 2207 |
- get_nuage_resource_path |
| 2208 |
|
| 2209 |
get_nuage_resource_path: |
| 2210 |
publish: |
| 2211 |
rest_resource_path: <% $.rest_resource_path_fragments.select(str($)).insert(0, $.api_prefix).join('/') %> |
| 2212 |
on-success: |
| 2213 |
- get_nuage_current_members |
| 2214 |
|
| 2215 |
get_nuage_current_members: |
| 2216 |
action: nokia.nuage.dummy_http |
| 2217 |
input: |
| 2218 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 2219 |
method: GET |
| 2220 |
headers: |
| 2221 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 2222 |
'Content-Type': 'application/json' |
| 2223 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 2224 |
verify: false |
| 2225 |
result: { |
| 2226 |
"status": 200, |
| 2227 |
"content": { |
| 2228 |
"ID": "5333bc71-729f-4869-8e4a-8e6cf849e4d1", |
| 2229 |
}, |
| 2230 |
"headers": { |
| 2231 |
"X-Nuage-Count": "0", |
| 2232 |
"Content-Type": "application/json" |
| 2233 |
} |
| 2234 |
} |
| 2235 |
publish: |
| 2236 |
current_members: <% switch( task().result.get(headers).get("X-Nuage-Count") != "0" => task().result.content.ID + $.body, |
| 2237 |
task().result.get(headers).get("X-Nuage-Count") = "0" => $.body |
| 2238 |
) %> |
| 2239 |
nuage_update_choice_ok: null |
| 2240 |
publish-on-error: |
| 2241 |
nuage_error_result: <% task().result %> |
| 2242 |
on-success: |
| 2243 |
- call_nuage_update_api |
| 2244 |
|
| 2245 |
call_nuage_update_api: |
| 2246 |
action: nokia.nuage.dummy_http |
| 2247 |
input: |
| 2248 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 2249 |
method: PUT |
| 2250 |
params: |
| 2251 |
'responseChoice': <% $.nuage_update_choice_ok %> |
| 2252 |
headers: |
| 2253 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 2254 |
'Content-Type': 'application/json' |
| 2255 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 2256 |
verify: false |
| 2257 |
body: <% str($.current_members).replace("(","[").replace(",)", "]").replace(")","]").replace("u'", "'") %> |
| 2258 |
result: { |
| 2259 |
"status": 300, |
| 2260 |
"content": { |
| 2261 |
"choices": [ |
| 2262 |
{ |
| 2263 |
"label": "OK", |
| 2264 |
"id": "FAKE_CHOICE_ID" |
| 2265 |
} |
| 2266 |
] |
| 2267 |
} |
| 2268 |
} |
| 2269 |
publish-on-error: |
| 2270 |
nuage_error_result: <% task().result %> |
| 2271 |
on-success: |
| 2272 |
- nuage_update_confirmation: <% task().result.status = 300 %> |
| 2273 |
- update_system_job_success: <% task().result.status < 300 %> |
| 2274 |
|
| 2275 |
nuage_update_confirmation: |
| 2276 |
publish: |
| 2277 |
nuage_update_choice_ok: <% task(call_nuage_update_api).result.content.choices.first(label = 'OK').id %> |
| 2278 |
on-success: |
| 2279 |
- call_nuage_update_api_final |
| 2280 |
|
| 2281 |
call_nuage_update_api_final: |
| 2282 |
action: nokia.nuage.dummy_http |
| 2283 |
input: |
| 2284 |
url: '<% $.nuage_vsd_url + $.rest_resource_path %>' |
| 2285 |
method: PUT |
| 2286 |
params: |
| 2287 |
'responseChoice': <% $.nuage_update_choice_ok %> |
| 2288 |
headers: |
| 2289 |
'X-Nuage-Organization': <% $.nuage_org %> |
| 2290 |
'Content-Type': 'application/json' |
| 2291 |
auth: '<% $.nuage_user %>:<% $.api_key %>' |
| 2292 |
verify: false |
| 2293 |
body: <% str($.current_members).replace("(","[").replace(",)", "]").replace(")","]").replace("u'", "'") %> |
| 2294 |
result: { |
| 2295 |
"status": 200 |
| 2296 |
} |
| 2297 |
publish-on-error: |
| 2298 |
nuage_error_result: <% task().result %> |
| 2299 |
on-success: |
| 2300 |
- update_system_job_success: <% task().result.status < 300 %> |
| 2301 |
|
| 2302 |
system_log: |
| 2303 |
action: std.echo |
| 2304 |
input: |
| 2305 |
output: "<% $ %>" |
| 2306 |
|
| 2307 |
system_log_fail: |
| 2308 |
action: std.echo |
| 2309 |
input: |
| 2310 |
output: "<% $ %>" |
| 2311 |
on-complete: |
| 2312 |
- fail |
| 2313 |
|
| 2314 |
update_system_job_failure: |
| 2315 |
action: nfvo_actions.update_system_job |
| 2316 |
input: |
| 2317 |
job_description: 'Creation failed for network resource' |
| 2318 |
job_id: "<% $.created_job.id %>" |
| 2319 |
job_status: FAILED |
| 2320 |
env: "<% env() %>" |
| 2321 |
on-error: |
| 2322 |
- system_log_fail |
| 2323 |
on-success: |
| 2324 |
- system_log_fail |
| 2325 |
|
| 2326 |
update_system_job_success: |
| 2327 |
action: nfvo_actions.update_system_job |
| 2328 |
input: |
| 2329 |
env: "<% env() %>" |
| 2330 |
job_description: "Update successful" |
| 2331 |
job_id: "<% $.created_job.id %>" |
| 2332 |
job_status: FINISHED |
| 2333 |
on-error: |
| 2334 |
- system_log |
| 2335 |
|
| 2336 |
std_noop: |
| 2337 |
type: direct |
| 2338 |
tasks: |
| 2339 |
task1: |
| 2340 |
action: std.noop |