1 # -*- coding: utf-8 -*-
4 # Copyright 2019 Tech Mahindra Limited
8 # Licensed under the Apache License, Version 2.0 (the "License"); you may
9 # not use this file except in compliance with the License. You may obtain
10 # a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17 # License for the specific language governing permissions and limitations
22 # 1. Feature 7829: Jayant Madavi, Mrityunjay Yadav : MY00514913@techmahindra.com : 06-sep-2019
28 [Arguments] ${vim_name} ${account_type} ${auth_url} ${user} ${password} ${tenant} ${description}
30 &{request_data}= Create Dictionary vim_user=${user} vim_password=${password} vim_url=${auth_url} vim_tenant_name=${tenant} vim_type=${account_type} description=${description} name=${vim_name}
32 &{headers}= Create Dictionary Authorization=Bearer ${token} Content-Type=application/json Accept=application/json
34 Create Session osmvim ${HOST} verify=${FALSE} headers=${headers}
37 ${res}= Post Request osmvim ${create_vim_uri} data=${request_data}
39 Pass Execution If ${res.status_code} in ${success_status_code_list} Create Vim Request completed
40 Get Vim ID ${res.content}
46 ${uri} = Catenate SEPARATOR=/ ${create_vim_uri} ${vim_id}
47 ${resp}= Delete Request osmvim ${uri}
50 Pass Execution If ${resp.status_code} in ${success_status_code_list} Delete Vim Request completed
56 # log to console ${res}
57 ${content}= To Json ${res}
58 ${id}= Get From Dictionary ${content} id
59 Set Suite Variable ${vim_id} ${id}
60 log Vim Id is ${vim_id}