File: autoscale_profile.py

package info (click to toggle)
python-azure 20181112%2Bgit-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 407,300 kB
  • sloc: python: 717,190; makefile: 201; sh: 76
file content (57 lines) | stat: -rw-r--r-- 2,324 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# 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 AutoscaleProfile(Model):
    """Autoscale profile.

    All required parameters must be populated in order to send to Azure.

    :param name: Required. the name of the profile.
    :type name: str
    :param capacity: Required. the number of instances that can be used during
     this profile.
    :type capacity: ~azure.mgmt.monitor.models.ScaleCapacity
    :param rules: Required. the collection of rules that provide the triggers
     and parameters for the scaling action. A maximum of 10 rules can be
     specified.
    :type rules: list[~azure.mgmt.monitor.models.ScaleRule]
    :param fixed_date: the specific date-time for the profile. This element is
     not used if the Recurrence element is used.
    :type fixed_date: ~azure.mgmt.monitor.models.TimeWindow
    :param recurrence: the repeating times at which this profile begins. This
     element is not used if the FixedDate element is used.
    :type recurrence: ~azure.mgmt.monitor.models.Recurrence
    """

    _validation = {
        'name': {'required': True},
        'capacity': {'required': True},
        'rules': {'required': True},
    }

    _attribute_map = {
        'name': {'key': 'name', 'type': 'str'},
        'capacity': {'key': 'capacity', 'type': 'ScaleCapacity'},
        'rules': {'key': 'rules', 'type': '[ScaleRule]'},
        'fixed_date': {'key': 'fixedDate', 'type': 'TimeWindow'},
        'recurrence': {'key': 'recurrence', 'type': 'Recurrence'},
    }

    def __init__(self, **kwargs):
        super(AutoscaleProfile, self).__init__(**kwargs)
        self.name = kwargs.get('name', None)
        self.capacity = kwargs.get('capacity', None)
        self.rules = kwargs.get('rules', None)
        self.fixed_date = kwargs.get('fixed_date', None)
        self.recurrence = kwargs.get('recurrence', None)