| 1 |
swagger: '2.0' |
| 2 |
info: |
| 3 |
version: "1.0.0" |
| 4 |
title: Service Manager |
| 5 |
|
| 6 |
schemes: |
| 7 |
- http |
| 8 |
|
| 9 |
produces: |
| 10 |
- application/vnd.cia.v1+json |
| 11 |
|
| 12 |
tags: |
| 13 |
- name: services |
| 14 |
|
| 15 |
basePath: /v1 |
| 16 |
|
| 17 |
paths: |
| 18 |
/services: |
| 19 |
parameters: |
| 20 |
- name: "X-Request-Id" |
| 21 |
in: "header" |
| 22 |
description: Unique identifier associated with request |
| 23 |
required: true |
| 24 |
type: string |
| 25 |
format: uuid |
| 26 |
get: |
| 27 |
tags: [services] |
| 28 |
operationId: searchServices |
| 29 |
summary: Search for Services |
| 30 |
description: | |
| 31 |
To apply filter criteria use the following approach: |
| 32 |
|
| 33 |
`?<field><operator><value>` |
| 34 |
|
| 35 |
Example: `?name=Test` |
| 36 |
|
| 37 |
parameters: |
| 38 |
- name: name |
| 39 |
in: query |
| 40 |
description: Search records by name |
| 41 |
required: false |
| 42 |
type: string |
| 43 |
minLength: 3 |
| 44 |
- name: version |
| 45 |
in: query |
| 46 |
description: Search records by version |
| 47 |
required: false |
| 48 |
type: string |
| 49 |
minLength: 3 |
| 50 |
- name: location |
| 51 |
in: query |
| 52 |
description: Search records by location |
| 53 |
required: false |
| 54 |
type: string |
| 55 |
minLength: 3 |
| 56 |
- name: region |
| 57 |
in: query |
| 58 |
description: Search records by region |
| 59 |
required: false |
| 60 |
type: string |
| 61 |
minLength: 3 |
| 62 |
responses: |
| 63 |
200: |
| 64 |
description: List of Services |
| 65 |
headers: |
| 66 |
X-Request-Id: |
| 67 |
description: Unique identifier associated with request |
| 68 |
type: string |
| 69 |
format: uuid |
| 70 |
schema: |
| 71 |
type: array |
| 72 |
items: |
| 73 |
$ref: "#/definitions/service_view" |
| 74 |
400: |
| 75 |
$ref: "#/responses/400" |
| 76 |
401: |
| 77 |
$ref: '#/responses/401' |
| 78 |
403: |
| 79 |
$ref: '#/responses/403' |
| 80 |
default: |
| 81 |
$ref: '#/responses/500' |
| 82 |
|
| 83 |
/services/{serviceId}: |
| 84 |
parameters: |
| 85 |
- name: serviceId |
| 86 |
description: Unique identifier for Service |
| 87 |
in: path |
| 88 |
required: true |
| 89 |
type: string |
| 90 |
format: uuid |
| 91 |
- name: "X-Request-Id" |
| 92 |
in: "header" |
| 93 |
description: Unique identifier associated with request |
| 94 |
required: true |
| 95 |
type: string |
| 96 |
format: uuid |
| 97 |
get: |
| 98 |
tags: [services] |
| 99 |
operationId: viewService |
| 100 |
summary: View Service |
| 101 |
description: View Service |
| 102 |
responses: |
| 103 |
200: |
| 104 |
description: Service |
| 105 |
headers: |
| 106 |
X-Request-Id: |
| 107 |
description: Unique identifier associated with request |
| 108 |
type: string |
| 109 |
format: uuid |
| 110 |
schema: |
| 111 |
$ref: "#/definitions/service_view" |
| 112 |
400: |
| 113 |
$ref: "#/responses/400" |
| 114 |
401: |
| 115 |
$ref: '#/responses/401' |
| 116 |
403: |
| 117 |
$ref: '#/responses/403' |
| 118 |
404: |
| 119 |
$ref: '#/responses/404' |
| 120 |
default: |
| 121 |
$ref: '#/responses/500' |
| 122 |
|
| 123 |
/services/{serviceId}/units: |
| 124 |
parameters: |
| 125 |
- name: serviceId |
| 126 |
description: Unique identifier for Service |
| 127 |
in: path |
| 128 |
required: true |
| 129 |
type: string |
| 130 |
format: uuid |
| 131 |
- name: "X-Request-Id" |
| 132 |
in: "header" |
| 133 |
description: Unique identifier associated with request |
| 134 |
required: true |
| 135 |
type: string |
| 136 |
format: uuid |
| 137 |
get: |
| 138 |
tags: [services] |
| 139 |
operationId: searchUnits |
| 140 |
summary: Search for Service Units |
| 141 |
description: | |
| 142 |
To apply filter criteria use the following approach: |
| 143 |
|
| 144 |
`?<field><operator><value>` |
| 145 |
|
| 146 |
Example: `?name=Test` |
| 147 |
|
| 148 |
parameters: |
| 149 |
- name: name |
| 150 |
in: query |
| 151 |
description: Search records by name |
| 152 |
required: false |
| 153 |
type: string |
| 154 |
minLength: 3 |
| 155 |
- name: type |
| 156 |
in: query |
| 157 |
description: Search records by type |
| 158 |
required: false |
| 159 |
type: string |
| 160 |
minLength: 3 |
| 161 |
responses: |
| 162 |
200: |
| 163 |
description: List of Service Units |
| 164 |
headers: |
| 165 |
X-Request-Id: |
| 166 |
description: Unique identifier associated with request |
| 167 |
type: string |
| 168 |
format: uuid |
| 169 |
schema: |
| 170 |
type: array |
| 171 |
items: |
| 172 |
$ref: "#/definitions/unit_view" |
| 173 |
400: |
| 174 |
$ref: "#/responses/400" |
| 175 |
401: |
| 176 |
$ref: '#/responses/401' |
| 177 |
403: |
| 178 |
$ref: '#/responses/403' |
| 179 |
404: |
| 180 |
$ref: '#/responses/404' |
| 181 |
default: |
| 182 |
$ref: '#/responses/500' |
| 183 |
|
| 184 |
|
| 185 |
/services/{serviceId}/units/{unitId}: |
| 186 |
parameters: |
| 187 |
- name: serviceId |
| 188 |
description: Unique identifier for Service |
| 189 |
in: path |
| 190 |
required: true |
| 191 |
type: string |
| 192 |
format: uuid |
| 193 |
- name: unitId |
| 194 |
description: Unique identifier for Service Unit |
| 195 |
in: path |
| 196 |
required: true |
| 197 |
type: string |
| 198 |
format: uuid |
| 199 |
- name: "X-Request-Id" |
| 200 |
in: "header" |
| 201 |
description: Unique identifier associated with request |
| 202 |
required: true |
| 203 |
type: string |
| 204 |
format: uuid |
| 205 |
get: |
| 206 |
tags: [services] |
| 207 |
operationId: viewUnit |
| 208 |
summary: View Service Unit |
| 209 |
description: View Service Unit |
| 210 |
responses: |
| 211 |
200: |
| 212 |
description: Service Unit |
| 213 |
headers: |
| 214 |
X-Request-Id: |
| 215 |
description: Unique identifier associated with request |
| 216 |
type: string |
| 217 |
format: uuid |
| 218 |
schema: |
| 219 |
$ref: "#/definitions/unit_view" |
| 220 |
400: |
| 221 |
$ref: "#/responses/400" |
| 222 |
401: |
| 223 |
$ref: '#/responses/401' |
| 224 |
403: |
| 225 |
$ref: '#/responses/403' |
| 226 |
404: |
| 227 |
$ref: '#/responses/404' |
| 228 |
default: |
| 229 |
$ref: '#/responses/500' |
| 230 |
|
| 231 |
definitions: |
| 232 |
|
| 233 |
service_view: |
| 234 |
title: Service View |
| 235 |
description: An order-able Service defined in Service Catalog. |
| 236 |
type: object |
| 237 |
properties: |
| 238 |
id: |
| 239 |
title: Service Identifier |
| 240 |
description: unique identifier for the service |
| 241 |
type: string |
| 242 |
format: uuid |
| 243 |
example: 3377f6e7-dd55-4639-bc54-65646fde2adc |
| 244 |
name: |
| 245 |
title: Service Name |
| 246 |
description: name for the service |
| 247 |
type: string |
| 248 |
example: OpenStack Service |
| 249 |
version: |
| 250 |
title: Service Version |
| 251 |
description: labeled variant of the service |
| 252 |
type: string |
| 253 |
example: Newton |
| 254 |
tenant_id: |
| 255 |
title: Service Providers Tenant |
| 256 |
description: The Tenant identifier for the Tenant providing the service |
| 257 |
type: string |
| 258 |
format: uuid |
| 259 |
example: 3377f6e7-dd55-4639-bc54-65646fde2adc |
| 260 |
location: |
| 261 |
title: Service Location |
| 262 |
description: location of the service |
| 263 |
type: string |
| 264 |
example: ALLN |
| 265 |
region: |
| 266 |
title: Service Region |
| 267 |
description: region of the service |
| 268 |
type: string |
| 269 |
example: US-EAST |
| 270 |
status: |
| 271 |
title: Service Status |
| 272 |
description: status of the service |
| 273 |
type: string |
| 274 |
enum: [CREATING, ACTIVE, UPDATING, DELETING, INACTIVE, DELETED, FAILED] |
| 275 |
example: ACTIVE |
| 276 |
tags: |
| 277 |
title: Service Tags |
| 278 |
description: tags to identify service properties |
| 279 |
type: array |
| 280 |
items: |
| 281 |
type: string |
| 282 |
x-omitempty: true |
| 283 |
example: [LA, ALPHA] |
| 284 |
metadata: |
| 285 |
title: Service Metadata |
| 286 |
description: metadata of the service |
| 287 |
type: object |
| 288 |
additionalProperties: |
| 289 |
type: string |
| 290 |
audit: |
| 291 |
$ref: "#/definitions/audit" |
| 292 |
|
| 293 |
unit_view: |
| 294 |
title: Service Unit View |
| 295 |
description: A Service Unit for the Location defined in Service Catalog. |
| 296 |
type: object |
| 297 |
properties: |
| 298 |
id: |
| 299 |
title: Service Unit Identifier |
| 300 |
description: unique identifier for the service unit |
| 301 |
type: string |
| 302 |
format: uuid |
| 303 |
example: 3377f6e7-dd55-4639-bc54-65646fde2adc |
| 304 |
name: |
| 305 |
title: Service Unit Name |
| 306 |
description: name for the service unit |
| 307 |
type: string |
| 308 |
example: Example Service Unit |
| 309 |
type: |
| 310 |
title: Service Unit Type |
| 311 |
description: type of the service unit |
| 312 |
type: string |
| 313 |
example: VCPU |
| 314 |
description: |
| 315 |
title: Service Unit Description |
| 316 |
description: summary describing the service unit |
| 317 |
type: string |
| 318 |
example: Long description about the service unit |
| 319 |
cost: |
| 320 |
title: Service Unit Cost |
| 321 |
description: cost for the service unit |
| 322 |
type: number |
| 323 |
format: double |
| 324 |
example: 0.02 |
| 325 |
period: |
| 326 |
title: Service Unit Cost Period |
| 327 |
description: cost period for the service unit |
| 328 |
type: string |
| 329 |
enum: [FLAT, HOURLY, MONTHLY] |
| 330 |
example: HOURLY |
| 331 |
cost_algorithm: |
| 332 |
title: Service Unit Consumption Cost Algorithm |
| 333 |
description: consumption cost algorithm for the service unit |
| 334 |
type: string |
| 335 |
enum: [SIMPLE_SUM, DAILY_MAX_AVG] |
| 336 |
example: SIMPLE_SUM |
| 337 |
quotas: |
| 338 |
title: Service Unit Quotas |
| 339 |
description: quotas defined for the service unit |
| 340 |
type: object |
| 341 |
additionalProperties: |
| 342 |
$ref: '#/definitions/quota' |
| 343 |
activated_at: |
| 344 |
title: Service Unit Cost Activation Timestamp |
| 345 |
description: > |
| 346 |
service unit activation date (inclusive) as YYYY-MM-DD with respect to the billing period |
| 347 |
always as the start of the billing period |
| 348 |
type: string |
| 349 |
example: 2018-02-01 |
| 350 |
deactivated_at: |
| 351 |
title: Service Unit Cost Deactivation Timestamp |
| 352 |
description: > |
| 353 |
service unit deactivation date (exclusive) as YYYY-MM-DD with respect to the billing period |
| 354 |
- omitted if empty or the end of the billing period |
| 355 |
type: string |
| 356 |
example: 2018-03-01 |
| 357 |
audit: |
| 358 |
$ref: "#/definitions/audit" |
| 359 |
|
| 360 |
quota: |
| 361 |
title: Service Unit Quota |
| 362 |
description: quota details with values |
| 363 |
type: object |
| 364 |
properties: |
| 365 |
min: |
| 366 |
title: Minimum quota value |
| 367 |
type: number |
| 368 |
format: double |
| 369 |
minimum: 0.0 |
| 370 |
example: 1.0 |
| 371 |
max: |
| 372 |
title: Maximum quota value |
| 373 |
type: number |
| 374 |
format: double |
| 375 |
minimum: 0.0 |
| 376 |
example: 1.0 |
| 377 |
default: |
| 378 |
title: Default quota value |
| 379 |
type: number |
| 380 |
format: double |
| 381 |
minimum: 0.0 |
| 382 |
example: 1.0 |
| 383 |
|
| 384 |
audit: |
| 385 |
title: Audit |
| 386 |
description: Audit trail details |
| 387 |
type: object |
| 388 |
properties: |
| 389 |
created_at: |
| 390 |
title: Created At |
| 391 |
description: timestamp when the record was created |
| 392 |
type: string |
| 393 |
format: date-time |
| 394 |
readOnly: true |
| 395 |
created_by: |
| 396 |
title: Created By |
| 397 |
description: entity that created the record |
| 398 |
type: string |
| 399 |
readOnly: true |
| 400 |
updated_at: |
| 401 |
title: Updated At |
| 402 |
description: timestamp when the record was updated |
| 403 |
type: string |
| 404 |
format: date-time |
| 405 |
readOnly: true |
| 406 |
updated_by: |
| 407 |
title: Updated By |
| 408 |
description: entity that updated the record |
| 409 |
type: string |
| 410 |
readOnly: true |
| 411 |
|
| 412 |
error: |
| 413 |
title: Error |
| 414 |
description: | |
| 415 |
An error provides information about why the request failed. |
| 416 |
type: object |
| 417 |
required: |
| 418 |
- code |
| 419 |
- message |
| 420 |
properties: |
| 421 |
code: |
| 422 |
title: Code |
| 423 |
description: | |
| 424 |
Code identifies a specific type of error. |
| 425 |
type: string |
| 426 |
message: |
| 427 |
title: Message |
| 428 |
description: | |
| 429 |
The message provides details about the failure. |
| 430 |
type: string |
| 431 |
|
| 432 |
responses: |
| 433 |
400: |
| 434 |
description: | |
| 435 |
Invalid Request Error. Check error message in the response body for details. |
| 436 |
examples: |
| 437 |
application/json: |
| 438 |
code: EXAMPLE-001 |
| 439 |
message: Missing required attribute 'name'. |
| 440 |
headers: |
| 441 |
X-Request-Id: |
| 442 |
description: Unique identifier associated with request |
| 443 |
type: string |
| 444 |
format: uuid |
| 445 |
schema: |
| 446 |
$ref: "#/definitions/error" |
| 447 |
401: |
| 448 |
description: | |
| 449 |
Authentication Failure |
| 450 |
examples: |
| 451 |
application/json: |
| 452 |
code: EXAMPLE-002 |
| 453 |
message: Authentication failed bad password. |
| 454 |
headers: |
| 455 |
X-Request-Id: |
| 456 |
description: Unique identifier associated with request |
| 457 |
type: string |
| 458 |
format: uuid |
| 459 |
schema: |
| 460 |
$ref: "#/definitions/error" |
| 461 |
402: |
| 462 |
description: | |
| 463 |
Insufficient Funds |
| 464 |
examples: |
| 465 |
application/json: |
| 466 |
code: EXAMPLE-003 |
| 467 |
message: Insufficient Funds to cover the cost of resource. |
| 468 |
headers: |
| 469 |
X-Request-Id: |
| 470 |
description: Unique identifier associated with request |
| 471 |
type: string |
| 472 |
format: uuid |
| 473 |
schema: |
| 474 |
$ref: "#/definitions/error" |
| 475 |
403: |
| 476 |
description: | |
| 477 |
Authorization Failure |
| 478 |
examples: |
| 479 |
application/json: |
| 480 |
code: EXAMPLE-004 |
| 481 |
message: Not authorized to perform action. |
| 482 |
headers: |
| 483 |
X-Request-Id: |
| 484 |
description: Unique identifier associated with request |
| 485 |
type: string |
| 486 |
format: uuid |
| 487 |
schema: |
| 488 |
$ref: "#/definitions/error" |
| 489 |
404: |
| 490 |
description: | |
| 491 |
Resource not found |
| 492 |
examples: |
| 493 |
application/json: |
| 494 |
code: EXAMPLE-005 |
| 495 |
message: Resource <id> does not exist. |
| 496 |
headers: |
| 497 |
X-Request-Id: |
| 498 |
description: Unique identifier associated with request |
| 499 |
type: string |
| 500 |
format: uuid |
| 501 |
schema: |
| 502 |
$ref: "#/definitions/error" |
| 503 |
409: |
| 504 |
description: | |
| 505 |
Conflict |
| 506 |
examples: |
| 507 |
application/json: |
| 508 |
code: EXAMPLE-006 |
| 509 |
message: Resource already exists. |
| 510 |
headers: |
| 511 |
X-Request-Id: |
| 512 |
description: Unique identifier associated with request |
| 513 |
type: string |
| 514 |
format: uuid |
| 515 |
schema: |
| 516 |
$ref: "#/definitions/error" |
| 517 |
422: |
| 518 |
description: | |
| 519 |
Unprocessable Entity Failure |
| 520 |
examples: |
| 521 |
application/json: |
| 522 |
code: EXAMPLE-007 |
| 523 |
message: Resource is not able to be updated. |
| 524 |
headers: |
| 525 |
X-Request-Id: |
| 526 |
description: Unique identifier associated with request |
| 527 |
type: string |
| 528 |
format: uuid |
| 529 |
schema: |
| 530 |
$ref: "#/definitions/error" |
| 531 |
500: |
| 532 |
description: | |
| 533 |
Internal Server Error. Check error entity in the response body for details. |
| 534 |
examples: |
| 535 |
application/json: |
| 536 |
code: EXAMPLE-009 |
| 537 |
message: Internal server error. |
| 538 |
headers: |
| 539 |
X-Request-Id: |
| 540 |
description: Unique identifier associated with request |
| 541 |
type: string |
| 542 |
format: uuid |
| 543 |
schema: |
| 544 |
$ref: "#/definitions/error" |
| 545 |
503: |
| 546 |
description: | |
| 547 |
Service Unavailable |
| 548 |
examples: |
| 549 |
application/json: |
| 550 |
code: EXAMPLE-010 |
| 551 |
message: Service Unavailable. |
| 552 |
headers: |
| 553 |
X-Request-Id: |
| 554 |
description: Unique identifier associated with request |
| 555 |
type: string |
| 556 |
format: uuid |
| 557 |
schema: |
| 558 |
$ref: "#/definitions/error" |