Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR track2_azure-mgmt-compute] Add enableAutomaticUpgrade property to VMExtensions for VMs and VMSS #1586

Open
wants to merge 2 commits into
base: sdkAutomation/track2_azure-mgmt-compute
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
# license information.
# --------------------------------------------------------------------------
from .v2019_04_01.models import *
from .v2019_11_01.models import *
from .v2019_12_01.models import *
from .v2020_05_01.models import *
from .v2020_06_01.models import *
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ async def create_or_update(
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = 'application/json'

# Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'AvailabilitySet')
body_content_kwargs['content'] = body_content
Expand All @@ -111,7 +110,7 @@ async def delete(
resource_group_name: str,
availability_set_name: str,
**kwargs
) -> "models.OperationStatusResponse":
) -> Optional["models.OperationStatusResponse"]:
"""Delete an availability set.

:param resource_group_name: The name of the resource group.
Expand All @@ -123,7 +122,7 @@ async def delete(
:rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse or None
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"]
cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]]
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2015-06-15"
Expand All @@ -145,7 +144,6 @@ async def delete(
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
Expand Down Expand Up @@ -203,7 +201,6 @@ async def get(
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
Expand Down Expand Up @@ -240,6 +237,10 @@ def list(
api_version = "2015-06-15"

def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
Expand All @@ -252,15 +253,11 @@ def prepare_request(next_link=None):
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
request = self._client.get(url, query_parameters, header_parameters)
return request

async def extract_data(pipeline_response):
Expand Down Expand Up @@ -311,6 +308,10 @@ def list_available_sizes(
api_version = "2015-06-15"

def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

if not next_link:
# Construct URL
url = self.list_available_sizes.metadata['url'] # type: ignore
Expand All @@ -324,15 +325,11 @@ def prepare_request(next_link=None):
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
request = self._client.get(url, query_parameters, header_parameters)
return request

async def extract_data(pipeline_response):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def list(
api_version = "2015-06-15"

def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
Expand All @@ -74,15 +78,11 @@ def prepare_request(next_link=None):
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
request = self._client.get(url, query_parameters, header_parameters)
return request

async def extract_data(pipeline_response):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ async def get(
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
Expand Down Expand Up @@ -143,7 +142,6 @@ async def list_types(
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
Expand Down Expand Up @@ -218,7 +216,6 @@ async def list_versions(
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ async def _create_or_update_initial(
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = 'application/json'

# Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtension')
body_content_kwargs['content'] = body_content
Expand All @@ -88,7 +87,6 @@ async def _create_or_update_initial(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)

deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('VirtualMachineExtension', pipeline_response)

Expand All @@ -108,7 +106,7 @@ async def begin_create_or_update(
vm_extension_name: str,
extension_parameters: "models.VirtualMachineExtension",
**kwargs
) -> "models.VirtualMachineExtension":
) -> AsyncLROPoller["models.VirtualMachineExtension"]:
"""The operation to create or update the extension.

:param resource_group_name: The name of the resource group.
Expand All @@ -127,8 +125,8 @@ async def begin_create_or_update(
polling object for personal polling strategy
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: VirtualMachineExtension, or the result of cls(response)
:rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension
:return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
Expand Down Expand Up @@ -205,7 +203,6 @@ async def _update_initial(
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = 'application/json'

# Construct and send request
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(extension_parameters, 'VirtualMachineExtensionUpdate')
body_content_kwargs['content'] = body_content
Expand Down Expand Up @@ -233,7 +230,7 @@ async def begin_update(
vm_extension_name: str,
extension_parameters: "models.VirtualMachineExtensionUpdate",
**kwargs
) -> "models.VirtualMachineExtension":
) -> AsyncLROPoller["models.VirtualMachineExtension"]:
"""The operation to update the extension.

:param resource_group_name: The name of the resource group.
Expand All @@ -251,8 +248,8 @@ async def begin_update(
polling object for personal polling strategy
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: VirtualMachineExtension, or the result of cls(response)
:rtype: ~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension
:return: An instance of AsyncLROPoller that returns either VirtualMachineExtension or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.VirtualMachineExtension]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
Expand Down Expand Up @@ -302,8 +299,8 @@ async def _delete_initial(
vm_name: str,
vm_extension_name: str,
**kwargs
) -> "models.OperationStatusResponse":
cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatusResponse"]
) -> Optional["models.OperationStatusResponse"]:
cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatusResponse"]]
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2015-06-15"
Expand All @@ -326,7 +323,6 @@ async def _delete_initial(
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
Expand All @@ -351,7 +347,7 @@ async def begin_delete(
vm_name: str,
vm_extension_name: str,
**kwargs
) -> "models.OperationStatusResponse":
) -> AsyncLROPoller["models.OperationStatusResponse"]:
"""The operation to delete the extension.

:param resource_group_name: The name of the resource group.
Expand All @@ -366,8 +362,8 @@ async def begin_delete(
polling object for personal polling strategy
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: OperationStatusResponse, or the result of cls(response)
:rtype: ~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse
:return: An instance of AsyncLROPoller that returns either OperationStatusResponse or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2015_06_15.models.OperationStatusResponse]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
Expand Down Expand Up @@ -458,7 +454,6 @@ async def get(
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ async def get(
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
Expand Down Expand Up @@ -171,7 +170,6 @@ async def list(
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
Expand Down Expand Up @@ -227,7 +225,6 @@ async def list_offers(
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
Expand Down Expand Up @@ -279,7 +276,6 @@ async def list_publishers(
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
Expand Down Expand Up @@ -339,7 +335,6 @@ async def list_skus(
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = 'application/json'

# Construct and send request
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
Expand Down
Loading