The heat.engine.resource ModuleΒΆ

heat.engine.resource.Metadata[source]

A descriptor for accessing the metadata of a resource while ensuring the most up-to-date data is always obtained from the database.

class heat.engine.resource.Resource(name, json_snippet, stack)[source]

Bases: object

Resource.ACTIONS = ('INIT', 'CREATE', 'DELETE', 'UPDATE', 'ROLLBACK', 'SUSPEND', 'RESUME')
Resource.COMPLETE = 'COMPLETE'
Resource.CREATE = 'CREATE'
Resource.DELETE = 'DELETE'
Resource.FAILED = 'FAILED'
Resource.FnBase64(data)[source]

http://docs.amazonwebservices.com/AWSCloudFormation/latest/UserGuide/ intrinsic-function-reference-base64.html

Resource.FnGetAtt(key)[source]

http://docs.amazonwebservices.com/AWSCloudFormation/latest/UserGuide/ intrinsic-function-reference-getatt.html

Resource.FnGetRefId()[source]

http://docs.amazonwebservices.com/AWSCloudFormation/latest/UserGuide/ intrinsic-function-reference-ref.html

Resource.INIT = 'INIT'
Resource.IN_PROGRESS = 'IN_PROGRESS'
Resource.RESUME = 'RESUME'
Resource.ROLLBACK = 'ROLLBACK'
Resource.STATUSES = ('IN_PROGRESS', 'FAILED', 'COMPLETE')
Resource.SUSPEND = 'SUSPEND'
Resource.UPDATE = 'UPDATE'
Resource.add_dependencies(deps)[source]
Resource.attributes_schema = {}
Resource.ceilometer()[source]
Resource.cinder()[source]
Resource.create()[source]

Create the resource. Subclasses should provide a handle_create() method to customise creation.

Resource.created_time = None
Resource.delete()[source]

Delete the resource. Subclasses should provide a handle_delete() method to customise deletion.

Resource.destroy(*args, **kwargs)[source]

Delete the resource and remove it from the database.

Resource.handle_update(json_snippet=None, tmpl_diff=None, prop_diff=None)[source]
Resource.has_interface(resource_type)[source]

Check to see if this resource is either mapped to resource_type or is a “resource_type”.

Resource.identifier()[source]

Return an identifier for this resource.

Resource.keystone()[source]
Resource.metadata = None
Resource.metadata_update(new_metadata=None)[source]

No-op for resources which don’t explicitly override this method

Resource.neutron()[source]
Resource.nova(service_type='compute')[source]
Resource.parsed_template(section=None, default={})[source]

Return the parsed template data for the resource. May be limited to only one section of the data, in which case a default value may also be supplied.

Resource.physical_resource_name()[source]
Resource.required_by()[source]

Returns a list of names of resources which directly require this resource as a dependency.

Resource.requires_deferred_auth = False
Resource.resource_id_set(inst)[source]
classmethod Resource.resource_to_template(resource_type)[source]
Parameters:
  • resource_type – The resource type to be displayed in the template
  • explode_nested – True if a resource’s nested properties schema should be resolved.
Returns:

A template where the resource’s properties_schema is mapped as parameters, and the resource’s attributes_schema is mapped as outputs

Resource.resume()[source]

Resume the resource. Subclasses should provide a handle_resume() method to implement resume

Resource.signal(details=None)[source]

signal the resource. Subclasses should provide a handle_signal() method to implement the signal, the base-class raise an exception if no handler is implemented.

Resource.state[source]

Returns state, tuple of action, status.

Resource.state_reset()[source]

Reset state to (INIT, COMPLETE)

Resource.state_set(action, status, reason='state changed')[source]
Resource.strict_dependency = True
Resource.suspend()[source]

Suspend the resource. Subclasses should provide a handle_suspend() method to implement suspend

Resource.swift()[source]
Resource.type()[source]
Resource.update(after, before=None)[source]

update the resource. Subclasses should provide a handle_update() method to customise update, the base-class handle_update will fail by default.

Resource.update_allowed_keys = ()
Resource.update_allowed_properties = ()
Resource.update_template_diff(after, before)[source]

Returns the difference between the before and after json snippets. If something has been removed in after which exists in before we set it to None. If any keys have changed which are not in update_allowed_keys, raises UpdateReplace if the differing keys are not in update_allowed_keys

Resource.update_template_diff_properties(after, before)[source]

Returns the changed Properties between the before and after json snippets. If a property has been removed in after which exists in before we set it to None. If any properties have changed which are not in update_allowed_properties, raises UpdateReplace if the modified properties are not in the update_allowed_properties

Resource.updated_time = None
Resource.validate()[source]
classmethod Resource.validate_deletion_policy(template)[source]
exception heat.engine.resource.UpdateReplace(resource_name='Unknown', message=u'The Resource %s requires replacement.')[source]

Bases: exceptions.Exception

Raised when resource update requires replacement

heat.engine.resource.get_class(resource_type, resource_name=None)[source]

Return the Resource class for a given resource type.

heat.engine.resource.get_types()[source]

Return an iterator over the list of valid resource types.

Previous topic

The heat.engine.event Module

Next topic

The heat.engine.stack_resource Module

This Page