| swagger: '2.0' |
| info: |
| version: 0.0.1 |
| title: Edge X Apid Gateway Deploy |
| contact: |
| name: Apigee, Inc. |
| url: http://www.apigee.com/ |
| email: sales@apigee.com |
| license: |
| name: Apache 2.0 |
| url: https://www.apache.org/licenses/LICENSE-2.0 |
| basePath: /deployments |
| schemes: |
| - http |
| consumes: |
| - application/json |
| produces: |
| - application/json |
| paths: |
| /current: |
| get: |
| description: Retrieve current deployment system and bundles to install. |
| parameters: |
| - name: If-None-Match |
| in: header |
| type: string |
| description: "If request If-None-Match header matches the ETag of deployment, the server returns a 304 Not Modified response indicating that the client already has the most recent bundle list." |
| - name: block |
| in: query |
| type: integer |
| description: 'If block > 0 AND if there is no new bundle list available, then block for up to the specified number of seconds until a new bundle list becomes available. If no new deployment becomes available, then return 304 Not Modified if If-None-Match is specified, 404 otherwise.' |
| responses: |
| '200': |
| headers: |
| ETag: |
| description: "Client should reuse ETag value in If-None-Match header of the next GET request." |
| type: string |
| description: The deployment system and bundles to install. |
| examples: |
| application/json: { |
| "deploymentId": "abc123", |
| "system" : { |
| "bundleId": "system-bundle-rev-3", |
| "uri": "file:///apid/bundles/system-bundle-rev-3.zip" |
| }, |
| "bundles": [ |
| { |
| "bundleId": "system-bundle-rev-3", |
| "uri": "file:///apid/bundles/system-bundle-release-1-1233.zip", |
| "scope": "@#$nike#$#$stage&#$(^#", |
| "org": "nike", |
| "env": "stage", |
| },{ |
| "bundleId": "bundleA-rev-9", |
| "uri": "file:///apid/bundles/bundleA-rev-9-26372.zip", |
| "scope": "@#$nike#$#$prod&#$(^#", |
| "org": "nike", |
| "env": "prod", |
| },{ |
| "bundleId": "bundleB-rev-1", |
| "uri": "file:///somewhere/bundles/bundleB-rev-1-72351.zip", |
| "scope": "@#$nike#$#$test&#$(^#", |
| "org": "nike", |
| "env": "test", |
| } |
| ] |
| } |
| schema: |
| $ref: '#/definitions/DeploymentResponse' |
| '304': |
| description: Deployment not modified. |
| '404': |
| description: No current Deployment. |
| |
| /{deploymentId}: |
| post: |
| description: Save results of deployment |
| parameters: |
| - name: deploymentId |
| in: path |
| required: true |
| type: string |
| description: deployment ID |
| - name: _ |
| in: body |
| required: true |
| description: Success or failure response |
| schema: |
| $ref: '#/definitions/DeploymentResult' |
| responses: |
| '200': |
| description: OK |
| default: |
| description: Error response |
| schema: |
| $ref: '#/definitions/ErrorResponse' |
| |
| definitions: |
| |
| ErrorResponse: |
| required: |
| - errorCode |
| - reason |
| properties: |
| errorCode: |
| type: number |
| reason: |
| type: string |
| example: { |
| "errorCode": 601, |
| "reason": "Something's wrong" |
| } |
| |
| DeploymentResponse: |
| type: object |
| required: |
| - deploymentId |
| - system |
| - bundles |
| properties: |
| deploymentId: |
| type: string |
| system: |
| type: object |
| $ref: '#/definitions/SystemBundle' |
| bundles: |
| type: array |
| items: |
| $ref: '#/definitions/UserBundle' |
| |
| SystemBundle: |
| type: object |
| required: |
| - bundleId |
| - uri |
| properties: |
| bundleId: |
| type: string |
| uri: |
| type: string |
| |
| UserBundle: |
| allOf: |
| - $ref: '#/definitions/SystemBundle' |
| required: |
| - scope |
| properties: |
| scope: |
| type: string |
| description: Used to convey request scope information to APID APIs |
| org: |
| type: string |
| description: Available for legacy purposes |
| env: |
| type: string |
| description: Available for legacy purposes |
| |
| DeploymentResult: |
| type: object |
| required: |
| - status |
| properties: |
| status: |
| type: string |
| enum: |
| - "SUCCESS" |
| - "FAIL" |
| error: |
| $ref: '#/definitions/DeploymentResultError' |
| description: Status of SUCCESS or FAIL plus error |
| example: { |
| "status": "SUCCESS" |
| } |
| |
| DeploymentResultError: |
| type: object |
| required: |
| - errorCode |
| - reason |
| properties: |
| errorCode: |
| type: number |
| reason: |
| type: string |
| bundleErrors: |
| type: array |
| items: |
| $ref: '#/definitions/DeploymentBundleError' |
| example: { |
| "error": { |
| "errorCode": 5, |
| "reason": "Failed restart", |
| "bundleErrors": [ |
| { |
| "bundleId": "system-bundle-rev-3", |
| "errorCode": 5, |
| "reason": "Invalid template parameter" |
| }, |
| { |
| "bundleId": "system-bundle-rev-9", |
| "errorCode": 1, |
| "reason": "Missing Virtual Host" |
| } |
| ] |
| } |
| } |
| |
| DeploymentBundleError: |
| type: object |
| required: |
| - bundleId |
| - errorCode |
| - reason |
| properties: |
| bundleId: |
| type: string |
| errorCode: |
| type: number |
| reason: |
| type: string |