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 hdinsight/resource-manager] [HDInsight] Add ListBillingSpecs API to HDInsight's stable and preview version #6104

Merged
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 @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -142,6 +152,7 @@
ResourceIdentityType,
HDInsightClusterProvisioningState,
AsyncOperationState,
FilterMode,
)

__all__ = [
Expand All @@ -154,6 +165,9 @@
'AutoscaleRecurrence',
'AutoscaleSchedule',
'AutoscaleTimeAndCapacity',
'BillingMeters',
'BillingResources',
'BillingResponseListResult',
'Cluster',
'ClusterConfigurations',
'ClusterCreateParametersExtended',
Expand All @@ -172,6 +186,7 @@
'ComputeProfile',
'ConnectivityEndpoint',
'DataDisksGroups',
'DiskBillingMeters',
'DiskEncryptionProperties',
'ErrorResponse', 'ErrorResponseException',
'Errors',
Expand Down Expand Up @@ -204,6 +219,7 @@
'Usage',
'UsagesListResult',
'VirtualNetworkProfile',
'VmSizeCompatibilityFilterV2',
'ClusterPaged',
'ApplicationPaged',
'RuntimeScriptActionDetailPaged',
Expand All @@ -216,4 +232,5 @@
'ResourceIdentityType',
'HDInsightClusterProvisioningState',
'AsyncOperationState',
'FilterMode',
]
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,9 @@ class AsyncOperationState(str, Enum):
in_progress = "InProgress"
succeeded = "Succeeded"
failed = "Failed"


class FilterMode(str, Enum):

exclude = "Exclude"
include = "Include"
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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)
Loading