blob: 991d807a4f5dbe54e287733faad3d5a13f9b01d9 [file] [log] [blame]
Renu Kumari22fe2162021-07-22 11:53:53 -04001# ============LICENSE_START=======================================================
2# Copyright (c) 2021 Bell Canada.
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 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
Renu Kumaric2b5e852021-07-28 00:07:41 -040054 - $ref: '#/components/parameters/observedTimestampAfter'
Renu Kumari0938b002021-05-04 09:02:14 -040055 - $ref: '#/components/parameters/simplePayloadFilter'
56 - $ref: '#/components/parameters/pointInTime'
57 - $ref: '#/components/parameters/pageNumber'
58 - $ref: '#/components/parameters/pageLimit'
59 - $ref: '#/components/parameters/sort'
60 responses:
61 '200':
62 description: OK
63 content:
64 application/json:
65 schema:
Renu Kumari22fe2162021-07-22 11:53:53 -040066 $ref: '#/components/schemas/AnchorHistory'
67 example:
68 nextRecordsLink: /v1/dataspace/my-dataspace/anchors/my-anchor/history?pageLimit=20&pageNumber=2
69 previousRecordsLink: /v1/dataspace/my-dataspace/anchors/my-anchor/history?pageLimit=20&pageNumber=0
70 records:
Renu Kumariea04c072021-08-10 16:43:04 -040071 - timestamp: '2021-03-21T00:00:00.000-0000'
Renu Kumari22fe2162021-07-22 11:53:53 -040072 dataspace: my-dataspace
73 schemaSet: my-schema-set
74 anchor: my-anchor
75 data:
76 status: UP
77
78
Renu Kumari0938b002021-05-04 09:02:14 -040079 '400':
80 $ref: '#/components/responses/BadRequest'
81 '401':
82 $ref: '#/components/responses/Unauthorized'
83 '403':
84 $ref: '#/components/responses/Forbidden'
85 '/v1/dataspaces/{dataspace-name}/anchors/history':
86 get:
87 description: 'Read anchors data based on filter criteria provided in query parameters'
88 tags:
89 - cps-temporal-query
90 summary: Get anchors data based on filter criteria
91 operationId: getAnchorsDataByFilter
92 parameters:
93 - $ref: '#/components/parameters/dataspaceName'
Renu Kumari22fe2162021-07-22 11:53:53 -040094 - name: schema-set-name
Renu Kumari0938b002021-05-04 09:02:14 -040095 in: query
96 description: Schema-set name
97 required: true
98 schema:
99 type: string
Renu Kumaric2b5e852021-07-28 00:07:41 -0400100 - $ref: '#/components/parameters/observedTimestampAfter'
Renu Kumari0938b002021-05-04 09:02:14 -0400101 - $ref: '#/components/parameters/simplePayloadFilter'
102 - $ref: '#/components/parameters/pointInTime'
103 - $ref: '#/components/parameters/pageNumber'
104 - $ref: '#/components/parameters/pageLimit'
105 - $ref: '#/components/parameters/sort'
106 responses:
107 '200':
108 description: OK
109 content:
110 application/json:
111 schema:
Renu Kumari22fe2162021-07-22 11:53:53 -0400112 $ref: '#/components/schemas/AnchorHistory'
113 example:
114 nextRecordsLink: /v1/dataspace/my-dataspace/anchors/history?pageLimit=20&pageNumber=2
115 previousRecordsLink: /v1/dataspace/my-dataspace/anchors/history?pageLimit=20&pageNumber=0
116 records:
Renu Kumariea04c072021-08-10 16:43:04 -0400117 - timestamp: '2021-03-21T00:00:00.000-0000'
Renu Kumari22fe2162021-07-22 11:53:53 -0400118 dataspace: my-dataspace
119 schemaSet: my-schema-set
120 anchor: my-anchor
121 data:
122 status: UP
123
Renu Kumari0938b002021-05-04 09:02:14 -0400124 '400':
125 $ref: '#/components/responses/BadRequest'
126 '401':
127 $ref: '#/components/responses/Unauthorized'
128 '403':
129 $ref: '#/components/responses/Forbidden'
130components:
131 parameters:
132 dataspaceName:
133 name: dataspace-name
134 in: path
135 description: Dataspace Name
136 required: true
137 schema:
138 type: string
Renu Kumaric2b5e852021-07-28 00:07:41 -0400139 observedTimestampAfter:
140 name: observedTimestampAfter
Renu Kumari0938b002021-05-04 09:02:14 -0400141 in: query
Renu Kumaric2b5e852021-07-28 00:07:41 -0400142 description: Fetch data with observed timestamp after <br/> Format - 'yyyy-MM-ddTHH:mm:ss.SSSZ'
Renu Kumari0938b002021-05-04 09:02:14 -0400143 required: false
144 schema:
145 type: string
Renu Kumariea04c072021-08-10 16:43:04 -0400146 example: '2021-03-21T00:00:00.000-0000'
Renu Kumari0938b002021-05-04 09:02:14 -0400147 simplePayloadFilter:
148 name: simplePayloadFilter
149 in: query
150 description: Payload filter
151 required: false
152 schema:
153 type: string
154 pointInTime:
155 name: pointInTime
156 in: query
157 description: Consider data modified before <br/> Format - 'yyyy-MM-ddTHH:mm:ss.SSSZ'
158 required: false
159 schema:
160 type: string
Renu Kumariea04c072021-08-10 16:43:04 -0400161 example: '2021-03-21T00:00:00.000-0000'
Renu Kumari0938b002021-05-04 09:02:14 -0400162 pageLimit:
163 in: query
164 name: pageLimit
165 required: false
166 schema:
167 type: integer
168 minimum: 0
Renu Kumari0938b002021-05-04 09:02:14 -0400169 default: 1000
170 description: The numbers of items to return
171 pageNumber:
172 name: pageNumber
173 in: query
174 description: Page number
175 required: false
176 schema:
177 type: integer
178 minimum: 0
179 default: 0
180 sort:
181 in: query
182 name: sort
183 required: false
184 schema:
185 type: string
Renu Kumaric2b5e852021-07-28 00:07:41 -0400186 default: observed_timestamp:desc
Renu Kumariea04c072021-08-10 16:43:04 -0400187 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 -0400188 responses:
189 BadRequest:
190 description: Bad Request
191 content:
192 application/json:
193 schema:
194 $ref: '#/components/schemas/ErrorMessage'
195 Unauthorized:
196 description: Unauthorized
197 content:
198 application/json:
199 schema:
200 $ref: '#/components/schemas/ErrorMessage'
201 Forbidden:
202 description: Forbidden
203 content:
204 application/json:
205 schema:
206 $ref: '#/components/schemas/ErrorMessage'
207 schemas:
Renu Kumari22fe2162021-07-22 11:53:53 -0400208 AnchorDetails:
209 type: object
210 title: AnchorDetails
211 properties:
Renu Kumariea04c072021-08-10 16:43:04 -0400212 observedTimestamp:
Renu Kumari22fe2162021-07-22 11:53:53 -0400213 type: string
Renu Kumariea04c072021-08-10 16:43:04 -0400214 example: '2021-03-21T00:00:00.000-0000'
Renu Kumari22fe2162021-07-22 11:53:53 -0400215 dataspace:
216 type: string
217 example: 'my-dataspace'
218 schemaSet:
219 type: string
220 example: 'my-schema-set'
221 anchor:
222 type: string
223 example: 'my-anchor'
224 data:
225 type: object
226 example: { "status" : "UP" }
Renu Kumari0938b002021-05-04 09:02:14 -0400227 AnchorHistory:
228 type: object
229 title: AnchorHistory
230 properties:
231 nextRecordsLink:
232 type: string
233 example: /v1/dataspace/dataspace-name/anchors/history?pageLimit=20&pageNumber=2
234 previousRecordsLink:
235 type: string
236 example: /v1/dataspace/dataspace-name/anchors/history?pageLimit=20&pageNumber=0
237 records:
238 type: array
239 items:
Renu Kumari22fe2162021-07-22 11:53:53 -0400240 $ref: '#/components/schemas/AnchorDetails'
Renu Kumari0938b002021-05-04 09:02:14 -0400241 required:
242 - records
Renu Kumari0938b002021-05-04 09:02:14 -0400243 ErrorMessage:
244 type: object
245 title: Error
246 properties:
247 status:
248 type: string
249 example: 400
250 message:
251 type: string
252 example: Data could not be fetched
253 details:
254 type: string
255 example: "after parameter should have datetime value in ISO format yyyy-MM-ddTHH:mm:ss.SSSZ"