From 373609b083a72f0d4cd7a156cb83b72b65341bad Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 28 Jun 2019 16:01:38 -0700 Subject: [PATCH] Generated from c3eda289dfe2b94eff37c1654a9abadf4ee3c8ad (#6104) Add enum for tier, osType and filtermode --- .../azure/mgmt/hdinsight/models/__init__.py | 17 ++ .../_hd_insight_management_client_enums.py | 6 + .../azure/mgmt/hdinsight/models/_models.py | 153 ++++++++++++++++++ .../mgmt/hdinsight/models/_models_py3.py | 153 ++++++++++++++++++ .../operations/_locations_operations.py | 61 ++++++- 5 files changed, 389 insertions(+), 1 deletion(-) diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py index a7f320ffa021..b559917fe865 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py @@ -19,6 +19,9 @@ from ._models_py3 import AutoscaleRecurrence from ._models_py3 import AutoscaleSchedule from ._models_py3 import AutoscaleTimeAndCapacity + from ._models_py3 import BillingMeters + from ._models_py3 import BillingResources + from ._models_py3 import BillingResponseListResult from ._models_py3 import Cluster from ._models_py3 import ClusterConfigurations from ._models_py3 import ClusterCreateParametersExtended @@ -37,6 +40,7 @@ from ._models_py3 import ComputeProfile from ._models_py3 import ConnectivityEndpoint from ._models_py3 import DataDisksGroups + from ._models_py3 import DiskBillingMeters from ._models_py3 import DiskEncryptionProperties from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import Errors @@ -69,6 +73,7 @@ from ._models_py3 import Usage from ._models_py3 import UsagesListResult from ._models_py3 import VirtualNetworkProfile + from ._models_py3 import VmSizeCompatibilityFilterV2 except (SyntaxError, ImportError): from ._models import Application from ._models import ApplicationGetEndpoint @@ -79,6 +84,9 @@ from ._models import AutoscaleRecurrence from ._models import AutoscaleSchedule from ._models import AutoscaleTimeAndCapacity + from ._models import BillingMeters + from ._models import BillingResources + from ._models import BillingResponseListResult from ._models import Cluster from ._models import ClusterConfigurations from ._models import ClusterCreateParametersExtended @@ -97,6 +105,7 @@ from ._models import ComputeProfile from ._models import ConnectivityEndpoint from ._models import DataDisksGroups + from ._models import DiskBillingMeters from ._models import DiskEncryptionProperties from ._models import ErrorResponse, ErrorResponseException from ._models import Errors @@ -129,6 +138,7 @@ from ._models import Usage from ._models import UsagesListResult from ._models import VirtualNetworkProfile + from ._models import VmSizeCompatibilityFilterV2 from ._paged_models import ApplicationPaged from ._paged_models import ClusterPaged from ._paged_models import OperationPaged @@ -142,6 +152,7 @@ ResourceIdentityType, HDInsightClusterProvisioningState, AsyncOperationState, + FilterMode, ) __all__ = [ @@ -154,6 +165,9 @@ 'AutoscaleRecurrence', 'AutoscaleSchedule', 'AutoscaleTimeAndCapacity', + 'BillingMeters', + 'BillingResources', + 'BillingResponseListResult', 'Cluster', 'ClusterConfigurations', 'ClusterCreateParametersExtended', @@ -172,6 +186,7 @@ 'ComputeProfile', 'ConnectivityEndpoint', 'DataDisksGroups', + 'DiskBillingMeters', 'DiskEncryptionProperties', 'ErrorResponse', 'ErrorResponseException', 'Errors', @@ -204,6 +219,7 @@ 'Usage', 'UsagesListResult', 'VirtualNetworkProfile', + 'VmSizeCompatibilityFilterV2', 'ClusterPaged', 'ApplicationPaged', 'RuntimeScriptActionDetailPaged', @@ -216,4 +232,5 @@ 'ResourceIdentityType', 'HDInsightClusterProvisioningState', 'AsyncOperationState', + 'FilterMode', ] diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_hd_insight_management_client_enums.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_hd_insight_management_client_enums.py index d58b9dad7770..94a5c11f6993 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_hd_insight_management_client_enums.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_hd_insight_management_client_enums.py @@ -69,3 +69,9 @@ class AsyncOperationState(str, Enum): in_progress = "InProgress" succeeded = "Succeeded" failed = "Failed" + + +class FilterMode(str, Enum): + + exclude = "Exclude" + include = "Include" diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models.py index aac7483fc73c..49ac52a8e992 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models.py @@ -357,6 +357,85 @@ def __init__(self, **kwargs): self.max_instance_count = kwargs.get('max_instance_count', None) +class BillingMeters(Model): + """The billing meters. + + :param meter_parameter: The virtual machine sizes. + :type meter_parameter: str + :param meter: The HDInsight meter guid. + :type meter: str + :param unit: The unit of meter, VMHours or CoreHours. + :type unit: str + """ + + _attribute_map = { + 'meter_parameter': {'key': 'meterParameter', 'type': 'str'}, + 'meter': {'key': 'meter', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BillingMeters, self).__init__(**kwargs) + self.meter_parameter = kwargs.get('meter_parameter', None) + self.meter = kwargs.get('meter', None) + self.unit = kwargs.get('unit', None) + + +class BillingResources(Model): + """The billing resources. + + :param region: The region or location. + :type region: str + :param billing_meters: The billing meter information. + :type billing_meters: list[~azure.mgmt.hdinsight.models.BillingMeters] + :param disk_billing_meters: The managed disk billing information. + :type disk_billing_meters: + list[~azure.mgmt.hdinsight.models.DiskBillingMeters] + """ + + _attribute_map = { + 'region': {'key': 'region', 'type': 'str'}, + 'billing_meters': {'key': 'billingMeters', 'type': '[BillingMeters]'}, + 'disk_billing_meters': {'key': 'diskBillingMeters', 'type': '[DiskBillingMeters]'}, + } + + def __init__(self, **kwargs): + super(BillingResources, self).__init__(**kwargs) + self.region = kwargs.get('region', None) + self.billing_meters = kwargs.get('billing_meters', None) + self.disk_billing_meters = kwargs.get('disk_billing_meters', None) + + +class BillingResponseListResult(Model): + """The response for the operation to get regional billingSpecs for a + subscription. + + :param vm_sizes: The virtual machine sizes to include or exclude. + :type vm_sizes: list[str] + :param vm_size_filters: The virtual machine filtering mode. Effectively + this can enabling or disabling the virtual machine sizes in a particular + set. + :type vm_size_filters: + list[~azure.mgmt.hdinsight.models.VmSizeCompatibilityFilterV2] + :param billing_resources: The billing and managed disk billing resources + for a region. + :type billing_resources: + list[~azure.mgmt.hdinsight.models.BillingResources] + """ + + _attribute_map = { + 'vm_sizes': {'key': 'vmSizes', 'type': '[str]'}, + 'vm_size_filters': {'key': 'vmSizeFilters', 'type': '[VmSizeCompatibilityFilterV2]'}, + 'billing_resources': {'key': 'billingResources', 'type': '[BillingResources]'}, + } + + def __init__(self, **kwargs): + super(BillingResponseListResult, self).__init__(**kwargs) + self.vm_sizes = kwargs.get('vm_sizes', None) + self.vm_size_filters = kwargs.get('vm_size_filters', None) + self.billing_resources = kwargs.get('billing_resources', None) + + class CloudError(Model): """CloudError. """ @@ -955,6 +1034,31 @@ def __init__(self, **kwargs): self.disk_size_gb = None +class DiskBillingMeters(Model): + """The disk billing meters. + + :param disk_rp_meter: The managed disk meter guid. + :type disk_rp_meter: str + :param sku: The managed disk billing sku, P30 or S30. + :type sku: str + :param tier: The managed disk billing tier, Standard or Premium. Possible + values include: 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.hdinsight.models.Tier + """ + + _attribute_map = { + 'disk_rp_meter': {'key': 'diskRpMeter', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'Tier'}, + } + + def __init__(self, **kwargs): + super(DiskBillingMeters, self).__init__(**kwargs) + self.disk_rp_meter = kwargs.get('disk_rp_meter', None) + self.sku = kwargs.get('sku', None) + self.tier = kwargs.get('tier', None) + + class DiskEncryptionProperties(Model): """The disk encryption properties. @@ -1785,3 +1889,52 @@ def __init__(self, **kwargs): super(VirtualNetworkProfile, self).__init__(**kwargs) self.id = kwargs.get('id', None) self.subnet = kwargs.get('subnet', None) + + +class VmSizeCompatibilityFilterV2(Model): + """This class represent a single filter object that defines a multidimensional + set. The dimensions of this set are Regions, ClusterFlavors, NodeTypes and + ClusterVersions. The constraint should be defined based on the following: + FilterMode (Exclude vs Include), VMSizes (the vm sizes in affect of + exclusion/inclusion) and the ordering of the Filters. Later filters + override previous settings if conflicted. + + :param filter_mode: The filtering mode. Effectively this can enabling or + disabling the VM sizes in a particular set. Possible values include: + 'Exclude', 'Include' + :type filter_mode: str or ~azure.mgmt.hdinsight.models.FilterMode + :param regions: The list of regions under the effect of the filter. + :type regions: list[str] + :param cluster_flavors: The list of cluster flavors under the effect of + the filter. + :type cluster_flavors: list[str] + :param node_types: The list of node types affected by the filter. + :type node_types: list[str] + :param cluster_versions: The list of cluster versions affected in + Major.Minor format. + :type cluster_versions: list[str] + :param os_type: The OSType affected, Windows or Linux. + :type os_type: list[str or ~azure.mgmt.hdinsight.models.OSType] + :param vm_sizes: The list of virtual machine sizes to include or exclude. + :type vm_sizes: list[str] + """ + + _attribute_map = { + 'filter_mode': {'key': 'filterMode', 'type': 'str'}, + 'regions': {'key': 'regions', 'type': '[str]'}, + 'cluster_flavors': {'key': 'clusterFlavors', 'type': '[str]'}, + 'node_types': {'key': 'nodeTypes', 'type': '[str]'}, + 'cluster_versions': {'key': 'clusterVersions', 'type': '[str]'}, + 'os_type': {'key': 'osType', 'type': '[OSType]'}, + 'vm_sizes': {'key': 'vmSizes', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(VmSizeCompatibilityFilterV2, self).__init__(**kwargs) + self.filter_mode = kwargs.get('filter_mode', None) + self.regions = kwargs.get('regions', None) + self.cluster_flavors = kwargs.get('cluster_flavors', None) + self.node_types = kwargs.get('node_types', None) + self.cluster_versions = kwargs.get('cluster_versions', None) + self.os_type = kwargs.get('os_type', None) + self.vm_sizes = kwargs.get('vm_sizes', None) diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models_py3.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models_py3.py index 226d163ea01f..b5bc3646d7d9 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models_py3.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models_py3.py @@ -357,6 +357,85 @@ def __init__(self, *, time: str=None, min_instance_count: int=None, max_instance self.max_instance_count = max_instance_count +class BillingMeters(Model): + """The billing meters. + + :param meter_parameter: The virtual machine sizes. + :type meter_parameter: str + :param meter: The HDInsight meter guid. + :type meter: str + :param unit: The unit of meter, VMHours or CoreHours. + :type unit: str + """ + + _attribute_map = { + 'meter_parameter': {'key': 'meterParameter', 'type': 'str'}, + 'meter': {'key': 'meter', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, *, meter_parameter: str=None, meter: str=None, unit: str=None, **kwargs) -> None: + super(BillingMeters, self).__init__(**kwargs) + self.meter_parameter = meter_parameter + self.meter = meter + self.unit = unit + + +class BillingResources(Model): + """The billing resources. + + :param region: The region or location. + :type region: str + :param billing_meters: The billing meter information. + :type billing_meters: list[~azure.mgmt.hdinsight.models.BillingMeters] + :param disk_billing_meters: The managed disk billing information. + :type disk_billing_meters: + list[~azure.mgmt.hdinsight.models.DiskBillingMeters] + """ + + _attribute_map = { + 'region': {'key': 'region', 'type': 'str'}, + 'billing_meters': {'key': 'billingMeters', 'type': '[BillingMeters]'}, + 'disk_billing_meters': {'key': 'diskBillingMeters', 'type': '[DiskBillingMeters]'}, + } + + def __init__(self, *, region: str=None, billing_meters=None, disk_billing_meters=None, **kwargs) -> None: + super(BillingResources, self).__init__(**kwargs) + self.region = region + self.billing_meters = billing_meters + self.disk_billing_meters = disk_billing_meters + + +class BillingResponseListResult(Model): + """The response for the operation to get regional billingSpecs for a + subscription. + + :param vm_sizes: The virtual machine sizes to include or exclude. + :type vm_sizes: list[str] + :param vm_size_filters: The virtual machine filtering mode. Effectively + this can enabling or disabling the virtual machine sizes in a particular + set. + :type vm_size_filters: + list[~azure.mgmt.hdinsight.models.VmSizeCompatibilityFilterV2] + :param billing_resources: The billing and managed disk billing resources + for a region. + :type billing_resources: + list[~azure.mgmt.hdinsight.models.BillingResources] + """ + + _attribute_map = { + 'vm_sizes': {'key': 'vmSizes', 'type': '[str]'}, + 'vm_size_filters': {'key': 'vmSizeFilters', 'type': '[VmSizeCompatibilityFilterV2]'}, + 'billing_resources': {'key': 'billingResources', 'type': '[BillingResources]'}, + } + + def __init__(self, *, vm_sizes=None, vm_size_filters=None, billing_resources=None, **kwargs) -> None: + super(BillingResponseListResult, self).__init__(**kwargs) + self.vm_sizes = vm_sizes + self.vm_size_filters = vm_size_filters + self.billing_resources = billing_resources + + class CloudError(Model): """CloudError. """ @@ -955,6 +1034,31 @@ def __init__(self, *, disks_per_node: int=None, **kwargs) -> None: self.disk_size_gb = None +class DiskBillingMeters(Model): + """The disk billing meters. + + :param disk_rp_meter: The managed disk meter guid. + :type disk_rp_meter: str + :param sku: The managed disk billing sku, P30 or S30. + :type sku: str + :param tier: The managed disk billing tier, Standard or Premium. Possible + values include: 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.hdinsight.models.Tier + """ + + _attribute_map = { + 'disk_rp_meter': {'key': 'diskRpMeter', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'Tier'}, + } + + def __init__(self, *, disk_rp_meter: str=None, sku: str=None, tier=None, **kwargs) -> None: + super(DiskBillingMeters, self).__init__(**kwargs) + self.disk_rp_meter = disk_rp_meter + self.sku = sku + self.tier = tier + + class DiskEncryptionProperties(Model): """The disk encryption properties. @@ -1785,3 +1889,52 @@ def __init__(self, *, id: str=None, subnet: str=None, **kwargs) -> None: super(VirtualNetworkProfile, self).__init__(**kwargs) self.id = id self.subnet = subnet + + +class VmSizeCompatibilityFilterV2(Model): + """This class represent a single filter object that defines a multidimensional + set. The dimensions of this set are Regions, ClusterFlavors, NodeTypes and + ClusterVersions. The constraint should be defined based on the following: + FilterMode (Exclude vs Include), VMSizes (the vm sizes in affect of + exclusion/inclusion) and the ordering of the Filters. Later filters + override previous settings if conflicted. + + :param filter_mode: The filtering mode. Effectively this can enabling or + disabling the VM sizes in a particular set. Possible values include: + 'Exclude', 'Include' + :type filter_mode: str or ~azure.mgmt.hdinsight.models.FilterMode + :param regions: The list of regions under the effect of the filter. + :type regions: list[str] + :param cluster_flavors: The list of cluster flavors under the effect of + the filter. + :type cluster_flavors: list[str] + :param node_types: The list of node types affected by the filter. + :type node_types: list[str] + :param cluster_versions: The list of cluster versions affected in + Major.Minor format. + :type cluster_versions: list[str] + :param os_type: The OSType affected, Windows or Linux. + :type os_type: list[str or ~azure.mgmt.hdinsight.models.OSType] + :param vm_sizes: The list of virtual machine sizes to include or exclude. + :type vm_sizes: list[str] + """ + + _attribute_map = { + 'filter_mode': {'key': 'filterMode', 'type': 'str'}, + 'regions': {'key': 'regions', 'type': '[str]'}, + 'cluster_flavors': {'key': 'clusterFlavors', 'type': '[str]'}, + 'node_types': {'key': 'nodeTypes', 'type': '[str]'}, + 'cluster_versions': {'key': 'clusterVersions', 'type': '[str]'}, + 'os_type': {'key': 'osType', 'type': '[OSType]'}, + 'vm_sizes': {'key': 'vmSizes', 'type': '[str]'}, + } + + def __init__(self, *, filter_mode=None, regions=None, cluster_flavors=None, node_types=None, cluster_versions=None, os_type=None, vm_sizes=None, **kwargs) -> None: + super(VmSizeCompatibilityFilterV2, self).__init__(**kwargs) + self.filter_mode = filter_mode + self.regions = regions + self.cluster_flavors = cluster_flavors + self.node_types = node_types + self.cluster_versions = cluster_versions + self.os_type = os_type + self.vm_sizes = vm_sizes diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_locations_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_locations_operations.py index 172ea365b2ee..5ef757d34b8c 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_locations_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_locations_operations.py @@ -42,7 +42,8 @@ def list_usages( self, location, custom_headers=None, raw=False, **operation_config): """Lists the usages for the specified location. - :param location: The location to get capabilities for. + :param location: The Azure location (region) for which to make the + request. :type location: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -94,3 +95,61 @@ def list_usages( return deserialized list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/usages'} + + def list_billing_specs( + self, location, custom_headers=None, raw=False, **operation_config): + """Lists the billingSpecs for the specified subscription and location. + + :param location: The Azure location (region) for which to make the + request. + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BillingResponseListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hdinsight.models.BillingResponseListResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_billing_specs.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BillingResponseListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_billing_specs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/billingSpecs'}