How to use the heat.engine.properties.Schema function in heat

To help you get started, we’ve selected a few heat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openstack / heat / heat / engine / resources / openstack / zaqar / queue.py View on Github external
support_status = support.SupportStatus(version='8.0.0')

    PROPERTIES = (
        QUEUE, PATHS, TTL, METHODS,
    ) = (
        'queue', 'paths', 'ttl', 'methods',
    )

    ATTRIBUTES = (
        SIGNATURE, EXPIRES, PATHS_ATTR, METHODS_ATTR, PROJECT, QUERY_STR,
    ) = (
        'signature', 'expires', 'paths', 'methods', 'project', 'query_str',
    )

    properties_schema = {
        QUEUE: properties.Schema(
            properties.Schema.STRING,
            _("Name of the queue instance to create a URL for."),
            required=True),
        PATHS: properties.Schema(
            properties.Schema.LIST,
            description=_("List of allowed paths to be accessed. "
                          "Default to allow queue messages URL.")),
        TTL: properties.Schema(
            properties.Schema.INTEGER,
            description=_("Time validity of the URL, in seconds. "
                          "Default to one day.")),
        METHODS: properties.Schema(
            properties.Schema.LIST,
            description=_("List of allowed HTTP methods to be used. "
                          "Default to allow GET."),
            schema=properties.Schema(
github openstack / heat / contrib / rackspace / rackspace / resources / cloud_dns.py View on Github external
RECORD_DATA: properties.Schema(
                        properties.Schema.STRING,
                        _('Type specific record data'),
                        required=True
                    ),
                    RECORD_PRIORITY: properties.Schema(
                        properties.Schema.INTEGER,
                        _('Required for MX and SRV records, but '
                          'forbidden for other record types. If '
                          'specified, must be an integer from 0 to '
                          '65535.'),
                        constraints=[
                            constraints.Range(0, 65535),
                        ]
                    ),
                    RECORD_TTL: properties.Schema(
                        properties.Schema.INTEGER,
                        _('How long other servers should cache '
                          'recorddata.'),
                        default=3600,
                        constraints=[
                            constraints.Range(min=300),
                        ]
                    ),
                    RECORD_TYPE: properties.Schema(
                        properties.Schema.STRING,
                        _('Specifies the record type.'),
                        required=True,
                        constraints=[
                            constraints.AllowedValues(['A', 'AAAA', 'NS',
                                                       'MX', 'CNAME',
                                                       'TXT', 'SRV']),
github openstack / heat / heat / engine / resources / neutron / router.py View on Github external
) = (
        'status', 'external_gateway_info', 'name', 'admin_state_up',
        'tenant_id', 'show',
    )

    properties_schema = {
        NAME: properties.Schema(
            properties.Schema.STRING,
            _('The name of the router.'),
            update_allowed=True
        ),
        EXTERNAL_GATEWAY: properties.Schema(
            properties.Schema.MAP,
            _('External network gateway configuration for a router.'),
            schema={
                EXTERNAL_GATEWAY_NETWORK: properties.Schema(
                    properties.Schema.STRING,
                    _('ID or name of the external network for the gateway.'),
                    required=True,
                    update_allowed=True
                ),
                EXTERNAL_GATEWAY_ENABLE_SNAT: properties.Schema(
                    properties.Schema.BOOLEAN,
                    _('Enables Source NAT on the router gateway. NOTE: The '
                      'default policy setting in Neutron restricts usage of '
                      'this property to administrative users only.'),
                    update_allowed=True
                ),
            },
            update_allowed=True
        ),
        VALUE_SPECS: properties.Schema(
github openstack / heat / heat / engine / resources / openstack / neutron / firewall.py View on Github external
constraints=[
                constraints.AllowedValues(['tcp', 'udp', 'icmp', 'any']),
            ],
            default='any',
            update_allowed=True,
        ),
        IP_VERSION: properties.Schema(
            properties.Schema.STRING,
            _('Internet protocol version.'),
            default='4',
            constraints=[
                constraints.AllowedValues(['4', '6']),
            ],
            update_allowed=True
        ),
        SOURCE_IP_ADDRESS: properties.Schema(
            properties.Schema.STRING,
            _('Source IP address or CIDR.'),
            update_allowed=True,
            constraints=[
                constraints.CustomConstraint('net_cidr')
            ]
        ),
        DESTINATION_IP_ADDRESS: properties.Schema(
            properties.Schema.STRING,
            _('Destination IP address or CIDR.'),
            update_allowed=True,
            constraints=[
                constraints.CustomConstraint('net_cidr')
            ]
        ),
        SOURCE_PORT: properties.Schema(
github openstack / heat / heat / engine / resources / openstack / heat / resource_group.py View on Github external
constraints.Length(min=3)
            ],
            support_status=support.SupportStatus(version='2014.2')
        ),
        RESOURCE_DEF: properties.Schema(
            properties.Schema.MAP,
            _('Resource definition for the resources in the group. The value '
              'of this property is the definition of a resource just as if '
              'it had been declared in the template itself.'),
            schema={
                RESOURCE_DEF_TYPE: properties.Schema(
                    properties.Schema.STRING,
                    _('The type of the resources in the group.'),
                    required=True
                ),
                RESOURCE_DEF_PROPERTIES: properties.Schema(
                    properties.Schema.MAP,
                    _('Property values for the resources in the group.')
                ),
                RESOURCE_DEF_METADATA: properties.Schema(
                    properties.Schema.MAP,
                    _('Supplied metadata for the resources in the group.'),
                    support_status=support.SupportStatus(version='5.0.0')
                ),

            },
            required=True,
            update_allowed=True
        ),
        REMOVAL_POLICIES: properties.Schema(
            properties.Schema.LIST,
            _('Policies for removal of resources on update.'),
github openstack / heat / heat / engine / resources / openstack / heat / cloud_config.py View on Github external
This resource will generally be referenced by OS::Nova::Server user_data,
    or OS::Heat::MultipartMime parts config. Since cloud-config is boot-only
    configuration, any changes to the definition will result in the
    replacement of all servers which reference it.
    """

    support_status = support.SupportStatus(version='2014.1')

    PROPERTIES = (
        CLOUD_CONFIG
    ) = (
        'cloud_config'
    )

    properties_schema = {
        CLOUD_CONFIG: properties.Schema(
            properties.Schema.MAP,
            _('Map representing the cloud-config data structure which will '
              'be formatted as YAML.')
        )
    }

    def handle_create(self):
        cloud_config = template_format.yaml.dump(
            self.properties[self.CLOUD_CONFIG],
            Dumper=template_format.yaml_dumper)
        props = {
            rpc_api.SOFTWARE_CONFIG_NAME: self.physical_resource_name(),
            rpc_api.SOFTWARE_CONFIG_CONFIG: '#cloud-config\n%s' % cloud_config,
            rpc_api.SOFTWARE_CONFIG_GROUP: 'Heat::Ungrouped'
        }
        sc = self.rpc_client().create_software_config(self.context, **props)
github Juniper / contrail-heat / contrail_heat / resources / physical_interface.py View on Github external
from heat.engine import attributes
from heat.engine import properties
from vnc_api import vnc_api
from contrail_heat.resources import contrail


class HeatPhysicalInterface(contrail.ContrailResource):
    PROPERTIES = (
        NAME, PHYSICAL_ROUTER,
    ) = (
        'name', 'physical_router',
    )

    properties_schema = {
        NAME: properties.Schema(
            properties.Schema.STRING,
            _('Physical interface name'),
            update_allowed=True,
        ),
        PHYSICAL_ROUTER: properties.Schema(
            properties.Schema.STRING,
            _('Physical router id.'),
            default=None,
        ),
    }

    attributes_schema = {
        "name": attributes.Schema(
            _('The name of the physical interface.'),
        ),
        "fq_name": attributes.Schema(
github openstack / heat / heat / engine / resources / openstack / heat / remote_stack.py View on Github external
required=False,
                    update_allowed=True,
                    support_status=support.SupportStatus(version='12.0.0'),
                ),
                SSL_INSECURE: properties.Schema(
                    properties.Schema.BOOLEAN,
                    _("If set, then the server's certificate will not be "
                      "verified."),
                    default=False,
                    required=False,
                    update_allowed=True,
                    support_status=support.SupportStatus(version='12.0.0'),
                ),
            }
        ),
        TEMPLATE: properties.Schema(
            properties.Schema.STRING,
            _('Template that specifies the stack to be created as '
              'a resource.'),
            required=True,
            update_allowed=True
        ),
        TIMEOUT: properties.Schema(
            properties.Schema.INTEGER,
            _('Number of minutes to wait for this stack creation.'),
            update_allowed=True
        ),
        PARAMETERS: properties.Schema(
            properties.Schema.MAP,
            _('Set of parameters passed to this stack.'),
            default={},
            update_allowed=True
github openstack / heat / heat / engine / resources / openstack / nova / server.py View on Github external
message=_('This is not supported with nova api '
                          'microversion 2.57 and above. '
                          'OS::Nova::Server resource will not support '
                          'it in the future. Please use user_data or metadata '
                          'instead. However, you can set heat config option '
                          'max_nova_api_microversion < 2.57 to use '
                          'this property in the meantime.')
            ),
            default={}
        ),
        ADMIN_PASS: properties.Schema(
            properties.Schema.STRING,
            _('The administrator password for the server.'),
            update_allowed=True
        ),
        TAGS: properties.Schema(
            properties.Schema.LIST,
            _('Server tags. Supported since client version 2.26.'),
            support_status=support.SupportStatus(version='8.0.0'),
            schema=properties.Schema(properties.Schema.STRING),
            update_allowed=True
        ),
        DEPLOYMENT_SWIFT_DATA: properties.Schema(
            properties.Schema.MAP,
            _('Swift container and object to use for storing deployment data '
              'for the server resource. The parameter is a map value '
              'with the keys "container" and "object", and the values '
              'are the corresponding container and object names. The '
              'software_config_transport parameter must be set to '
              'POLL_TEMP_URL for swift to be used. If not specified, '
              'and software_config_transport is set to POLL_TEMP_URL, a '
              'container will be automatically created from the resource '
github openstack / heat / heat / engine / resources / openstack / neutron / port.py View on Github external
],
            update_allowed=True,
            support_status=support.SupportStatus(
                status=support.HIDDEN,
                version='9.0.0',
                previous_status=support.SupportStatus(
                    status=support.DEPRECATED,
                    version='6.0.0',
                    message=_('Replacement policy used to work around flawed '
                              'nova/neutron port interaction which has been '
                              'fixed since Liberty.'),
                    previous_status=support.SupportStatus(version='2014.2')
                )
            )
        ),
        DNS_NAME: properties.Schema(
            properties.Schema.STRING,
            _('DNS name associated with the port.'),
            update_allowed=True,
            constraints=[
                constraints.CustomConstraint('dns_name')
            ],
            support_status=support.SupportStatus(version='7.0.0'),
        ),
        TAGS: properties.Schema(
            properties.Schema.LIST,
            _('The tags to be added to the port.'),
            schema=properties.Schema(properties.Schema.STRING),
            update_allowed=True,
            support_status=support.SupportStatus(version='9.0.0')
        ),
    }