wrapanapi 4.0.3__tar.gz → 4.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/PKG-INFO +1 -1
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/msazure.py +29 -21
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/.gitignore +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/LICENSE +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/README.rst +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/pyproject.toml +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/__init__.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/clients/__init__.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/clients/rest_client.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/clients/websocket_client.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/const.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/entities/__init__.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/entities/base.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/entities/instance.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/entities/network.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/entities/physical_container.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/entities/server.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/entities/stack.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/entities/template.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/entities/vm.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/entities/volume.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/exceptions.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/__init__.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/base.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/container/__init__.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/container/podman.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/container/rhopenshift.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/ec2.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/google.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/hawkular.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/lenovo.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/nuage.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/openstack.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/openstack_infra.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/redfish.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/rhevm.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/scvmm.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/vcloud.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/systems/virtualcenter.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/utils/__init__.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/utils/json_utils.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/utils/logger_mixin.py +0 -0
- {wrapanapi-4.0.3 → wrapanapi-4.0.4}/wrapanapi/utils/random.py +0 -0
|
@@ -241,7 +241,9 @@ class AzureInstance(Instance):
|
|
|
241
241
|
|
|
242
242
|
def delete(self):
|
|
243
243
|
self.logger.info("deleting vm '%s'", self.name)
|
|
244
|
-
operation = self._api.
|
|
244
|
+
operation = self._api.begin_delete(
|
|
245
|
+
resource_group_name=self._resource_group, vm_name=self.name
|
|
246
|
+
)
|
|
245
247
|
return self._wait_on_operation(operation)
|
|
246
248
|
|
|
247
249
|
def cleanup(self):
|
|
@@ -265,7 +267,9 @@ class AzureInstance(Instance):
|
|
|
265
267
|
|
|
266
268
|
def start(self):
|
|
267
269
|
self.logger.info("starting vm '%s'", self.name)
|
|
268
|
-
operation = self._api.
|
|
270
|
+
operation = self._api.begin_start(
|
|
271
|
+
resource_group_name=self._resource_group, vm_name=self.name
|
|
272
|
+
)
|
|
269
273
|
if self._wait_on_operation(operation):
|
|
270
274
|
self.wait_for_state(VmState.RUNNING)
|
|
271
275
|
return True
|
|
@@ -273,7 +277,7 @@ class AzureInstance(Instance):
|
|
|
273
277
|
|
|
274
278
|
def stop(self):
|
|
275
279
|
self.logger.info("stopping vm '%s'", self.name)
|
|
276
|
-
operation = self._api.
|
|
280
|
+
operation = self._api.begin_deallocate(
|
|
277
281
|
resource_group_name=self._resource_group, vm_name=self.name
|
|
278
282
|
)
|
|
279
283
|
if self._wait_on_operation(operation):
|
|
@@ -283,7 +287,9 @@ class AzureInstance(Instance):
|
|
|
283
287
|
|
|
284
288
|
def restart(self):
|
|
285
289
|
self.logger.info("restarting vm '%s'", self.name)
|
|
286
|
-
operation = self._api.
|
|
290
|
+
operation = self._api.begin_restart(
|
|
291
|
+
resource_group_name=self._resource_group, vm_name=self.name
|
|
292
|
+
)
|
|
287
293
|
if self._wait_on_operation(operation):
|
|
288
294
|
self.wait_for_state(VmState.RUNNING)
|
|
289
295
|
return True
|
|
@@ -291,7 +297,9 @@ class AzureInstance(Instance):
|
|
|
291
297
|
|
|
292
298
|
def suspend(self):
|
|
293
299
|
self.logger.info("suspending vm '%s'", self.name)
|
|
294
|
-
operation = self._api.
|
|
300
|
+
operation = self._api.begin_power_off(
|
|
301
|
+
resource_group_name=self._resource_group, vm_name=self.name
|
|
302
|
+
)
|
|
295
303
|
if self._wait_on_operation(operation):
|
|
296
304
|
self.wait_for_state(VmState.SUSPENDED)
|
|
297
305
|
return True
|
|
@@ -314,7 +322,7 @@ class AzureInstance(Instance):
|
|
|
314
322
|
)
|
|
315
323
|
self._wait_on_operation(operation)
|
|
316
324
|
self.logger.info("Capturing VM '%s'", self.name)
|
|
317
|
-
operation = self._api.
|
|
325
|
+
operation = self._api.begin_capture(
|
|
318
326
|
resource_group_name=self._resource_group,
|
|
319
327
|
vm_name=self.name,
|
|
320
328
|
parameters=params,
|
|
@@ -417,7 +425,7 @@ class AzureBlobImage(Template):
|
|
|
417
425
|
"location": location,
|
|
418
426
|
"public_ip_allocation_method": "Dynamic",
|
|
419
427
|
}
|
|
420
|
-
public_ip = self.system.network_client.public_ip_addresses.
|
|
428
|
+
public_ip = self.system.network_client.public_ip_addresses.begin_create_or_update(
|
|
421
429
|
resource_group_name=resource_group,
|
|
422
430
|
public_ip_address_name=vm_name,
|
|
423
431
|
parameters=public_ip_params,
|
|
@@ -430,7 +438,7 @@ class AzureBlobImage(Template):
|
|
|
430
438
|
"location": location,
|
|
431
439
|
"address_space": {"address_prefixes": [address_space]},
|
|
432
440
|
}
|
|
433
|
-
virtual_networks.
|
|
441
|
+
virtual_networks.begin_create_or_update(
|
|
434
442
|
resource_group_name=resource_group,
|
|
435
443
|
virtual_network_name=vnet_name,
|
|
436
444
|
parameters=vnet_params,
|
|
@@ -440,7 +448,7 @@ class AzureBlobImage(Template):
|
|
|
440
448
|
subnet_name = "default"
|
|
441
449
|
subnets = self.system.network_client.subnets
|
|
442
450
|
if subnet_name not in [v.name for v in subnets.list(resource_group, vnet_name)]:
|
|
443
|
-
vsubnet = subnets.
|
|
451
|
+
vsubnet = subnets.begin_create_or_update(
|
|
444
452
|
resource_group_name=resource_group,
|
|
445
453
|
virtual_network_name=vnet_name,
|
|
446
454
|
subnet_name="default",
|
|
@@ -466,7 +474,7 @@ class AzureBlobImage(Template):
|
|
|
466
474
|
}
|
|
467
475
|
|
|
468
476
|
def _create_or_update_nic():
|
|
469
|
-
return self.system.network_client.network_interfaces.
|
|
477
|
+
return self.system.network_client.network_interfaces.begin_create_or_update(
|
|
470
478
|
resource_group_name=resource_group,
|
|
471
479
|
network_interface_name=vm_name,
|
|
472
480
|
parameters=nic_params,
|
|
@@ -504,7 +512,7 @@ class AzureBlobImage(Template):
|
|
|
504
512
|
},
|
|
505
513
|
"network_profile": {"network_interfaces": [{"id": nic.id}]},
|
|
506
514
|
}
|
|
507
|
-
vm = self.system.compute_client.virtual_machines.
|
|
515
|
+
vm = self.system.compute_client.virtual_machines.begin_create_or_update(
|
|
508
516
|
resource_group_name=resource_group,
|
|
509
517
|
vm_name=vm_name,
|
|
510
518
|
parameters=vm_parameters,
|
|
@@ -888,7 +896,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
888
896
|
|
|
889
897
|
resources = self._list_resources(resource_group, hours_old)
|
|
890
898
|
if resources:
|
|
891
|
-
self.resource_client.resource_groups.
|
|
899
|
+
self.resource_client.resource_groups.begin_delete(resource_group)
|
|
892
900
|
|
|
893
901
|
def remove_nics_by_search(self, nic_template=None, resource_group=None):
|
|
894
902
|
"""
|
|
@@ -904,7 +912,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
904
912
|
|
|
905
913
|
for nic in nic_list:
|
|
906
914
|
try:
|
|
907
|
-
operation = self.network_client.network_interfaces.
|
|
915
|
+
operation = self.network_client.network_interfaces.begin_delete(
|
|
908
916
|
resource_group_name=resource_group or self.resource_group,
|
|
909
917
|
network_interface_name=nic,
|
|
910
918
|
)
|
|
@@ -932,7 +940,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
932
940
|
)
|
|
933
941
|
|
|
934
942
|
for pip in pip_list:
|
|
935
|
-
operation = self.network_client.public_ip_addresses.
|
|
943
|
+
operation = self.network_client.public_ip_addresses.begin_delete(
|
|
936
944
|
resource_group_name=resource_group or self.resource_group,
|
|
937
945
|
public_ip_address_name=pip,
|
|
938
946
|
)
|
|
@@ -965,7 +973,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
965
973
|
self.logger.info("Attempting to find all the unattached disks and delete.")
|
|
966
974
|
discs = self.list_free_discs(resource_group=self.resource_group)
|
|
967
975
|
for disc_name in discs:
|
|
968
|
-
operation = self.compute_client.disks.
|
|
976
|
+
operation = self.compute_client.disks.begin_delete(
|
|
969
977
|
resource_group_name=resource_group or self.resource_group,
|
|
970
978
|
disk_name=disc_name,
|
|
971
979
|
)
|
|
@@ -980,7 +988,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
980
988
|
security_groups = self.network_client.network_security_groups
|
|
981
989
|
self.logger.info("Attempting to Create New Azure Security Group %s", group_name)
|
|
982
990
|
nsg = NetworkSecurityGroup(location=self.region)
|
|
983
|
-
operation = security_groups.
|
|
991
|
+
operation = security_groups.begin_create_or_update(
|
|
984
992
|
resource_group_name=resource_group or self.resource_group,
|
|
985
993
|
network_security_group_name=group_name,
|
|
986
994
|
parameters=nsg,
|
|
@@ -997,7 +1005,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
997
1005
|
"""
|
|
998
1006
|
self.logger.info("Attempting to Remove Azure Security Group '%s'", group_name)
|
|
999
1007
|
security_groups = self.network_client.network_security_groups
|
|
1000
|
-
operation = security_groups.
|
|
1008
|
+
operation = security_groups.begin_delete(
|
|
1001
1009
|
resource_group_name=resource_group or self.resource_group,
|
|
1002
1010
|
network_security_group_name=group_name,
|
|
1003
1011
|
)
|
|
@@ -1031,7 +1039,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
1031
1039
|
)
|
|
1032
1040
|
]
|
|
1033
1041
|
nsg = self.network_client.network_security_groups
|
|
1034
|
-
operation = nsg.
|
|
1042
|
+
operation = nsg.begin_create_or_update(resource_group, secgroup_name, parameters)
|
|
1035
1043
|
operation.wait()
|
|
1036
1044
|
self.logger.info("Network Security Group Rule is created.")
|
|
1037
1045
|
return operation.status()
|
|
@@ -1135,7 +1143,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
1135
1143
|
for disk in self.compute_client.disks.list_by_resource_group(resource_group):
|
|
1136
1144
|
if disk.name.startswith("test") and disk.managed_by is None:
|
|
1137
1145
|
self.logger.info("Removing disk '%s'", disk.name)
|
|
1138
|
-
self.compute_client.disks.
|
|
1146
|
+
self.compute_client.disks.begin_delete(
|
|
1139
1147
|
resource_group_name=resource_group, disk_name=disk.name
|
|
1140
1148
|
)
|
|
1141
1149
|
removed_disks.append({"resource_group": resource_group, "disk": disk.name})
|
|
@@ -1269,7 +1277,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
1269
1277
|
"""
|
|
1270
1278
|
self.logger.info("Removes a Deployment Stack resource created with Orchestration")
|
|
1271
1279
|
deps = self.resource_client.deployments
|
|
1272
|
-
operation = deps.
|
|
1280
|
+
operation = deps.begin_delete(
|
|
1273
1281
|
resource_group_name=resource_group or self.resource_group,
|
|
1274
1282
|
deployment_name=stack_name,
|
|
1275
1283
|
)
|
|
@@ -1306,7 +1314,7 @@ class AzureSystem(System, VmMixin, TemplateMixin):
|
|
|
1306
1314
|
resource_group = resource_group or self.resource_group
|
|
1307
1315
|
for image in image_list:
|
|
1308
1316
|
self.logger.info("Deleting '%s' from '%s'", image, resource_group)
|
|
1309
|
-
response = self.compute_client.images.
|
|
1317
|
+
response = self.compute_client.images.begin_delete(
|
|
1310
1318
|
resource_group_name=resource_group, image_name=image
|
|
1311
1319
|
)
|
|
1312
1320
|
result.append((image, response))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|