Vijay VK | 269194f | 2020-01-15 21:59:05 +0000 | [diff] [blame] | 1 | { |
| 2 | "swagger": "2.0", |
| 3 | "basePath": "/onboarding", |
| 4 | "paths": { |
| 5 | "/components": { |
| 6 | "post": { |
| 7 | "responses": { |
| 8 | "500": { |
| 9 | "description": "Internal Server Error" |
| 10 | }, |
| 11 | "409": { |
| 12 | "description": "Component already exists", |
| 13 | "schema": { |
| 14 | "$ref": "#/definitions/Error message" |
| 15 | } |
| 16 | }, |
| 17 | "400": { |
| 18 | "description": "Bad Request", |
| 19 | "schema": { |
| 20 | "$ref": "#/definitions/Error message" |
| 21 | } |
| 22 | }, |
| 23 | "200": { |
| 24 | "description": "Success", |
| 25 | "schema": { |
| 26 | "$ref": "#/definitions/Component post" |
| 27 | } |
| 28 | } |
| 29 | }, |
| 30 | "description": "Add a Component to the Catalog", |
| 31 | "operationId": "post_component", |
| 32 | "parameters": [{ |
| 33 | "name": "payload", |
| 34 | "required": true, |
| 35 | "in": "body", |
| 36 | "schema": { |
| 37 | "$ref": "#/definitions/Component Spec" |
| 38 | } |
| 39 | }, { |
| 40 | "name": "X-Fields", |
| 41 | "in": "header", |
| 42 | "type": "string", |
| 43 | "format": "mask", |
| 44 | "description": "An optional fields mask to support partial object fetching - https://flask-restplus.readthedocs.io/en/stable/mask.html" |
| 45 | }], |
| 46 | "tags": ["onboarding"] |
| 47 | }, |
| 48 | "get": { |
| 49 | "responses": { |
| 50 | "500": { |
| 51 | "description": "Internal Server Error" |
| 52 | }, |
| 53 | "200": { |
| 54 | "description": "Success", |
| 55 | "schema": { |
| 56 | "$ref": "#/definitions/Component List" |
| 57 | } |
| 58 | } |
| 59 | }, |
| 60 | "description": "Get list of Components in the catalog", |
| 61 | "operationId": "get_components", |
| 62 | "parameters": [{ |
| 63 | "name": "name", |
| 64 | "in": "query", |
| 65 | "type": "string", |
| 66 | "description": "Name of component to filter for" |
| 67 | }, { |
| 68 | "name": "version", |
| 69 | "in": "query", |
| 70 | "type": "string", |
| 71 | "description": "Version of component to filter for" |
| 72 | }, { |
| 73 | "name": "X-Fields", |
| 74 | "in": "header", |
| 75 | "type": "string", |
| 76 | "format": "mask", |
| 77 | "description": "An optional fields mask to support partial object fetching - https://flask-restplus.readthedocs.io/en/stable/mask.html" |
| 78 | }], |
| 79 | "tags": ["onboarding"] |
| 80 | } |
| 81 | }, |
| 82 | "/components/{component_id}": { |
| 83 | "parameters": [{ |
| 84 | "name": "component_id", |
| 85 | "in": "path", |
| 86 | "required": true, |
| 87 | "type": "string" |
| 88 | }], |
| 89 | "put": { |
| 90 | "responses": { |
| 91 | "500": { |
| 92 | "description": "Internal Server Error" |
| 93 | }, |
| 94 | "404": { |
| 95 | "description": "Component not found in Catalog", |
| 96 | "schema": { |
| 97 | "$ref": "#/definitions/Error message" |
| 98 | } |
| 99 | }, |
| 100 | "400": { |
| 101 | "description": "Bad Request", |
| 102 | "schema": { |
| 103 | "$ref": "#/definitions/Error message" |
| 104 | } |
| 105 | }, |
| 106 | "200": { |
| 107 | "description": "Success, Component replaced" |
| 108 | } |
| 109 | }, |
| 110 | "description": "Replace a Component Spec in the Catalog", |
| 111 | "operationId": "put_component", |
| 112 | "parameters": [{ |
| 113 | "name": "payload", |
| 114 | "required": true, |
| 115 | "in": "body", |
| 116 | "schema": { |
| 117 | "$ref": "#/definitions/Component Spec" |
| 118 | } |
| 119 | }], |
| 120 | "tags": ["onboarding"] |
| 121 | }, |
| 122 | "get": { |
| 123 | "responses": { |
| 124 | "500": { |
| 125 | "description": "Internal Server Error" |
| 126 | }, |
| 127 | "404": { |
| 128 | "description": "Component not found in Catalog", |
| 129 | "schema": { |
| 130 | "$ref": "#/definitions/Error message" |
| 131 | } |
| 132 | }, |
| 133 | "200": { |
| 134 | "description": "Success", |
| 135 | "schema": { |
| 136 | "$ref": "#/definitions/component fields by id" |
| 137 | } |
| 138 | } |
| 139 | }, |
| 140 | "description": "Get a Component", |
| 141 | "operationId": "get_component", |
| 142 | "parameters": [{ |
| 143 | "name": "X-Fields", |
| 144 | "in": "header", |
| 145 | "type": "string", |
| 146 | "format": "mask", |
| 147 | "description": "An optional fields mask to support partial object fetching - https://flask-restplus.readthedocs.io/en/stable/mask.html" |
| 148 | }], |
| 149 | "tags": ["onboarding"] |
| 150 | }, |
| 151 | "patch": { |
| 152 | "responses": { |
| 153 | "500": { |
| 154 | "description": "Internal Server Error" |
| 155 | }, |
| 156 | "404": { |
| 157 | "description": "Component not found in Catalog", |
| 158 | "schema": { |
| 159 | "$ref": "#/definitions/Error message" |
| 160 | } |
| 161 | }, |
| 162 | "403": { |
| 163 | "description": "Forbidden Request", |
| 164 | "schema": { |
| 165 | "$ref": "#/definitions/Error message" |
| 166 | } |
| 167 | }, |
| 168 | "400": { |
| 169 | "description": "Bad Request", |
| 170 | "schema": { |
| 171 | "$ref": "#/definitions/Error message" |
| 172 | } |
| 173 | }, |
| 174 | "200": { |
| 175 | "description": "Success, Component status updated" |
| 176 | } |
| 177 | }, |
| 178 | "description": "Update a Component's status in the Catalog", |
| 179 | "operationId": "patch_component", |
| 180 | "parameters": [{ |
| 181 | "name": "payload", |
| 182 | "required": true, |
| 183 | "in": "body", |
| 184 | "schema": { |
| 185 | "$ref": "#/definitions/Patch Spec" |
| 186 | } |
| 187 | }], |
| 188 | "tags": ["onboarding"] |
| 189 | } |
| 190 | }, |
| 191 | "/dataformats": { |
| 192 | "post": { |
| 193 | "responses": { |
| 194 | "500": { |
| 195 | "description": "Internal Server Error" |
| 196 | }, |
| 197 | "409": { |
| 198 | "description": "Data Format already exists", |
| 199 | "schema": { |
| 200 | "$ref": "#/definitions/Error message" |
| 201 | } |
| 202 | }, |
| 203 | "400": { |
| 204 | "description": "Bad Request", |
| 205 | "schema": { |
| 206 | "$ref": "#/definitions/Error message" |
| 207 | } |
| 208 | }, |
| 209 | "200": { |
| 210 | "description": "Success", |
| 211 | "schema": { |
| 212 | "$ref": "#/definitions/Data Format post" |
| 213 | } |
| 214 | } |
| 215 | }, |
| 216 | "description": "Add a Data Format to the Catalog", |
| 217 | "operationId": "post_dataformat", |
| 218 | "parameters": [{ |
| 219 | "name": "payload", |
| 220 | "required": true, |
| 221 | "in": "body", |
| 222 | "schema": { |
| 223 | "$ref": "#/definitions/Data Format Spec" |
| 224 | } |
| 225 | }, { |
| 226 | "name": "X-Fields", |
| 227 | "in": "header", |
| 228 | "type": "string", |
| 229 | "format": "mask", |
| 230 | "description": "An optional fields mask to support partial object fetching - https://flask-restplus.readthedocs.io/en/stable/mask.html" |
| 231 | }], |
| 232 | "tags": ["onboarding"] |
| 233 | }, |
| 234 | "get": { |
| 235 | "responses": { |
| 236 | "500": { |
| 237 | "description": "Internal Server Error" |
| 238 | }, |
| 239 | "200": { |
| 240 | "description": "Success", |
| 241 | "schema": { |
| 242 | "$ref": "#/definitions/Data Format List" |
| 243 | } |
| 244 | } |
| 245 | }, |
| 246 | "description": "Get list of Data Formats in the catalog", |
| 247 | "operationId": "get_dataformats", |
| 248 | "parameters": [{ |
| 249 | "name": "X-Fields", |
| 250 | "in": "header", |
| 251 | "type": "string", |
| 252 | "format": "mask", |
| 253 | "description": "An optional fields mask to support partial object fetching - https://flask-restplus.readthedocs.io/en/stable/mask.html" |
| 254 | }], |
| 255 | "tags": ["onboarding"] |
| 256 | } |
| 257 | }, |
| 258 | "/dataformats/{dataformat_id}": { |
| 259 | "parameters": [{ |
| 260 | "name": "dataformat_id", |
| 261 | "in": "path", |
| 262 | "required": true, |
| 263 | "type": "string" |
| 264 | }], |
| 265 | "put": { |
| 266 | "responses": { |
| 267 | "500": { |
| 268 | "description": "Internal Server Error" |
| 269 | }, |
| 270 | "404": { |
| 271 | "description": "Data Format not found in Catalog", |
| 272 | "schema": { |
| 273 | "$ref": "#/definitions/Error message" |
| 274 | } |
| 275 | }, |
| 276 | "400": { |
| 277 | "description": "Bad Request", |
| 278 | "schema": { |
| 279 | "$ref": "#/definitions/Error message" |
| 280 | } |
| 281 | }, |
| 282 | "200": { |
| 283 | "description": "Success, Data Format added" |
| 284 | } |
| 285 | }, |
| 286 | "description": "Replace a Data Format Spec in the Catalog", |
| 287 | "operationId": "put_dataformat", |
| 288 | "parameters": [{ |
| 289 | "name": "payload", |
| 290 | "required": true, |
| 291 | "in": "body", |
| 292 | "schema": { |
| 293 | "$ref": "#/definitions/Data Format Spec" |
| 294 | } |
| 295 | }], |
| 296 | "tags": ["onboarding"] |
| 297 | }, |
| 298 | "get": { |
| 299 | "responses": { |
| 300 | "500": { |
| 301 | "description": "Internal Server Error" |
| 302 | }, |
| 303 | "404": { |
| 304 | "description": "Data Format not found in Catalog", |
| 305 | "schema": { |
| 306 | "$ref": "#/definitions/Error message" |
| 307 | } |
| 308 | }, |
| 309 | "200": { |
| 310 | "description": "Success", |
| 311 | "schema": { |
| 312 | "$ref": "#/definitions/dataformat fields by id" |
| 313 | } |
| 314 | } |
| 315 | }, |
| 316 | "description": "Get a Data Format", |
| 317 | "operationId": "get_dataformat", |
| 318 | "parameters": [{ |
| 319 | "name": "X-Fields", |
| 320 | "in": "header", |
| 321 | "type": "string", |
| 322 | "format": "mask", |
| 323 | "description": "An optional fields mask to support partial object fetching - https://flask-restplus.readthedocs.io/en/stable/mask.html" |
| 324 | }], |
| 325 | "tags": ["onboarding"] |
| 326 | }, |
| 327 | "patch": { |
| 328 | "responses": { |
| 329 | "500": { |
| 330 | "description": "Internal Server Error" |
| 331 | }, |
| 332 | "404": { |
| 333 | "description": "Data Format not found in Catalog", |
| 334 | "schema": { |
| 335 | "$ref": "#/definitions/Error message" |
| 336 | } |
| 337 | }, |
| 338 | "403": { |
| 339 | "description": "Forbidden Request", |
| 340 | "schema": { |
| 341 | "$ref": "#/definitions/Error message" |
| 342 | } |
| 343 | }, |
| 344 | "400": { |
| 345 | "description": "Bad Request", |
| 346 | "schema": { |
| 347 | "$ref": "#/definitions/Error message" |
| 348 | } |
| 349 | }, |
| 350 | "200": { |
| 351 | "description": "Success, Data Format status updated" |
| 352 | } |
| 353 | }, |
| 354 | "description": "Update a Data Format's status in the Catalog", |
| 355 | "operationId": "patch_dataformat", |
| 356 | "parameters": [{ |
| 357 | "name": "payload", |
| 358 | "required": true, |
| 359 | "in": "body", |
| 360 | "schema": { |
| 361 | "$ref": "#/definitions/Patch Spec" |
| 362 | } |
| 363 | }], |
| 364 | "tags": ["onboarding"] |
| 365 | } |
| 366 | } |
| 367 | }, |
| 368 | "info": { |
| 369 | "title": "DCAE Onboarding HTTP API", |
| 370 | "version": "2.12.0" |
| 371 | }, |
| 372 | "produces": ["application/json"], |
| 373 | "consumes": ["application/json"], |
| 374 | "tags": [{ |
| 375 | "name": "onboarding", |
| 376 | "description": "Default namespace" |
| 377 | }], |
| 378 | "definitions": { |
| 379 | "Component Spec": { |
| 380 | "properties": { |
| 381 | "owner": { |
| 382 | "type": "string" |
| 383 | }, |
| 384 | "spec": { |
| 385 | "type": "object", |
| 386 | "description": "The Component Spec schema is here -> https://git.onap.org/dcaegen2/platform/cli/plain/component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json" |
| 387 | } |
| 388 | } |
| 389 | }, |
| 390 | "Error message": { |
| 391 | "properties": { |
| 392 | "message": { |
| 393 | "type": "string", |
| 394 | "description": ". . . . .Details about the unsuccessful API request" |
| 395 | } |
| 396 | }, |
| 397 | "type": "object" |
| 398 | }, |
| 399 | "Component post": { |
| 400 | "required": ["componentUrl"], |
| 401 | "properties": { |
| 402 | "componentUrl": { |
| 403 | "type": "string", |
| 404 | "description": ". . . . Url to the Component Specification" |
| 405 | } |
| 406 | }, |
| 407 | "type": "object" |
| 408 | }, |
| 409 | "Component List": { |
| 410 | "properties": { |
| 411 | "components": { |
| 412 | "type": "array", |
| 413 | "items": { |
| 414 | "$ref": "#/definitions/component fields" |
| 415 | } |
| 416 | } |
| 417 | }, |
| 418 | "type": "object" |
| 419 | }, |
| 420 | "component fields": { |
| 421 | "required": ["componentType", "componentUrl", "description", "id", "modified", "name", "owner", "status", "version", "whenAdded"], |
| 422 | "properties": { |
| 423 | "id": { |
| 424 | "type": "string", |
| 425 | "description": ". . . . ID of the component" |
| 426 | }, |
| 427 | "name": { |
| 428 | "type": "string", |
| 429 | "description": ". . . . Name of the component" |
| 430 | }, |
| 431 | "version": { |
| 432 | "type": "string", |
| 433 | "description": ". . . . Version of the component" |
| 434 | }, |
| 435 | "owner": { |
| 436 | "type": "string", |
| 437 | "description": ". . . . ID of who added the component" |
| 438 | }, |
| 439 | "whenAdded": { |
| 440 | "type": "string", |
| 441 | "format": "date-time", |
| 442 | "description": ". . . . When component was added to the Catalog" |
| 443 | }, |
| 444 | "modified": { |
| 445 | "type": "string", |
| 446 | "format": "date-time", |
| 447 | "description": ". . . . When component was last modified" |
| 448 | }, |
| 449 | "status": { |
| 450 | "type": "string", |
| 451 | "description": ". . . . Status of the component" |
| 452 | }, |
| 453 | "description": { |
| 454 | "type": "string", |
| 455 | "description": ". . . . Description of the component" |
| 456 | }, |
| 457 | "componentType": { |
| 458 | "type": "string", |
| 459 | "description": ". . . . only \"docker\"" |
| 460 | }, |
| 461 | "componentUrl": { |
| 462 | "type": "string", |
| 463 | "description": ". . . . Url to the Component Specification" |
| 464 | } |
| 465 | }, |
| 466 | "type": "object" |
| 467 | }, |
| 468 | "Patch Spec": { |
| 469 | "required": ["owner", "status"], |
| 470 | "properties": { |
| 471 | "owner": { |
| 472 | "type": "string", |
| 473 | "description": "User ID" |
| 474 | }, |
| 475 | "status": { |
| 476 | "type": "string", |
| 477 | "description": ". . . . .[published] is the only status change supported right now", |
| 478 | "example": "published", |
| 479 | "enum": ["published", "revoked"] |
| 480 | } |
| 481 | }, |
| 482 | "type": "object" |
| 483 | }, |
| 484 | "component fields by id": { |
| 485 | "allOf": [{ |
| 486 | "$ref": "#/definitions/component fields" |
| 487 | }, { |
| 488 | "required": ["spec"], |
| 489 | "properties": { |
| 490 | "spec": { |
| 491 | "type": "object", |
| 492 | "description": "The Component Specification (json)" |
| 493 | } |
| 494 | }, |
| 495 | "type": "object" |
| 496 | }] |
| 497 | }, |
| 498 | "Data Format Spec": { |
| 499 | "properties": { |
| 500 | "owner": { |
| 501 | "type": "string" |
| 502 | }, |
| 503 | "spec": { |
| 504 | "type": "object", |
| 505 | "description": "The Data Format Spec schema is here -> https://git.onap.org/dcaegen2/platform/cli/plain/component-json-schemas/data-format/dcae-cli-v1/data-format-schema.json" |
| 506 | } |
| 507 | } |
| 508 | }, |
| 509 | "Data Format post": { |
| 510 | "required": ["dataFormatUrl"], |
| 511 | "properties": { |
| 512 | "dataFormatUrl": { |
| 513 | "type": "string", |
| 514 | "description": ". . . . Url to the Data Format Specification" |
| 515 | } |
| 516 | }, |
| 517 | "type": "object" |
| 518 | }, |
| 519 | "Data Format List": { |
| 520 | "properties": { |
| 521 | "dataFormats": { |
| 522 | "type": "array", |
| 523 | "items": { |
| 524 | "$ref": "#/definitions/dataformat fields" |
| 525 | } |
| 526 | } |
| 527 | }, |
| 528 | "type": "object" |
| 529 | }, |
| 530 | "dataformat fields": { |
| 531 | "required": ["dataFormatUrl", "description", "id", "modified", "name", "owner", "status", "version", "whenAdded"], |
| 532 | "properties": { |
| 533 | "id": { |
| 534 | "type": "string", |
| 535 | "description": ". . . . ID of the data format" |
| 536 | }, |
| 537 | "name": { |
| 538 | "type": "string", |
| 539 | "description": ". . . . Name of the data format" |
| 540 | }, |
| 541 | "version": { |
| 542 | "type": "string", |
| 543 | "description": ". . . . Version of the data format" |
| 544 | }, |
| 545 | "owner": { |
| 546 | "type": "string", |
| 547 | "description": ". . . . ID of who added the data format" |
| 548 | }, |
| 549 | "whenAdded": { |
| 550 | "type": "string", |
| 551 | "format": "date-time", |
| 552 | "description": ". . . . When data format was added to the Catalog" |
| 553 | }, |
| 554 | "modified": { |
| 555 | "type": "string", |
| 556 | "format": "date-time", |
| 557 | "description": ". . . . When data format was last modified" |
| 558 | }, |
| 559 | "status": { |
| 560 | "type": "string", |
| 561 | "description": ". . . . Status of the data format" |
| 562 | }, |
| 563 | "description": { |
| 564 | "type": "string", |
| 565 | "description": ". . . . Description of the data format" |
| 566 | }, |
| 567 | "dataFormatUrl": { |
| 568 | "type": "string", |
| 569 | "description": ". . . . Url to the Data Format Specification" |
| 570 | } |
| 571 | }, |
| 572 | "type": "object" |
| 573 | }, |
| 574 | "dataformat fields by id": { |
| 575 | "allOf": [{ |
| 576 | "$ref": "#/definitions/dataformat fields" |
| 577 | }, { |
| 578 | "required": ["spec"], |
| 579 | "properties": { |
| 580 | "spec": { |
| 581 | "type": "object", |
| 582 | "description": "The Data Format Specification (json)" |
| 583 | } |
| 584 | }, |
| 585 | "type": "object" |
| 586 | }] |
| 587 | } |
| 588 | }, |
| 589 | "responses": { |
| 590 | "ParseError": { |
| 591 | "description": "When a mask can't be parsed" |
| 592 | }, |
| 593 | "MaskError": { |
| 594 | "description": "When any error occurs on mask" |
| 595 | } |
| 596 | } |
| 597 | } |