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 compute/resource-manager] Adding new VirtualMachines.POST.Reapply action to compute api-version: 2019-07-01. Updating parameter info for skus api-version:2019-04-01.. #7378

Merged
merged 3 commits into from
Sep 20, 2019
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ComputeManagementClient(MultiApiClientMixin, SDKClient):
:type profile: azure.profiles.KnownProfiles
"""

DEFAULT_API_VERSION = '2019-04-01'
DEFAULT_API_VERSION = '2019-07-01'
_PROFILE_TAG = "azure.mgmt.compute.ComputeManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand All @@ -55,15 +55,11 @@ class ComputeManagementClient(MultiApiClientMixin, SDKClient):
'dedicated_host_groups': '2019-03-01',
'dedicated_hosts': '2019-03-01',
'disks': '2019-03-01',
'galleries': '2019-03-01',
'gallery_application_versions': '2019-03-01',
'gallery_applications': '2019-03-01',
'gallery_image_versions': '2019-03-01',
'gallery_images': '2019-03-01',
'images': '2019-03-01',
'log_analytics': '2019-03-01',
'operations': '2019-03-01',
'proximity_placement_groups': '2019-03-01',
'resource_skus': '2019-04-01',
'snapshots': '2019-03-01',
'usage': '2019-03-01',
'virtual_machine_extension_images': '2019-03-01',
Expand Down Expand Up @@ -109,6 +105,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2018-10-01: :mod:`v2018_10_01.models<azure.mgmt.compute.v2018_10_01.models>`
* 2019-03-01: :mod:`v2019_03_01.models<azure.mgmt.compute.v2019_03_01.models>`
* 2019-04-01: :mod:`v2019_04_01.models<azure.mgmt.compute.v2019_04_01.models>`
* 2019-07-01: :mod:`v2019_07_01.models<azure.mgmt.compute.v2019_07_01.models>`
"""
if api_version == '2015-06-15':
from .v2015_06_15 import models
Expand Down Expand Up @@ -146,6 +143,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2019-04-01':
from .v2019_04_01 import models
return models
elif api_version == '2019-07-01':
from .v2019_07_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
Expand Down Expand Up @@ -245,12 +245,15 @@ def galleries(self):

* 2018-06-01: :class:`GalleriesOperations<azure.mgmt.compute.v2018_06_01.operations.GalleriesOperations>`
* 2019-03-01: :class:`GalleriesOperations<azure.mgmt.compute.v2019_03_01.operations.GalleriesOperations>`
* 2019-07-01: :class:`GalleriesOperations<azure.mgmt.compute.v2019_07_01.operations.GalleriesOperations>`
"""
api_version = self._get_api_version('galleries')
if api_version == '2018-06-01':
from .v2018_06_01.operations import GalleriesOperations as OperationClass
elif api_version == '2019-03-01':
from .v2019_03_01.operations import GalleriesOperations as OperationClass
elif api_version == '2019-07-01':
from .v2019_07_01.operations import GalleriesOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -260,10 +263,13 @@ def gallery_application_versions(self):
"""Instance depends on the API version:

* 2019-03-01: :class:`GalleryApplicationVersionsOperations<azure.mgmt.compute.v2019_03_01.operations.GalleryApplicationVersionsOperations>`
* 2019-07-01: :class:`GalleryApplicationVersionsOperations<azure.mgmt.compute.v2019_07_01.operations.GalleryApplicationVersionsOperations>`
"""
api_version = self._get_api_version('gallery_application_versions')
if api_version == '2019-03-01':
from .v2019_03_01.operations import GalleryApplicationVersionsOperations as OperationClass
elif api_version == '2019-07-01':
from .v2019_07_01.operations import GalleryApplicationVersionsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -273,10 +279,13 @@ def gallery_applications(self):
"""Instance depends on the API version:

