Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2EE47200CB6 for ; Thu, 29 Jun 2017 13:53:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2D5A0160BED; Thu, 29 Jun 2017 11:53:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DBF92160BF7 for ; Thu, 29 Jun 2017 13:53:13 +0200 (CEST) Received: (qmail 86491 invoked by uid 500); 29 Jun 2017 11:53:13 -0000 Mailing-List: contact commits-help@ariatosca.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ariatosca.incubator.apache.org Delivered-To: mailing list commits@ariatosca.incubator.apache.org Received: (qmail 86482 invoked by uid 99); 29 Jun 2017 11:53:13 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jun 2017 11:53:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9077B188A36 for ; Thu, 29 Jun 2017 11:53:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.221 X-Spam-Level: X-Spam-Status: No, score=-4.221 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 2_2QGkBYiv9U for ; Thu, 29 Jun 2017 11:53:02 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id CE2AD5FE2F for ; Thu, 29 Jun 2017 11:52:59 +0000 (UTC) Received: (qmail 85896 invoked by uid 99); 29 Jun 2017 11:52:59 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jun 2017 11:52:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 371CCE5E08; Thu, 29 Jun 2017 11:52:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ran@apache.org To: commits@ariatosca.incubator.apache.org Date: Thu, 29 Jun 2017 11:52:59 -0000 Message-Id: <22856997f3f944dcb9b2e760d1ffb3fd@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [02/10] incubator-ariatosca git commit: ARIA-286 Sphinx documentation for code and CLI archived-at: Thu, 29 Jun 2017 11:53:16 -0000 http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8eef8ed9/extensions/aria_extension_tosca/simple_v1_0/definitions.py ---------------------------------------------------------------------- diff --git a/extensions/aria_extension_tosca/simple_v1_0/definitions.py b/extensions/aria_extension_tosca/simple_v1_0/definitions.py index 8564249..1bd0366 100644 --- a/extensions/aria_extension_tosca/simple_v1_0/definitions.py +++ b/extensions/aria_extension_tosca/simple_v1_0/definitions.py @@ -42,7 +42,7 @@ class PropertyDefinition(ExtensiblePresentation): an entity defined in this specification (e.g., Node Types, Relationship Types, Capability Types, etc.). Properties are used by template authors to provide input values to TOSCA entities which indicate their "desired state" when they are instantiated. The value of a property can be - retrieved using the :code:`get_property` function within TOSCA Service Templates. + retrieved using the ``get_property`` function within TOSCA Service Templates. See the `TOSCA Simple Profile v1.0 cos01 specification `__ - :rtype: list of (str, :class:`ConstraintClause`) + :type: list of (str, :class:`ConstraintClause`) """ @field_validator(node_filter_capabilities_validator) @@ -80,7 +84,7 @@ class NodeFilter(ExtensiblePresentation): matching TOSCA entities (e.g., Node Template, Node Type, Capability Types, etc.) based upon their capabilities' property definitions' values. - :rtype: list of (str, :class:`CapabilityDefinition`) + :type: list of (str, :class:`CapabilityDefinition`) """ @cachedmethod http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8eef8ed9/extensions/aria_extension_tosca/simple_v1_0/misc.py ---------------------------------------------------------------------- diff --git a/extensions/aria_extension_tosca/simple_v1_0/misc.py b/extensions/aria_extension_tosca/simple_v1_0/misc.py index 74eba18..f4d43ac 100644 --- a/extensions/aria_extension_tosca/simple_v1_0/misc.py +++ b/extensions/aria_extension_tosca/simple_v1_0/misc.py @@ -39,6 +39,8 @@ from .presentation.types import (convert_shorthand_to_full_type_name, @implements_specification('3.5.1', 'tosca-simple-1.0') class Description(AsIsPresentation): """ + Human-readable description. + See the `TOSCA Simple Profile v1.0 cos01 specification `__ @@ -55,6 +57,10 @@ class Description(AsIsPresentation): @has_fields @implements_specification('3.9.3.2', 'tosca-simple-1.0') class MetaData(ExtensiblePresentation): + """ + Meta data. + """ + @primitive_field(str) @implements_specification('3.9.3.3', 'tosca-simple-1.0') def template_name(self): @@ -82,7 +88,7 @@ class MetaData(ExtensiblePresentation): @primitive_dict_unknown_fields() def custom(self): """ - :rtype: dict + :type: dict """ @short_form_field('url') @@ -103,7 +109,7 @@ class Repository(ExtensiblePresentation): """ The optional description for the repository. - :rtype: :class:`Description` + :type: :class:`Description` """ @primitive_field(str, required=True) @@ -111,7 +117,7 @@ class Repository(ExtensiblePresentation): """ The required URL or network address used to access the repository. - :rtype: str + :type: :obj:`basestring` """ @primitive_field() @@ -119,7 +125,7 @@ class Repository(ExtensiblePresentation): """ The optional Credential used to authorize access to the repository. - :rtype: tosca.datatypes.Credential + :type: tosca.datatypes.Credential """ @cachedmethod @@ -145,7 +151,7 @@ class Import(ExtensiblePresentation): """ The required symbolic name for the imported file. - :rtype: str + :type: :obj:`basestring` """ @primitive_field(str) @@ -154,7 +160,7 @@ class Import(ExtensiblePresentation): The optional symbolic name of the repository definition where the imported file can be found as a string. - :rtype: str + :type: :obj:`basestring` """ @primitive_field(str) @@ -163,7 +169,7 @@ class Import(ExtensiblePresentation): The optional namespace URI to that will be applied to type definitions found within the imported file as a string. - :rtype: str + :type: :obj:`basestring` """ @primitive_field(str) @@ -173,7 +179,7 @@ class Import(ExtensiblePresentation): forming a qualified name (i.e., qname) when referencing type definitions from the imported file. - :rtype: str + :type: :obj:`basestring` """ @has_fields @@ -233,7 +239,7 @@ class ConstraintClause(ExtensiblePresentation): Constrains a property or parameter to a value in range of (inclusive) the two values declared. - Note: subclasses or templates of types that declare a property with the :code:`in_range` + Note: subclasses or templates of types that declare a property with the ``in_range`` constraint MAY only further restrict the range specified by the parent type. """ @@ -300,19 +306,19 @@ class EntrySchema(ExtensiblePresentation): @primitive_field(str, required=True) def type(self): """ - :rtype: str + :type: :obj:`basestring` """ @object_field(Description) def description(self): """ - :rtype: :class:`Description` + :type: :class:`Description` """ @object_list_field(ConstraintClause) def constraints(self): """ - :rtype: list of (str, :class:`ConstraintClause`) + :type: list of (str, :class:`ConstraintClause`) """ @cachedmethod @@ -326,13 +332,17 @@ class EntrySchema(ExtensiblePresentation): @short_form_field('primary') @has_fields class OperationImplementation(ExtensiblePresentation): + """ + Operation implementation. + """ + @primitive_field(str) def primary(self): """ The optional implementation artifact name (i.e., the primary script file name within a TOSCA CSAR file). - :rtype: str + :type: :obj:`basestring` """ @primitive_list_field(str) @@ -342,10 +352,14 @@ class OperationImplementation(ExtensiblePresentation): which are referenced by the primary implementation artifact (e.g., a library the script installs or a secondary script). - :rtype: list of str + :type: [:obj:`basestring`] """ class SubstitutionMappingsRequirement(AsIsPresentation): + """ + Substitution mapping for requirement. + """ + @property @cachedmethod def node_template(self): @@ -361,6 +375,10 @@ class SubstitutionMappingsRequirement(AsIsPresentation): validate_subtitution_mappings_requirement(context, self) class SubstitutionMappingsCapability(AsIsPresentation): + """ + Substitution mapping for capability. + """ + @property @cachedmethod def node_template(self): @@ -378,23 +396,27 @@ class SubstitutionMappingsCapability(AsIsPresentation): @has_fields @implements_specification('2.10', 'tosca-simple-1.0') class SubstitutionMappings(ExtensiblePresentation): + """ + Substitution mappings. + """ + @field_validator(type_validator('node type', convert_shorthand_to_full_type_name, 'node_types')) @primitive_field(str, required=True) def node_type(self): """ - :rtype: str + :type: :obj:`basestring` """ @object_dict_field(SubstitutionMappingsRequirement) def requirements(self): """ - :rtype: dict of str, :class:`SubstitutionMappingsRequirement` + :type: {:obj:`basestring`: :class:`SubstitutionMappingsRequirement`} """ @object_dict_field(SubstitutionMappingsCapability) def capabilities(self): """ - :rtype: dict of str, :class:`SubstitutionMappingsCapability` + :type: {:obj:`basestring`: :class:`SubstitutionMappingsCapability`} """ @cachedmethod http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8eef8ed9/extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py ---------------------------------------------------------------------- diff --git a/extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py b/extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py index 5813ccf..957dc7b 100644 --- a/extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py +++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py @@ -484,7 +484,6 @@ def create_substitution_template_model(context, service_template, substitution_m node_template_model.capability_templates[capability.capability] model.mappings[name] = \ SubstitutionTemplateMapping(name=name, - node_template=node_template_model, capability_template=capability_template_model) requirements = substitution_mappings.requirements @@ -499,7 +498,6 @@ def create_substitution_template_model(context, service_template, substitution_m break model.mappings[name] = \ SubstitutionTemplateMapping(name=name, - node_template=node_template_model, requirement_template=requirement_template_model) return model http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8eef8ed9/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py ---------------------------------------------------------------------- diff --git a/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py b/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py index a90a9fc..d75e723 100644 --- a/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py +++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py @@ -26,8 +26,8 @@ from .parameters import (convert_parameter_definitions_to_values, merge_raw_para def get_inherited_valid_source_types(context, presentation): """ - If we haven't set the :code:`valid_source_types` fields, uses that value from our parent, if - we have one (recursively). + If we haven't set the ``valid_source_types`` fields, uses that value from our parent, if we have + one (recursively). """ valid_source_types = presentation.valid_source_types http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8eef8ed9/extensions/aria_extension_tosca/simple_v1_0/modeling/copy.py ---------------------------------------------------------------------- diff --git a/extensions/aria_extension_tosca/simple_v1_0/modeling/copy.py b/extensions/aria_extension_tosca/simple_v1_0/modeling/copy.py index b86e8eb..bd9037f 100644 --- a/extensions/aria_extension_tosca/simple_v1_0/modeling/copy.py +++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/copy.py @@ -19,7 +19,7 @@ def get_default_raw_from_copy(presentation, field_name): """ - Used for the :code:`_get_default_raw` field hook. + Used for the ``_get_default_raw`` field hook. """ copy = presentation._raw.get('copy') http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8eef8ed9/extensions/aria_extension_tosca/simple_v1_0/modeling/data_types.py ---------------------------------------------------------------------- diff --git a/extensions/aria_extension_tosca/simple_v1_0/modeling/data_types.py b/extensions/aria_extension_tosca/simple_v1_0/modeling/data_types.py index c0d79e5..ba94c70 100644 --- a/extensions/aria_extension_tosca/simple_v1_0/modeling/data_types.py +++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/data_types.py @@ -55,7 +55,7 @@ def get_inherited_constraints(context, presentation): def coerce_data_type_value(context, presentation, data_type, entry_schema, constraints, value, # pylint: disable=unused-argument aspect): """ - Handles the :code:`_coerce_data()` hook for complex data types. + Handles the ``_coerce_data()`` hook for complex data types. There are two kinds of handling: @@ -383,7 +383,7 @@ def coerce_value(context, presentation, the_type, entry_schema, constraints, val Supports both complex data types and primitives. - Data types can use the :code:`coerce_value` extension to hook their own specialized function. + Data types can use the ``coerce_value`` extension to hook their own specialized function. If the extension is present, we will delegate to that hook. """ @@ -454,10 +454,10 @@ def coerce_to_data_type_class(context, presentation, cls, entry_schema, constrai Returns the value after it's coerced to a data type class, reporting validation errors if it cannot be coerced. Constraints will be applied after coersion. - Will either call a :code:`_create` static function in the class, or instantiate it using a - constructor if :code:`_create` is not available. + Will either call a ``_create`` static function in the class, or instantiate it using a + constructor if ``_create`` is not available. - This will usually be called by a :code:`coerce_value` extension hook in a :class:`DataType`. + This will usually be called by a ``coerce_value`` extension hook in a :class:`DataType`. """ try: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8eef8ed9/extensions/aria_extension_tosca/simple_v1_0/modeling/functions.py ---------------------------------------------------------------------- diff --git a/extensions/aria_extension_tosca/simple_v1_0/modeling/functions.py b/extensions/aria_extension_tosca/simple_v1_0/modeling/functions.py index 7025213..590c6a0 100644 --- a/extensions/aria_extension_tosca/simple_v1_0/modeling/functions.py +++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/functions.py @@ -34,7 +34,7 @@ from aria.modeling.functions import (Function, Evaluation) @implements_specification('4.3.1', 'tosca-simple-1.0') class Concat(Function): """ - The :code:`concat` function is used to concatenate two or more string values within a TOSCA + The ``concat`` function is used to concatenate two or more string values within a TOSCA service template. """ @@ -76,7 +76,7 @@ class Concat(Function): @implements_specification('4.3.2', 'tosca-simple-1.0') class Token(Function): """ - The :code:`token` function is used within a TOSCA service template on a string to parse out + The ``token`` function is used within a TOSCA service template on a string to parse out (tokenize) substrings separated by one or more token characters within a larger string. """ @@ -127,7 +127,7 @@ class Token(Function): @implements_specification('4.4.1', 'tosca-simple-1.0') class GetInput(Function): """ - The :code:`get_input` function is used to retrieve the values of properties declared within the + The ``get_input`` function is used to retrieve the values of properties declared within the inputs section of a TOSCA Service Template. """ @@ -170,7 +170,7 @@ class GetInput(Function): @implements_specification('4.4.2', 'tosca-simple-1.0') class GetProperty(Function): """ - The :code:`get_property` function is used to retrieve property values between modelable entities + The ``get_property`` function is used to retrieve property values between modelable entities defined in the same service template. """ @@ -238,7 +238,7 @@ class GetProperty(Function): @implements_specification('4.5.1', 'tosca-simple-1.0') class GetAttribute(Function): """ - The :code:`get_attribute` function is used to retrieve the values of named attributes declared + The ``get_attribute`` function is used to retrieve the values of named attributes declared by the referenced node or relationship template name. """ @@ -285,7 +285,7 @@ class GetAttribute(Function): @implements_specification('4.6.1', 'tosca-simple-1.0') # pylint: disable=abstract-method class GetOperationOutput(Function): """ - The :code:`get_operation_output` function is used to retrieve the values of variables exposed / + The ``get_operation_output`` function is used to retrieve the values of variables exposed / exported from an interface operation. """ @@ -331,7 +331,7 @@ class GetOperationOutput(Function): @implements_specification('4.7.1', 'tosca-simple-1.0') class GetNodesOfType(Function): """ - The :code:`get_nodes_of_type` function can be used to retrieve a list of all known instances of + The ``get_nodes_of_type`` function can be used to retrieve a list of all known instances of nodes of the declared Node Type. """ @@ -367,7 +367,7 @@ class GetNodesOfType(Function): @implements_specification('4.8.1', 'tosca-simple-1.0') # pylint: disable=abstract-method class GetArtifact(Function): """ - The :code:`get_artifact` function is used to retrieve artifact location between modelable + The ``get_artifact`` function is used to retrieve artifact location between modelable entities defined in the same service template. """ @@ -574,7 +574,7 @@ def get_hosts(container_holder, name, locator): using this reference (i.e., as identified by its HostedOn relationship). Specifically, TOSCA orchestrators that encounter this keyword when evaluating the get_attribute - or :code:`get_property` functions SHALL search each node along the "HostedOn" relationship chain + or ``get_property`` functions SHALL search each node along the "HostedOn" relationship chain starting at the immediate node that hosts the node where the function was evaluated (and then that node's host node, and so forth) until a match is found or the "HostedOn" relationship chain ends. http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8eef8ed9/extensions/aria_extension_tosca/simple_v1_0/presentation/extensible.py ---------------------------------------------------------------------- diff --git a/extensions/aria_extension_tosca/simple_v1_0/presentation/extensible.py b/extensions/aria_extension_tosca/simple_v1_0/presentation/extensible.py index a2fd6ee..63bc02f 100644 --- a/extensions/aria_extension_tosca/simple_v1_0/presentation/extensible.py +++ b/extensions/aria_extension_tosca/simple_v1_0/presentation/extensible.py @@ -19,7 +19,7 @@ from aria.parser.presentation import (Presentation, has_fields, primitive_dict_f @has_fields class ExtensiblePresentation(Presentation): """ - A presentation that supports an optional :code:`_extensions` dict field. + A presentation that supports an optional ``_extensions`` dict field. """ @primitive_dict_field() http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8eef8ed9/extensions/aria_extension_tosca/simple_v1_0/presentation/field_validators.py ---------------------------------------------------------------------- diff --git a/extensions/aria_extension_tosca/simple_v1_0/presentation/field_validators.py b/extensions/aria_extension_tosca/simple_v1_0/presentation/field_validators.py index d7b03ae..be80702 100644 --- a/extensions/aria_extension_tosca/simple_v1_0/presentation/field_validators.py +++ b/extensions/aria_extension_tosca/simple_v1_0/presentation/field_validators.py @@ -33,7 +33,7 @@ def 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 :func:`field_validator` decorator for the :code:`copy` field in + Use with the :func:`field_validator` decorator for the ``copy`` field in :class:`NodeTemplate` and :class:`RelationshipTemplate`. """ @@ -64,7 +64,7 @@ def 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 :func:`field_validator` decorator for the :code:`type` fields in + Used with the :func:`field_validator` decorator for the ``type`` fields in :class:`PropertyDefinition`, :class:`AttributeDefinition`, :class:`ParameterDefinition`, and :class:`EntrySchema`. @@ -103,10 +103,10 @@ def data_type_validator(type_name='data type'): def entry_schema_validator(field, presentation, context): """ - According to whether the data type supports :code:`entry_schema` (e.g., it is or inherits from + 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 :func:`field_validator` decorator for the :code:`entry_schema` field in + Used with the :func:`field_validator` decorator for the ``entry_schema`` field in :class:`PropertyDefinition` and :class:`AttributeDefinition`. """ @@ -145,7 +145,7 @@ def data_value_validator(field, presentation, context): """ Makes sure that the field contains a valid value according to data type and constraints. - Used with the :func:`field_validator` decorator for the :code:`default` field in + Used with the :func:`field_validator` decorator for the ``default`` field in :class:`PropertyDefinition` and :class:`AttributeDefinition`. """ @@ -172,7 +172,7 @@ def 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 :func:`field_validator` decorator for the :code:`derived_from` field in + Used with the :func:`field_validator` decorator for the ``derived_from`` field in :class:`DataType`. """ @@ -201,7 +201,7 @@ def data_type_properties_validator(field, presentation, context): """ Makes sure that we do not have properties if we have a primitive ancestor. - Used with the :func:`field_validator` decorator for the :code:`properties` field in + Used with the :func:`field_validator` decorator for the ``properties`` field in :class:`DataType`. """ @@ -241,7 +241,7 @@ def constraint_clause_in_range_validator(field, presentation, context): 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 :func:`field_validator` decorator for the :code:`in_range` field in + Used with the :func:`field_validator` decorator for the ``in_range`` field in :class:`ConstraintClause`. """ @@ -278,7 +278,7 @@ def 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 :func:`field_validator` decorator for the :code:`valid_values` field in + Used with the :func:`field_validator` decorator for the ``valid_values`` field in :class:`ConstraintClause`. """ @@ -294,7 +294,7 @@ def constraint_clause_pattern_validator(field, presentation, context): """ Makes sure that the value is a valid regular expression. - Used with the :func:`field_validator` decorator for the :code:`pattern` field in + Used with the :func:`field_validator` decorator for the ``pattern`` field in :class:`ConstraintClause`. """ @@ -324,7 +324,7 @@ def 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 :func:`field_validator` decorator for the :code:`node` field in + Used with the :func:`field_validator` decorator for the ``node`` field in :class:`RequirementAssignment`. """ @@ -343,11 +343,11 @@ def node_template_or_type_validator(field, presentation, context): def 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 - :code:`node` field or a general capability type. + ``node`` field or a general capability type. - If the value refers to a capability type, make sure the :code:`node` field was not assigned. + If the value refers to a capability type, make sure the ``node`` field was not assigned. - Used with the :func:`field_validator` decorator for the :code:`capability` field in + Used with the :func:`field_validator` decorator for the ``capability`` field in :class:`RequirementAssignment`. """ @@ -385,7 +385,7 @@ def 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 :func:`field_validator` decorator for the :code:`node_filter` field in + Used with the :func:`field_validator` decorator for the ``node_filter`` field in :class:`RequirementAssignment`. """ @@ -409,7 +409,7 @@ def 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 :func:`field_validator` decorator for the :code:`type` field in + Used with the :func:`field_validator` decorator for the ``type`` field in :class:`RelationshipAssignment`. """ @@ -434,7 +434,7 @@ def 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 :func:`field_validator` decorator for the :code:`targets` field in + Used with the :func:`field_validator` decorator for the ``targets`` field in :class:`PolicyType`. """ @@ -458,7 +458,7 @@ def 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 :func:`field_validator` decorator for the :code:`targets` field in + Used with the :func:`field_validator` decorator for the ``targets`` field in :class:`PolicyTemplate`. """ @@ -514,7 +514,7 @@ def 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 :func:`field_validator` decorator for the :code:`properties` field in + Used with the :func:`field_validator` decorator for the ``properties`` field in :class:`NodeFilter`. """ @@ -537,7 +537,7 @@ def 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 :func:`field_validator` decorator for the :code:`capabilities` field in + Used with the :func:`field_validator` decorator for the ``capabilities`` field in :class:`NodeFilter`. """ http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8eef8ed9/extensions/aria_extension_tosca/simple_v1_0/presentation/types.py ---------------------------------------------------------------------- diff --git a/extensions/aria_extension_tosca/simple_v1_0/presentation/types.py b/extensions/aria_extension_tosca/simple_v1_0/presentation/types.py index 088a246..610e4a0 100644 --- a/extensions/aria_extension_tosca/simple_v1_0/presentation/types.py +++ b/extensions/aria_extension_tosca/simple_v1_0/presentation/types.py @@ -17,11 +17,11 @@ def convert_shorthand_to_full_type_name(context, name, types_dict): # pylint: di """ Converts a shorthand type name to its full type name, or else returns it unchanged. - Works by checking for :code:`shorthand_name` in the types' :code:`_extensions` field. See also + Works by checking for ``shorthand_name`` in the types' ``_extensions`` field. See also :class:`aria_extension_tosca.v1_0.presentation.extensible.ExtensiblePresentation`. - Can be used as the conversion function argument in :code:`type_validator` and - :code:`derived_from_validator`. + Can be used as the conversion function argument in ``type_validator`` and + ``derived_from_validator``. """ if (name is not None) and types_dict and (name not in types_dict): @@ -35,11 +35,11 @@ def get_type_by_full_or_shorthand_name(context, name, *types_dict_names): """ Gets a type either by its full name or its shorthand name. - Works by checking for :code:`shorthand_name` in the types' :code:`_extensions` field. See also - :class:`aria_extension_tosca.v1_0.presentation.extensible.ExtensiblePresentation`. + Works by checking for ``shorthand_name`` in the types' ``_extensions`` field. See also + :class:`~aria_extension_tosca.v1_0.presentation.extensible.ExtensiblePresentation`. The arguments from the third onwards are used to locate a nested field under - :code:`service_template` under the root presenter. + ``service_template`` under the root presenter. """ if name is not None: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8eef8ed9/extensions/aria_extension_tosca/simple_v1_0/presenter.py ---------------------------------------------------------------------- diff --git a/extensions/aria_extension_tosca/simple_v1_0/presenter.py b/extensions/aria_extension_tosca/simple_v1_0/presenter.py index f64078f..394e303 100644 --- a/extensions/aria_extension_tosca/simple_v1_0/presenter.py +++ b/extensions/aria_extension_tosca/simple_v1_0/presenter.py @@ -27,9 +27,9 @@ class ToscaSimplePresenter1_0(Presenter): # pylint: disable=invalid-name,abstrac ARIA presenter for the `TOSCA Simple Profile v1.0 cos01 `__. - Supported :code:`tosca_definitions_version` values: + Supported ``tosca_definitions_version`` values: - * :code:`tosca_simple_yaml_1_0` + * ``tosca_simple_yaml_1_0`` """ DSL_VERSIONS = ('tosca_simple_yaml_1_0',) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8eef8ed9/extensions/aria_extension_tosca/simple_v1_0/templates.py ---------------------------------------------------------------------- diff --git a/extensions/aria_extension_tosca/simple_v1_0/templates.py b/extensions/aria_extension_tosca/simple_v1_0/templates.py index 123a00e..285e496 100644 --- a/extensions/aria_extension_tosca/simple_v1_0/templates.py +++ b/extensions/aria_extension_tosca/simple_v1_0/templates.py @@ -60,7 +60,7 @@ class NodeTemplate(ExtensiblePresentation): """ The required name of the Node Type the Node Template is based upon. - :rtype: str + :type: :obj:`basestring` """ @object_field(Description) @@ -68,7 +68,7 @@ class NodeTemplate(ExtensiblePresentation): """ An optional description for the Node Template. - :rtype: :class:`Description` + :type: :class:`Description` """ @primitive_list_field(str) @@ -77,7 +77,7 @@ class NodeTemplate(ExtensiblePresentation): An optional list of directive values to provide processing instructions to orchestrators and tooling. - :rtype: list of str + :type: [:obj:`basestring`] """ @object_dict_field(PropertyAssignment) @@ -85,7 +85,7 @@ class NodeTemplate(ExtensiblePresentation): """ An optional list of property value assignments for the Node Template. - :rtype: dict of str, :class:`PropertyAssignment` + :type: {:obj:`basestring`: :class:`PropertyAssignment`} """ @object_dict_field(AttributeAssignment) @@ -93,7 +93,7 @@ class NodeTemplate(ExtensiblePresentation): """ An optional list of attribute value assignments for the Node Template. - :rtype: dict of str, :class:`AttributeAssignment` + :type: {:obj:`basestring`: :class:`AttributeAssignment`} """ @object_sequenced_list_field(RequirementAssignment) @@ -101,7 +101,7 @@ class NodeTemplate(ExtensiblePresentation): """ An optional sequenced list of requirement assignments for the Node Template. - :rtype: list of (str, :class:`RequirementAssignment`) + :type: list of (str, :class:`RequirementAssignment`) """ @object_dict_field(CapabilityAssignment) @@ -109,7 +109,7 @@ class NodeTemplate(ExtensiblePresentation): """ An optional list of capability assignments for the Node Template. - :rtype: dict of str, :class:`CapabilityAssignment` + :type: {:obj:`basestring`: :class:`CapabilityAssignment`} """ @object_dict_field(InterfaceAssignment) @@ -117,7 +117,7 @@ class NodeTemplate(ExtensiblePresentation): """ An optional list of named interface definitions for the Node Template. - :rtype: dict of str, :class:`InterfaceAssignment` + :type: {:obj:`basestring`: :class:`InterfaceAssignment`} """ @object_dict_field(ArtifactAssignment) @@ -125,7 +125,7 @@ class NodeTemplate(ExtensiblePresentation): """ An optional list of named artifact definitions for the Node Template. - :rtype: dict of str, :class:`ArtifactAssignment` + :type: {:obj:`basestring`: :class:`ArtifactAssignment`} """ @object_field(NodeFilter) @@ -134,7 +134,7 @@ class NodeTemplate(ExtensiblePresentation): The optional filter definition that TOSCA orchestrators would use to select the correct target node. This keyname is only valid if the directive has the value of "selectable" set. - :rtype: :class:`NodeFilter` + :type: :class:`NodeFilter` """ @field_validator(copy_validator('node template', 'node_templates')) @@ -144,7 +144,7 @@ class NodeTemplate(ExtensiblePresentation): The optional (symbolic) name of another node template to copy into (all keynames and values) and use as a basis for this node template. - :rtype: str + :type: :obj:`basestring` """ @cachedmethod @@ -223,7 +223,7 @@ class RelationshipTemplate(ExtensiblePresentation): """ The required name of the Relationship Type the Relationship Template is based upon. - :rtype: str + :type: :obj:`basestring` """ @object_field(Description) @@ -231,7 +231,7 @@ class RelationshipTemplate(ExtensiblePresentation): """ An optional description for the Relationship Template. - :rtype: :class:`Description` + :type: :class:`Description` """ @object_dict_field(PropertyAssignment) @@ -239,7 +239,7 @@ class RelationshipTemplate(ExtensiblePresentation): """ An optional list of property assignments for the Relationship Template. - :rtype: dict of str, :class:`PropertyAssignment` + :type: {:obj:`basestring`: :class:`PropertyAssignment`} """ @object_dict_field(AttributeAssignment) @@ -247,7 +247,7 @@ class RelationshipTemplate(ExtensiblePresentation): """ An optional list of attribute assignments for the Relationship Template. - :rtype: dict of str, :class:`AttributeAssignment` + :type: {:obj:`basestring`: :class:`AttributeAssignment`} """ @object_dict_field(InterfaceAssignment) @@ -257,7 +257,7 @@ class RelationshipTemplate(ExtensiblePresentation): ARIA NOTE: Spec is wrong here, should be Relationship Template. - :rtype: dict of str, :class:`InterfaceAssignment` + :type: {:obj:`basestring`: :class:`InterfaceAssignment`} """ @field_validator(copy_validator('relationship template', 'relationship_templates')) @@ -267,7 +267,7 @@ class RelationshipTemplate(ExtensiblePresentation): The optional (symbolic) name of another relationship template to copy into (all keynames and values) and use as a basis for this relationship template. - :rtype: str + :type: :obj:`basestring` """ @cachedmethod @@ -319,7 +319,7 @@ class GroupTemplate(ExtensiblePresentation): """ The required name of the group type the group definition is based upon. - :rtype: str + :type: :obj:`basestring` """ @object_field(Description) @@ -327,7 +327,7 @@ class GroupTemplate(ExtensiblePresentation): """ The optional description for the group definition. - :rtype: :class:`Description` + :type: :class:`Description` """ @object_dict_field(PropertyAssignment) @@ -335,7 +335,7 @@ class GroupTemplate(ExtensiblePresentation): """ An optional list of property value assignments for the group definition. - :rtype: dict of str, :class:`PropertyAssignment` + :type: {:obj:`basestring`: :class:`PropertyAssignment`} """ @field_validator(list_type_validator('node template', 'topology_template', 'node_templates')) @@ -345,7 +345,7 @@ class GroupTemplate(ExtensiblePresentation): The optional list of one or more node template names that are members of this group definition. - :rtype: list of str + :type: [:obj:`basestring`] """ @object_dict_field(InterfaceAssignment) @@ -353,7 +353,7 @@ class GroupTemplate(ExtensiblePresentation): """ An optional list of named interface definitions for the group definition. - :rtype: dict of str, :class:`InterfaceDefinition` + :type: {:obj:`basestring`: :class:`InterfaceDefinition`} """ @cachedmethod @@ -392,7 +392,7 @@ class PolicyTemplate(ExtensiblePresentation): """ The required name of the policy type the policy definition is based upon. - :rtype: str + :type: :obj:`basestring` """ @object_field(Description) @@ -400,7 +400,7 @@ class PolicyTemplate(ExtensiblePresentation): """ The optional description for the policy definition. - :rtype: :class:`Description` + :type: :class:`Description` """ @object_dict_field(PropertyAssignment) @@ -408,7 +408,7 @@ class PolicyTemplate(ExtensiblePresentation): """ An optional list of property value assignments for the policy definition. - :rtype: dict of str, :class:`PropertyAssignment` + :type: {:obj:`basestring`: :class:`PropertyAssignment` """ @field_validator(policy_targets_validator) @@ -417,7 +417,7 @@ class PolicyTemplate(ExtensiblePresentation): """ An optional list of valid Node Templates or Groups the Policy can be applied to. - :rtype: list of str + :type: [:obj:`basestring`] """ @cachedmethod @@ -444,7 +444,7 @@ class TopologyTemplate(ExtensiblePresentation): This section defines the topology template of a cloud application. The main ingredients of the topology template are node templates representing components of the application and relationship templates representing links between the components. These elements are defined in the nested - :code:`node_templates` section and the nested relationship_templates sections, respectively. + ``node_templates`` section and the nested relationship_templates sections, respectively. Furthermore, a topology template allows for defining input parameters, output parameters as well as grouping of node templates. @@ -458,7 +458,7 @@ class TopologyTemplate(ExtensiblePresentation): """ The optional description for the Topology Template. - :rtype: :class:`Description` + :type: :class:`Description` """ @object_dict_field(ParameterDefinition) @@ -467,7 +467,7 @@ class TopologyTemplate(ExtensiblePresentation): An optional list of input parameters (i.e., as parameter definitions) for the Topology Template. - :rtype: dict of str, :class:`ParameterDefinition` + :type: {:obj:`basestring`: :class:`ParameterDefinition`} """ @object_dict_field(NodeTemplate) @@ -475,7 +475,7 @@ class TopologyTemplate(ExtensiblePresentation): """ An optional list of node template definitions for the Topology Template. - :rtype: dict of str, :class:`NodeTemplate` + :type: {:obj:`basestring`: :class:`NodeTemplate`} """ @object_dict_field(RelationshipTemplate) @@ -483,7 +483,7 @@ class TopologyTemplate(ExtensiblePresentation): """ An optional list of relationship templates for the Topology Template. - :rtype: dict of str, :class:`RelationshipTemplate` + :type: {:obj:`basestring`: :class:`RelationshipTemplate`} """ @object_dict_field(GroupTemplate) @@ -500,7 +500,7 @@ class TopologyTemplate(ExtensiblePresentation): """ An optional list of Policy definitions for the Topology Template. - :rtype: dict of str, :class:`PolicyTemplate` + :type: {:obj:`basestring`: :class:`PolicyTemplate`} """ @object_dict_field(ParameterDefinition) @@ -509,7 +509,7 @@ class TopologyTemplate(ExtensiblePresentation): An optional list of output parameters (i.e., as parameter definitions) for the Topology Template. - :rtype: dict of str, :class:`ParameterDefinition` + :type: {:obj:`basestring`: :class:`ParameterDefinition`} """ @object_field(SubstitutionMappings) @@ -551,6 +551,8 @@ class TopologyTemplate(ExtensiblePresentation): @implements_specification('3.9', 'tosca-simple-1.0') class ServiceTemplate(ExtensiblePresentation): """ + Servicate template. + See the `TOSCA Simple Profile v1.0 cos01 specification `__. @@ -567,7 +569,7 @@ class ServiceTemplate(ExtensiblePresentation): /TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html #_Toc379455047>`__ - :rtype: str + :type: :obj:`basestring` """ @object_field(MetaData) @@ -580,7 +582,7 @@ class ServiceTemplate(ExtensiblePresentation): /TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html #_Toc379455048>`__ - :rtype: :class:`MetaData` + :type: :class:`MetaData` """ @object_field(Description) @@ -589,7 +591,7 @@ class ServiceTemplate(ExtensiblePresentation): """ Declares a description for this Service Template and its contents. - :rtype: :class:`Description` + :type: :class:`Description` """ @primitive_field() @@ -613,7 +615,7 @@ class ServiceTemplate(ExtensiblePresentation): the service template along with their addresses and necessary credential information used to connect to them in order to retrieve the artifacts. - :rtype: dict of str, :class:`Repository` + :type: {:obj:`basestring`: :class:`Repository`} """ @object_list_field(Import) @@ -623,7 +625,7 @@ class ServiceTemplate(ExtensiblePresentation): Declares import statements external TOSCA Definitions documents. For example, these may be file location or URIs relative to the service template file within the same TOSCA CSAR file. - :rtype: list of :class:`Import` + :type: list of :class:`Import` """ @object_dict_field(ArtifactType) @@ -633,7 +635,7 @@ class ServiceTemplate(ExtensiblePresentation): This section contains an optional list of artifact type definitions for use in the service template. - :rtype: dict of str, :class:`ArtifactType` + :type: {:obj:`basestring`: :class:`ArtifactType`} """ @object_dict_field(DataType) @@ -642,7 +644,7 @@ class ServiceTemplate(ExtensiblePresentation): """ Declares a list of optional TOSCA Data Type definitions. - :rtype: dict of str, :class:`DataType` + :type: {:obj:`basestring`: :class:`DataType`} """ @object_dict_field(CapabilityType) @@ -652,7 +654,7 @@ class ServiceTemplate(ExtensiblePresentation): This section contains an optional list of capability type definitions for use in the service template. - :rtype: dict of str, :class:`CapabilityType` + :type: {:obj:`basestring`: :class:`CapabilityType`} """ @object_dict_field(InterfaceType) @@ -662,7 +664,7 @@ class ServiceTemplate(ExtensiblePresentation): This section contains an optional list of interface type definitions for use in the service template. - :rtype: dict of str, :class:`InterfaceType` + :type: {:obj:`basestring`: :class:`InterfaceType`} """ @object_dict_field(RelationshipType) @@ -672,7 +674,7 @@ class ServiceTemplate(ExtensiblePresentation): This section contains a set of relationship type definitions for use in the service template. - :rtype: dict of str, :class:`RelationshipType` + :type: {:obj:`basestring`: :class:`RelationshipType`} """ @object_dict_field(NodeType) @@ -681,7 +683,7 @@ class ServiceTemplate(ExtensiblePresentation): """ This section contains a set of node type definitions for use in the service template. - :rtype: dict of str, :class:`NodeType` + :type: {:obj:`basestring`: :class:`NodeType`} """ @object_dict_field(GroupType) @@ -690,7 +692,7 @@ class ServiceTemplate(ExtensiblePresentation): """ This section contains a list of group type definitions for use in the service template. - :rtype: dict of str, :class:`GroupType` + :type: {:obj:`basestring`: :class:`GroupType`} """ @object_dict_field(PolicyType) @@ -699,7 +701,7 @@ class ServiceTemplate(ExtensiblePresentation): """ This section contains a list of policy type definitions for use in the service template. - :rtype: dict of str, :class:`PolicyType` + :type: {:obj:`basestring`: :class:`PolicyType`} """ @object_field(TopologyTemplate) @@ -709,7 +711,7 @@ class ServiceTemplate(ExtensiblePresentation): that represent the application's or service's components, as well as relationship templates representing relations between the components. - :rtype: :class:`TopologyTemplate` + :type: :class:`TopologyTemplate` """ def _dump(self, context): http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8eef8ed9/extensions/aria_extension_tosca/simple_v1_0/types.py ---------------------------------------------------------------------- diff --git a/extensions/aria_extension_tosca/simple_v1_0/types.py b/extensions/aria_extension_tosca/simple_v1_0/types.py index d97b89c..570b89f 100644 --- a/extensions/aria_extension_tosca/simple_v1_0/types.py +++ b/extensions/aria_extension_tosca/simple_v1_0/types.py @@ -64,7 +64,7 @@ class ArtifactType(ExtensiblePresentation): """ An optional parent Artifact Type name the Artifact Type derives from. - :rtype: str + :type: :obj:`basestring` """ @field_getter(data_type_class_getter(Version)) @@ -73,7 +73,7 @@ class ArtifactType(ExtensiblePresentation): """ An optional version for the Artifact Type definition. - :rtype: :class:`Version` + :type: :class:`Version` """ @object_field(Description) @@ -81,7 +81,7 @@ class ArtifactType(ExtensiblePresentation): """ An optional description for the Artifact Type. - :rtype: :class:`Description` + :type: :class:`Description` """ @primitive_field(str) @@ -89,7 +89,7 @@ class ArtifactType(ExtensiblePresentation): """ The required mime type property for the Artifact Type. - :rtype: str + :type: :obj:`basestring` """ @primitive_list_field(str) @@ -97,7 +97,7 @@ class ArtifactType(ExtensiblePresentation): """ The required file extension property for the Artifact Type. - :rtype: list of str + :type: [:obj:`basestring`] """ @object_dict_field(PropertyDefinition) @@ -105,7 +105,7 @@ class ArtifactType(ExtensiblePresentation): """ An optional list of property definitions for the Artifact Type. - :rtype: dict of str, :class:`PropertyDefinition` + :type: {:obj:`basestring`: :class:`PropertyDefinition`} """ @cachedmethod @@ -147,7 +147,7 @@ class DataType(ExtensiblePresentation): """ The optional key used when a datatype is derived from an existing TOSCA Data Type. - :rtype: str + :type: :obj:`basestring` """ @object_field(Version) @@ -155,7 +155,7 @@ class DataType(ExtensiblePresentation): """ An optional version for the Data Type definition. - :rtype: :class:`Version` + :type: :class:`Version` """ @object_field(Description) @@ -163,7 +163,7 @@ class DataType(ExtensiblePresentation): """ The optional description for the Data Type. - :rtype: :class:`Description` + :type: :class:`Description` """ @field_validator(data_type_constraints_validator) @@ -172,7 +172,7 @@ class DataType(ExtensiblePresentation): """ The optional list of sequenced constraint clauses for the Data Type. - :rtype: list of (str, :class:`ConstraintClause`) + :type: list of (str, :class:`ConstraintClause`) """ @field_validator(data_type_properties_validator) @@ -182,7 +182,7 @@ class DataType(ExtensiblePresentation): The optional list property definitions that comprise the schema for a complex Data Type in TOSCA. - :rtype: dict of str, :class:`PropertyDefinition` + :type: {:obj:`basestring`: :class:`PropertyDefinition`} """ @cachedmethod @@ -244,7 +244,7 @@ class CapabilityType(ExtensiblePresentation): """ An optional parent capability type name this new Capability Type derives from. - :rtype: str + :type: :obj:`basestring` """ @object_field(Version) @@ -252,7 +252,7 @@ class CapabilityType(ExtensiblePresentation): """ An optional version for the Capability Type definition. - :rtype: :class:`Version` + :type: :class:`Version` """ @object_field(Description) @@ -260,7 +260,7 @@ class CapabilityType(ExtensiblePresentation): """ An optional description for the Capability Type. - :rtype: :class:`Description` + :type: :class:`Description` """ @object_dict_field(PropertyDefinition) @@ -270,7 +270,7 @@ class CapabilityType(ExtensiblePresentation): ARIA NOTE: The spec says 'list', but the examples are all of dicts. - :rtype: dict of str, :class:`PropertyDefinition` + :type: {:obj:`basestring`: :class:`PropertyDefinition`} """ @object_dict_field(AttributeDefinition) @@ -278,7 +278,7 @@ class CapabilityType(ExtensiblePresentation): """ An optional list of attribute definitions for the Capability Type. - :rtype: dict of str, :class:`AttributeDefinition` + :type: {:obj:`basestring`: :class:`AttributeDefinition`} """ @field_validator(list_type_validator('node type', convert_shorthand_to_full_type_name, @@ -289,7 +289,7 @@ class CapabilityType(ExtensiblePresentation): An optional list of one or more valid names of Node Types that are supported as valid sources of any relationship established to the declared Capability Type. - :rtype: list of str + :type: [:obj:`basestring`] """ @cachedmethod @@ -345,7 +345,7 @@ class InterfaceType(ExtensiblePresentation): """ An optional parent Interface Type name this new Interface Type derives from. - :rtype: str + :type: :obj:`basestring` """ @object_field(Version) @@ -353,7 +353,7 @@ class InterfaceType(ExtensiblePresentation): """ An optional version for the Interface Type definition. - :rtype: :class:`Version` + :type: :class:`Version` """ @object_field(Description) @@ -361,7 +361,7 @@ class InterfaceType(ExtensiblePresentation): """ An optional description for the Interface Type. - :rtype: :class:`Description` + :type: :class:`Description` """ @object_dict_field(PropertyDefinition) @@ -369,13 +369,13 @@ class InterfaceType(ExtensiblePresentation): """ The optional list of input parameter definitions. - :rtype: dict of str, :class:`PropertyDefinition` + :type: {:obj:`basestring`: :class:`PropertyDefinition`} """ @object_dict_unknown_fields(OperationDefinition) def operations(self): """ - :rtype: dict of str, :class:`OperationDefinition` + :type: {:obj:`basestring`: :class:`OperationDefinition`} """ @cachedmethod @@ -424,7 +424,7 @@ class RelationshipType(ExtensiblePresentation): """ An optional parent Relationship Type name the Relationship Type derives from. - :rtype: str + :type: :obj:`basestring` """ @object_field(Version) @@ -432,7 +432,7 @@ class RelationshipType(ExtensiblePresentation): """ An optional version for the Relationship Type definition. - :rtype: :class:`Version` + :type: :class:`Version` """ @object_field(Description) @@ -440,7 +440,7 @@ class RelationshipType(ExtensiblePresentation): """ An optional description for the Relationship Type. - :rtype: :class:`Description` + :type: :class:`Description` """ @object_dict_field(PropertyDefinition) @@ -448,7 +448,7 @@ class RelationshipType(ExtensiblePresentation): """ An optional list of property definitions for the Relationship Type. - :rtype: dict of str, :class:`PropertyDefinition` + :type: {:obj:`basestring`: :class:`PropertyDefinition`} """ @object_dict_field(AttributeDefinition) @@ -456,7 +456,7 @@ class RelationshipType(ExtensiblePresentation): """ An optional list of attribute definitions for the Relationship Type. - :rtype: dict of str, :class:`AttributeDefinition` + :type: {:obj:`basestring`: :class:`AttributeDefinition`} """ @object_dict_field(InterfaceDefinition) @@ -464,7 +464,7 @@ class RelationshipType(ExtensiblePresentation): """ An optional list of interface definitions interfaces supported by the Relationship Type. - :rtype: dict of str, :class:`InterfaceDefinition` + :type: {:obj:`basestring`: :class:`InterfaceDefinition`} """ @field_validator(list_type_validator('capability type', convert_shorthand_to_full_type_name, @@ -475,7 +475,7 @@ class RelationshipType(ExtensiblePresentation): An optional list of one or more names of Capability Types that are valid targets for this relationship. - :rtype: list of str + :type: [:obj:`basestring`] """ @cachedmethod @@ -538,7 +538,7 @@ class NodeType(ExtensiblePresentation): """ An optional parent Node Type name this new Node Type derives from. - :rtype: str + :type: :obj:`basestring` """ @object_field(Version) @@ -546,7 +546,7 @@ class NodeType(ExtensiblePresentation): """ An optional version for the Node Type definition. - :rtype: :class:`Version` + :type: :class:`Version` """ @object_field(Description) @@ -554,7 +554,7 @@ class NodeType(ExtensiblePresentation): """ An optional description for the Node Type. - :rtype: :class:`Description` + :type: :class:`Description` """ @object_dict_field(PropertyDefinition) @@ -562,7 +562,7 @@ class NodeType(ExtensiblePresentation): """ An optional list of property definitions for the Node Type. - :rtype: dict of str, :class:`PropertyDefinition` + :type: {:obj:`basestring`: :class:`PropertyDefinition`} """ @object_dict_field(AttributeDefinition) @@ -570,7 +570,7 @@ class NodeType(ExtensiblePresentation): """ An optional list of attribute definitions for the Node Type. - :rtype: dict of str, :class:`AttributeDefinition` + :type: {:obj:`basestring`: :class:`AttributeDefinition`} """ @object_sequenced_list_field(RequirementDefinition) @@ -582,7 +582,7 @@ class NodeType(ExtensiblePresentation): more than one requirement of the same name, behavior is undefined. The idea is to use the "occurrences" field if you need to limit the number of requirement assignments. - :rtype: list of (str, :class:`RequirementDefinition`) + :type: list of (str, :class:`RequirementDefinition`) """ @object_dict_field(CapabilityDefinition) @@ -590,7 +590,7 @@ class NodeType(ExtensiblePresentation): """ An optional list of capability definitions for the Node Type. - :rtype: list of :class:`CapabilityDefinition` + :type: list of :class:`CapabilityDefinition` """ @object_dict_field(InterfaceDefinition) @@ -598,7 +598,7 @@ class NodeType(ExtensiblePresentation): """ An optional list of interface definitions supported by the Node Type. - :rtype: dict of str, :class:`InterfaceDefinition` + :type: {:obj:`basestring`: :class:`InterfaceDefinition`} """ @object_dict_field(ArtifactAssignment) @@ -606,7 +606,7 @@ class NodeType(ExtensiblePresentation): """ An optional list of named artifact definitions for the Node Type. - :rtype: dict of str, :class:`ArtifactAssignment` + :type: {:obj:`basestring`: :class:`ArtifactAssignment`} """ @cachedmethod @@ -694,7 +694,7 @@ class GroupType(ExtensiblePresentation): """ An optional parent Group Type name the Group Type derives from. - :rtype: str + :type: :obj:`basestring` """ @object_field(Version) @@ -702,7 +702,7 @@ class GroupType(ExtensiblePresentation): """ An optional version for the Group Type definition. - :rtype: :class:`Version` + :type: :class:`Version` """ @object_field(Description) @@ -710,7 +710,7 @@ class GroupType(ExtensiblePresentation): """ The optional description for the Group Type. - :rtype: :class:`Description` + :type: :class:`Description` """ @object_dict_field(PropertyDefinition) @@ -718,7 +718,7 @@ class GroupType(ExtensiblePresentation): """ An optional list of property definitions for the Group Type. - :rtype: dict of str, :class:`PropertyDefinition` + :type: {:obj:`basestring`: :class:`PropertyDefinition`} """ @field_validator(list_type_validator('node type', convert_shorthand_to_full_type_name, @@ -734,7 +734,7 @@ class GroupType(ExtensiblePresentation): For example, if we were to name this as an explicit Relationship Type we might call this "MemberOf" (group). - :rtype: list of str + :type: [:obj:`basestring`] """ @object_dict_field(InterfaceDefinition) @@ -742,7 +742,7 @@ class GroupType(ExtensiblePresentation): """ An optional list of interface definitions supported by the Group Type. - :rtype: dict of str, :class:`InterfaceDefinition` + :type: {:obj:`basestring`: :class:`InterfaceDefinition`} """ @cachedmethod @@ -800,7 +800,7 @@ class PolicyType(ExtensiblePresentation): """ An optional parent Policy Type name the Policy Type derives from. - :rtype: str + :type: :obj:`basestring` """ @object_field(Version) @@ -808,7 +808,7 @@ class PolicyType(ExtensiblePresentation): """ An optional version for the Policy Type definition. - :rtype: :class:`Version` + :type: :class:`Version` """ @object_field(Description) @@ -816,7 +816,7 @@ class PolicyType(ExtensiblePresentation): """ The optional description for the Policy Type. - :rtype: :class:`Description` + :type: :class:`Description` """ @object_dict_field(PropertyDefinition) @@ -824,7 +824,7 @@ class PolicyType(ExtensiblePresentation): """ An optional list of property definitions for the Policy Type. - :rtype: :class:`PropertyDefinition` + :type: :class:`PropertyDefinition` """ @field_validator(list_node_type_or_group_type_validator) @@ -838,7 +838,7 @@ class PolicyType(ExtensiblePresentation): were to name this as an explicit Relationship Type we might call this "AppliesTo" (node or group). - :rtype: list of str + :type: [:obj:`basestring`] """ @cachedmethod http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8eef8ed9/tests/orchestrator/workflows/core/test_events.py ---------------------------------------------------------------------- diff --git a/tests/orchestrator/workflows/core/test_events.py b/tests/orchestrator/workflows/core/test_events.py index 30cc8ee..ff50eab 100644 --- a/tests/orchestrator/workflows/core/test_events.py +++ b/tests/orchestrator/workflows/core/test_events.py @@ -128,8 +128,8 @@ def run_standard_lifecycle_operation_on_node(ctx, op_name): def _assert_node_state_changed_as_a_result_of_standard_lifecycle_operation(node, op_name): - assert global_test_dict['transitional_state'] == NodeBase._op_to_state[op_name]['transitional'] - assert node.state == NodeBase._op_to_state[op_name]['finished'] + assert global_test_dict['transitional_state'] == NodeBase._OP_TO_STATE[op_name]['transitional'] + assert node.state == NodeBase._OP_TO_STATE[op_name]['finished'] @workflow