github.com/rzurga/go-swagger@v0.28.1-0.20211109195225-5d1f453ffa3a/fixtures/bugs/2223/fixture-2223.yaml (about) 1 produces: 2 - application/vnd.cia.v1+json 3 schemes: 4 - http 5 swagger: "2.0" 6 info: 7 description: Manages provisioning of GCP resources 8 title: GCP Service 9 version: 0.2.0 10 basePath: /v1 11 paths: 12 /gcp/accounts: 13 get: 14 description: List all Accounts, with optional query parameters. 15 tags: 16 - gcp 17 summary: List Accounts 18 operationId: listAccounts 19 parameters: 20 - minLength: 3 21 type: string 22 description: filter list by name 23 name: name 24 in: query 25 - enum: 26 - NEW 27 - ACTIVE 28 - FAILED 29 - CREATING 30 - UPDATING 31 - DELETING 32 - SUSPENDED 33 type: string 34 description: filter list by status 35 name: status 36 in: query 37 - uniqueItems: true 38 type: array 39 items: 40 type: string 41 description: filter the fields in each returned record. (comma-delimited) 42 name: fields 43 in: query 44 - minimum: 0 45 type: integer 46 description: max number of records to return. 47 name: limit 48 in: query 49 - minimum: 0 50 type: integer 51 description: segment of records to return incremented by limit. 52 name: offset 53 in: query 54 - uniqueItems: true 55 type: array 56 items: 57 pattern: '[-]?\w+' 58 type: string 59 description: sort by fields that determines the order of the results. (comma-delimited) 60 name: sort 61 in: query 62 responses: 63 "200": 64 description: List of Accounts 65 schema: 66 type: array 67 items: 68 $ref: '#/definitions/account_view' 69 headers: 70 X-Request-Id: 71 type: string 72 format: uuid 73 description: Unique identifier associated with request 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 post: 83 description: Create a GCP Account in GCP Organization 84 consumes: 85 - application/vnd.cia.v1+json 86 tags: 87 - gcp 88 summary: Create GCP Account 89 operationId: createAccount 90 parameters: 91 - description: GCP Account details 92 name: Account 93 in: body 94 required: true 95 schema: 96 $ref: '#/definitions/account' 97 responses: 98 "201": 99 description: Account Created 100 headers: 101 Location: 102 type: string 103 description: URL of the created account 104 X-Request-Id: 105 type: string 106 format: uuid 107 description: Unique identifier associated with request 108 "400": 109 $ref: '#/responses/400' 110 "401": 111 $ref: '#/responses/401' 112 "402": 113 $ref: '#/responses/402' 114 "403": 115 $ref: '#/responses/403' 116 "409": 117 $ref: '#/responses/409' 118 default: 119 $ref: '#/responses/500' 120 parameters: 121 - type: string 122 format: uuid 123 description: Unique identifier associated with request 124 name: X-Request-Id 125 in: header 126 required: true 127 - type: string 128 format: uuid 129 description: Parent tenant ID 130 name: X-Tenant-Id 131 in: header 132 required: true 133 /gcp/accounts/{accountId}: 134 get: 135 description: View a account by Id 136 tags: 137 - gcp 138 summary: Get Account 139 operationId: viewAccount 140 responses: 141 "200": 142 description: Account details 143 schema: 144 $ref: '#/definitions/account_view' 145 headers: 146 X-Request-Id: 147 type: string 148 format: uuid 149 description: Unique identifer associated with request 150 "400": 151 $ref: '#/responses/400' 152 "401": 153 $ref: '#/responses/401' 154 "403": 155 $ref: '#/responses/403' 156 "404": 157 $ref: '#/responses/404' 158 default: 159 $ref: '#/responses/500' 160 delete: 161 description: Delete account by ID 162 tags: 163 - gcp 164 summary: Delete account 165 operationId: deleteAccount 166 responses: 167 "204": 168 description: Account deleted 169 headers: 170 X-Request-Id: 171 type: string 172 format: uuid 173 description: Unique identifier associated with request 174 "400": 175 $ref: '#/responses/400' 176 "401": 177 $ref: '#/responses/401' 178 "403": 179 $ref: '#/responses/403' 180 "404": 181 $ref: '#/responses/404' 182 "409": 183 $ref: '#/responses/409' 184 default: 185 $ref: '#/responses/500' 186 patch: 187 description: Applies changes to Account by ID 188 consumes: 189 - application/vnd.cia.v1+json 190 tags: 191 - gcp 192 summary: Update Account 193 operationId: updateAccount 194 parameters: 195 - description: body of account 196 name: account_partial 197 in: body 198 required: true 199 schema: 200 $ref: '#/definitions/account_partial' 201 responses: 202 "204": 203 description: Account 204 headers: 205 X-Request-Id: 206 type: string 207 format: uuid 208 description: Unique identifier associated with request 209 "400": 210 $ref: '#/responses/400' 211 "401": 212 $ref: '#/responses/401' 213 "402": 214 $ref: '#/responses/402' 215 "403": 216 $ref: '#/responses/403' 217 "404": 218 $ref: '#/responses/404' 219 "409": 220 $ref: '#/responses/409' 221 "422": 222 $ref: '#/responses/422' 223 default: 224 $ref: '#/responses/500' 225 parameters: 226 - type: string 227 format: uuid 228 description: Unqiue ID of the Account 229 name: accountId 230 in: path 231 required: true 232 - type: string 233 format: uuid 234 description: Unique identifier associated with request 235 name: X-Request-Id 236 in: header 237 required: true 238 - type: string 239 format: uuid 240 description: Parent tenant ID 241 name: X-Tenant-Id 242 in: header 243 required: true 244 /gcp/accounts/{accountId}/admins: 245 x-visibility: private 246 get: 247 security: 248 - internal: [] 249 description: Check if queried user is admin of the GCP project or not, if yes, 250 return the user CEC_ID in reponse 251 tags: 252 - gcp 253 summary: Check if user is and admin of the GCP project or not 254 operationId: getAdmins 255 parameters: 256 - minLength: 3 257 type: string 258 description: CEC ID of the user 259 name: user 260 in: query 261 required: true 262 responses: 263 "200": 264 description: Admin details 265 schema: 266 type: array 267 items: 268 type: string 269 example: 270 - admin 271 headers: 272 X-Request-Id: 273 type: string 274 format: uuid 275 description: Unique identifer associated with request 276 "400": 277 $ref: '#/responses/400' 278 "401": 279 $ref: '#/responses/401' 280 "403": 281 $ref: '#/responses/403' 282 "404": 283 $ref: '#/responses/404' 284 default: 285 $ref: '#/responses/500' 286 parameters: 287 - type: string 288 format: uuid 289 description: Unqiue ID of the Account 290 name: accountId 291 in: path 292 required: true 293 - type: string 294 format: uuid 295 description: Unique identifier associated with request 296 name: X-Request-Id 297 in: header 298 required: true 299 - type: string 300 format: uuid 301 description: Parent tenant ID 302 name: X-Tenant-Id 303 in: header 304 required: true 305 /gcp/workflows/{accountId}: 306 x-visibility: private 307 patch: 308 security: [] 309 description: Update workflow for an existing account 310 consumes: 311 - application/vnd.cia.v1+json 312 tags: 313 - gcp 314 summary: Update workflow 315 operationId: updateWorkflow 316 parameters: 317 - description: Workflow Operation 318 name: workflow 319 in: body 320 required: true 321 schema: 322 $ref: '#/definitions/workflow' 323 responses: 324 "204": 325 description: Workflow operation accepted. 326 headers: 327 X-Request-Id: 328 type: string 329 format: uuid 330 description: Unique identifer associated with request 331 "400": 332 $ref: '#/responses/400' 333 "404": 334 $ref: '#/responses/404' 335 default: 336 $ref: '#/responses/500' 337 parameters: 338 - type: string 339 format: uuid 340 description: Unqiue ID of the account 341 name: accountId 342 in: path 343 required: true 344 - type: string 345 format: uuid 346 description: Unique identifer associated with request 347 name: X-Request-Id 348 in: header 349 required: true 350 - type: string 351 format: uuid 352 description: Parent tenant ID 353 name: X-Tenant-Id 354 in: header 355 required: true 356 definitions: 357 account: 358 description: Account details. 359 type: object 360 title: Account 361 required: 362 - name 363 - estimated_cost 364 - lifecycle 365 - user_attribution 366 properties: 367 audit: 368 $ref: '#/definitions/audit' 369 cloud_registration_id: 370 description: Cloud Registration Id of a GCP account 371 type: string 372 title: Cloud Registration Id 373 example: abc123 374 estimated_cost: 375 description: An estimated cost (amount) to allocate for a GCP account 376 type: number 377 format: double 378 title: Estimated Cost 379 minimum: 0 380 example: 1230.456 381 id: 382 description: Unique ID identifying the account 383 type: string 384 format: uuid 385 title: Account ID 386 readOnly: true 387 example: 1234f6e7-dd55-4639-bc54-65646fde2adc 388 lifecycle: 389 description: Lifcycle of a GCP account 390 type: string 391 title: Lifecycle 392 enum: 393 - NONPROD 394 - PROD 395 metadata: 396 description: Metadata associated with the account 397 type: object 398 title: Metadata 399 additionalProperties: 400 type: string 401 readOnly: true 402 name: 403 description: Name of the account 404 type: string 405 title: account name 406 maxLength: 30 407 minLength: 4 408 pattern: ^[a-zA-Z0-9][a-zA-Z0-9-!'" ]+[a-zA-Z0-9!]$ 409 example: Widget Adapter 410 status: 411 description: status of the account 412 type: string 413 title: account status 414 enum: 415 - NEW 416 - ACTIVE 417 - FAILED 418 - CREATING 419 - UPDATING 420 - DELETING 421 - SUSPENDED 422 readOnly: true 423 example: ACTIVE 424 tags: 425 description: Tags associated with the account 426 type: array 427 title: Account tags 428 items: 429 type: string 430 x-omitempty: true 431 example: 432 - build 433 - jenkins 434 user_attribution: 435 $ref: '#/definitions/user_attribution' 436 account_partial: 437 description: Partial account captures fields for account updates 438 type: object 439 title: Partial account 440 properties: 441 admin: 442 description: Username of the user who wants to add as project owner 443 type: string 444 title: Admin Username 445 example: crobbins 446 cloud_registration_id: 447 description: Cloud Registration Id of a GCP account 448 type: string 449 title: Cloud Registration Id 450 example: abc123 451 estimated_cost: 452 description: An estimated cost (amount) to allocate for a GCP account 453 type: number 454 format: double 455 title: Estimated Cost 456 minimum: 0 457 example: 1230.456 458 lifecycle: 459 description: Lifecycle of a GCP account 460 type: string 461 title: Lifecycle 462 enum: 463 - NONPROD 464 - PROD 465 name: 466 description: Name of the account 467 type: string 468 title: Account Name 469 maxLength: 30 470 minLength: 4 471 pattern: ^[a-zA-Z0-9][a-zA-Z0-9-!'" ]+[a-zA-Z0-9!]$ 472 example: Sample GCP Account 473 status: 474 description: cancel the approval request by passing status CANCELED 475 type: string 476 title: account status 477 enum: 478 - CANCELED 479 - ACTIVE 480 user_attribution: 481 description: User Attribution for a GCP account 482 type: object 483 title: User Attribution 484 properties: 485 business_application_name: 486 description: Business Application Name 487 type: string 488 title: Business Application Name 489 x-nullable: true 490 business_contact: 491 description: Business contact for this GCP account 492 type: string 493 title: Business Contact 494 x-nullable: true 495 data_classification: 496 description: Technical contact for this GCP account 497 type: string 498 title: Data Classification 499 enum: 500 - CONFIDENTIAL 501 - HIGHLYCONFIDENTIAL 502 - PUBLIC 503 - RESTRICTED 504 x-nullable: true 505 technical_contact: 506 description: Technical contact for this GCP account 507 type: string 508 title: Technical Contact 509 x-nullable: true 510 account_view: 511 description: Account details. 512 type: object 513 title: Account View 514 properties: 515 audit: 516 $ref: '#/definitions/audit' 517 cloud_registration_id: 518 description: Cloud Registration Id of a GCP account 519 type: string 520 title: Cloud Registration Id 521 example: abc123 522 estimated_cost: 523 description: An estimated cost (amount) to allocate for a GCP account 524 type: number 525 format: double 526 title: Estimated Cost 527 minimum: 0 528 example: 1230.456 529 id: 530 description: Unique ID identifying the account 531 type: string 532 format: uuid 533 title: Account ID 534 readOnly: true 535 example: 1234f6e7-dd55-4639-bc54-65646fde2adc 536 lifecycle: 537 description: Lifcycle of a GCP account 538 type: string 539 title: Lifecycle 540 enum: 541 - NONPROD 542 - PROD 543 readOnly: true 544 metadata: 545 description: Metadata associated with the account 546 type: object 547 title: Metadata 548 additionalProperties: 549 type: string 550 readOnly: true 551 name: 552 description: Name of the account 553 type: string 554 title: account name 555 readOnly: true 556 example: Widget Adapter 557 status: 558 description: status of the account 559 type: string 560 title: account status 561 enum: 562 - NEW 563 - ACTIVE 564 - FAILED 565 - CREATING 566 - UPDATING 567 - DELETING 568 - SUSPENDED 569 readOnly: true 570 example: ACTIVE 571 tags: 572 description: Tags associated with the Account 573 type: array 574 title: Account tags 575 items: 576 type: string 577 x-omitempty: true 578 readOnly: true 579 example: 580 - build 581 - jenkins 582 user_attribution: 583 $ref: '#/definitions/user_attribution' 584 audit: 585 description: Audit trail details 586 type: object 587 title: Audit 588 properties: 589 created_at: 590 description: timestamp when the record was created 591 type: string 592 format: date-time 593 title: Created At 594 readOnly: true 595 created_by: 596 description: entity that created the record 597 type: string 598 title: Created By 599 readOnly: true 600 example: user-cec 601 updated_at: 602 description: timestamp when the record was updated 603 type: string 604 format: date-time 605 title: Updated At 606 readOnly: true 607 updated_by: 608 description: entity that updated the record 609 type: string 610 title: Updated By 611 readOnly: true 612 example: user-cec 613 readOnly: true 614 error: 615 description: | 616 An error provides information about why the request failed. 617 type: object 618 title: Error 619 required: 620 - code 621 - message 622 properties: 623 code: 624 description: | 625 Code identifies a specific type of error. 626 type: string 627 title: Code 628 message: 629 description: | 630 The message provides details about the failure. 631 type: string 632 title: Message 633 user: 634 description: | 635 A User is the authenticated person performing actions. 636 type: object 637 title: User Structure 638 required: 639 - name 640 properties: 641 client_id: 642 description: client_id is created via PingID 643 type: string 644 title: oauth2 client_id 645 display: 646 description: formal name used when greeting a person 647 type: string 648 title: display name 649 name: 650 description: human readable identifier 651 type: string 652 title: login name 653 token: 654 description: token used during authentication 655 type: string 656 title: authentication token 657 x-visibility: private 658 user_attribution: 659 description: User Attribution for a GCP account 660 type: object 661 title: User Attribution 662 required: 663 - business_application_name 664 - business_contact 665 - technical_contact 666 - data_classification 667 properties: 668 business_application_name: 669 description: Business Application Name 670 type: string 671 title: Business Application Name 672 x-nullable: true 673 business_contact: 674 description: Business contact for this GCP account 675 type: string 676 title: Business Contact 677 x-nullable: true 678 data_classification: 679 description: Technical contact for this GCP account 680 type: string 681 title: Data Classification 682 enum: 683 - CONFIDENTIAL 684 - HIGHLYCONFIDENTIAL 685 - PUBLIC 686 - RESTRICTED 687 x-nullable: true 688 technical_contact: 689 description: Technical contact for this GCP account 690 type: string 691 title: Technical Contact 692 x-nullable: true 693 workflow: 694 description: Workflow operations to perform 695 type: object 696 title: Workflow 697 required: 698 - operation 699 properties: 700 operation: 701 description: Operation to perform on workflow 702 type: string 703 title: Operation 704 enum: 705 - CREATE_RESTART 706 example: CREATE_RESTART 707 x-visibility: private 708 responses: 709 "400": 710 description: | 711 Invalid Request Error. Check error message in the response body for details. 712 schema: 713 $ref: '#/definitions/error' 714 headers: 715 X-Request-Id: 716 type: string 717 format: uuid 718 description: Unique identifer associated with request 719 examples: 720 application/json: 721 code: EXAMPLE-001 722 message: Missing required attribute 'name'. 723 "401": 724 description: | 725 Authentication Failure 726 schema: 727 $ref: '#/definitions/error' 728 headers: 729 X-Request-Id: 730 type: string 731 format: uuid 732 description: Unique identifer associated with request 733 examples: 734 application/json: 735 code: EXAMPLE-002 736 message: Authentication failed bad password. 737 "402": 738 description: | 739 Insufficient Funds 740 schema: 741 $ref: '#/definitions/error' 742 headers: 743 X-Request-Id: 744 type: string 745 format: uuid 746 description: Unique identifer associated with request 747 examples: 748 application/json: 749 code: EXAMPLE-003 750 message: Insufficient Funds to cover the cost of resource. 751 "403": 752 description: | 753 Authorization Failure 754 schema: 755 $ref: '#/definitions/error' 756 headers: 757 X-Request-Id: 758 type: string 759 format: uuid 760 description: Unique identifer associated with request 761 examples: 762 application/json: 763 code: EXAMPLE-004 764 message: Not authorized to perform action. 765 "404": 766 description: | 767 Resource not found 768 schema: 769 $ref: '#/definitions/error' 770 headers: 771 X-Request-Id: 772 type: string 773 format: uuid 774 description: Unique identifer associated with request 775 examples: 776 application/json: 777 code: EXAMPLE-005 778 message: Resource <id> does not exist. 779 "409": 780 description: | 781 Conflict 782 schema: 783 $ref: '#/definitions/error' 784 headers: 785 X-Request-Id: 786 type: string 787 format: uuid 788 description: Unique identifer associated with request 789 examples: 790 application/json: 791 code: EXAMPLE-006 792 message: Resource already exists. 793 "422": 794 description: | 795 Unprocessable Entity Failure 796 schema: 797 $ref: '#/definitions/error' 798 headers: 799 X-Request-Id: 800 type: string 801 format: uuid 802 description: Unique identifer associated with request 803 examples: 804 application/json: 805 code: EXAMPLE-007 806 message: Resource is not able to be updated. 807 "500": 808 description: | 809 Internal Server Error. Check error entity in the response body for details. 810 schema: 811 $ref: '#/definitions/error' 812 headers: 813 X-Request-Id: 814 type: string 815 format: uuid 816 description: Unique identifer associated with request 817 examples: 818 application/json: 819 code: EXAMPLE-009 820 message: Internal server error. 821 "503": 822 description: | 823 Service Unavailable 824 schema: 825 $ref: '#/definitions/error' 826 headers: 827 X-Request-Id: 828 type: string 829 format: uuid 830 description: Unique identifer associated with request 831 examples: 832 application/json: 833 code: EXAMPLE-010 834 message: Service Unavailable. 835 securityDefinitions: 836 internal: 837 type: apiKey 838 name: X-API-Key 839 in: header 840 token: 841 type: apiKey 842 name: WAMAUTH 843 in: header 844 security: 845 - token: [] 846 - internal: [] 847 tags: 848 - description: GCP Account Operations 849 name: gcp 850 x-mcmp-component-type: public-cloud