From 4d906e5210c570678bba6db82d85b16ff2ebaaf8 Mon Sep 17 00:00:00 2001 From: Lukasz Rajewski Date: Fri, 24 Mar 2023 11:26:41 +0000 Subject: Fix doc-rules job and cds-ui build - Doc changes to satisfy new doc-rules - Fixo f CDS-UI build Issue-ID: CCSDK-3859 Signed-off-by: Lukasz Rajewski Change-Id: I9471e845afd39d06466da9a5db8fde5acdf15ea1 --- docs/api-reference/media/api-doc-template.txt | 204 ++++++++++++++ .../media/cds-bp-processor-api-swagger.json | 292 +++++++++++++++------ 2 files changed, 418 insertions(+), 78 deletions(-) create mode 100644 docs/api-reference/media/api-doc-template.txt (limited to 'docs/api-reference/media') diff --git a/docs/api-reference/media/api-doc-template.txt b/docs/api-reference/media/api-doc-template.txt new file mode 100644 index 000000000..a983a8cfe --- /dev/null +++ b/docs/api-reference/media/api-doc-template.txt @@ -0,0 +1,204 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 +.. International License. http://creativecommons.org/licenses/by/4.0 +.. Copyright (C) 2020 Deutsche Telekom AG. + +.. This is a template to document new APIs for CDS blueprint processor + +.. make use of tabs whenever it fits + +Module +==================== + +Resource 1 +------------ + +General description about the resource. + + +Method 1 Endpoint 1 +~~~~~~~~~~~~~~~~~~~~ + + ```` +...................... + +Method 1 Endpoint 1 description + +Request +........... + +.. code-block:: bash + :caption: **(sample) request** + + request command + +.. can be split into Header and Body description if thats more suitable. +.. If its split, Header requires content-type definition, Body requires example payload + +**Request Path Parameters:** + +.. list-table:: + :widths: 20 20 20 40 + :header-rows: 1 + + * - Parameter + - Type + - Required + - Description + * - value 1 + - value 2 + - value 3 + - value 4 + * - value 1 + - value 2 + - value 3 + - value 4 + +**Request Query Parameters:** + +.. list-table:: + :widths: 20 20 20 40 + :header-rows: 1 + + * - Parameter + - Type + - Required + - Description + * - value 1 + - value 2 + - value 3 + - value 4 + * - value 1 + - value 2 + - value 3 + - value 4 + +**Request Body Parameters:** + +.. list-table:: + :widths: 20 20 20 40 + :header-rows: 1 + + * - Parameter + - Type + - Required + - Description + * - value 1 + - value 2 + - value 3 + - value 4 + * - value 1 + - value 2 + - value 3 + - value 4 + +Success Response(s) +...................... + +HTTP Status 202 OK + +Headers: +``Content-Type:application/json`` + +.. code-block:: json + :caption: **(sample) response body and/or response schema** + + (sample) response (can be {}) + +**Success Response Parameters:** + +.. list-table:: + :widths: 30 30 40 + :header-rows: 1 + + * - Parameter + - Type + - Description + * - value 1 + - value 2 + - value 3 + * - value 1 + - value 2 + - value 3 + +Error Response(s) +...................... + +HTTP Status 404 The requested resource could not be found + +.. code-block:: json + :caption: **sample error response** + + error response + +**Error Response Parameters:** + +.. list-table:: + :widths: 30 30 40 + :header-rows: 1 + + * - Parameter + - Type + - Description + * - value 1 + - value 2 + - value 3 + * - value 1 + - value 2 + - value 3 + +.. or just table for responses with HTTP code, description and schema + +Consumes +............ + +``application/json`` + +Produces +........... + +``application/json`` + + +Functional Description +.............................. + +What does the API do in detail? + +Technical Description +........................... + +Called class, methods, other hints. + +Related topics +...................... + +.. toctree:: + :maxdepth: 1 + + +Method 2 Endpoint 1 +~~~~~~~~~~~~~~~~~~~~ + + ```` +...................... + +Method 2 Endpoint 1 description + +.. + + +Method 1 Endpoint 2 (Subresource): +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + ```` +.............................. + + +.. + +Resource 2 +-------------------- + + +.. + diff --git a/docs/api-reference/media/cds-bp-processor-api-swagger.json b/docs/api-reference/media/cds-bp-processor-api-swagger.json index 606d0b861..de7e94c6a 100644 --- a/docs/api-reference/media/cds-bp-processor-api-swagger.json +++ b/docs/api-reference/media/cds-bp-processor-api-swagger.json @@ -998,32 +998,6 @@ } } }, - "/api/v1/model-type/" : { - "post" : { - "tags" : [ "Model Type Catalog" ], - "summary" : "Save a model type", - "description" : "Save a model type by model type definition provided.", - "operationId" : "ModelTypeController_saveModelType_POST.org.onap.ccsdk.cds.blueprintsprocessor.designer.api", - "consumes" : [ "application/json" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/ModelType" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/ModelType" - } - } - } - } - }, "/api/v1/model-type/by-definition/{definitionType}" : { "get" : { "tags" : [ "Model Type Catalog" ], @@ -1179,7 +1153,7 @@ "tags" : [ "Resources" ], "summary" : "Delete resources using resolution key", "description" : "Delete all the resources associated to a resolution-key using blueprint metadata, artifact name and the resolution-key.", - "operationId" : "ResourceController_deleteByBlueprintNameAndBlueprintVersionAndArtifactNameAndResolutionKey_DELETE.org.onap.ccsdk.cds.blueprintsprocessor.resource.api", + "operationId" : "ResourceController_deleteResolutions_DELETE.org.onap.ccsdk.cds.blueprintsprocessor.resource.api", "produces" : [ "application/json" ], "parameters" : [ { "name" : "bpName", @@ -1203,14 +1177,106 @@ "name" : "resolutionKey", "in" : "query", "description" : "Resolution Key associated with the resolution", + "required" : false, + "type" : "string" + }, { + "name" : "resourceType", + "in" : "query", + "description" : "resourceType associated with the resolution, must be used with resourceId", + "required" : false, + "type" : "string" + }, { + "name" : "resourceId", + "in" : "query", + "description" : "Resolution Key associated with the resolution, must be used with resourceType", + "required" : false, + "type" : "string" + }, { + "name" : "lastN", + "in" : "query", + "description" : "Only delete last N occurrences", + "required" : false, + "type" : "integer", + "format" : "int32" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "object" + } + } + } + } + }, + "/api/v1/resources/occurrences" : { + "get" : { + "tags" : [ "Resources" ], + "summary" : "Get the map of resolved resources with 'occurrence' as the keys to the resolved resources ", + "description" : "With optional 'occurrence' options, subset of stored resolved resources can be retrieved using the blueprint name, blueprint version, artifact name and the resolution-key.", + "operationId" : "ResourceController_getOccurrences_GET.org.onap.ccsdk.cds.blueprintsprocessor.resource.api", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "bpName", + "in" : "query", + "description" : "Name of the CBA.", "required" : true, "type" : "string" + }, { + "name" : "bpVersion", + "in" : "query", + "description" : "Version of the CBA.", + "required" : true, + "type" : "string" + }, { + "name" : "artifactName", + "in" : "query", + "description" : "Artifact name for which to retrieve a resolved resource.", + "required" : true, + "type" : "string" + }, { + "name" : "resolutionKey", + "in" : "query", + "description" : "Resolution Key associated with the resolution.", + "required" : true, + "type" : "string" + }, { + "name" : "firstN", + "in" : "query", + "description" : "Number of earlier N occurrences of the resolutions.", + "required" : false, + "type" : "integer", + "format" : "int32" + }, { + "name" : "lastN", + "in" : "query", + "description" : "Number of latest N occurrences of the resolutions.", + "required" : false, + "type" : "integer", + "format" : "int32" + }, { + "name" : "begin", + "in" : "query", + "description" : "For Range option - 'begin' is the start occurrence of range of the resolutions.", + "required" : false, + "type" : "integer", + "format" : "int32" + }, { + "name" : "end", + "in" : "query", + "description" : "For Range option - 'end' is the end occurrence of the range of the resolutions.", + "required" : false, + "type" : "integer", + "format" : "int32" } ], "responses" : { "200" : { "description" : "successful operation", "schema" : { - "$ref" : "#/definitions/Unit" + "type" : "array", + "items" : { + "$ref" : "#/definitions/ResourceResolution" + } } } } @@ -1258,7 +1324,80 @@ "200" : { "description" : "successful operation", "schema" : { - "$ref" : "#/definitions/ResourceResolution" + "type" : "object" + } + } + } + } + }, + "/api/v1/template/occurrences" : { + "get" : { + "tags" : [ "Resource template" ], + "summary" : "Get the map of resolved templates with 'occurrence' as the keys to the resolved templates ", + "description" : "With optional 'occurrence' options, subset of stored resolved templates can be retrieved using the blueprint name, blueprint version, artifact name and the resolution-key.", + "operationId" : "TemplateController_getOccurrences_GET.org.onap.ccsdk.cds.blueprintsprocessor.resource.api", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "bpName", + "in" : "query", + "description" : "Name of the CBA.", + "required" : true, + "type" : "string" + }, { + "name" : "bpVersion", + "in" : "query", + "description" : "Version of the CBA.", + "required" : true, + "type" : "string" + }, { + "name" : "artifactName", + "in" : "query", + "description" : "Artifact name for which to retrieve a resolved resource.", + "required" : true, + "type" : "string" + }, { + "name" : "resolutionKey", + "in" : "query", + "description" : "Resolution Key associated with the resolution.", + "required" : true, + "type" : "string" + }, { + "name" : "firstN", + "in" : "query", + "description" : "Number of earlier N occurrences of the templates.", + "required" : false, + "type" : "integer", + "format" : "int32" + }, { + "name" : "lastN", + "in" : "query", + "description" : "Number of latest N occurrences of the templates.", + "required" : false, + "type" : "integer", + "format" : "int32" + }, { + "name" : "begin", + "in" : "query", + "description" : "For Range option - 'begin' is the start occurrence of range of the templates.", + "required" : false, + "type" : "integer", + "format" : "int32" + }, { + "name" : "end", + "in" : "query", + "description" : "For Range option - 'end' is the end occurrence of the range of the templates.", + "required" : false, + "type" : "integer", + "format" : "int32" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/TemplateResolution" + } } } } @@ -1612,19 +1751,13 @@ "JsonNode" : { "type" : "object", "properties" : { - "array" : { - "type" : "boolean" - }, - "null" : { - "type" : "boolean" - }, "float" : { "type" : "boolean" }, - "bigInteger" : { + "array" : { "type" : "boolean" }, - "bigDecimal" : { + "null" : { "type" : "boolean" }, "valueNode" : { @@ -1655,25 +1788,31 @@ "type" : "string", "enum" : [ "ARRAY", "BINARY", "BOOLEAN", "MISSING", "NULL", "NUMBER", "OBJECT", "POJO", "STRING" ] }, + "object" : { + "type" : "boolean" + }, "number" : { "type" : "boolean" }, - "binary" : { + "bigDecimal" : { "type" : "boolean" }, - "boolean" : { + "bigInteger" : { "type" : "boolean" }, "double" : { "type" : "boolean" }, + "long" : { + "type" : "boolean" + }, "int" : { "type" : "boolean" }, - "long" : { + "boolean" : { "type" : "boolean" }, - "object" : { + "binary" : { "type" : "boolean" } } @@ -1839,6 +1978,13 @@ "type" : "integer", "format" : "int64" }, + "number" : { + "type" : "integer", + "format" : "int32" + }, + "sort" : { + "$ref" : "#/definitions/Sort" + }, "size" : { "type" : "integer", "format" : "int32" @@ -1849,12 +1995,11 @@ "type" : "object" } }, - "number" : { - "type" : "integer", - "format" : "int32" + "first" : { + "type" : "boolean" }, - "sort" : { - "$ref" : "#/definitions/Sort" + "last" : { + "type" : "boolean" }, "pageable" : { "$ref" : "#/definitions/Pageable" @@ -1863,12 +2008,6 @@ "type" : "integer", "format" : "int32" }, - "last" : { - "type" : "boolean" - }, - "first" : { - "type" : "boolean" - }, "empty" : { "type" : "boolean" } @@ -1885,6 +2024,13 @@ "type" : "integer", "format" : "int64" }, + "number" : { + "type" : "integer", + "format" : "int32" + }, + "sort" : { + "$ref" : "#/definitions/Sort" + }, "size" : { "type" : "integer", "format" : "int32" @@ -1895,12 +2041,11 @@ "$ref" : "#/definitions/BlueprintModelSearch" } }, - "number" : { - "type" : "integer", - "format" : "int32" + "first" : { + "type" : "boolean" }, - "sort" : { - "$ref" : "#/definitions/Sort" + "last" : { + "type" : "boolean" }, "pageable" : { "$ref" : "#/definitions/Pageable" @@ -1909,12 +2054,6 @@ "type" : "integer", "format" : "int32" }, - "last" : { - "type" : "boolean" - }, - "first" : { - "type" : "boolean" - }, "empty" : { "type" : "boolean" } @@ -1923,18 +2062,12 @@ "Pageable" : { "type" : "object", "properties" : { - "offset" : { - "type" : "integer", - "format" : "int64" - }, "sort" : { "$ref" : "#/definitions/Sort" }, - "paged" : { - "type" : "boolean" - }, - "unpaged" : { - "type" : "boolean" + "offset" : { + "type" : "integer", + "format" : "int64" }, "pageNumber" : { "type" : "integer", @@ -1943,6 +2076,12 @@ "pageSize" : { "type" : "integer", "format" : "int32" + }, + "paged" : { + "type" : "boolean" + }, + "unpaged" : { + "type" : "boolean" } } }, @@ -2206,13 +2345,13 @@ "Sort" : { "type" : "object", "properties" : { - "unsorted" : { + "empty" : { "type" : "boolean" }, - "sorted" : { + "unsorted" : { "type" : "boolean" }, - "empty" : { + "sorted" : { "type" : "boolean" } } @@ -2265,9 +2404,6 @@ } } }, - "Unit" : { - "type" : "object" - }, "WorkFlowSpecRequest" : { "type" : "object", "required" : [ "blueprintName", "workflowName" ], -- cgit 1.2.3-korg