Fix vfc-lcm/packages/tests pep8 issue
[vfc/nfvo/lcm.git] / lcm / packages / tests / test_nf.py
1 # Copyright 2016-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 import json
16
17 import mock
18 from django.test import Client
19 from django.test import TestCase
20 from rest_framework import status
21
22 from lcm.packages.nf_package import NfOnBoardingThread, NfPkgDeletePendingThread
23 from lcm.packages.nf_package import NfPkgDeleteThread
24 from lcm.pub.database.models import JobStatusModel, JobModel
25 from lcm.pub.database.models import NfPackageModel, VnfPackageFileModel, NfInstModel
26 from lcm.pub.nfvi.vim.vimadaptor import VimAdaptor
27 from lcm.pub.utils import fileutil
28 from lcm.pub.utils import restcall
29
30
31 class TestNfPackage(TestCase):
32     def setUp(self):
33         self.client = Client()
34         NfPackageModel.objects.filter().delete()
35         VnfPackageFileModel.objects.filter().delete()
36         NfInstModel.objects.filter().delete()
37         JobModel.objects.filter().delete()
38         JobStatusModel.objects.filter().delete()
39         self.vnfd_raw_data = {
40             "rawData": {
41                 "instance": {
42                     "metadata": {
43                         "is_shared": False,
44                         "plugin_info": "vbrasplugin_1.0",
45                         "vendor": "zte",
46                         "request_reclassification": False,
47                         "name": "vbras",
48                         "version": 1,
49                         "vnf_type": "vbras",
50                         "cross_dc": False,
51                         "vnfd_version": "1.0.0",
52                         "id": "zte_vbras_1.0",
53                         "nsh_aware": True
54                     },
55                     "nodes": [
56                         {
57                             "id": "aaa_dnet_cp_0xu2j5sbigxc8h1ega3if0ld1",
58                             "type_name": "tosca.nodes.nfv.ext.zte.CP",
59                             "template_name": "aaa_dnet_cp",
60                             "properties": {
61                                 "bandwidth": {
62                                     "type_name": "integer",
63                                     "value": 0
64                                 },
65                                 "direction": {
66                                     "type_name": "string",
67                                     "value": "bidirectional"
68                                 },
69                                 "vnic_type": {
70                                     "type_name": "string",
71                                     "value": "normal"
72                                 },
73                                 "sfc_encapsulation": {
74                                     "type_name": "string",
75                                     "value": "mac"
76                                 },
77                                 "order": {
78                                     "type_name": "integer",
79                                     "value": 2
80                                 }
81                             },
82                             "relationships": [
83                                 {
84                                     "name": "guest_os",
85                                     "source_requirement_index": 0,
86                                     "target_node_id": "AAA_image_d8aseebr120nbm7bo1ohkj194",
87                                     "target_capability_name": "feature"
88                                 }
89                             ]
90                         },
91                         {
92                             "id": "LB_Image_oj5l2ay8l2g6vcq6fsswzduha",
93                             "type_name": "tosca.nodes.nfv.ext.ImageFile",
94                             "template_name": "LB_Image",
95                             "properties": {
96                                 "disk_format": {
97                                     "type_name": "string",
98                                     "value": "qcow2"
99                                 },
100                                 "file_url": {
101                                     "type_name": "string",
102                                     "value": "/SoftwareImages/image-lb"
103                                 },
104                                 "name": {
105                                     "type_name": "string",
106                                     "value": "image-lb"
107                                 }
108                             }
109                         }
110                     ]
111                 },
112                 "model": {
113                     "metadata": {
114                         "is_shared": False,
115                         "plugin_info": "vbrasplugin_1.0",
116                         "vendor": "zte",
117                         "request_reclassification": False,
118                         "name": "vbras",
119                         "version": 1,
120                         "vnf_type": "vbras",
121                         "cross_dc": False,
122                         "vnfd_version": "1.0.0",
123                         "id": "zte_vbras_1.0",
124                         "nsh_aware": True
125                     },
126                     "node_templates": [
127                         {
128                             "name": "aaa_dnet_cp",
129                             "type_name": "tosca.nodes.nfv.ext.zte.CP",
130                             "default_instances": 1,
131                             "min_instances": 0,
132                             "properties": {
133                                 "bandwidth": {
134                                     "type_name": "integer",
135                                     "value": 0
136                                 }
137                             },
138                             "requirement_templates": [
139                                 {
140                                     "name": "virtualbinding",
141                                     "target_node_template_name": "AAA",
142                                     "target_capability_name": "virtualbinding"
143                                 }
144                             ]
145                         }
146                     ]
147                 }
148             }
149         }
150
151     def tearDown(self):
152         pass
153
154     def assert_job_result(self, job_id, job_progress, job_detail):
155         jobs = JobStatusModel.objects.filter(
156             jobid=job_id,
157             progress=job_progress,
158             descp=job_detail)
159         self.assertEqual(1, len(jobs))
160
161     @mock.patch.object(NfOnBoardingThread, 'run')
162     def test_nf_pkg_on_boarding_normal(self, mock_run):
163         resp = self.client.post("/api/nslcm/v0/vnfpackage", {
164             "csarId": "1",
165             "vimIds": ["1"]
166         }, format='json')
167         self.assertEqual(resp.status_code, status.HTTP_202_ACCEPTED)
168
169     @mock.patch.object(restcall, 'call_req')
170     def test_nf_pkg_on_boarding_when_on_boarded(self, mock_call_req):
171         mock_call_req.return_value = [0, json.JSONEncoder().encode({"onBoardState": "onBoarded"}), '200']
172         NfOnBoardingThread(csar_id="1",
173                            vim_ids=["1"],
174                            lab_vim_id="",
175                            job_id="2").run()
176         self.assert_job_result("2", 255, "CSAR(1) already onBoarded.")
177
178     @mock.patch.object(restcall, 'call_req')
179     def test_nf_pkg_on_boarding_when_on_boarding(self, mock_call_req):
180         mock_call_req.return_value = [0, json.JSONEncoder().encode({
181             "onBoardState": "non-onBoarded",
182             "processState": "onBoarding"
183         }), '200']
184         NfOnBoardingThread(csar_id="2",
185                            vim_ids=["1"],
186                            lab_vim_id="",
187                            job_id="3").run()
188         self.assert_job_result("3", 255, "CSAR(2) is onBoarding now.")
189
190     @mock.patch.object(restcall, 'call_req')
191     def test_nf_on_boarding_when_nfd_already_exists(self, mock_call_req):
192         mock_vals = {
193             "/api/catalog/v1/csars/2":
194                 [0, json.JSONEncoder().encode({
195                     "onBoardState": "onBoardFailed", "processState": "deleteFailed"}), '200'],
196             "/api/catalog/v1/servicetemplates/queryingrawdata":
197                 [0, json.JSONEncoder().encode(self.vnfd_raw_data), '200']}
198
199         def side_effect(*args):
200             return mock_vals[args[4]]
201
202         mock_call_req.side_effect = side_effect
203         NfPackageModel(uuid="1", nfpackageid="2", vnfdid="zte_vbras_1.0").save()
204         NfOnBoardingThread(csar_id="2", vim_ids=["1"], lab_vim_id="", job_id="4").run()
205         self.assert_job_result("4", 255, "NFD(zte_vbras_1.0) already exists.")
206
207     @mock.patch.object(restcall, 'call_req')
208     @mock.patch.object(fileutil, 'download_file_from_http')
209     @mock.patch.object(VimAdaptor, '__init__')
210     @mock.patch.object(VimAdaptor, 'create_image')
211     @mock.patch.object(VimAdaptor, 'get_image')
212     def test_nf_on_boarding_when_successfully(self, mock_get_image, mock_create_image,
213                                               mock__init__, mock_download_file_from_http, mock_call_req):
214         mock_download_file_from_http.return_value = True, "/root/package"
215         mock_vals = {
216             "/api/catalog/v1/csars/2":
217                 [0, json.JSONEncoder().encode({
218                     "onBoardState": "onBoardFailed", "processState": "deleteFailed"}), '200'],
219             "/api/catalog/v1/servicetemplates/queryingrawdata":
220                 [0, json.JSONEncoder().encode(self.vnfd_raw_data), '200'],
221             "/api/catalog/v1/csars/2/files?relativePath=/SoftwareImages/image-lb":
222                 [0, json.JSONEncoder().encode({
223                     "csar_file_info": [{"downloadUri": "8"}, {"localPath": "9"}]}), '200'],
224             "/cloud-infrastructure/cloud-regions?depth=all":
225                 [0, json.JSONEncoder().encode(vims_info), '200'],
226             "/api/catalog/v1/csars/2?onBoardState=onBoarded": [0, '{}', 200],
227             "/api/catalog/v1/csars/2?operationalState=Enabled": [0, '{}', 200],
228             "/api/catalog/v1/csars/2?processState=normal": [0, '{}', 200]}
229         mock_create_image.return_value = [0, {"id": "30", "name": "jerry", "res_type": 0}]
230         mock__init__.return_value = None
231         mock_get_image.return_value = [0, {"id": "30", "name": "jerry", "size": "60", "status": "active"}]
232
233         def side_effect(*args):
234             return mock_vals[args[4]]
235         mock_call_req.side_effect = side_effect
236
237         NfOnBoardingThread(csar_id="2", vim_ids=["1"], lab_vim_id="", job_id="4").run()
238         self.assert_job_result("4", 100, "CSAR(2) onBoarding successfully.")
239
240     # @mock.patch.object(restcall, 'call_req')
241     # @mock.patch.object(fileutil, 'download_file_from_http')
242     # @mock.patch.object(VimAdaptor, '__init__')
243     # @mock.patch.object(VimAdaptor, 'create_image')
244     # @mock.patch.object(VimAdaptor, 'get_image')
245     # def test_nf_on_boarding_when_timeout(self, mock_get_image, mock_create_image,
246     #                                      mock__init__, mock_download_file_from_http, mock_call_req):
247     #     nf_package.MAX_RETRY_TIMES = 2
248     #     nf_package.SLEEP_INTERVAL_SECONDS = 1
249     #     mock_download_file_from_http.return_value = True, "/root/package"
250     #     mock_vals = {
251     #         "/api/catalog/v1/csars/3":
252     #         [0, json.JSONEncoder().encode({"onBoardState": "onBoardFailed",
253     #                                        "processState": "deleteFailed"}), '200'],
254     #         "/api/catalog/v1/servicetemplates/queryingrawdata":
255     #             [0, json.JSONEncoder().encode(self.vnfd_raw_data), '200'],
256     #         "/api/catalog/v1/csars/3/files?relativePath=/SoftwareImages/image-lb":
257     #             [0, json.JSONEncoder().encode({
258     #                 "csar_file_info": [{"downloadUri": "8"}, {"localPath": "9"}]}), '200'],
259     #         "/api/catalog/v1/csars/3?processState=onBoardFailed": [0, '{}', 200],
260     #         "/cloud-infrastructure/cloud-regions?depth=all":
261     #             [0, json.JSONEncoder().encode(vims_info), 200]}
262     #     mock_create_image.return_value = [0, {"id": "30", "name": "jerry", "res_type": 0}]
263     #     mock__init__.return_value = None
264     #     mock_get_image.return_value = [0, {"id": "30", "name": "jerry", "size": "60", "status": "0"}]
265     #
266     #     def side_effect(*args):
267     #         return mock_vals[args[4]]
268     #
269     #     mock_call_req.side_effect = side_effect
270     #     NfOnBoardingThread(csar_id="3", vim_ids=["1"], lab_vim_id="", job_id="6").run()
271     #     self.assert_job_result("6", 255, "Failed to create image:timeout(2 seconds.)")
272
273     # @mock.patch.object(restcall, 'call_req')
274     # @mock.patch.object(fileutil, 'download_file_from_http')
275     # @mock.patch.object(VimAdaptor, '__init__')
276     # @mock.patch.object(VimAdaptor, 'create_image')
277     # def test_nf_on_boarding_when_failed_to_create_image(self, mock_create_image,
278     #                                                     mock__init__, mock_download_file_from_http, mock_call_req):
279     #     mock_download_file_from_http.return_value = True, "/root/package"
280     #     mock_vals = {
281     #         "/api/catalog/v1/csars/5":
282     #             [0, json.JSONEncoder().encode({
283     #                 "onBoardState": "onBoardFailed", "processState": "deleteFailed"}), '200'],
284     #         "/api/catalog/v1/servicetemplates/queryingrawdata":
285     #             [0, json.JSONEncoder().encode(self.vnfd_raw_data), '200'],
286     #         "/api/catalog/v1/csars/5/files?relativePath=/SoftwareImages/image-lb":
287     #             [0, json.JSONEncoder().encode({
288     #                 "csar_file_info": [{"downloadUri": "8"}, {"localPath": "9"}]}), '200'],
289     #         "/api/catalog/v1/csars/5?processState=onBoardFailed": [0, '{}', 200],
290     #         "/cloud-infrastructure/cloud-regions?depth=all":
291     #             [0, json.JSONEncoder().encode(vims_info), '200']}
292     #     mock_create_image.return_value = [1, 'Unsupported image format.']
293     #     mock__init__.return_value = None
294     #
295     #     def side_effect(*args):
296     #         return mock_vals[args[4]]
297     #     mock_call_req.side_effect = side_effect
298     #     NfOnBoardingThread(csar_id="5", vim_ids=["1"], lab_vim_id="", job_id="8").run()
299     #     self.assert_job_result("8", 255, "Failed to create image:Unsupported image format.")
300
301     #########################################################################
302     @mock.patch.object(restcall, 'call_req')
303     def test_get_csar_successfully(self, mock_call_req):
304         mock_call_req.return_value = [0, json.JSONEncoder().encode({
305             "name": "1", "provider": "2", "version": "3", "operationalState": "4",
306             "usageState": "5", "onBoardState": "6", "processState": "7",
307             "deletionPending": "8", "downloadUri": "9", "createTime": "10",
308             "modifyTime": "11", "format": "12", "size": "13"
309         }), '200']
310         NfPackageModel(uuid="1", vnfdid="001", vendor="vendor",
311                        vnfdversion="1.2.0", vnfversion="1.1.0", nfpackageid="13").save()
312         VnfPackageFileModel(id="1", filename="filename", imageid="00001",
313                             vimid="1", vimuser="001", tenant="12", status="1", vnfpid="13").save()
314         NfInstModel(nfinstid="1", mnfinstid="001", nf_name="name", package_id="13").save()
315         resp = self.client.get("/api/nslcm/v0/vnfpackage/13")
316         self.assertEqual(resp.status_code, status.HTTP_200_OK)
317         expect_data = {
318             "csarId": '13',
319             "packageInfo": {
320                 "vnfdId": "001",
321                 "vnfdProvider": "vendor",
322                 "vnfdVersion": "1.2.0",
323                 "vnfVersion": "1.1.0",
324                 "name": "1",
325                 "provider": "2",
326                 "version": "3",
327                 "operationalState": "4",
328                 "usageState": "5",
329                 "onBoardState": "6",
330                 "processState": "7",
331                 "deletionPending": "8",
332                 "downloadUri": "9",
333                 "createTime": "10",
334                 "modifyTime": "11",
335                 "format": "12",
336                 "size": "13"},
337             "imageInfo": [{
338                 "index": "0",
339                 "fileName": "filename",
340                 "imageId": "00001",
341                 "vimId": "1",
342                 "vimUser": "001",
343                 "tenant": "12",
344                 "status": "1"}],
345             "vnfInstanceInfo": [{
346                 "vnfInstanceId": "1",
347                 "vnfInstanceName": "name"}]}
348         self.assertEqual(expect_data, resp.data)
349
350     #########################################################################
351     @mock.patch.object(restcall, 'call_req')
352     def test_delete_pending_csar_when_successfully(self, mock_call_req):
353         mock_call_req.return_value = [0, json.JSONEncoder().encode({
354             "processState": "deleting"}), "200"]
355         NfPkgDeletePendingThread(csar_id="1", job_id='2').run()
356         self.assert_job_result("2", 100, "Delete pending CSAR(1) successfully.")
357
358     @mock.patch.object(restcall, 'call_req')
359     def test_delete_pending_csar_when_deleting(self, mock_call_req):
360         NfPackageModel(uuid="01", nfpackageid="1").save()
361         mock_call_req.return_value = [0, json.JSONEncoder().encode({
362             "processState": "deleting"}), "200"]
363         NfPkgDeletePendingThread(csar_id="1", job_id='2').run()
364         self.assert_job_result("2", 100, "CSAR(1) is deleting now.")
365
366     @mock.patch.object(restcall, 'call_req')
367     def test_delete_pending_csar_when_not_deletion_pending(self, mock_call_req):
368         NfPackageModel(uuid="01", nfpackageid="1").save()
369         mock_call_req.return_value = [0, json.JSONEncoder().encode({
370             "deletionPending": "false"}), "200"]
371         NfPkgDeletePendingThread(csar_id="1", job_id='2').run()
372         self.assert_job_result("2", 100, "CSAR(1) need not to be deleted.")
373
374     @mock.patch.object(restcall, 'call_req')
375     def test_delete_pending_csar_when_in_using(self, mock_call_req):
376         mock_call_req.return_value = [0, json.JSONEncoder().encode({
377             "processState": "normal"}), "200"]
378         NfPackageModel(uuid="01", nfpackageid="1").save()
379         NfInstModel(nfinstid="01", package_id="1").save()
380         NfPkgDeletePendingThread(csar_id="1", job_id='2').run()
381         self.assert_job_result("2", 100, "CSAR(1) is in using, cannot be deleted.")
382
383     @mock.patch.object(VimAdaptor, '__init__')
384     @mock.patch.object(VimAdaptor, 'delete_image')
385     @mock.patch.object(restcall, 'call_req')
386     def test_delete_csarr_when_exception(self, mock_call_req, mock_delete_image, mock_init_):
387         mock_vals = {
388             ("/api/catalog/v1/csars/1", "DELETE"):
389                 [1, "{}", "400"],
390             ("/api/catalog/v1/csars/1?processState=deleting", "PUT"):
391                 [0, "{}", "200"],
392             ("/api/catalog/v1/csars/1?processState=deleteFailed", "PUT"):
393                 [0, "{}", "200"],
394             ("/api/catalog/v1/csars/1", "GET"):
395                 [0, json.JSONEncoder().encode({"processState": "normal"}), "200"],
396             ("/cloud-infrastructure/cloud-regions?depth=all", "GET"):
397                 [0, json.JSONEncoder().encode(vims_info), "200"]}
398         mock_delete_image.return_value = [0, "", '200']
399
400         def side_effect(*args):
401             return mock_vals[(args[4], args[5])]
402
403         mock_call_req.side_effect = side_effect
404         mock_init_.return_value = None
405         VnfPackageFileModel(vnfpid="1", imageid="001", vimid="002").save()
406         NfPackageModel(uuid="01", nfpackageid="1").save()
407         NfPkgDeletePendingThread(csar_id="1", job_id='2').run()
408         self.assert_job_result("2", 255, "Failed to delete CSAR(1) from catalog.")
409
410     @mock.patch.object(VimAdaptor, '__init__')
411     @mock.patch.object(VimAdaptor, 'delete_image')
412     @mock.patch.object(restcall, 'call_req')
413     def test_delete_csar_when_successfully(self, mock_call_req, mock_delete_image, mock_init_):
414         mock_vals = {
415             ("/api/catalog/v1/csars/1", "DELETE"):
416                 [0, json.JSONEncoder().encode({"successfully": "successfully"}), "200"],
417             ("/api/catalog/v1/csars/1?processState=deleting", "PUT"):
418                 [0, json.JSONEncoder().encode({"successfully": "successfully"}), "200"],
419             ("/api/catalog/v1/csars/1?processState=deleteFailed", "PUT"):
420                 [0, json.JSONEncoder().encode({"successfully": "successfully"}), "200"],
421             ("/api/catalog/v1/csars/1", "GET"):
422                 [0, json.JSONEncoder().encode({"notProcessState": "notProcessState"}), "200"],
423             ("/cloud-infrastructure/cloud-regions?depth=all", "GET"):
424                 [0, json.JSONEncoder().encode(vims_info), "200"]}
425         mock_delete_image.return_value = [0, json.JSONEncoder().encode({"test": "test"}), '200']
426
427         def side_effect(*args):
428             return mock_vals[(args[4], args[5])]
429
430         mock_call_req.side_effect = side_effect
431         mock_init_.return_value = None
432         VnfPackageFileModel(vnfpid="1", imageid="001", vimid="002").save()
433         NfPackageModel(uuid="01", nfpackageid="1").save()
434         NfPkgDeletePendingThread(csar_id="1", job_id='2').run()
435         self.assert_job_result("2", 100, "Delete CSAR(1) successfully.")
436
437     #########################################################################
438     @mock.patch.object(restcall, 'call_req')
439     def test_delete_nf_pkg_when_deleting(self, mock_call_req):
440         mock_call_req.return_value = [0, json.JSONEncoder().encode({"processState": "deleting"}), '200']
441         NfPkgDeleteThread(csar_id="1", job_id="2").run()
442         self.assert_job_result("2", 100, "CSAR(1) is deleting now.")
443
444     def test_get_nf_csars_normal(self):
445         NfPackageModel(uuid="01", nfpackageid="1", vnfdid="2").save()
446         resp = self.client.get("/api/nslcm/v0/vnfpackage")
447         self.assertEqual(resp.status_code, status.HTTP_200_OK)
448         self.assertEqual(1, len(resp.data["csars"]))
449         self.assertEqual("1", resp.data["csars"][0]["csarId"])
450         self.assertEqual("2", resp.data["csars"][0]["vnfdId"])
451
452
453 vims_info = {
454     "cloud-region": [
455         {
456             "cloud-owner": "example-cloud-owner-val-60268",
457             "cloud-region-id": "example-cloud-region-id-val-77704",
458             "cloud-type": "example-cloud-type-val-20689",
459             "owner-defined-type": "example-owner-defined-type-val-24237",
460             "cloud-region-version": "example-cloud-region-version-val-95948",
461             "identity-url": "example-identity-url-val-98336",
462             "cloud-zone": "example-cloud-zone-val-67202",
463             "complex-name": "example-complex-name-val-86264",
464             "sriov-automation": True,
465             "cloud-extra-info": "example-cloud-extra-info-val-44735",
466             "cloud-epa-caps": "example-cloud-epa-caps-val-67134",
467             "resource-version": "example-resource-version-val-47608",
468             "volume-groups": {
469                 "volume-group": [
470                     {
471                         "volume-group-id": "example-volume-group-id-val-79555",
472                         "volume-group-name": "example-volume-group-name-val-21888",
473                         "heat-stack-id": "example-heat-stack-id-val-56926",
474                         "vnf-type": "example-vnf-type-val-47890",
475                         "orchestration-status": "example-orchestration-status-val-34971",
476                         "model-customization-id": "example-model-customization-id-val-7851",
477                         "vf-module-model-customization-id": "example-vf-module-model-customization-id-val-35365",
478                         "resource-version": "example-resource-version-val-66022"
479                     }
480                 ]
481             },
482             "tenants": {
483                 "tenant": [
484                     {
485                         "tenant-id": "example-tenant-id-val-30151",
486                         "tenant-name": "example-tenant-name-val-12231",
487                         "tenant-context": "example-tenant-context-val-80991",
488                         "resource-version": "example-resource-version-val-5033",
489                         "vservers": {
490                             "vserver": [
491                                 {
492                                     "vserver-id": "example-vserver-id-val-70581",
493                                     "vserver-name": "example-vserver-name-val-63390",
494                                     "vserver-name2": "example-vserver-name2-val-70924",
495                                     "prov-status": "example-prov-status-val-24088",
496                                     "vserver-selflink": "example-vserver-selflink-val-17737",
497                                     "in-maint": True,
498                                     "is-closed-loop-disabled": True,
499                                     "resource-version": "example-resource-version-val-46166",
500                                     "volumes": {
501                                         "volume": [
502                                             {
503                                                 "volume-id": "example-volume-id-val-9740",
504                                                 "volume-selflink": "example-volume-selflink-val-8411",
505                                                 "resource-version": "example-resource-version-val-41965"
506                                             }
507                                         ]
508                                     },
509                                     "l-interfaces": {
510                                         "l-interface": [
511                                             {
512                                                 "interface-name": "example-interface-name-val-67663",
513                                                 "interface-role": "example-interface-role-val-27132",
514                                                 "v6-wan-link-ip": "example-v6-wan-link-ip-val-85445",
515                                                 "selflink": "example-selflink-val-83317",
516                                                 "interface-id": "example-interface-id-val-98716",
517                                                 "macaddr": "example-macaddr-val-18235",
518                                                 "network-name": "example-network-name-val-45040",
519                                                 "management-option": "example-management-option-val-65761",
520                                                 "interface-description": "example-interface-description-val-32615",
521                                                 "is-port-mirrored": True,
522                                                 "resource-version": "example-resource-version-val-10801",
523                                                 "in-maint": True,
524                                                 "prov-status": "example-prov-status-val-5726",
525                                                 "is-ip-unnumbered": True,
526                                                 "allowed-address-pairs": "example-allowed-address-pairs-val-52679",
527                                                 "vlans": {
528                                                     "vlan": [
529                                                         {
530                                                             "vlan-interface": "example-vlan-interface-val-61591",
531                                                             "vlan-id-inner": 53472228,
532                                                             "vlan-id-outer": 93087267,
533                                                             "resource-version": "example-resource-version-val-52900",
534                                                             "speed-value": "example-speed-value-val-69335",
535                                                             "speed-units": "example-speed-units-val-72089",
536                                                             "vlan-description": "example-vlan-description-val-96604",
537                                                             "backdoor-connection": "example-backdoor-connection-val-42299",
538                                                             "vpn-key": "example-vpn-key-val-50517",
539                                                             "orchestration-status": "example-orchestration-status-val-66570",
540                                                             "in-maint": True,
541                                                             "prov-status": "example-prov-status-val-46495",
542                                                             "is-ip-unnumbered": True,
543                                                             "l3-interface-ipv4-address-list": [
544                                                                 {
545                                                                     "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-32173",
546                                                                     "l3-interface-ipv4-prefix-length": 29740951,
547                                                                     "vlan-id-inner": 93873764,
548                                                                     "vlan-id-outer": 82615508,
549                                                                     "is-floating": True,
550                                                                     "resource-version": "example-resource-version-val-75216",
551                                                                     "neutron-network-id": "example-neutron-network-id-val-77878",
552                                                                     "neutron-subnet-id": "example-neutron-subnet-id-val-79062"
553                                                                 }
554                                                             ],
555                                                             "l3-interface-ipv6-address-list": [
556                                                                 {
557                                                                     "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-88548",
558                                                                     "l3-interface-ipv6-prefix-length": 89047373,
559                                                                     "vlan-id-inner": 95671681,
560                                                                     "vlan-id-outer": 88533796,
561                                                                     "is-floating": True,
562                                                                     "resource-version": "example-resource-version-val-40990",
563                                                                     "neutron-network-id": "example-neutron-network-id-val-81951",
564                                                                     "neutron-subnet-id": "example-neutron-subnet-id-val-4218"
565                                                                 }
566                                                             ]
567                                                         }
568                                                     ]
569                                                 },
570                                                 "sriov-vfs": {
571                                                     "sriov-vf": [
572                                                         {
573                                                             "pci-id": "example-pci-id-val-12933",
574                                                             "vf-vlan-filter": "example-vf-vlan-filter-val-90275",
575                                                             "vf-mac-filter": "example-vf-mac-filter-val-13509",
576                                                             "vf-vlan-strip": True,
577                                                             "vf-vlan-anti-spoof-check": True,
578                                                             "vf-mac-anti-spoof-check": True,
579                                                             "vf-mirrors": "example-vf-mirrors-val-59746",
580                                                             "vf-broadcast-allow": True,
581                                                             "vf-unknown-multicast-allow": True,
582                                                             "vf-unknown-unicast-allow": True,
583                                                             "vf-insert-stag": True,
584                                                             "vf-link-status": "example-vf-link-status-val-37662",
585                                                             "resource-version": "example-resource-version-val-86970",
586                                                             "neutron-network-id": "example-neutron-network-id-val-71727"
587                                                         }
588                                                     ]
589                                                 },
590                                                 "l-interfaces": {
591                                                     "l-interface": [
592                                                         {
593                                                             "interface-name": "example-interface-name-val-91632",
594                                                             "interface-role": "example-interface-role-val-59119",
595                                                             "v6-wan-link-ip": "example-v6-wan-link-ip-val-21039",
596                                                             "selflink": "example-selflink-val-16277",
597                                                             "interface-id": "example-interface-id-val-77457",
598                                                             "macaddr": "example-macaddr-val-49026",
599                                                             "network-name": "example-network-name-val-3483",
600                                                             "management-option": "example-management-option-val-16429",
601                                                             "interface-description": "example-interface-description-val-50889",
602                                                             "is-port-mirrored": True,
603                                                             "resource-version": "example-resource-version-val-30308",
604                                                             "in-maint": True,
605                                                             "prov-status": "example-prov-status-val-69406",
606                                                             "is-ip-unnumbered": True,
607                                                             "allowed-address-pairs": "example-allowed-address-pairs-val-49123"
608                                                         }
609                                                     ]
610                                                 },
611                                                 "l3-interface-ipv4-address-list": [
612                                                     {
613                                                         "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-63922",
614                                                         "l3-interface-ipv4-prefix-length": 13823411,
615                                                         "vlan-id-inner": 14316230,
616                                                         "vlan-id-outer": 66559625,
617                                                         "is-floating": True,
618                                                         "resource-version": "example-resource-version-val-30766",
619                                                         "neutron-network-id": "example-neutron-network-id-val-46636",
620                                                         "neutron-subnet-id": "example-neutron-subnet-id-val-96658"
621                                                     }
622                                                 ],
623                                                 "l3-interface-ipv6-address-list": [
624                                                     {
625                                                         "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-21246",
626                                                         "l3-interface-ipv6-prefix-length": 20226253,
627                                                         "vlan-id-inner": 68200128,
628                                                         "vlan-id-outer": 18442586,
629                                                         "is-floating": True,
630                                                         "resource-version": "example-resource-version-val-24602",
631                                                         "neutron-network-id": "example-neutron-network-id-val-49811",
632                                                         "neutron-subnet-id": "example-neutron-subnet-id-val-67505"
633                                                     }
634                                                 ]
635                                             }
636                                         ]
637                                     }
638                                 }
639                             ]
640                         }
641                     }
642                 ]
643             },
644             "flavors": {
645                 "flavor": [
646                     {
647                         "flavor-id": "example-flavor-id-val-15058",
648                         "flavor-name": "example-flavor-name-val-69485",
649                         "flavor-vcpus": 92601,
650                         "flavor-ram": 31468,
651                         "flavor-disk": 58744,
652                         "flavor-ephemeral": 84771,
653                         "flavor-swap": "example-flavor-swap-val-66481",
654                         "flavor-is-public": True,
655                         "flavor-selflink": "example-flavor-selflink-val-48912",
656                         "flavor-disabled": True,
657                         "resource-version": "example-resource-version-val-55131"
658                     }
659                 ]
660             },
661             "group-assignments": {
662                 "group-assignment": [
663                     {
664                         "group-id": "example-group-id-val-79234",
665                         "group-type": "example-group-type-val-29164",
666                         "group-name": "example-group-name-val-57605",
667                         "group-description": "example-group-description-val-52975",
668                         "resource-version": "example-resource-version-val-10280"
669                     }
670                 ]
671             },
672             "snapshots": {
673                 "snapshot": [
674                     {
675                         "snapshot-id": "example-snapshot-id-val-60630",
676                         "snapshot-name": "example-snapshot-name-val-90351",
677                         "snapshot-architecture": "example-snapshot-architecture-val-3225",
678                         "snapshot-os-distro": "example-snapshot-os-distro-val-31399",
679                         "snapshot-os-version": "example-snapshot-os-version-val-16981",
680                         "application": "example-application-val-34584",
681                         "application-vendor": "example-application-vendor-val-97854",
682                         "application-version": "example-application-version-val-20705",
683                         "snapshot-selflink": "example-snapshot-selflink-val-84731",
684                         "prev-snapshot-id": "example-prev-snapshot-id-val-77339",
685                         "resource-version": "example-resource-version-val-19220"
686                     }
687                 ]
688             },
689             "images": {
690                 "image": [
691                     {
692                         "image-id": "example-image-id-val-34721",
693                         "image-name": "example-image-name-val-64106",
694                         "image-architecture": "example-image-architecture-val-8247",
695                         "image-os-distro": "example-image-os-distro-val-98534",
696                         "image-os-version": "example-image-os-version-val-87444",
697                         "application": "example-application-val-30758",
698                         "application-vendor": "example-application-vendor-val-7048",
699                         "application-version": "example-application-version-val-79678",
700                         "image-selflink": "example-image-selflink-val-72836",
701                         "resource-version": "example-resource-version-val-79432",
702                         "metadata": {
703                             "metadatum": [
704                                 {
705                                     "metaname": "example-metaname-val-75188",
706                                     "metaval": "example-metaval-val-64947",
707                                     "resource-version": "example-resource-version-val-59427"
708                                 }
709                             ]
710                         }
711                     }
712                 ]
713             },
714             "dvs-switches": {
715                 "dvs-switch": [
716                     {
717                         "switch-name": "example-switch-name-val-21335",
718                         "vcenter-url": "example-vcenter-url-val-74348",
719                         "resource-version": "example-resource-version-val-51253"
720                     }
721                 ]
722             },
723             "oam-networks": {
724                 "oam-network": [
725                     {
726                         "network-uuid": "example-network-uuid-val-65686",
727                         "network-name": "example-network-name-val-94383",
728                         "cvlan-tag": 31041170,
729                         "ipv4-oam-gateway-address": "example-ipv4-oam-gateway-address-val-15815",
730                         "ipv4-oam-gateway-address-prefix-length": 65477,
731                         "resource-version": "example-resource-version-val-21712"
732                     }
733                 ]
734             },
735             "availability-zones": {
736                 "availability-zone": [
737                     {
738                         "availability-zone-name": "example-availability-zone-name-val-14569",
739                         "hypervisor-type": "example-hypervisor-type-val-70481",
740                         "operational-status": "example-operational-status-val-13589",
741                         "resource-version": "example-resource-version-val-78031"
742                     }
743                 ]
744             },
745             "esr-system-info-list": {
746                 "esr-system-info": [
747                     {
748                         "esr-system-info-id": "example-esr-system-info-id-val-58799",
749                         "system-name": "example-system-name-val-78629",
750                         "type": "example-type-val-4146",
751                         "vendor": "example-vendor-val-11916",
752                         "version": "example-version-val-60284",
753                         "service-url": "example-service-url-val-85858",
754                         "user-name": "example-user-name-val-23297",
755                         "password": "example-password-val-33729",
756                         "system-type": "example-system-type-val-54309",
757                         "protocal": "example-protocal-val-86585",
758                         "ssl-cacert": "example-ssl-cacert-val-95811",
759                         "ssl-insecure": True,
760                         "ip-address": "example-ip-address-val-62987",
761                         "port": "example-port-val-83650",
762                         "cloud-domain": "example-cloud-domain-val-9841",
763                         "default-tenant": "example-default-tenant-val-52776",
764                         "resource-version": "example-resource-version-val-61961"
765                     }
766                 ]
767             }
768         }
769     ]
770 }