aria_extension_tosca.simple_v1_0.presentation
¶
aria_extension_tosca.simple_v1_0.presentation.extensible
¶
-
class
aria_extension_tosca.simple_v1_0.presentation.extensible.
ExtensiblePresentation
(name=None, raw=None, container=None)¶ Bases:
aria.parser.presentation.presentation.Presentation
A presentation that supports an optional
_extensions
dict field.
aria_extension_tosca.simple_v1_0.presentation.field_getters
¶
-
aria_extension_tosca.simple_v1_0.presentation.field_getters.
data_type_class_getter
(cls, allow_null=False)¶ Wraps the field value in a specialized data type class.
Can be used with the
field_getter()
decorator.
aria_extension_tosca.simple_v1_0.presentation.field_validators
¶
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
capability_definition_or_type_validator
(field, presentation, context)¶ Makes sure refers to either a capability assignment name in the node template referred to by the
node
field or a general capability type.If the value refers to a capability type, make sure the
node
field was not assigned.Used with the
field_validator()
decorator for thecapability
field inRequirementAssignment
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
constraint_clause_field_validator
(field, presentation, context)¶ Makes sure that field contains a valid value for the container type.
Used with the
field_validator()
decorator for various field inConstraintClause
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
constraint_clause_in_range_validator
(field, presentation, context)¶ Makes sure that the value is a list with exactly two elements, that both lower bound contains a valid value for the container type, and that the upper bound is either “UNBOUNDED” or a valid value for the container type.
Used with the
field_validator()
decorator for thein_range
field inConstraintClause
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
constraint_clause_pattern_validator
(field, presentation, context)¶ Makes sure that the value is a valid regular expression.
Used with the
field_validator()
decorator for thepattern
field inConstraintClause
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
constraint_clause_valid_values_validator
(field, presentation, context)¶ Makes sure that the value is a list of valid values for the container type.
Used with the
field_validator()
decorator for thevalid_values
field inConstraintClause
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
copy_validator
(template_type_name, templates_dict_name)¶ Makes sure that the field refers to an existing template defined in the root presenter.
Use with the
field_validator()
decorator for thecopy
field inNodeTemplate
andRelationshipTemplate
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
data_type_constraints_validator
(field, presentation, context)¶ Makes sure that we do not have constraints if we are a complex type (with no primitive ancestor).
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
data_type_derived_from_validator
(field, presentation, context)¶ Makes sure that the field refers to a valid parent data type (complex or primitive).
Used with the
field_validator()
decorator for thederived_from
field inDataType
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
data_type_properties_validator
(field, presentation, context)¶ Makes sure that we do not have properties if we have a primitive ancestor.
Used with the
field_validator()
decorator for theproperties
field inDataType
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
data_type_validator
(type_name='data type')¶ Makes sure that the field refers to a valid data type, whether complex or primitive.
Used with the
field_validator()
decorator for thetype
fields inPropertyDefinition
,AttributeDefinition
,ParameterDefinition
, andEntrySchema
.Extra behavior beyond validation: generated function returns true if field is a complex data type.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
data_value_validator
(field, presentation, context)¶ Makes sure that the field contains a valid value according to data type and constraints.
Used with the
field_validator()
decorator for thedefault
field inPropertyDefinition
andAttributeDefinition
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
entry_schema_validator
(field, presentation, context)¶ According to whether the data type supports
entry_schema
(e.g., it is or inherits from list or map), make sure that we either have or don’t have a valid data type value.Used with the
field_validator()
decorator for theentry_schema
field inPropertyDefinition
andAttributeDefinition
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
group_members_validator
(field, presentation, context)¶ Makes sure that the field’s elements refer to node templates and that they match the node types declared in the group type.
Used with the
field_validator()
decorator for thetargets
field inGroupTemplate
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
list_node_type_or_group_type_validator
(field, presentation, context)¶ Makes sure that the field’s elements refer to either node types or a group types.
Used with the
field_validator()
decorator for thetargets
field inPolicyType
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
node_filter_capabilities_validator
(field, presentation, context)¶ Makes sure that the field’s elements refer to defined capabilities and properties in the target node type.
Used with the
field_validator()
decorator for thecapabilities
field inNodeFilter
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
node_filter_properties_validator
(field, presentation, context)¶ Makes sure that the field’s elements refer to defined properties in the target node type.
Used with the
field_validator()
decorator for theproperties
field inNodeFilter
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
node_filter_validator
(field, presentation, context)¶ Makes sure that the field has a value only if “node” refers to a node type.
Used with the
field_validator()
decorator for thenode_filter
field inRequirementAssignment
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
node_template_or_type_validator
(field, presentation, context)¶ Makes sure that the field refers to either a node template or a node type.
Used with the
field_validator()
decorator for thenode
field inRequirementAssignment
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
policy_targets_validator
(field, presentation, context)¶ Makes sure that the field’s elements refer to either node templates or groups, and that they match the node types and group types declared in the policy type.
Used with the
field_validator()
decorator for thetargets
field inPolicyTemplate
.
-
aria_extension_tosca.simple_v1_0.presentation.field_validators.
relationship_template_or_type_validator
(field, presentation, context)¶ Makes sure that the field refers to either a relationship template or a relationship type.
Used with the
field_validator()
decorator for thetype
field inRelationshipAssignment
.
aria_extension_tosca.simple_v1_0.presentation.types
¶
-
aria_extension_tosca.simple_v1_0.presentation.types.
convert_name_to_full_type_name
(context, name, types_dict)¶ Converts a type name to its full type name, or else returns it unchanged.
Works by checking for
shorthand_name
andtype_qualified_name
in the types’_extensions
field. See alsoaria_extension_tosca.v1_0.presentation.extensible.ExtensiblePresentation
.Can be used as the conversion function argument in
type_validator
andderived_from_validator
.
-
aria_extension_tosca.simple_v1_0.presentation.types.
get_type_by_name
(context, name, *types_dict_names)¶ Gets a type either by its full name or its shorthand name or type-qualified name.
Works by checking for
shorthand_name
andtype_qualified_name
in the types’_extensions
field. See alsoExtensiblePresentation
.The arguments from the third onwards are used to locate a nested field under
service_template
under the root presenter.