Skip to content

Commit

Permalink
[Azure Compute v2] Fixed the API version (demisto#31517)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmhw authored Dec 17, 2023
1 parent bc69d12 commit 3561ef8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import urllib3
from MicrosoftApiModule import * # noqa: E402

# Disable insecure warnings
urllib3.disable_warnings()

'''GLOBAL VARS'''
API_VERSION = '2023-03-01'
Expand Down Expand Up @@ -468,11 +465,11 @@ def validate_provisioning_state(self, resource_group, vm_name):

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

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

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

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


def test_module(client: MsGraphClient):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ script:
description: Run this command if for some reason you need to rerun the authentication process.
execution: false
name: azure-vm-auth-reset
dockerimage: demisto/crypto:1.0.0.80214
dockerimage: demisto/crypto:1.0.0.83343
runonce: false
script: '-'
subtype: python3
Expand Down
10 changes: 10 additions & 0 deletions Packs/AzureCompute/ReleaseNotes/1_2_19.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

#### Integrations

##### Azure Compute v2

- Fixed an issue about the API Version in the following commands:
- azure-vm-create-nic
- azure-vm-get-nic-details
- azure-vm-get-public-ip-details
- Updated the Docker image to: *demisto/crypto:1.0.0.83343*.
2 changes: 1 addition & 1 deletion Packs/AzureCompute/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Azure Compute",
"description": "Create and Manage Azure Virtual Machines",
"support": "xsoar",
"currentVersion": "1.2.18",
"currentVersion": "1.2.19",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down

0 comments on commit 3561ef8

Please sign in to comment.