Renu Kumari | 0938b00 | 2021-05-04 09:02:14 -0400 | [diff] [blame^] | 1 | openapi: 3.0.1 |
| 2 | info: |
| 3 | title: ONAP Open API v3 Configuration Persistence Service - Temporal |
| 4 | description: CPS-Temporal is time-series database for network data |
| 5 | version: 1.0.0 |
| 6 | contact: |
| 7 | name: ONAP |
| 8 | url: 'https://onap.readthedocs.io' |
| 9 | email: onap-discuss@lists.onap.org |
| 10 | license: |
| 11 | name: Apache 2.0 |
| 12 | url: 'http://www.apache.org/licenses/LICENSE-2.0' |
| 13 | x-planned-retirement-date: '202212' |
| 14 | x-component: Modeling |
| 15 | servers: |
| 16 | - url: '//localhost:8088/cps-temporal/api' |
| 17 | tags: |
| 18 | - name: cps-temporal-query |
| 19 | description: CPS Temporal Query |
| 20 | paths: |
| 21 | '/v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/history': |
| 22 | get: |
| 23 | description: 'Read the data for the specified anchor based on filter criteria provided in query parameters' |
| 24 | tags: |
| 25 | - cps-temporal-query |
| 26 | summary: Get anchor data by name |
| 27 | operationId: getAnchorDataByName |
| 28 | parameters: |
| 29 | - $ref: '#/components/parameters/dataspaceName' |
| 30 | - name: anchor-name |
| 31 | in: path |
| 32 | description: Anchor Name |
| 33 | required: true |
| 34 | schema: |
| 35 | type: string |
| 36 | - $ref: '#/components/parameters/after' |
| 37 | - $ref: '#/components/parameters/simplePayloadFilter' |
| 38 | - $ref: '#/components/parameters/pointInTime' |
| 39 | - $ref: '#/components/parameters/pageNumber' |
| 40 | - $ref: '#/components/parameters/pageLimit' |
| 41 | - $ref: '#/components/parameters/sort' |
| 42 | responses: |
| 43 | '200': |
| 44 | description: OK |
| 45 | content: |
| 46 | application/json: |
| 47 | schema: |
| 48 | $ref: '#/components/schemas/AnchorDataByNameResponse' |
| 49 | '400': |
| 50 | $ref: '#/components/responses/BadRequest' |
| 51 | '401': |
| 52 | $ref: '#/components/responses/Unauthorized' |
| 53 | '403': |
| 54 | $ref: '#/components/responses/Forbidden' |
| 55 | '/v1/dataspaces/{dataspace-name}/anchors/history': |
| 56 | get: |
| 57 | description: 'Read anchors data based on filter criteria provided in query parameters' |
| 58 | tags: |
| 59 | - cps-temporal-query |
| 60 | summary: Get anchors data based on filter criteria |
| 61 | operationId: getAnchorsDataByFilter |
| 62 | parameters: |
| 63 | - $ref: '#/components/parameters/dataspaceName' |
| 64 | - name: schemaset-name |
| 65 | in: query |
| 66 | description: Schema-set name |
| 67 | required: true |
| 68 | schema: |
| 69 | type: string |
| 70 | - $ref: '#/components/parameters/after' |
| 71 | - $ref: '#/components/parameters/simplePayloadFilter' |
| 72 | - $ref: '#/components/parameters/pointInTime' |
| 73 | - $ref: '#/components/parameters/pageNumber' |
| 74 | - $ref: '#/components/parameters/pageLimit' |
| 75 | - $ref: '#/components/parameters/sort' |
| 76 | responses: |
| 77 | '200': |
| 78 | description: OK |
| 79 | content: |
| 80 | application/json: |
| 81 | schema: |
| 82 | $ref: '#/components/schemas/AnchorsDataByFilterResponse' |
| 83 | '400': |
| 84 | $ref: '#/components/responses/BadRequest' |
| 85 | '401': |
| 86 | $ref: '#/components/responses/Unauthorized' |
| 87 | '403': |
| 88 | $ref: '#/components/responses/Forbidden' |
| 89 | components: |
| 90 | parameters: |
| 91 | dataspaceName: |
| 92 | name: dataspace-name |
| 93 | in: path |
| 94 | description: Dataspace Name |
| 95 | required: true |
| 96 | schema: |
| 97 | type: string |
| 98 | after: |
| 99 | name: after |
| 100 | in: query |
| 101 | description: Fetch data after <br/> Format - 'yyyy-MM-ddTHH:mm:ss.SSSZ' |
| 102 | required: false |
| 103 | schema: |
| 104 | type: string |
| 105 | example: '2021-03-21T00:00:00.000000-0:00' |
| 106 | simplePayloadFilter: |
| 107 | name: simplePayloadFilter |
| 108 | in: query |
| 109 | description: Payload filter |
| 110 | required: false |
| 111 | schema: |
| 112 | type: string |
| 113 | pointInTime: |
| 114 | name: pointInTime |
| 115 | in: query |
| 116 | description: Consider data modified before <br/> Format - 'yyyy-MM-ddTHH:mm:ss.SSSZ' |
| 117 | required: false |
| 118 | schema: |
| 119 | type: string |
| 120 | example: '2021-03-21T00:00:00.000000-0:00' |
| 121 | pageLimit: |
| 122 | in: query |
| 123 | name: pageLimit |
| 124 | required: false |
| 125 | schema: |
| 126 | type: integer |
| 127 | minimum: 0 |
| 128 | maximum: 10000 |
| 129 | default: 1000 |
| 130 | description: The numbers of items to return |
| 131 | pageNumber: |
| 132 | name: pageNumber |
| 133 | in: query |
| 134 | description: Page number |
| 135 | required: false |
| 136 | schema: |
| 137 | type: integer |
| 138 | minimum: 0 |
| 139 | default: 0 |
| 140 | sort: |
| 141 | in: query |
| 142 | name: sort |
| 143 | required: false |
| 144 | schema: |
| 145 | type: string |
| 146 | default: timestamp:desc |
| 147 | description: "Sort by timestamp in 'asc' or 'desc' order. Supported values: <br/> timestamp:desc<br/>timestamp:asc" |
| 148 | responses: |
| 149 | BadRequest: |
| 150 | description: Bad Request |
| 151 | content: |
| 152 | application/json: |
| 153 | schema: |
| 154 | $ref: '#/components/schemas/ErrorMessage' |
| 155 | Unauthorized: |
| 156 | description: Unauthorized |
| 157 | content: |
| 158 | application/json: |
| 159 | schema: |
| 160 | $ref: '#/components/schemas/ErrorMessage' |
| 161 | Forbidden: |
| 162 | description: Forbidden |
| 163 | content: |
| 164 | application/json: |
| 165 | schema: |
| 166 | $ref: '#/components/schemas/ErrorMessage' |
| 167 | schemas: |
| 168 | AnchorHistory: |
| 169 | type: object |
| 170 | title: AnchorHistory |
| 171 | properties: |
| 172 | nextRecordsLink: |
| 173 | type: string |
| 174 | example: /v1/dataspace/dataspace-name/anchors/history?pageLimit=20&pageNumber=2 |
| 175 | previousRecordsLink: |
| 176 | type: string |
| 177 | example: /v1/dataspace/dataspace-name/anchors/history?pageLimit=20&pageNumber=0 |
| 178 | records: |
| 179 | type: array |
| 180 | items: |
| 181 | type: object |
| 182 | properties: |
| 183 | timestamp: |
| 184 | type: string |
| 185 | format: date-time |
| 186 | example: '2021-03-21T00:00:00.000000-0:00' |
| 187 | dataspace: |
| 188 | type: string |
| 189 | example: 'my-dataspace' |
| 190 | schemaSet: |
| 191 | type: string |
| 192 | example: 'my-schema-set' |
| 193 | anchor: |
| 194 | type: string |
| 195 | example: 'my-anchor' |
| 196 | data: |
| 197 | type: object |
| 198 | example: { "status" : "UP" } |
| 199 | required: |
| 200 | - records |
| 201 | |
| 202 | AnchorsDataByFilterResponse: |
| 203 | allOf: # Combines the BasicErrorModel and the inline model |
| 204 | - $ref: '#/components/schemas/AnchorHistory' |
| 205 | - title: getAnchorDataByNameResponse |
| 206 | properties: |
| 207 | nextRecordsLink: |
| 208 | type: string |
| 209 | example: /v1/dataspace/my-dataspace/anchors/history?pageLimit=20&pageNumber=2 |
| 210 | previousRecordsLink: |
| 211 | type: string |
| 212 | example: /v1/dataspace/my-dataspace/anchors/history?pageLimit=20&pageNumber=0 |
| 213 | |
| 214 | AnchorDataByNameResponse: |
| 215 | allOf: # Combines the BasicErrorModel and the inline model |
| 216 | - $ref: '#/components/schemas/AnchorHistory' |
| 217 | - title: getAnchorDataByNameResponse |
| 218 | properties: |
| 219 | nextRecordsLink: |
| 220 | type: string |
| 221 | example: /v1/dataspace/my-dataspace/anchors/my-anchor/history?pageLimit=20&pageNumber=2 |
| 222 | previousRecordsLink: |
| 223 | type: string |
| 224 | example: /v1/dataspace/my-dataspace/anchors/my-anchor/history?pageLimit=20&pageNumber=0 |
| 225 | |
| 226 | ErrorMessage: |
| 227 | type: object |
| 228 | title: Error |
| 229 | properties: |
| 230 | status: |
| 231 | type: string |
| 232 | example: 400 |
| 233 | message: |
| 234 | type: string |
| 235 | example: Data could not be fetched |
| 236 | details: |
| 237 | type: string |
| 238 | example: "after parameter should have datetime value in ISO format yyyy-MM-ddTHH:mm:ss.SSSZ" |