* 2019-03-01: :class:`GalleryApplicationsOperations<azure.mgmt.compute.v2019_03_01.operations.GalleryApplicationsOperations>`
* 2019-07-01: :class:`GalleryApplicationsOperations<azure.mgmt.compute.v2019_07_01.operations.GalleryApplicationsOperations>`
"""
api_version = self._get_api_version('gallery_applications')
if api_version == '2019-03-01':
from .v2019_03_01.operations import GalleryApplicationsOperations as OperationClass
elif api_version == '2019-07-01':
from .v2019_07_01.operations import GalleryApplicationsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -287,12 +296,15 @@ def gallery_image_versions(self):

* 2018-06-01: :class:`GalleryImageVersionsOperations<azure.mgmt.compute.v2018_06_01.operations.GalleryImageVersionsOperations>`
* 2019-03-01: :class:`GalleryImageVersionsOperations<azure.mgmt.compute.v2019_03_01.operations.GalleryImageVersionsOperations>`
* 2019-07-01: :class:`GalleryImageVersionsOperations<azure.mgmt.compute.v2019_07_01.operations.GalleryImageVersionsOperations>`
"""
api_version = self._get_api_version('gallery_image_versions')
if api_version == '2018-06-01':
from .v2018_06_01.operations import GalleryImageVersionsOperations as OperationClass
elif api_version == '2019-03-01':
from .v2019_03_01.operations import GalleryImageVersionsOperations as OperationClass
elif api_version == '2019-07-01':
from .v2019_07_01.operations import GalleryImageVersionsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -303,12 +315,15 @@ def gallery_images(self):

* 2018-06-01: :class:`GalleryImagesOperations<azure.mgmt.compute.v2018_06_01.operations.GalleryImagesOperations>`
* 2019-03-01: :class:`GalleryImagesOperations<azure.mgmt.compute.v2019_03_01.operations.GalleryImagesOperations>`
* 2019-07-01: :class:`GalleryImagesOperations<azure.mgmt.compute.v2019_07_01.operations.GalleryImagesOperations>`
"""
api_version = self._get_api_version('gallery_images')
if api_version == '2018-06-01':
from .v2018_06_01.operations import GalleryImagesOperations as OperationClass
elif api_version == '2019-03-01':
from .v2019_03_01.operations import GalleryImagesOperations as OperationClass
elif api_version == '2019-07-01':
from .v2019_07_01.operations import GalleryImagesOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
# --------------------------------------------------------------------------
from .v2019_03_01.models import *
from .v2019_04_01.models import *
from .v2019_07_01.models import *
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ def __init__(self, client, config, serializer, deserializer):
self.config = config

def list(
self, custom_headers=None, raw=False, **operation_config):
self, filter=None, custom_headers=None, raw=False, **operation_config):
"""Gets the list of Microsoft.Compute SKUs available for your
Subscription.

:param filter: The filter to apply on the operation.
:type filter: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -66,6 +68,8 @@ def prepare_request(next_link=None):
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
if filter is not None:
query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')

else:
url = next_link
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from ._configuration import ComputeManagementClientConfiguration
from ._compute_management_client import ComputeManagementClient
__all__ = ['ComputeManagementClient', 'ComputeManagementClientConfiguration']

from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer

from ._configuration import ComputeManagementClientConfiguration
from .operations import GalleriesOperations
from .operations import GalleryImagesOperations
from .operations import GalleryImageVersionsOperations
from .operations import GalleryApplicationsOperations
from .operations import GalleryApplicationVersionsOperations
from . import models


class ComputeManagementClient(SDKClient):
"""Compute Client

:ivar config: Configuration for client.
:vartype config: ComputeManagementClientConfiguration

:ivar galleries: Galleries operations
:vartype galleries: azure.mgmt.compute.v2019_07_01.operations.GalleriesOperations
:ivar gallery_images: GalleryImages operations
:vartype gallery_images: azure.mgmt.compute.v2019_07_01.operations.GalleryImagesOperations
:ivar gallery_image_versions: GalleryImageVersions operations
:vartype gallery_image_versions: azure.mgmt.compute.v2019_07_01.operations.GalleryImageVersionsOperations
:ivar gallery_applications: GalleryApplications operations
:vartype gallery_applications: azure.mgmt.compute.v2019_07_01.operations.GalleryApplicationsOperations
:ivar gallery_application_versions: GalleryApplicationVersions operations
:vartype gallery_application_versions: azure.mgmt.compute.v2019_07_01.operations.GalleryApplicationVersionsOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = ComputeManagementClientConfiguration(credentials, subscription_id, base_url)
super(ComputeManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2019-07-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.galleries = GalleriesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.gallery_images = GalleryImagesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.gallery_image_versions = GalleryImageVersionsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.gallery_applications = GalleryApplicationsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.gallery_application_versions = GalleryApplicationVersionsOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrestazure import AzureConfiguration

from .version import VERSION


class ComputeManagementClientConfiguration(AzureConfiguration):
"""Configuration for ComputeManagementClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(ComputeManagementClientConfiguration, self).__init__(base_url)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

self.add_user_agent('azure-mgmt-compute/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id
Loading