# GENERATED FILE - DO NOT EDIT THIS FILE UNLESS YOU ARE A WIZZARD
#pylint:  skip-file
from heat.engine import properties
from heat.engine import constraints
from heat.engine import attributes
from heat.common.i18n import _
from avi.heat.avi_resource import AviResource
from avi.heat.avi_resou
rce import AviNestedResource
from options import *

from common import *
from options import *
from vi_mgr_common import *
from dos import *
from analytics_policy import *
from vip_autoscale import *


class VssPlacement(object):
    # all schemas
    num_subcores_schema = properties.Schema(
        properties.Schema.NUMBER,
        _("(Introduced in: 17.2.5) Number of sub-cores that comprise a CPU co
re. (Default: 4)"),
        required=False,
        update_allowed=True,
    )
    core_nonaffinity_schema = properties.Schema(
        properties.Schema.NUMBER,
        _("(Introduced in: 17.2.5) Degree of core non-affinity for VS placement. (Default: 2)"),
        required=False,
        update_allowed=True,
    )

    # properties list
    PROPERTIES = (
        'num_subcores',
        'core_nonaffinity',
    )

    # mapping of properties to their schemas
    properties_schema = {
        'num_subcores': num_subcores_schema,
        'core_nonaffinity': core_nonaffinity_schema,
    }



class VcenterClusters(object):
    # all schemas
    cluster_uuids_item_schema = properties.Schema(
        properties.Schema.STRING,
        _(""),
        required=True,
        update_allowed=False,
    )
    cluster_uuids_schema = properties.Schema(
        properties.Schema.LIST,
        _(" You can either provide UUID or provide a name with the prefix 'get_avi_uuid_by_name:', e.g., 'get_avi_uuid_by_name:my_obj_name'."),
        schema=cluster_uuids_item_schema,
        required=False,
        update_allowed=True,
    )
    include_schema = properties.Schema(
        properties.Schema.BOOLEAN,
        _(" (Default: False)"),
        required=False,
        update_allowed=True,
    )

    # properties list
    PROPERTIES = (
        'cluster_uuids',
        'include',
    )

    # mapping of properties to their schemas
    properties_schema = {
        'cluster_uuids': cluster_uuids_schema,
        'include': include_schema,
    }

    # for supporting get_avi_uuid_by_name functionality
    field_references = {
        'cluster_uuids': 'vimgrclusterruntime',
    }



class VcenterHosts(object):
    # all schemas
    host_uuids_item_schema = properties.Schema(
        properties.Schema.STRING,
        _(""),
        required=True,
        update_allowed=False,
    )
    host_uuids_schema = properties.Schema(
        properties.Schema.LIST,
        _(" You can either provide UUID or provide a name with the prefix 'get_avi_uuid_by_name:', e.g., 'get_avi_uuid_by_name:my_obj_name'."),
        schema=host_uuids_item_schema,
        required=False,
        update_allowed=True,
    )
    include_schema = properties.Schema(
        properties.Schema.BOOLEAN,
        _(" (Default: False)"),
        required=False,
        update_allowed=True,
    )

    # properties list
    PROPERTIES = (
        'host_uuids',
        'include',
    )

    # mapping of properties to their schemas
    properties_schema = {
        'host_uuids': host_uuids_schema,
        'include': include_schema,
    }

    # for supporting get_avi_uuid_by_name functionality
    field_references = {
        'host_uuids': 'vimgrhostruntime',
    }



class IptableRule(object):
    # all schemas
    src_ip_schema = properties.Schema(
        properties.Schema.MAP,
        _(""),
        schema=IpAddrPrefix.properties_schema,
        required=False,
        update_allowed=True,
    )
    dst_ip_schema = properties.Schema(
        properties.Schema.MAP,
        _(""),
        schema=IpAddrPrefix.properties_schema,
        required=False,
        update_allowed=True,
    )
    src_port_schema = properties.Schema(
        properties.Schema.MAP,
        _(""),
        schema=PortRange.properties_schema,
        required=False,
        update_allowed=True,
    )
    dst_port_schema = properties.Schema(
        properties.Schema.MAP,
        _(""),
        schema=PortRange.properties_schema,
        required=False,
        update_allowed=True,
    )
    proto_schema = properties.Schema(
        properties.Schema.STRING,
        _(""),
        required=False,
        update_allowed=True,
        constraints=[
            constraints.AllowedValues(['PROTO_ALL', 'PROTO_ICMP', 'PROTO_TCP', 'PROTO_UDP']),
        ],
    )
    input_interface_schema = properties.Schema(
        properties.Schema.STRING,
        _(""),
        required=False,
        update_allowed=True,
    )
    output_interface_schema = properties.Schema(
        properties.Schema.STRING,
        _(""),
        required=False,
        update_allowed=True,
    )
    action_schema = properties.Schema(
        properties.Schema.STRING,
        _(""),
        required=True,
        update_allowed=True,
        constraints=[
            constraints.AllowedValues(['ACCEPT', 'DNAT', 'DROP', 'MASQUERADE', 'REJECT']),
        ],
    )
    dnat_ip_schema = properties.Schema(
        properties.Schema.MAP,
        _(""),
        schema=IpAddr.properties_schema,
        required=False,
        update_allowed=True,
    )
    tag_schema = properties.Schema(
        properties.Schema.STRING,
        _(""),
        required=False,
        update_allowed=True,
    )

    # properties list
    PROPERTIES = (
        'src_ip',
        'dst_ip',
        'src_port',
        'dst_port',
        'proto',
        'input_interface',
        'output_interface',
        'action',
        'dnat_ip',
        'tag',
    )

    # mapping of properties to their schemas
    properties_schema = {
        'src_ip': src_ip_schema,
        'dst_ip': dst_ip_schema,
        'src_port': src_port_schema,
        'dst_port': dst_port_schema,
        'proto': proto_schema,
        'input_interface': input_interface_schema,
        'output_interface': output_interface_schema,
        'action': action_schema,
        'dnat_ip': dnat_ip_schema,
        'tag': tag_schema,
    }

    # for supporting get_avi_uuid_by_name functionality
    field_references = {
        'src_ip': getattr(IpAddrPrefix, 'field_references', {}),
        'dst_ip': getattr(IpAddrPrefix, 'field_references', {}),
        'src_port': getattr(PortRange, 'field_references', {}),
        'dst_port': getattr(PortRange, 'field_references', {}),
        'dnat_ip': getattr(IpAddr, 'field_references', {}),
    }

    unique_keys = {
        'src_ip': getattr(IpAddrPrefix, 'unique_keys', {}),
        'dst_ip': getattr(IpAddrPrefix, 'unique_keys', {}),
        'src_port': getattr(PortRange, 'unique_keys', {}),
        'dst_port': getattr(PortRange, 'unique_keys', {}),
        'dnat_ip': getattr(IpAddr, 'unique_keys', {}),
    }



class IptableRuleSet(object):
    # all schemas
    table_schema = properties.Schema(
        properties.Schema.STRING,
        _(""),
        required=True,
        update_allowed=True,
    )
    chain_schema = properties.Schema(
        properties.Schema.STRING,
        _(""),
        required=True,
        update_allowed=True,
    )
    rules_item_schema = properties.Schema(
        properties.Schema.MAP,
        _(""),
        schema=IptableRule.properties_schema,
        required=True,
        update_allowed=False,
    )
    rules_schema = properties.Schema(
        properties.Schema.LIST,
        _(""),
        schema=rules_item_schema,
        required=False,
        update_allowed=True,
    )

    # properties list
    PROPERTIES = (
        'table',
        'chain',
        'rules',
    )

    # mapping of properties to their schemas
    properties_schema = {
        'table': table_schema,
        'chain': chain_schema,
        'rules': rules_schema,
    }

    # for supporting get_avi_uuid_by_name functionality
    field_references = {
        'rules': getattr(IptableRule, 'field_references', {}),
    }

    unique_keys = {
        'rules': getattr(IptableRule, 'unique_keys', {}),
    }



class ServiceEngineGroup(AviResource):
    resource_name = "serviceenginegroup"
    # all schemas
   