Skip to content
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 @@ -124,6 +124,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2018-09-30: :mod:`v2018_09_30.models<azure.mgmt.compute.v2018_09_30.models>`
* 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>`
"""
if api_version == '2015-06-15':
from .v2015_06_15 import models
Expand Down Expand Up @@ -158,6 +159,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2019-03-01':
from .v2019_03_01 import models
return models
elif api_version == '2019-04-01':
from .v2019_04_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
Expand Down Expand Up @@ -379,12 +383,15 @@ def resource_skus(self):

* 2017-03-30: :class:`ResourceSkusOperations<azure.mgmt.compute.v2017_03_30.operations.ResourceSkusOperations>`
* 2017-09-01: :class:`ResourceSkusOperations<azure.mgmt.compute.v2017_09_01.operations.ResourceSkusOperations>`
* 2019-04-01: :class:`ResourceSkusOperations<azure.mgmt.compute.v2019_04_01.operations.ResourceSkusOperations>`
"""
api_version = self._get_api_version('resource_skus')
if api_version == '2017-03-30':
from .v2017_03_30.operations import ResourceSkusOperations as OperationClass
elif api_version == '2017-09-01':
from .v2017_09_01.operations import ResourceSkusOperations as OperationClass
elif api_version == '2019-04-01':
from .v2019_04_01.operations import ResourceSkusOperations 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
18 changes: 18 additions & 0 deletions azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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 .compute_management_client import ComputeManagementClient
from .version import VERSION

__all__ = ['ComputeManagementClient']

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# 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 msrestazure import AzureConfiguration
from .version import VERSION
from .operations.resource_skus_operations import ResourceSkusOperations
from . import models


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)

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


class ComputeManagementClient(SDKClient):
"""Compute Client

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

:ivar resource_skus: ResourceSkus operations
:vartype resource_skus: azure.mgmt.compute.v2019_04_01.operations.ResourceSkusOperations

: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-04-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.resource_skus = ResourceSkusOperations(
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.
# --------------------------------------------------------------------------

try:
from .resource_sku_capacity_py3 import ResourceSkuCapacity
from .resource_sku_costs_py3 import ResourceSkuCosts
from .resource_sku_capabilities_py3 import ResourceSkuCapabilities
from .resource_sku_zone_details_py3 import ResourceSkuZoneDetails
from .resource_sku_restriction_info_py3 import ResourceSkuRestrictionInfo
from .resource_sku_restrictions_py3 import ResourceSkuRestrictions
from .resource_sku_location_info_py3 import ResourceSkuLocationInfo
from .resource_sku_py3 import ResourceSku
except (SyntaxError, ImportError):
from .resource_sku_capacity import ResourceSkuCapacity
from .resource_sku_costs import ResourceSkuCosts
from .resource_sku_capabilities import ResourceSkuCapabilities
from .resource_sku_zone_details import ResourceSkuZoneDetails
from .resource_sku_restriction_info import ResourceSkuRestrictionInfo
from .resource_sku_restrictions import ResourceSkuRestrictions
from .resource_sku_location_info import ResourceSkuLocationInfo
from .resource_sku import ResourceSku
from .resource_sku_paged import ResourceSkuPaged
from .compute_management_client_enums import (
ResourceSkuCapacityScaleType,
ResourceSkuRestrictionsType,
ResourceSkuRestrictionsReasonCode,
)

__all__ = [
'ResourceSkuCapacity',
'ResourceSkuCosts',
'ResourceSkuCapabilities',
'ResourceSkuZoneDetails',
'ResourceSkuRestrictionInfo',
'ResourceSkuRestrictions',
'ResourceSkuLocationInfo',
'ResourceSku',
'ResourceSkuPaged',
'ResourceSkuCapacityScaleType',
'ResourceSkuRestrictionsType',
'ResourceSkuRestrictionsReasonCode',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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 enum import Enum


class ResourceSkuCapacityScaleType(str, Enum):

automatic = "Automatic"
manual = "Manual"
none = "None"


class ResourceSkuRestrictionsType(str, Enum):

location = "Location"
zone = "Zone"


class ResourceSkuRestrictionsReasonCode(str, Enum):

quota_id = "QuotaId"
not_available_for_subscription = "NotAvailableForSubscription"
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# 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.serialization import Model


class ResourceSku(Model):
"""Describes an available Compute SKU.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar resource_type: The type of resource the SKU applies to.
:vartype resource_type: str
:ivar name: The name of SKU.
:vartype name: str
:ivar tier: Specifies the tier of virtual machines in a scale set.<br
/><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic**
:vartype tier: str
:ivar size: The Size of the SKU.
:vartype size: str
:ivar family: The Family of this particular SKU.
:vartype family: str
:ivar kind: The Kind of resources that are supported in this SKU.
:vartype kind: str
:ivar capacity: Specifies the number of virtual machines in the scale set.
:vartype capacity:
~azure.mgmt.compute.v2019_04_01.models.ResourceSkuCapacity
:ivar locations: The set of locations that the SKU is available.
:vartype locations: list[str]
:ivar location_info: A list of locations and availability zones in those
locations where the SKU is available.
:vartype location_info:
list[~azure.mgmt.compute.v2019_04_01.models.ResourceSkuLocationInfo]
:ivar api_versions: The api versions that support this SKU.
:vartype api_versions: list[str]
:ivar costs: Metadata for retrieving price info.
:vartype costs:
list[~azure.mgmt.compute.v2019_04_01.models.ResourceSkuCosts]
:ivar capabilities: A name value pair to describe the capability.
:vartype capabilities:
list[~azure.mgmt.compute.v2019_04_01.models.ResourceSkuCapabilities]
:ivar restrictions: The restrictions because of which SKU cannot be used.
This is empty if there are no restrictions.
:vartype restrictions:
list[~azure.mgmt.compute.v2019_04_01.models.ResourceSkuRestrictions]
"""

_validation = {
'resource_type': {'readonly': True},
'name': {'readonly': True},
'tier': {'readonly': True},
'size': {'readonly': True},
'family': {'readonly': True},
'kind': {'readonly': True},
'capacity': {'readonly': True},
'locations': {'readonly': True},
'location_info': {'readonly': True},
'api_versions': {'readonly': True},
'costs': {'readonly': True},
'capabilities': {'readonly': True},
'restrictions': {'readonly': True},
}

_attribute_map = {
'resource_type': {'key': 'resourceType', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'tier': {'key': 'tier', 'type': 'str'},
'size': {'key': 'size', 'type': 'str'},
'family': {'key': 'family', 'type': 'str'},
'kind': {'key': 'kind', 'type': 'str'},
'capacity': {'key': 'capacity', 'type': 'ResourceSkuCapacity'},
'locations': {'key': 'locations', 'type': '[str]'},
'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'},
'api_versions': {'key': 'apiVersions', 'type': '[str]'},
'costs': {'key': 'costs', 'type': '[ResourceSkuCosts]'},
'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapabilities]'},
'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'},
}

def __init__(self, **kwargs):
super(ResourceSku, self).__init__(**kwargs)
self.resource_type = None
self.name = None
self.tier = None
self.size = None
self.family = None
self.kind = None
self.capacity = None
self.locations = None
self.location_info = None
self.api_versions = None
self.costs = None
self.capabilities = None
self.restrictions = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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.serialization import Model


class ResourceSkuCapabilities(Model):
"""Describes The SKU capabilities object.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar name: An invariant to describe the feature.
:vartype name: str
:ivar value: An invariant if the feature is measured by quantity.
:vartype value: str
"""

_validation = {
'name': {'readonly': True},
'value': {'readonly': True},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ResourceSkuCapabilities, self).__init__(**kwargs)
self.name = None
self.value = None
Loading