diff options
author | Singal, Kapil (ks220y) <ks220y@att.com> | 2020-09-24 12:47:56 -0400 |
---|---|---|
committer | Singal, Kapil (ks220y) <ks220y@att.com> | 2020-09-24 18:07:12 -0400 |
commit | f1aafc40ad8f15b61faa3631e5a56fcf7c34bf49 (patch) | |
tree | 27b4a52b99472d4781814751f4c46343b82960a5 /docs/modelingconcepts/data-type.rst | |
parent | 2b0442d1d2e721c4bf762bb2a3e75bc7606f9fcf (diff) |
Refactoring Docs
Issue-ID: CCSDK-2846
Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Change-Id: I34e469deb914fc4e452159a2c3419270f8eb97bc
Diffstat (limited to 'docs/modelingconcepts/data-type.rst')
-rw-r--r-- | docs/modelingconcepts/data-type.rst | 105 |
1 files changed, 46 insertions, 59 deletions
diff --git a/docs/modelingconcepts/data-type.rst b/docs/modelingconcepts/data-type.rst index 72eb12591..a231e5aa5 100644 --- a/docs/modelingconcepts/data-type.rst +++ b/docs/modelingconcepts/data-type.rst @@ -6,7 +6,7 @@ .. _data_type: Data type -------------------------------------- +--------- Represents the **schema** of a specific type of **data**. @@ -28,6 +28,7 @@ Supports both **primitive** and **complex** data types: - * json * list * array + For complex data type, an **entry schema** is required, defining the type of value contained within the complex type, if list or array. @@ -37,61 +38,47 @@ Users can **create** as many **data type** as needed. **Creating Custom Data Types:** - To create a custom data-type you can use a POST call to CDS endpoint: + To create a custom data-type you can use a POST call to CDS endpoint: "<cds-ip>:<cds-port>/api/v1/model-type" .. code-block:: python :caption: **Payload:** { - "model-name": "<model-name>", "derivedFrom": "tosca.datatypes.Root", - "definitionType": "data_type", - "definition": { - "description": "<description>", - "version": "<version-number: eg 1.0.0>", - "properties": {<add properties of your custom data type in JSON format>}, - "derived_from": "tosca.datatypes.Root" - }, - "description": "<description", - "version": "<version>", - "tags": "<model-name>,datatypes.Root.data_type", - "creationDate": "<creation timestamp>", - "updatedBy": "<name>" - } -Data type are useful to manipulate data during resource resolution. +Data type are useful to manipulate data during resource resolution. They can be used to format the JSON output as needed. -List of existing data type: +List of existing data type: `<https://github.com/onap/ccsdk-cds/tree/master/components/model-catalog/definition-type/starter-type/data_type>`_ -`TOSCA specification +`TOSCA specification <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454187>`_ **Below is a list of existing data types** .. tabs:: - + .. tab:: resource-assignment **datatype-resource-assignment** - Used to define entries within artifact-mapping-resource + Used to define entries within artifact-mapping-resource (see tab Artifact Type -> artifact-mapping-resource) That datatype represent a **resource** to be resolved. We also refer @@ -124,44 +111,44 @@ List of existing data type: .. code-block:: JSON :caption: **datatype-resource-assignment** - { + { "version": "1.0.0", "description": "This is Resource Assignment Data Type", "properties": { - "property": { - "required": true, - "type": "datatype-property" - }, - "input-param": { - "required": true, - "type": "boolean" - }, - "dictionary-name": { - "required": false, - "type": "string" - }, - "dictionary-source": { - "required": false, - "type": "string" - }, - "dependencies": { - "required": true, - "type": "list", - "entry_schema": { - "type": "string" - } - }, - "updated-date": { - "required": false, - "type": "string" - }, - "updated-by": { - "required": false, - "type": "string" - } + "property": { + "required": true, + "type": "datatype-property" + }, + "input-param": { + "required": true, + "type": "boolean" + }, + "dictionary-name": { + "required": false, + "type": "string" + }, + "dictionary-source": { + "required": false, + "type": "string" + }, + "dependencies": { + "required": true, + "type": "list", + "entry_schema": { + "type": "string" + } + }, + "updated-date": { + "required": false, + "type": "string" + }, + "updated-by": { + "required": false, + "type": "string" + } }, "derived_from": "tosca.datatypes.Root" - } + } .. tab:: property @@ -192,9 +179,9 @@ List of existing data type: :caption: **datatype-property** { - "version": "1.0.0", - "description": "This is Resource Assignment Data Type", - "properties": { + "version": "1.0.0", + "description": "This is Resource Assignment Data Type", + "properties": { "property": { "required": true, "type": "datatype-property" @@ -226,6 +213,6 @@ List of existing data type: "required": false, "type": "string" } - }, - "derived_from": "tosca.datatypes.Root" + }, + "derived_from": "tosca.datatypes.Root" }
\ No newline at end of file |