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 #1930

Merged
merged 16 commits into from
Mar 21, 2018
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 36 additions & 0 deletions azure-mgmt-compute/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,42 @@
Release History
===============

4.0.0rc1 (2018-XX-XX)
+++++++++++++++++++++

**General Breaking changes**

This version uses a next-generation code generator that *might* introduce breaking changes.

- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments.
To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments.
- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered.
While this is not a breaking change, the distinctions are important, and are documented here:
https://docs.python.org/3/library/enum.html#others
At a glance:

- "is" should not be used at all.
- "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered.

- New Long Running Operation:

- Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same.
- Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used.
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`.
- New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`,
the response of the initial call will be returned without polling.
- `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`.
- `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away.

**Compute features**

- Support zone resilient for image/snapshots (new ApiVersion 2018-04-01)
- Add "operations" operation group
- Add availability_set.update
- Add images.update
- Add virtual_machine.update

3.1.0rc3 (2018-11-01)
+++++++++++++++++++++

Expand Down
40 changes: 38 additions & 2 deletions azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ class ComputeManagementClient(object):

DEFAULT_API_VERSION = '2017-12-01'
DEFAULT_PROFILE = {
'disks': '2017-03-30',
'disks': '2018-04-01',
'resource_skus': '2017-09-01',
'snapshots': '2017-03-30',
'snapshots': '2018-04-01',
}

def __init__(self, credentials, subscription_id, api_version=DEFAULT_API_VERSION, base_url=None, profile=DEFAULT_PROFILE):
Expand All @@ -108,6 +108,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2017-03-30: :mod:`v2017_03_30.models<azure.mgmt.compute.v2017_03_30.models>`
* 2017-09-01: :mod:`v2017_09_01.models<azure.mgmt.compute.v2017_09_01.models>`
* 2017-12-01: :mod:`v2017_12_01.models<azure.mgmt.compute.v2017_12_01.models>`
* 2018-04-01: :mod:`v2018_04_01.models<azure.mgmt.compute.v2018_04_01.models>`
"""
if api_version == '2015-06-15':
from .v2015_06_15 import models
Expand All @@ -127,6 +128,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2017-12-01':
from .v2017_12_01 import models
return models
elif api_version == '2018-04-01':
from .v2018_04_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
Expand Down Expand Up @@ -160,12 +164,15 @@ def disks(self):

* 2016-04-30-preview: :class:`DisksOperations<azure.mgmt.compute.v2016_04_30_preview.operations.DisksOperations>`
* 2017-03-30: :class:`DisksOperations<azure.mgmt.compute.v2017_03_30.operations.DisksOperations>`
* 2018-04-01: :class:`DisksOperations<azure.mgmt.compute.v2018_04_01.operations.DisksOperations>`
"""
api_version = self.profile.get('disks', self.api_version)
if api_version == '2016-04-30-preview':
from .v2016_04_30_preview.operations import DisksOperations as OperationClass
elif api_version == '2017-03-30':
from .v2017_03_30.operations import DisksOperations as OperationClass
elif api_version == '2018-04-01':
from .v2018_04_01.operations import DisksOperations 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 @@ -189,6 +196,32 @@ def images(self):
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)))

@property
def log_analytics(self):
"""Instance depends on the API version:

* 2017-12-01: :class:`LogAnalyticsOperations<azure.mgmt.compute.v2017_12_01.operations.LogAnalyticsOperations>`
"""
api_version = self.profile.get('log_analytics', self.api_version)
if api_version == '2017-12-01':
from .v2017_12_01.operations import LogAnalyticsOperations 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)))

@property
def operations(self):
"""Instance depends on the API version:

* 2017-12-01: :class:`Operations<azure.mgmt.compute.v2017_12_01.operations.Operations>`
"""
api_version = self.profile.get('operations', self.api_version)
if api_version == '2017-12-01':
from .v2017_12_01.operations import Operations 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)))

@property
def resource_skus(self):
"""Instance depends on the API version:
Expand All @@ -211,12 +244,15 @@ def snapshots(self):

* 2016-04-30-preview: :class:`SnapshotsOperations<azure.mgmt.compute.v2016_04_30_preview.operations.SnapshotsOperations>`
* 2017-03-30: :class:`SnapshotsOperations<azure.mgmt.compute.v2017_03_30.operations.SnapshotsOperations>`
* 2018-04-01: :class:`SnapshotsOperations<azure.mgmt.compute.v2018_04_01.operations.SnapshotsOperations>`
"""
api_version = self.profile.get('snapshots', self.api_version)
if api_version == '2016-04-30-preview':
from .v2016_04_30_preview.operations import SnapshotsOperations as OperationClass
elif api_version == '2017-03-30':
from .v2017_03_30.operations import SnapshotsOperations as OperationClass
elif api_version == '2018-04-01':
from .v2018_04_01.operations import SnapshotsOperations 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
4 changes: 2 additions & 2 deletions azure-mgmt-compute/azure/mgmt/compute/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# --------------------------------------------------------------------------
import warnings

from .v2017_03_30.models import *
from .v2017_09_01.models import *
from .v2017_12_01.models import * # Note that this line is overriding some models of 2017-03-30. See link below for details.
from .v2017_12_01.models import *
from .v2018_04_01.models import * # Note that this line is overriding some models of 2017-12-01. See link below for details.

warnings.warn("Import models from this file is deprecated. See https://aka.ms/pysdkmodels",
DeprecationWarning)
Loading