Skip to content

Commit 3561ef8

Browse files
authored
[Azure Compute v2] Fixed the API version (demisto#31517)
1 parent bc69d12 commit 3561ef8

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

Packs/AzureCompute/Integrations/AzureCompute_v2/AzureCompute_v2.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import demistomock as demisto
22
from CommonServerPython import *
33
from CommonServerUserPython import *
4-
import urllib3
54
from MicrosoftApiModule import * # noqa: E402
65

7-
# Disable insecure warnings
8-
urllib3.disable_warnings()
96

107
'''GLOBAL VARS'''
118
API_VERSION = '2023-03-01'
@@ -468,11 +465,11 @@ def validate_provisioning_state(self, resource_group, vm_name):
468465

469466
def get_network_interface(self, resource_group, interface_name):
470467
url_suffix = f"{resource_group}/providers/Microsoft.Network/networkInterfaces/{interface_name}"
471-
return self.ms_client.http_request(method='GET', url_suffix=url_suffix, params=self.default_params)
468+
return self.ms_client.http_request(method='GET', url_suffix=url_suffix, params={"api-version": '2023-05-01'})
472469

473470
def get_public_ip_details(self, resource_group, address_name):
474471
url_suffix = f"{resource_group}/providers/Microsoft.Network/publicIPAddresses/{address_name}"
475-
return self.ms_client.http_request(method='GET', url_suffix=url_suffix, params=self.default_params)
472+
return self.ms_client.http_request(method='GET', url_suffix=url_suffix, params={"api-version": '2023-05-01'})
476473

477474
def create_nic(self, resource_group, args):
478475
# Retrieve relevant command argument
@@ -481,7 +478,12 @@ def create_nic(self, resource_group, args):
481478

482479
# Construct VM object utilizing parameters passed as command arguments
483480
payload = create_nic_parameters(resource_group, self.subscription_id, args)
484-
return self.ms_client.http_request(method='PUT', url_suffix=url_suffix, params=self.default_params, json_data=payload)
481+
return self.ms_client.http_request(
482+
method='PUT',
483+
url_suffix=url_suffix,
484+
params={'api-version': '2023-05-01'},
485+
json_data=payload
486+
)
485487

486488

487489
def test_module(client: MsGraphClient):

Packs/AzureCompute/Integrations/AzureCompute_v2/AzureCompute_v2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ script:
645645
description: Run this command if for some reason you need to rerun the authentication process.
646646
execution: false
647647
name: azure-vm-auth-reset
648-
dockerimage: demisto/crypto:1.0.0.80214
648+
dockerimage: demisto/crypto:1.0.0.83343
649649
runonce: false
650650
script: '-'
651651
subtype: python3
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
#### Integrations
3+
4+
##### Azure Compute v2
5+
6+
- Fixed an issue about the API Version in the following commands:
7+
- azure-vm-create-nic
8+
- azure-vm-get-nic-details
9+
- azure-vm-get-public-ip-details
10+
- Updated the Docker image to: *demisto/crypto:1.0.0.83343*.

Packs/AzureCompute/pack_metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Azure Compute",
33
"description": "Create and Manage Azure Virtual Machines",
44
"support": "xsoar",
5-
"currentVersion": "1.2.18",
5+
"currentVersion": "1.2.19",
66
"author": "Cortex XSOAR",
77
"url": "https://www.paloaltonetworks.com/cortex",
88
"email": "",

0 commit comments

Comments
 (0)