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 optional billing profile to VMSS Create and Update APIs for Api Version 2019-03-01 #6169

Closed
Closed
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
2 changes: 1 addition & 1 deletion sdk/compute/azure-mgmt-compute/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the Microsoft Azure Compute Management Client Library.
Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.
This package has been tested with Python 2.7, 3.5, 3.6 and 3.7.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from ._models_py3 import AutomaticOSUpgradeProperties
from ._models_py3 import AvailabilitySet
from ._models_py3 import AvailabilitySetUpdate
from ._models_py3 import BillingProfile
from ._models_py3 import BootDiagnostics
from ._models_py3 import BootDiagnosticsInstanceView
from ._models_py3 import ComputeOperationValue
Expand Down Expand Up @@ -179,6 +180,7 @@
from ._models import AutomaticOSUpgradeProperties
from ._models import AvailabilitySet
from ._models import AvailabilitySetUpdate
from ._models import BillingProfile
from ._models import BootDiagnostics
from ._models import BootDiagnosticsInstanceView
from ._models import ComputeOperationValue
Expand Down Expand Up @@ -392,6 +394,7 @@
'AutomaticOSUpgradeProperties',
'AvailabilitySet',
'AvailabilitySetUpdate',
'BillingProfile',
'BootDiagnostics',
'BootDiagnosticsInstanceView',
'ComputeOperationValue',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,36 @@ def __init__(self, **kwargs):
self.sku = kwargs.get('sku', None)


class BillingProfile(Model):
"""Specifies the billing related details of a low priority VM or VMSS.
<br><br>Minimum api-version: 2019-03-01.

:param max_price: Specifies the maximum price you are willing to pay for a
low priority VM/VMSS. This price is in US Dollars. <br><br> This price
will be compared with the current low priority price for the VM size.
Also, the prices are compared at the time of create/update of low priority
VM/VMSS and the operation will only succeed if the maxPrice is greater
than the current low priority price. <br><br> The maxPrice will also be
used for evicting a low priority VM/VMSS if the current low priority price
goes beyond the maxPrice after creation of VM/VMSS. <br><br> Possible
values are: <br><br> - Any decimal value greater than zero. Example:
$0.01538 <br><br> -1 – indicates default price to be up-to on-demand.
<br><br> You can set the maxPrice to -1 to indicate that the low priority
VM/VMSS should not be evicted for price reasons. Also, the default max
price is -1 if it is not provided by you. <br><br>Minimum api-version:
2019-03-01.
:type max_price: float
"""

_attribute_map = {
'max_price': {'key': 'maxPrice', 'type': 'float'},
}

def __init__(self, **kwargs):
super(BillingProfile, self).__init__(**kwargs)
self.max_price = kwargs.get('max_price', None)


class BootDiagnostics(Model):
"""Boot Diagnostics is a debugging feature which allows you to view Console
Output and Screenshot to diagnose VM status. <br><br> You can easily view
Expand Down Expand Up @@ -5729,6 +5759,10 @@ class VirtualMachineScaleSetUpdateVMProfile(Model):
:param license_type: The license type, which is for bring your own license
scenario.
:type license_type: str
:param billing_profile: Specifies the billing related details of a low
priority VMSS. <br><br>Minimum api-version: 2019-03-01.
:type billing_profile:
~azure.mgmt.compute.v2019_03_01.models.BillingProfile
"""

_attribute_map = {
Expand All @@ -5738,6 +5772,7 @@ class VirtualMachineScaleSetUpdateVMProfile(Model):
'diagnostics_profile': {'key': 'diagnosticsProfile', 'type': 'DiagnosticsProfile'},
'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'},
'license_type': {'key': 'licenseType', 'type': 'str'},
'billing_profile': {'key': 'billingProfile', 'type': 'BillingProfile'},
}

def __init__(self, **kwargs):
Expand All @@ -5748,6 +5783,7 @@ def __init__(self, **kwargs):
self.diagnostics_profile = kwargs.get('diagnostics_profile', None)
self.extension_profile = kwargs.get('extension_profile', None)
self.license_type = kwargs.get('license_type', None)
self.billing_profile = kwargs.get('billing_profile', None)


class VirtualMachineScaleSetVM(Resource):
Expand Down Expand Up @@ -6129,6 +6165,10 @@ class VirtualMachineScaleSetVMProfile(Model):
2017-10-30-preview. Possible values include: 'Deallocate', 'Delete'
:type eviction_policy: str or
~azure.mgmt.compute.v2019_03_01.models.VirtualMachineEvictionPolicyTypes
:param billing_profile: Specifies the billing related details of a low
priority VMSS. <br><br>Minimum api-version: 2019-03-01.
:type billing_profile:
~azure.mgmt.compute.v2019_03_01.models.BillingProfile
"""

_attribute_map = {
Expand All @@ -6140,6 +6180,7 @@ class VirtualMachineScaleSetVMProfile(Model):
'license_type': {'key': 'licenseType', 'type': 'str'},
'priority': {'key': 'priority', 'type': 'str'},
'eviction_policy': {'key': 'evictionPolicy', 'type': 'str'},
'billing_profile': {'key': 'billingProfile', 'type': 'BillingProfile'},
}

def __init__(self, **kwargs):
Expand All @@ -6152,6 +6193,7 @@ def __init__(self, **kwargs):
self.license_type = kwargs.get('license_type', None)
self.priority = kwargs.get('priority', None)
self.eviction_policy = kwargs.get('eviction_policy', None)
self.billing_profile = kwargs.get('billing_profile', None)


class VirtualMachineScaleSetVMProtectionPolicy(Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,36 @@ def __init__(self, *, tags=None, platform_update_domain_count: int=None, platfor
self.sku = sku


class BillingProfile(Model):
"""Specifies the billing related details of a low priority VM or VMSS.
<br><br>Minimum api-version: 2019-03-01.

