--- ############################################################################## # Copyright 2018 Parker Berberian and Others # # # # Licensed under the Apache License, Version 2.0 (the License); # # you may not use this file except in compliance with the License. # # You may obtain a copy of the License at # # # # http://www.apache.org/licenses/LICENSE-2.0 # # # # Unless required by applicable law or agreed to in writing, software # # distributed under the License is distributed on an AS IS BASIS, # # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # # limitations under the License. # ############################################################################## version: '2.0' laas.network_master_workflow: description: fulfills all network tasks from the dashboard input: - job_id tasks: get_tasks: action: laas.get_task_list input: job_id: <% $.job_id %> type: "network" publish: tasklist: <% task(get_tasks).result.result %> on-success: - get_start_index get_start_index: action: core.local cmd="echo 0" publish: index: <% int(task(get_start_index).result.stdout) %> on-success: - finish: <% $.index >= len($.tasklist) %> - network_task: <% $.index < len($.tasklist) %> loop: action: core.local input: cmd: 'echo $((<% $.index %>+1))' publish: index: <% int(task(loop).result.stdout) %> on-success: - finish: <% $.index >= len($.tasklist) %> - network_task: <% $.index < len($.tasklist) %> network_task: action: laas.network_workflow input: task_id: <% $.tasklist[$.index] %> job_id: <% $.job_id %> on-success: - loop on-error: - retry_network_task retry_network_task: action: laas.network_workflow input: task_id: <% $.tasklist[$.index] %> job_id: <% $.job_id %> on-success: - loop finish: action: core.local cmd="exit 0" on-success: succeed