X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=docs%2Fapi%2Fswagger%2Fcps%2Fopenapi.yaml;h=80766cc07017a30ba0f65db39f1abab366e5a4c3;hb=f569b0235e21f47ab761c75b2af35b889a969f48;hp=e8f13d4df940102147a328b37e2d522843c6a95d;hpb=1a65023937c209ae05c8e84093376b737e78320c;p=cps.git diff --git a/docs/api/swagger/cps/openapi.yaml b/docs/api/swagger/cps/openapi.yaml index e8f13d4df..80766cc07 100644 --- a/docs/api/swagger/cps/openapi.yaml +++ b/docs/api/swagger/cps/openapi.yaml @@ -29,6 +29,7 @@ paths: summary: Create a dataspace description: Create a new dataspace operationId: createDataspace + deprecated: true parameters: - name: dataspace-name in: query @@ -95,6 +96,75 @@ paths: status: 500 message: Internal Server Error details: Internal Server Error occurred + /v2/dataspaces: + post: + tags: + - cps-admin + summary: Create a dataspace + description: Create a new dataspace + operationId: createDataspaceV2 + parameters: + - name: dataspace-name + in: query + description: dataspace-name + required: true + schema: + type: string + example: my-dataspace + responses: + "201": + description: Created + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 400 + message: Bad Request + details: The provided request is not valid + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 401 + message: Unauthorized request + details: This request is unauthorized + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 403 + message: Request Forbidden + details: This request is forbidden + "409": + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 409 + message: Conflicting request + details: The request cannot be processed as the resource is in use. + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 500 + message: Internal Server Error + details: Internal Server Error occurred + /{apiVersion}/dataspaces: delete: tags: - cps-admin @@ -102,6 +172,7 @@ paths: description: Delete a dataspace operationId: deleteDataspace parameters: + - $ref: '#/components/parameters/apiVersionInPath' - name: dataspace-name in: query description: dataspace-name @@ -163,7 +234,128 @@ paths: status: 500 message: Internal Server Error details: Internal Server Error occurred - /v1/dataspaces/{dataspace-name}/anchors: + /{apiVersion}/admin/dataspaces: + get: + tags: + - cps-admin + summary: Get dataspaces + description: "Read all dataspaces" + operationId: getAllDataspaces + parameters: + - $ref: '#/components/parameters/apiVersionInPath' + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DataspaceDetails' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 400 + message: Bad Request + details: The provided request is not valid + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 401 + message: Unauthorized request + details: This request is unauthorized + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 403 + message: Request Forbidden + details: This request is forbidden + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 500 + message: Internal Server Error + details: Internal Server Error occurred + /{apiVersion}/admin/dataspaces/{dataspace-name}: + get: + tags: + - cps-admin + summary: Get a dataspace + description: Read an dataspace given a dataspace name + operationId: getDataspace + parameters: + - $ref: '#/components/parameters/apiVersionInPath' + - name: dataspace-name + in: path + description: dataspace-name + required: true + schema: + type: string + example: my-dataspace + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DataspaceDetails' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 400 + message: Bad Request + details: The provided request is not valid + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 401 + message: Unauthorized request + details: This request is unauthorized + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 403 + message: Request Forbidden + details: This request is forbidden + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 500 + message: Internal Server Error + details: Internal Server Error occurred + /{apiVersion}/dataspaces/{dataspace-name}/anchors: get: tags: - cps-admin @@ -171,6 +363,7 @@ paths: description: "Read all anchors, given a dataspace" operationId: getAnchors parameters: + - $ref: '#/components/parameters/apiVersionInPath' - name: dataspace-name in: path description: dataspace-name @@ -227,10 +420,12 @@ paths: status: 500 message: Internal Server Error details: Internal Server Error occurred + /v1/dataspaces/{dataspace-name}/anchors: post: tags: - cps-admin summary: Create an anchor + deprecated: true description: Create a new anchor in the given dataspace operationId: createAnchor parameters: @@ -313,7 +508,89 @@ paths: status: 500 message: Internal Server Error details: Internal Server Error occurred - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}: + /v2/dataspaces/{dataspace-name}/anchors: + post: + tags: + - cps-admin + summary: Create an anchor + description: Create a new anchor in the given dataspace + operationId: createAnchorV2 + parameters: + - name: dataspace-name + in: path + description: dataspace-name + required: true + schema: + type: string + example: my-dataspace + - name: schema-set-name + in: query + description: schema-set-name + required: true + schema: + type: string + example: my-schema-set + - name: anchor-name + in: query + description: anchor-name + required: true + schema: + type: string + example: my-anchor + responses: + "201": + description: Created + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 400 + message: Bad Request + details: The provided request is not valid + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 401 + message: Unauthorized request + details: This request is unauthorized + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 403 + message: Request Forbidden + details: This request is forbidden + "409": + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 409 + message: Conflicting request + details: The request cannot be processed as the resource is in use. + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 500 + message: Internal Server Error + details: Internal Server Error occurred + /{apiVersion}/dataspaces/{dataspace-name}/anchors/{anchor-name}: get: tags: - cps-admin @@ -321,6 +598,7 @@ paths: description: Read an anchor given an anchor name and a dataspace operationId: getAnchor parameters: + - $ref: '#/components/parameters/apiVersionInPath' - name: dataspace-name in: path description: dataspace-name @@ -385,9 +663,162 @@ paths: delete: tags: - cps-admin - summary: Delete an anchor - description: Delete an anchor given an anchor name and a dataspace - operationId: deleteAnchor + summary: Delete an anchor + description: Delete an anchor given an anchor name and a dataspace + operationId: deleteAnchor + parameters: + - $ref: '#/components/parameters/apiVersionInPath' + - name: dataspace-name + in: path + description: dataspace-name + required: true + schema: + type: string + example: my-dataspace + - name: anchor-name + in: path + description: anchor-name + required: true + schema: + type: string + example: my-anchor + responses: + "204": + description: No Content + content: {} + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 400 + message: Bad Request + details: The provided request is not valid + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 401 + message: Unauthorized request + details: This request is unauthorized + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 403 + message: Request Forbidden + details: This request is forbidden + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 500 + message: Internal Server Error + details: Internal Server Error occurred + /v1/dataspaces/{dataspace-name}/schema-sets: + post: + tags: + - cps-admin + summary: Create a schema set + description: Create a new schema set in the given dataspace + operationId: createSchemaSet + parameters: + - name: dataspace-name + in: path + description: dataspace-name + required: true + schema: + type: string + example: my-dataspace + - name: schema-set-name + in: query + description: schema-set-name + required: true + schema: + type: string + example: my-schema-set + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/MultipartFile' + required: true + responses: + "201": + description: Created + content: + text/plain: + schema: + type: string + example: my-resource + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 400 + message: Bad Request + details: The provided request is not valid + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 401 + message: Unauthorized request + details: This request is unauthorized + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 403 + message: Request Forbidden + details: This request is forbidden + "409": + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 409 + message: Conflicting request + details: The request cannot be processed as the resource is in use. + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 500 + message: Internal Server Error + details: Internal Server Error occurred + /v2/dataspaces/{dataspace-name}/schema-sets: + post: + tags: + - cps-admin + summary: Create a schema set + description: Create a new schema set in the given dataspace + operationId: createSchemaSetV2 parameters: - name: dataspace-name in: path @@ -396,17 +827,22 @@ paths: schema: type: string example: my-dataspace - - name: anchor-name - in: path - description: anchor-name + - name: schema-set-name + in: query + description: schema-set-name required: true schema: type: string - example: my-anchor + example: my-schema-set + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/MultipartFile' + required: true responses: - "204": - description: No Content - content: {} + "201": + description: Created "400": description: Bad Request content: @@ -437,6 +873,16 @@ paths: status: 403 message: Request Forbidden details: This request is forbidden + "409": + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 409 + message: Conflicting request + details: The request cannot be processed as the resource is in use. "500": description: Internal Server Error content: @@ -447,14 +893,15 @@ paths: status: 500 message: Internal Server Error details: Internal Server Error occurred - /v1/dataspaces/{dataspace-name}/schema-sets: - post: + /{apiVersion}/dataspaces/{dataspace-name}/schema-sets: + get: tags: - cps-admin - summary: Create a schema set - description: Create a new schema set in the given dataspace - operationId: createSchemaSet + summary: Get schema sets for a given dataspace + description: "Read schema sets for a given dataspace" + operationId: getSchemaSets parameters: + - $ref: '#/components/parameters/apiVersionInPath' - name: dataspace-name in: path description: dataspace-name @@ -462,27 +909,15 @@ paths: schema: type: string example: my-dataspace - - name: schema-set-name - in: query - description: schema-set-name - required: true - schema: - type: string - example: my-schema-set - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/MultipartFile' - required: true responses: - "201": - description: Created + "200": + description: OK content: - text/plain: + application/json: schema: - type: string - example: my-resource + type: array + items: + $ref: '#/components/schemas/SchemaSetDetails' "400": description: Bad Request content: @@ -513,16 +948,6 @@ paths: status: 403 message: Request Forbidden details: This request is forbidden - "409": - description: Conflict - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorMessage' - example: - status: 409 - message: Conflicting request - details: The request cannot be processed as the resource is in use. "500": description: Internal Server Error content: @@ -533,7 +958,7 @@ paths: status: 500 message: Internal Server Error details: Internal Server Error occurred - /v1/dataspaces/{dataspace-name}/schema-sets/{schema-set-name}: + /{apiVersion}/dataspaces/{dataspace-name}/schema-sets/{schema-set-name}: get: tags: - cps-admin @@ -541,6 +966,7 @@ paths: description: Read a schema set given a schema set name and a dataspace operationId: getSchemaSet parameters: + - $ref: '#/components/parameters/apiVersionInPath' - name: dataspace-name in: path description: dataspace-name @@ -609,6 +1035,7 @@ paths: description: Delete a schema set given a schema set name and a dataspace operationId: deleteSchemaSet parameters: + - $ref: '#/components/parameters/apiVersionInPath' - name: dataspace-name in: path description: dataspace-name @@ -684,6 +1111,7 @@ paths: summary: Get a node description: Get a node with an option to retrieve all the children for a given anchor and dataspace + deprecated: true operationId: getNodeByDataspaceAndAnchor parameters: - name: dataspace-name @@ -771,7 +1199,102 @@ paths: message: Internal Server Error details: Internal Server Error occurred x-codegen-request-body-name: xpath - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes: + /v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/node: + get: + tags: + - cps-data + summary: Get a node + description: Get a node with an option to retrieve all the children for a given + anchor and dataspace + operationId: getNodeByDataspaceAndAnchorV2 + parameters: + - name: dataspace-name + in: path + description: dataspace-name + required: true + schema: + type: string + example: my-dataspace + - name: anchor-name + in: path + description: anchor-name + required: true + schema: + type: string + example: my-anchor + - name: xpath + in: query + description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html" + required: false + schema: + type: string + default: / + examples: + container xpath: + value: /shops/bookstore + list attributes xpath: + value: "/shops/bookstore/categories[@code=1]" + - name: descendants + in: query + description: descendants + required: false + schema: + type: string + example: 3 + default: none + pattern: '^all$|^none$|^[0-9]+$|^-1$' + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + examples: + dataSample: + $ref: '#/components/examples/dataSample' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 400 + message: Bad Request + details: The provided request is not valid + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 401 + message: Unauthorized request + details: This request is unauthorized + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 403 + message: Request Forbidden + details: This request is forbidden + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 500 + message: Internal Server Error + details: Internal Server Error occurred + x-codegen-request-body-name: xpath + /{apiVersion}/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes: put: tags: - cps-data @@ -780,6 +1303,7 @@ paths: \ and a parent node xpath" operationId: replaceNode parameters: + - $ref: '#/components/parameters/apiVersionInPath' - name: dataspace-name in: path description: dataspace-name @@ -879,6 +1403,7 @@ paths: description: Create a node for a given anchor and dataspace operationId: createNode parameters: + - $ref: '#/components/parameters/apiVersionInPath' - name: dataspace-name in: path description: dataspace-name @@ -987,6 +1512,7 @@ paths: xpath. operationId: deleteDataNode parameters: + - $ref: '#/components/parameters/apiVersionInPath' - name: dataspace-name in: path description: dataspace-name @@ -1072,6 +1598,7 @@ paths: a parent node xpath operationId: updateNodeLeaves parameters: + - $ref: '#/components/parameters/apiVersionInPath' - name: dataspace-name in: path description: dataspace-name @@ -1164,7 +1691,7 @@ paths: status: 500 message: Internal Server Error details: Internal Server Error occurred - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes: + /{apiVersion}/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes: put: tags: - cps-data @@ -1172,6 +1699,7 @@ paths: description: "Replace list content under a given parent, anchor and dataspace" operationId: replaceListContent parameters: + - $ref: '#/components/parameters/apiVersionInPath' - name: dataspace-name in: path description: dataspace-name @@ -1270,6 +1798,7 @@ paths: description: Add list element(s) to a list for a given anchor and dataspace operationId: addListElements parameters: + - $ref: '#/components/parameters/apiVersionInPath' - name: dataspace-name in: path description: dataspace-name @@ -1366,6 +1895,7 @@ paths: description: Delete one or all list element(s) for a given anchor and dataspace operationId: deleteListOrListElement parameters: + - $ref: '#/components/parameters/apiVersionInPath' - name: dataspace-name in: path description: dataspace-name @@ -1443,7 +1973,7 @@ paths: message: Internal Server Error details: Internal Server Error occurred deprecated: true - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes/query: + /{apiVersion}/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes/query: get: tags: - cps-query @@ -1451,6 +1981,7 @@ paths: description: Query data nodes for the given dataspace and anchor using CPS path operationId: getNodesByDataspaceAndAnchorAndCpsPath parameters: + - $ref: '#/components/parameters/apiVersionInPath' - name: dataspace-name in: path description: dataspace-name @@ -1536,7 +2067,112 @@ paths: message: Internal Server Error details: Internal Server Error occurred x-codegen-request-body-name: xpath + /v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes/query: + get: + tags: + - cps-query + summary: Query data nodes + description: Query data nodes for the given dataspace and anchor using CPS path + operationId: getNodesByDataspaceAndAnchorAndCpsPathV2 + parameters: + - name: dataspace-name + in: path + description: dataspace-name + required: true + schema: + type: string + example: my-dataspace + - name: anchor-name + in: path + description: anchor-name + required: true + schema: + type: string + example: my-anchor + - name: cps-path + in: query + description: "For more details on cps path, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html" + required: false + schema: + type: string + default: / + examples: + container cps path: + value: //bookstore + list attributes cps path: + value: "//categories[@code=1]" + - name: descendants + in: query + description: descendants + required: false + schema: + type: string + pattern: '^all$|^none$|^[0-9]+$|^-1$' + example: false + default: none + example: 3 + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + examples: + dataSample: + $ref: '#/components/examples/dataSample' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 400 + message: Bad Request + details: The provided request is not valid + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 401 + message: Unauthorized request + details: This request is unauthorized + "403": + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 403 + message: Request Forbidden + details: This request is forbidden + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + example: + status: 500 + message: Internal Server Error + details: Internal Server Error occurred + x-codegen-request-body-name: xpath components: + parameters: + apiVersionInPath: + name: apiVersion + in: path + description: apiVersion + required: true + schema: + type: string + enum: [v1, v2] + default: v2 securitySchemes: basicAuth: type: http @@ -1565,6 +2201,13 @@ components: schemaSetName: type: string example: my-schema-set + DataspaceDetails: + title: Dataspace details by dataspace Name + type: object + properties: + name: + type: string + example: my-dataspace MultipartFile: required: - file @@ -1615,4 +2258,4 @@ components: name: kids security: - - basicAuth: [] \ No newline at end of file + - basicAuth: []