blob: a96947bd39ced85bcb74fb838504557f255515d5 [file] [log] [blame]
Renu Kumari22fe2162021-07-22 11:53:53 -04001# ============LICENSE_START=======================================================
puthuparambil.adityacb23b172022-01-10 12:58:37 +00002# Copyright (c) 2021-2022 Bell Canada.
Renu Kumari22fe2162021-07-22 11:53:53 -04003# ================================================================================
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 Kumari0938b002021-05-04 09:02:14 -040019openapi: 3.0.1
20info:
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
33servers:
Renu Kumari22fe2162021-07-22 11:53:53 -040034 - url: '/cps-temporal/api'
Renu Kumari0938b002021-05-04 09:02:14 -040035tags:
36 - name: cps-temporal-query
37 description: CPS Temporal Query
38paths:
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
emaclee336dfaa2021-12-01 13:54:04 +000054 example: my-anchor
Renu Kumaric2b5e852021-07-28 00:07:41 -040055 - $ref: '#/components/parameters/observedTimestampAfter'
Renu Kumari0938b002021-05-04 09:02:14 -040056 - $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 Kumari22fe2162021-07-22 11:53:53 -040067 $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 Kumariea04c072021-08-10 16:43:04 -040072 - timestamp: '2021-03-21T00:00:00.000-0000'
Renu Kumari22fe2162021-07-22 11:53:53 -040073 dataspace: my-dataspace
74 schemaSet: my-schema-set
75 anchor: my-anchor
76 data:
77 status: UP
78
79
Renu Kumari0938b002021-05-04 09:02:14 -040080 '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 Kumari22fe2162021-07-22 11:53:53 -040095 - name: schema-set-name
Renu Kumari0938b002021-05-04 09:02:14 -040096 in: query
97 description: Schema-set name
98 required: true
99 schema:
100 type: string
Renu Kumaric2b5e852021-07-28 00:07:41 -0400101 - $ref: '#/components/parameters/observedTimestampAfter'
Renu Kumari0938b002021-05-04 09:02:14 -0400102 - $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 Kumari22fe2162021-07-22 11:53:53 -0400113 $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 Kumariea04c072021-08-10 16:43:04 -0400118 - timestamp: '2021-03-21T00:00:00.000-0000'
Renu Kumari22fe2162021-07-22 11:53:53 -0400119 dataspace: my-dataspace
120 schemaSet: my-schema-set
121 anchor: my-anchor
122 data:
123 status: UP
124
Renu Kumari0938b002021-05-04 09:02:14 -0400125 '400':
126 $ref: '#/components/responses/BadRequest'
127 '401':
128 $ref: '#/components/responses/Unauthorized'
129 '403':
130 $ref: '#/components/responses/Forbidden'
131components:
132 parameters:
133 dataspaceName:
134 name: dataspace-name
135 in: path
136 description: Dataspace Name
137 required: true
138 schema:
139 type: string
Renu Kumaric2b5e852021-07-28 00:07:41 -0400140 observedTimestampAfter:
141 name: observedTimestampAfter
Renu Kumari0938b002021-05-04 09:02:14 -0400142 in: query
Renu Kumaric2b5e852021-07-28 00:07:41 -0400143 description: Fetch data with observed timestamp after <br/> Format - 'yyyy-MM-ddTHH:mm:ss.SSSZ'
Renu Kumari0938b002021-05-04 09:02:14 -0400144 required: false
145 schema:
146 type: string
Renu Kumariea04c072021-08-10 16:43:04 -0400147 example: '2021-03-21T00:00:00.000-0000'
Renu Kumari0938b002021-05-04 09:02:14 -0400148 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 Kumariea04c072021-08-10 16:43:04 -0400162 example: '2021-03-21T00:00:00.000-0000'
Renu Kumari0938b002021-05-04 09:02:14 -0400163 pageLimit:
164 in: query
165 name: pageLimit
166 required: false
167 schema:
168 type: integer
169 minimum: 0
Renu Kumari0938b002021-05-04 09:02:14 -0400170 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 Kumaric2b5e852021-07-28 00:07:41 -0400187 default: observed_timestamp:desc
Renu Kumariea04c072021-08-10 16:43:04 -0400188 description: "Sort by timestamp in 'asc' or 'desc' order. Supported values: <br/>observed_timestamp:desc<br/>anchor:asc,observed_timestamp:desc"
Renu Kumari0938b002021-05-04 09:02:14 -0400189 responses:
190 BadRequest:
191 description: Bad Request
192 content:
193 application/json:
194 schema:
195 $ref: '#/components/schemas/ErrorMessage'
emaclee336dfaa2021-12-01 13:54:04 +0000196 example:
puthuparambil.adityacb23b172022-01-10 12:58:37 +0000197 status: 400
emaclee336dfaa2021-12-01 13:54:04 +0000198 message: Bad request error message
199 details: Bad request error details
Renu Kumari0938b002021-05-04 09:02:14 -0400200 Unauthorized:
201 description: Unauthorized
202 content:
203 application/json:
204 schema:
205 $ref: '#/components/schemas/ErrorMessage'
emaclee336dfaa2021-12-01 13:54:04 +0000206 example:
207 status: 401
208 message: Unauthorized error message
209 details: Unauthorized error details
Renu Kumari0938b002021-05-04 09:02:14 -0400210 Forbidden:
211 description: Forbidden
212 content:
213 application/json:
214 schema:
215 $ref: '#/components/schemas/ErrorMessage'
emaclee336dfaa2021-12-01 13:54:04 +0000216 example:
217 status: 403
218 message: Forbidden error message
219 details: Forbidden error details
Renu Kumari0938b002021-05-04 09:02:14 -0400220 schemas:
Renu Kumari22fe2162021-07-22 11:53:53 -0400221 AnchorDetails:
222 type: object
223 title: AnchorDetails
224 properties:
Renu Kumariea04c072021-08-10 16:43:04 -0400225 observedTimestamp:
Renu Kumari22fe2162021-07-22 11:53:53 -0400226 type: string
Renu Kumariea04c072021-08-10 16:43:04 -0400227 example: '2021-03-21T00:00:00.000-0000'
puthuparambil.adityacb23b172022-01-10 12:58:37 +0000228 operation:
229 type: string
230 enum: [CREATE, UPDATE, DELETE]
231 example: UPDATE
Renu Kumari22fe2162021-07-22 11:53:53 -0400232 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 Kumari0938b002021-05-04 09:02:14 -0400244 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 Kumari22fe2162021-07-22 11:53:53 -0400257 $ref: '#/components/schemas/AnchorDetails'
Renu Kumari0938b002021-05-04 09:02:14 -0400258 required:
259 - records
Renu Kumari0938b002021-05-04 09:02:14 -0400260 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"