How to use the heat.engine.resource.Resource 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 / aws / ec2 / instance.py View on Github external
cfg.CONF.import_opt('max_server_name_length', 'heat.common.config')

from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine.clients import progress
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine.resources import scheduler_hints as sh

LOG = logging.getLogger(__name__)


class Instance(resource.Resource, sh.SchedulerHintsMixin):

    PROPERTIES = (
        IMAGE_ID, INSTANCE_TYPE, KEY_NAME, AVAILABILITY_ZONE,
        DISABLE_API_TERMINATION, KERNEL_ID, MONITORING,
        PLACEMENT_GROUP_NAME, PRIVATE_IP_ADDRESS, RAM_DISK_ID,
        SECURITY_GROUPS, SECURITY_GROUP_IDS, NETWORK_INTERFACES,
        SOURCE_DEST_CHECK, SUBNET_ID, TAGS, NOVA_SCHEDULER_HINTS, TENANCY,
        USER_DATA, VOLUMES, BLOCK_DEVICE_MAPPINGS
    ) = (
        'ImageId', 'InstanceType', 'KeyName', 'AvailabilityZone',
        'DisableApiTermination', 'KernelId', 'Monitoring',
        'PlacementGroupName', 'PrivateIpAddress', 'RamDiskId',
        'SecurityGroups', 'SecurityGroupIds', 'NetworkInterfaces',
        'SourceDestCheck', 'SubnetId', 'Tags', 'NovaSchedulerHints', 'Tenancy',
        'UserData', 'Volumes', 'BlockDeviceMappings'
    )
github openstack / heat / heat / engine / resources / openstack / designate / zone.py View on Github external
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine import support
from heat.engine import translation


class DesignateZone(resource.Resource):
    """Heat Template Resource for Designate Zone.

    Designate provides DNS-as-a-Service services for OpenStack. So, zone, part
    of domain is a realm with an identification string, unique in DNS.
    """

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

    PROPERTIES = (
        NAME, TTL, DESCRIPTION, EMAIL, TYPE, PRIMARIES, MASTERS
    ) = (
        'name', 'ttl', 'description', 'email', 'type', 'primaries', 'masters'
    )

    ATTRIBUTES = (
github openstack / heat / heat / engine / resources / openstack / heat / access_policy.py View on Github external
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from heat.common import exception
from heat.common.i18n import _
from heat.engine import properties
from heat.engine import resource


class AccessPolicy(resource.Resource):
    """Resource for defining which resources can be accessed by users.

    NOTE: Now this resource is actually associated with an AWS user resource,
    not any OS:: resource though it is registered under the OS namespace below.

    Resource for defining resources that users are allowed to access by the
    DescribeStackResource API.
    """
    PROPERTIES = (
        ALLOWED_RESOURCES,
    ) = (
        'AllowedResources',
    )

    properties_schema = {
        ALLOWED_RESOURCES: properties.Schema(
github infobloxopen / heat-infoblox / heat_infoblox / resources / netmri_job.py View on Github external
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine import support

from heat_infoblox import constants
from heat_infoblox import resource_utils

import infoblox_netmri as netmri

LOG = logging.getLogger(__name__)


class NetMRIJob(resource.Resource):
    '''A resource which represents a job executed in NetMRI.'''

    PROPERTIES = (
        SOURCE, SCRIPT, JOB_SPEC, TEMPLATE,
        WAIT, INPUTS, TARGETS,
        DEVICE_ID, DEVICE_IP_ADDR, DEVICE_NET_IP_ADDR,
        NETWORK_VIEW
    ) = (
        'source', 'script', 'job_specification', 'config_template',
        'wait', 'inputs', 'targets',
        'device_id', 'device_ip_address', 'device_netview_ip_addr',
        'network_view'
    )

    ATTRIBUTES = (
        JOB,
github openstack / heat / heat / engine / resources / openstack / designate / domain.py View on Github external
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.
import six

from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine import support


class DesignateDomain(resource.Resource):
    """Heat Template Resource for Designate Domain.

    Designate provides DNS-as-a-Service services for OpenStack. So, domain
    is a realm with an identification string, unique in DNS.
    """

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

    entity = 'domains'

    default_client_name = 'designate'

    PROPERTIES = (
        NAME, TTL, DESCRIPTION, EMAIL
    ) = (
github infobloxopen / heat-infoblox / heat_infoblox / resources / ha_pair.py View on Github external
import netaddr
import time

from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import properties
from heat.engine import resource
from heat.engine import support

from heat_infoblox import resource_utils


LOG = logging.getLogger(__name__)


class HaPair(resource.Resource):
    '''A resource which represents an Infoblox HA pair.

    This is used to combine two instances into HA pair.
    '''

    PROPERTIES = (
        NAME, VIP_PORT, NODE1_HA_PORT, NODE2_HA_PORT,
        NODE1_LAN1_PORT, NODE2_LAN1_PORT,
        VIP_FLOATING_IP, NODE1_FLOATING_IP, NODE2_FLOATING_IP,
        VIRTUAL_ROUTER_ID, NODE_WAIT_TIMEOUT, NODE_WAIT_RETRIES,
        NODE1_ADMIN, NODE1_PASSWORD, NODE2_ADMIN, NODE2_PASSWORD,
        UPDATE_ALLOWED_ADDRESS_PAIRS
    ) = (
        'name', 'vip', 'node1_ha', 'node2_ha', 'node1_lan1', 'node2_lan1',
        'vip_floating_ip', 'node1_floating_ip', 'node2_floating_ip',
        'virtual_router_id', 'node_wait_timeout', 'node_wait_retries',
github openstack / heat / heat / engine / resources / aws / autoscaling / autoscaling_group.py View on Github external
def _make_launch_config_resource(self, name, props):
        lc_res_type = 'AWS::AutoScaling::LaunchConfiguration'
        lc_res_def = rsrc_defn.ResourceDefinition(name,
                                                  lc_res_type,
                                                  props)
        lc_res = resource.Resource(name, lc_res_def, self.stack)
        return lc_res
github openstack / heat / heat / engine / resources / openstack / heat / wait_condition.py View on Github external
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import timeutils

from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine.resources import wait_condition as wc_base
from heat.engine import support

LOG = logging.getLogger(__name__)


class HeatWaitCondition(resource.Resource):
    """Resource for handling signals received by WaitConditionHandle.

    Resource takes WaitConditionHandle and starts to create. Resource is in
    CREATE_IN_PROGRESS status until WaitConditionHandle doesn't receive
    sufficient number of successful signals (this number can be specified with
    count property) and successfully creates after that, or fails due to
    timeout.
    """

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

    PROPERTIES = (
        HANDLE, TIMEOUT, COUNT,
    ) = (
        'handle', 'timeout', 'count',
    )
github F5Networks / f5-openstack-heat-plugins / f5_heat / resources / f5_ltm_virtualserver.py View on Github external
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

from heat.common import exception
from heat.common.i18n import _
from heat.engine import properties
from heat.engine import resource

from common.mixins import f5_common_resources
from common.mixins import F5BigIPMixin


class F5LTMVirtualServer(resource.Resource, F5BigIPMixin):
    '''Manages creation of an F5® LTM Virtual Server Resource.'''

    PROPERTIES = (
        NAME,
        BIGIP_SERVER,
        PARTITION,
        IP,
        PORT,
        DEFAULT_POOL,
        VLANS
    ) = (
        'name',
        'bigip_server',
        'partition',
        'ip',
        'port',