3de38762aa
Change-Id: Ie417df96258c2daa852d14e588de4ad2d54bb819
296 lines
6.6 KiB
YAML
Executable File
296 lines
6.6 KiB
YAML
Executable File
# this is the RDS API
|
|
swagger: '2.0'
|
|
info:
|
|
title: RDS API
|
|
description: RDS API
|
|
version: "3.5"
|
|
# the domain of the service
|
|
host: server
|
|
# array of all schemes that your API supports
|
|
schemes:
|
|
- http
|
|
# will be prefixed to all paths
|
|
basePath: /v1/rds
|
|
consumes:
|
|
- application/json
|
|
produces:
|
|
- application/json
|
|
paths:
|
|
/resources:
|
|
post:
|
|
summary: New Resource
|
|
description: |
|
|
Creates new resource
|
|
parameters:
|
|
- name: resource
|
|
in: body
|
|
description: The new resource
|
|
required: true
|
|
schema:
|
|
$ref: "#/definitions/Resource"
|
|
tags:
|
|
- Resources
|
|
responses:
|
|
201:
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/CreatedResource'
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
delete:
|
|
summary: Update resource
|
|
description: |
|
|
Update resource
|
|
parameters:
|
|
- name: resource
|
|
in: body
|
|
description: The new resource to update
|
|
required: true
|
|
schema:
|
|
$ref: "#/definitions/Resource"
|
|
tags:
|
|
- Resources
|
|
responses:
|
|
200:
|
|
description: OK
|
|
schema:
|
|
type: string
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
/status:
|
|
post:
|
|
summary: New resource status
|
|
description: |
|
|
Creates new resource status
|
|
parameters:
|
|
- name: status_input
|
|
in: body
|
|
description: New resoure status
|
|
required: true
|
|
schema:
|
|
$ref: "#/definitions/StatusInput"
|
|
tags:
|
|
- Status
|
|
responses:
|
|
201:
|
|
description: Created
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
/status/resource/{id}:
|
|
get:
|
|
summary: Get resource status
|
|
description: |
|
|
Get resource status
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: resource id
|
|
required: true
|
|
type: string
|
|
tags:
|
|
- Status
|
|
responses:
|
|
200:
|
|
description: resource status
|
|
schema:
|
|
$ref: '#/definitions/ResourceStatus'
|
|
default:
|
|
description: Unexpected error
|
|
schema:
|
|
$ref: '#/definitions/Error'
|
|
definitions:
|
|
Resource:
|
|
type: object
|
|
required:
|
|
- service_template
|
|
properties:
|
|
service_template:
|
|
$ref: '#/definitions/ResourceData'
|
|
ResourceData:
|
|
type: object
|
|
required:
|
|
- resource
|
|
- model
|
|
- tracking
|
|
properties:
|
|
resource:
|
|
$ref: '#/definitions/ResourceTypeData'
|
|
model:
|
|
type: string
|
|
description: model
|
|
tracking:
|
|
$ref: '#/definitions/TrackingData'
|
|
ResourceTypeData:
|
|
type: object
|
|
required:
|
|
- resource_type
|
|
properties:
|
|
resource_type:
|
|
type: string
|
|
description: resource type
|
|
resource_id:
|
|
type: string
|
|
description: resource id
|
|
TrackingData:
|
|
type: object
|
|
required:
|
|
- external_id
|
|
- tracking_id
|
|
properties:
|
|
external_id:
|
|
type: string
|
|
description: external id
|
|
tracking_id:
|
|
type: string
|
|
description: tracking id
|
|
CreatedResource:
|
|
type: object
|
|
required:
|
|
- id
|
|
- links
|
|
properties:
|
|
id:
|
|
type: string
|
|
description: id
|
|
created:
|
|
type: string
|
|
description: tracking id
|
|
links:
|
|
$ref: '#/definitions/links'
|
|
updated:
|
|
type: string
|
|
description: tracking id
|
|
err:
|
|
type: string
|
|
description: tracking id
|
|
message:
|
|
type: string
|
|
description: tracking id
|
|
links:
|
|
type: object
|
|
required:
|
|
- self
|
|
properties:
|
|
self:
|
|
type: string
|
|
description: self
|
|
Error:
|
|
type: object
|
|
properties:
|
|
faultcode:
|
|
type: string
|
|
faultstring:
|
|
type: string
|
|
debuginfo:
|
|
type: string
|
|
StatusInput:
|
|
type: object
|
|
required:
|
|
- rds_listener
|
|
properties:
|
|
rds_listener:
|
|
$ref: '#/definitions/StatusResourceData'
|
|
StatusResourceData:
|
|
type: object
|
|
required:
|
|
- resource-id
|
|
- request-id
|
|
- resource-type
|
|
- resource-template-version
|
|
- resource-template-type
|
|
- resource-operation
|
|
- ord-notifier-id
|
|
- region
|
|
- status
|
|
- error-code
|
|
- error-msg
|
|
properties:
|
|
resource-id:
|
|
type: string
|
|
description: resource id
|
|
request-id:
|
|
type: string
|
|
description: request id (transaction ID received from RDS)
|
|
resource-type:
|
|
type: string
|
|
description: resource type (e.g., 'customer')
|
|
resource-template-version:
|
|
type: string
|
|
description: resource template version (Git commit ID)
|
|
resource-template-type:
|
|
type: string
|
|
description: resource template type
|
|
resource-operation:
|
|
type: string
|
|
description: resource operation
|
|
ord-notifier-id:
|
|
type: string
|
|
description: ord notifier id
|
|
region:
|
|
type: string
|
|
description: region
|
|
status:
|
|
type: string
|
|
description: status
|
|
error-code:
|
|
type: string
|
|
description: error code
|
|
error-msg:
|
|
type: string
|
|
description: error msg
|
|
ResourceStatus:
|
|
type: object
|
|
required:
|
|
- status
|
|
- regions
|
|
properties:
|
|
status:
|
|
type: string
|
|
description: status
|
|
regions:
|
|
type: array
|
|
items:
|
|
$ref: '#/definitions/OutputResource'
|
|
OutputResource:
|
|
type: object
|
|
required:
|
|
- region
|
|
- timestamp
|
|
- ord_transaction_id
|
|
- resource_id
|
|
- ord_notifier_id
|
|
- status
|
|
- error_code
|
|
- error_msg
|
|
properties:
|
|
region:
|
|
type: string
|
|
description: region
|
|
timestamp:
|
|
type: string
|
|
description: timestamp
|
|
ord_transaction_id:
|
|
type: string
|
|
description: ord transaction id
|
|
resource_id:
|
|
type: string
|
|
description: resource id
|
|
ord_notifier_id:
|
|
type: string
|
|
description: ord notifier id
|
|
status:
|
|
type: string
|
|
description: status
|
|
error_code:
|
|
type: string
|
|
description: error code
|
|
error_msg:
|
|
type: string
|
|
description: error msg
|