Renu Kumari | 22fe216 | 2021-07-22 11:53:53 -0400 | [diff] [blame] | 1 | # ============LICENSE_START======================================================= |
puthuparambil.aditya | cb23b17 | 2022-01-10 12:58:37 +0000 | [diff] [blame] | 2 | # Copyright (c) 2021-2022 Bell Canada. |
Renu Kumari | 22fe216 | 2021-07-22 11:53:53 -0400 | [diff] [blame] | 3 | # ================================================================================ |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | # SPDX-License-Identifier: Apache-2.0 |
| 17 | # ============LICENSE_END========================================================= |
| 18 | |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 19 | openapi: 3.0.1 |
| 20 | info: |
| 21 | title: ONAP Open API v3 Configuration Persistence Service - Temporal |
| 22 | description: CPS-Temporal is time-series database for network data |
| 23 | version: 1.0.0 |
| 24 | contact: |
| 25 | name: ONAP |
| 26 | url: 'https://onap.readthedocs.io' |
| 27 | email: onap-discuss@lists.onap.org |
| 28 | license: |
| 29 | name: Apache 2.0 |
| 30 | url: 'http://www.apache.org/licenses/LICENSE-2.0' |
| 31 | x-planned-retirement-date: '202212' |
| 32 | x-component: Modeling |
| 33 | servers: |
Renu Kumari | 22fe216 | 2021-07-22 11:53:53 -0400 | [diff] [blame] | 34 | - url: '/cps-temporal/api' |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 35 | tags: |
| 36 | - name: cps-temporal-query |
| 37 | description: CPS Temporal Query |
| 38 | paths: |
| 39 | '/v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/history': |
| 40 | get: |
| 41 | description: 'Read the data for the specified anchor based on filter criteria provided in query parameters' |
| 42 | tags: |
| 43 | - cps-temporal-query |
| 44 | summary: Get anchor data by name |
| 45 | operationId: getAnchorDataByName |
| 46 | parameters: |
| 47 | - $ref: '#/components/parameters/dataspaceName' |
| 48 | - name: anchor-name |
| 49 | in: path |
| 50 | description: Anchor Name |
| 51 | required: true |
| 52 | schema: |
| 53 | type: string |
emaclee | 336dfaa | 2021-12-01 13:54:04 +0000 | [diff] [blame] | 54 | example: my-anchor |
Renu Kumari | c2b5e85 | 2021-07-28 00:07:41 -0400 | [diff] [blame] | 55 | - $ref: '#/components/parameters/observedTimestampAfter' |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 56 | - $ref: '#/components/parameters/simplePayloadFilter' |
| 57 | - $ref: '#/components/parameters/pointInTime' |
| 58 | - $ref: '#/components/parameters/pageNumber' |
| 59 | - $ref: '#/components/parameters/pageLimit' |
| 60 | - $ref: '#/components/parameters/sort' |
| 61 | responses: |
| 62 | '200': |
| 63 | description: OK |
| 64 | content: |
| 65 | application/json: |
| 66 | schema: |
Renu Kumari | 22fe216 | 2021-07-22 11:53:53 -0400 | [diff] [blame] | 67 | $ref: '#/components/schemas/AnchorHistory' |
| 68 | example: |
| 69 | nextRecordsLink: /v1/dataspace/my-dataspace/anchors/my-anchor/history?pageLimit=20&pageNumber=2 |
| 70 | previousRecordsLink: /v1/dataspace/my-dataspace/anchors/my-anchor/history?pageLimit=20&pageNumber=0 |
| 71 | records: |
Renu Kumari | ea04c07 | 2021-08-10 16:43:04 -0400 | [diff] [blame] | 72 | - timestamp: '2021-03-21T00:00:00.000-0000' |
Renu Kumari | 22fe216 | 2021-07-22 11:53:53 -0400 | [diff] [blame] | 73 | dataspace: my-dataspace |
| 74 | schemaSet: my-schema-set |
| 75 | anchor: my-anchor |
| 76 | data: |
| 77 | status: UP |
| 78 | |
| 79 | |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 80 | '400': |
| 81 | $ref: '#/components/responses/BadRequest' |
| 82 | '401': |
| 83 | $ref: '#/components/responses/Unauthorized' |
| 84 | '403': |
| 85 | $ref: '#/components/responses/Forbidden' |
| 86 | '/v1/dataspaces/{dataspace-name}/anchors/history': |
| 87 | get: |
| 88 | description: 'Read anchors data based on filter criteria provided in query parameters' |
| 89 | tags: |
| 90 | - cps-temporal-query |
| 91 | summary: Get anchors data based on filter criteria |
| 92 | operationId: getAnchorsDataByFilter |
| 93 | parameters: |
| 94 | - $ref: '#/components/parameters/dataspaceName' |
Renu Kumari | 22fe216 | 2021-07-22 11:53:53 -0400 | [diff] [blame] | 95 | - name: schema-set-name |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 96 | in: query |
| 97 | description: Schema-set name |
| 98 | required: true |
| 99 | schema: |
| 100 | type: string |
Renu Kumari | c2b5e85 | 2021-07-28 00:07:41 -0400 | [diff] [blame] | 101 | - $ref: '#/components/parameters/observedTimestampAfter' |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 102 | - $ref: '#/components/parameters/simplePayloadFilter' |
| 103 | - $ref: '#/components/parameters/pointInTime' |
| 104 | - $ref: '#/components/parameters/pageNumber' |
| 105 | - $ref: '#/components/parameters/pageLimit' |
| 106 | - $ref: '#/components/parameters/sort' |
| 107 | responses: |
| 108 | '200': |
| 109 | description: OK |
| 110 | content: |
| 111 | application/json: |
| 112 | schema: |
Renu Kumari | 22fe216 | 2021-07-22 11:53:53 -0400 | [diff] [blame] | 113 | $ref: '#/components/schemas/AnchorHistory' |
| 114 | example: |
| 115 | nextRecordsLink: /v1/dataspace/my-dataspace/anchors/history?pageLimit=20&pageNumber=2 |
| 116 | previousRecordsLink: /v1/dataspace/my-dataspace/anchors/history?pageLimit=20&pageNumber=0 |
| 117 | records: |
Renu Kumari | ea04c07 | 2021-08-10 16:43:04 -0400 | [diff] [blame] | 118 | - timestamp: '2021-03-21T00:00:00.000-0000' |
Renu Kumari | 22fe216 | 2021-07-22 11:53:53 -0400 | [diff] [blame] | 119 | dataspace: my-dataspace |
| 120 | schemaSet: my-schema-set |
| 121 | anchor: my-anchor |
| 122 | data: |
| 123 | status: UP |
| 124 | |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 125 | '400': |
| 126 | $ref: '#/components/responses/BadRequest' |
| 127 | '401': |
| 128 | $ref: '#/components/responses/Unauthorized' |
| 129 | '403': |
| 130 | $ref: '#/components/responses/Forbidden' |
| 131 | components: |
| 132 | parameters: |
| 133 | dataspaceName: |
| 134 | name: dataspace-name |
| 135 | in: path |
| 136 | description: Dataspace Name |
| 137 | required: true |
| 138 | schema: |
| 139 | type: string |
Renu Kumari | c2b5e85 | 2021-07-28 00:07:41 -0400 | [diff] [blame] | 140 | observedTimestampAfter: |
| 141 | name: observedTimestampAfter |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 142 | in: query |
Renu Kumari | c2b5e85 | 2021-07-28 00:07:41 -0400 | [diff] [blame] | 143 | description: Fetch data with observed timestamp after <br/> Format - 'yyyy-MM-ddTHH:mm:ss.SSSZ' |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 144 | required: false |
| 145 | schema: |
| 146 | type: string |
Renu Kumari | ea04c07 | 2021-08-10 16:43:04 -0400 | [diff] [blame] | 147 | example: '2021-03-21T00:00:00.000-0000' |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 148 | simplePayloadFilter: |
| 149 | name: simplePayloadFilter |
| 150 | in: query |
| 151 | description: Payload filter |
| 152 | required: false |
| 153 | schema: |
| 154 | type: string |
| 155 | pointInTime: |
| 156 | name: pointInTime |
| 157 | in: query |
| 158 | description: Consider data modified before <br/> Format - 'yyyy-MM-ddTHH:mm:ss.SSSZ' |
| 159 | required: false |
| 160 | schema: |
| 161 | type: string |
Renu Kumari | ea04c07 | 2021-08-10 16:43:04 -0400 | [diff] [blame] | 162 | example: '2021-03-21T00:00:00.000-0000' |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 163 | pageLimit: |
| 164 | in: query |
| 165 | name: pageLimit |
| 166 | required: false |
| 167 | schema: |
| 168 | type: integer |
| 169 | minimum: 0 |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 170 | default: 1000 |
| 171 | description: The numbers of items to return |
| 172 | pageNumber: |
| 173 | name: pageNumber |
| 174 | in: query |
| 175 | description: Page number |
| 176 | required: false |
| 177 | schema: |
| 178 | type: integer |
| 179 | minimum: 0 |
| 180 | default: 0 |
| 181 | sort: |
| 182 | in: query |
| 183 | name: sort |
| 184 | required: false |
| 185 | schema: |
| 186 | type: string |
Renu Kumari | c2b5e85 | 2021-07-28 00:07:41 -0400 | [diff] [blame] | 187 | default: observed_timestamp:desc |
Renu Kumari | ea04c07 | 2021-08-10 16:43:04 -0400 | [diff] [blame] | 188 | description: "Sort by timestamp in 'asc' or 'desc' order. Supported values: <br/>observed_timestamp:desc<br/>anchor:asc,observed_timestamp:desc" |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 189 | responses: |
| 190 | BadRequest: |
| 191 | description: Bad Request |
| 192 | content: |
| 193 | application/json: |
| 194 | schema: |
| 195 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 336dfaa | 2021-12-01 13:54:04 +0000 | [diff] [blame] | 196 | example: |
puthuparambil.aditya | cb23b17 | 2022-01-10 12:58:37 +0000 | [diff] [blame] | 197 | status: 400 |
emaclee | 336dfaa | 2021-12-01 13:54:04 +0000 | [diff] [blame] | 198 | message: Bad request error message |
| 199 | details: Bad request error details |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 200 | Unauthorized: |
| 201 | description: Unauthorized |
| 202 | content: |
| 203 | application/json: |
| 204 | schema: |
| 205 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 336dfaa | 2021-12-01 13:54:04 +0000 | [diff] [blame] | 206 | example: |
| 207 | status: 401 |
| 208 | message: Unauthorized error message |
| 209 | details: Unauthorized error details |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 210 | Forbidden: |
| 211 | description: Forbidden |
| 212 | content: |
| 213 | application/json: |
| 214 | schema: |
| 215 | $ref: '#/components/schemas/ErrorMessage' |
emaclee | 336dfaa | 2021-12-01 13:54:04 +0000 | [diff] [blame] | 216 | example: |
| 217 | status: 403 |
| 218 | message: Forbidden error message |
| 219 | details: Forbidden error details |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 220 | schemas: |
Renu Kumari | 22fe216 | 2021-07-22 11:53:53 -0400 | [diff] [blame] | 221 | AnchorDetails: |
| 222 | type: object |
| 223 | title: AnchorDetails |
| 224 | properties: |
Renu Kumari | ea04c07 | 2021-08-10 16:43:04 -0400 | [diff] [blame] | 225 | observedTimestamp: |
Renu Kumari | 22fe216 | 2021-07-22 11:53:53 -0400 | [diff] [blame] | 226 | type: string |
Renu Kumari | ea04c07 | 2021-08-10 16:43:04 -0400 | [diff] [blame] | 227 | example: '2021-03-21T00:00:00.000-0000' |
puthuparambil.aditya | cb23b17 | 2022-01-10 12:58:37 +0000 | [diff] [blame] | 228 | operation: |
| 229 | type: string |
| 230 | enum: [CREATE, UPDATE, DELETE] |
| 231 | example: UPDATE |
Renu Kumari | 22fe216 | 2021-07-22 11:53:53 -0400 | [diff] [blame] | 232 | dataspace: |
| 233 | type: string |
| 234 | example: 'my-dataspace' |
| 235 | schemaSet: |
| 236 | type: string |
| 237 | example: 'my-schema-set' |
| 238 | anchor: |
| 239 | type: string |
| 240 | example: 'my-anchor' |
| 241 | data: |
| 242 | type: object |
| 243 | example: { "status" : "UP" } |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 244 | AnchorHistory: |
| 245 | type: object |
| 246 | title: AnchorHistory |
| 247 | properties: |
| 248 | nextRecordsLink: |
| 249 | type: string |
| 250 | example: /v1/dataspace/dataspace-name/anchors/history?pageLimit=20&pageNumber=2 |
| 251 | previousRecordsLink: |
| 252 | type: string |
| 253 | example: /v1/dataspace/dataspace-name/anchors/history?pageLimit=20&pageNumber=0 |
| 254 | records: |
| 255 | type: array |
| 256 | items: |
Renu Kumari | 22fe216 | 2021-07-22 11:53:53 -0400 | [diff] [blame] | 257 | $ref: '#/components/schemas/AnchorDetails' |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 258 | required: |
| 259 | - records |
Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame] | 260 | ErrorMessage: |
| 261 | type: object |
| 262 | title: Error |
| 263 | properties: |
| 264 | status: |
| 265 | type: string |
| 266 | example: 400 |
| 267 | message: |
| 268 | type: string |
| 269 | example: Data could not be fetched |
| 270 | details: |
| 271 | type: string |
| 272 | example: "after parameter should have datetime value in ISO format yyyy-MM-ddTHH:mm:ss.SSSZ" |