0b2e6005ffb3ec497bb5a7ffc39fd2257bd96088
[vfc/gvnfm/vnflcm.git] / lcm / lcm / pub / msapi / nfvolcm.py
1 # Copyright 2017 ZTE Corporation.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #         http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 from lcm.pub.utils.restcall import req_by_msb
16
17 #call gvnfm driver
18 def vnfd_rawdata_get(vnfdid):
19     ret = req_by_msb("openoapi/nslcm/v1/vnfs/%s" % vnfdid, "GET")
20     return ret
21
22 #call gvnfm driver
23 def apply_grant_to_nfvo(data):
24     ret = req_by_msb("openoapi/nslcm/v1/grantvnf" , "POST", data)
25     return ret
26
27 #call gvnfm driver
28 def notify_lcm_to_nfvo(data, nf_inst_id):
29     ret = req_by_msb("openoapi/nslcm/v1/vnfs/%s/Notify"%nf_inst_id, "POST", data)
30     return ret
31
32 #call gvnfm driver
33 def apply_res_to_nfvo(data):
34     ret = req_by_msb("openoapi/nslcm/v1/res" , "POST", data)
35     return ret