:param max_price: Specifies the maximum price you are willing to pay for a
low priority VM/VMSS. This price is in US Dollars. <br><br> This price
will be compared with the current low priority price for the VM size.
Also, the prices are compared at the time of create/update of low priority
VM/VMSS and the operation will only succeed if the maxPrice is greater
than the current low priority price. <br><br> The maxPrice will also be
used for evicting a low priority VM/VMSS if the current low priority price
goes beyond the maxPrice after creation of VM/VMSS. <br><br> Possible
values are: <br><br> - Any decimal value greater than zero. Example:
$0.01538 <br><br> -1 – indicates default price to be up-to on-demand.
<br><br> You can set the maxPrice to -1 to indicate that the low priority
VM/VMSS should not be evicted for price reasons. Also, the default max
price is -1 if it is not provided by you. <br><br>Minimum api-version:
2019-03-01.
:type max_price: float
"""

_attribute_map = {
'max_price': {'key': 'maxPrice', 'type': 'float'},
}

def __init__(self, *, max_price: float=None, **kwargs) -> None:
super(BillingProfile, self).__init__(**kwargs)
self.max_price = max_price


class BootDiagnostics(Model):
"""Boot Diagnostics is a debugging feature which allows you to view Console
Output and Screenshot to diagnose VM status. <br><br> You can easily view
Expand Down Expand Up @@ -5729,6 +5759,10 @@ class VirtualMachineScaleSetUpdateVMProfile(Model):
:param license_type: The license type, which is for bring your own license
scenario.
:type license_type: str
:param billing_profile: Specifies the billing related details of a low
priority VMSS. <br><br>Minimum api-version: 2019-03-01.
:type billing_profile:
~azure.mgmt.compute.v2019_03_01.models.BillingProfile
"""

_attribute_map = {
Expand All @@ -5738,16 +5772,18 @@ class VirtualMachineScaleSetUpdateVMProfile(Model):
'diagnostics_profile': {'key': 'diagnosticsProfile', 'type': 'DiagnosticsProfile'},
'extension_profile': {'key': 'extensionProfile', 'type': 'VirtualMachineScaleSetExtensionProfile'},
'license_type': {'key': 'licenseType', 'type': 'str'},
'billing_profile': {'key': 'billingProfile', 'type': 'BillingProfile'},
}

def __init__(self, *, os_profile=None, storage_profile=None, network_profile=None, diagnostics_profile=None, extension_profile=None, license_type: str=None, **kwargs) -> None:
def __init__(self, *, os_profile=None, storage_profile=None, network_profile=None, diagnostics_profile=None, extension_profile=None, license_type: str=None, billing_profile=None, **kwargs) -> None:
super(VirtualMachineScaleSetUpdateVMProfile, self).__init__(**kwargs)
self.os_profile = os_profile
self.storage_profile = storage_profile
self.network_profile = network_profile
self.diagnostics_profile = diagnostics_profile
self.extension_profile = extension_profile
self.license_type = license_type
self.billing_profile = billing_profile


class VirtualMachineScaleSetVM(Resource):
Expand Down Expand Up @@ -6129,6 +6165,10 @@ class VirtualMachineScaleSetVMProfile(Model):
2017-10-30-preview. Possible values include: 'Deallocate', 'Delete'
:type eviction_policy: str or
~azure.mgmt.compute.v2019_03_01.models.VirtualMachineEvictionPolicyTypes
:param billing_profile: Specifies the billing related details of a low
priority VMSS. <br><br>Minimum api-version: 2019-03-01.
:type billing_profile:
~azure.mgmt.compute.v2019_03_01.models.BillingProfile
"""

_attribute_map = {
Expand All @@ -6140,9 +6180,10 @@ class VirtualMachineScaleSetVMProfile(Model):
'license_type': {'key': 'licenseType', 'type': 'str'},
'priority': {'key': 'priority', 'type': 'str'},
'eviction_policy': {'key': 'evictionPolicy', 'type': 'str'},
'billing_profile': {'key': 'billingProfile', 'type': 'BillingProfile'},
}

def __init__(self, *, os_profile=None, storage_profile=None, network_profile=None, diagnostics_profile=None, extension_profile=None, license_type: str=None, priority=None, eviction_policy=None, **kwargs) -> None:
def __init__(self, *, os_profile=None, storage_profile=None, network_profile=None, diagnostics_profile=None, extension_profile=None, license_type: str=None, priority=None, eviction_policy=None, billing_profile=None, **kwargs) -> None:
super(VirtualMachineScaleSetVMProfile, self).__init__(**kwargs)
self.os_profile = os_profile
self.storage_profile = storage_profile
Expand All @@ -6152,6 +6193,7 @@ def __init__(self, *, os_profile=None, storage_profile=None, network_profile=Non
self.license_type = license_type
self.priority = priority
self.eviction_policy = eviction_policy
self.billing_profile = billing_profile


class VirtualMachineScaleSetVMProtectionPolicy(Model):
Expand Down
1 change: 0 additions & 1 deletion sdk/compute/azure-mgmt-compute/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
Expand Down