Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Update datasource CRUD spec (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Su authored Sep 27, 2018
1 parent 6a5e6ab commit ea2f051
Show file tree
Hide file tree
Showing 2 changed files with 190 additions and 4 deletions.
97 changes: 95 additions & 2 deletions spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,11 @@ paths:
tags:
- Datasources
parameters:
- $ref: '#/parameters/owner'
- $ref: '#/parameters/name'
- name: datasource
in: body
required: true
schema:
$ref: '#/definitions/DatasourceToCreate'
responses:
201:
description: SUCCESS
Expand All @@ -848,6 +851,70 @@ paths:
description: 'Unexpected error'
schema:
$ref: '#/definitions/Error'

/datasources/{datasourceID}:
x-resource: Datasources
get:
summary: 'Get datasource by ID'
parameters:
- $ref: '#/parameters/datasourceID'
tags:
- Datasources
responses:
200:
description: SUCCESS
schema:
$ref: '#/definitions/Datasource'
403:
description: 'Insufficient permissions to get this datasource'
schema:
$ref: '#/definitions/Error'
default:
description: 'Unexpected error'
schema:
$ref: '#/definitions/Error'
put:
summary: 'Replace a datasource'
tags:
- Datasources
parameters:
- $ref: '#/parameters/datasourceID'
- name: datasource
in: body
required: true
schema:
allOf:
- $ref: '#/definitions/Datasource'
- $ref: '#/definitions/DatasourceBands'
responses:
204:
description: 'Update successful (no further processing needed)'
403:
description: 'Insufficient permissions or object does not exist'
schema:
$ref: '#/definitions/Error'
default:
description: 'Unexpected error'
schema:
$ref: '#/definitions/Error'
delete:
summary: 'Delete a datasource'
tags:
- Datasources
parameters:
- $ref: '#/parameters/datasourceID'
responses:
200:
description: 'Deletion successful (no content)'
403:
description: 'Insufficient permissions or object does not exist'
schema:
$ref: '#/definitions/Error'
default:
description: 'Unexpected error'
schema:
$ref: '#/definitions/Error'

/datasources/{datasourceID}/permissions/:
x-resource: Datasources
get:
Expand Down Expand Up @@ -4847,6 +4914,31 @@ definitions:
blueBand:
type: integer

DatasourceToCreate:
type: object
description: 'Datasource to be created'
allOf:
- $ref: '#/definitions/DatasourceCreated'
- $ref: '#/definitions/DatasourceBands'

DatasourceBands:
type: object
description: 'Band definitions of a datasource'
allOf:
- type: object
properties:
bands:
type: array
items:
type: object
properties:
name:
type: string
number:
type: string
wavelength:
type: number
format: float

DatasourceCreated:
type: object
Expand Down Expand Up @@ -4910,6 +5002,7 @@ definitions:
type: array
items:
$ref: '#/definitions/Datasource'

License:
type: object
description: 'A record of license'
Expand Down
97 changes: 95 additions & 2 deletions spec/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,11 @@ paths:
tags:
- Datasources
parameters:
- $ref: '#/parameters/owner'
- $ref: '#/parameters/name'
- name: datasource
in: body
required: true
schema:
$ref: '#/definitions/DatasourceToCreate'
responses:
201:
description: SUCCESS
Expand All @@ -848,6 +851,70 @@ paths:
description: 'Unexpected error'
schema:
$ref: '#/definitions/Error'

/datasources/{datasourceID}:
x-resource: Datasources
get:
summary: 'Get datasource by ID'
parameters:
- $ref: '#/parameters/datasourceID'
tags:
- Datasources
responses:
200:
description: SUCCESS
schema:
$ref: '#/definitions/Datasource'
403:
description: 'Insufficient permissions to get this datasource'
schema:
$ref: '#/definitions/Error'
default:
description: 'Unexpected error'
schema:
$ref: '#/definitions/Error'
put:
summary: 'Replace a datasource'
tags:
- Datasources
parameters:
- $ref: '#/parameters/datasourceID'
- name: datasource
in: body
required: true
schema:
allOf:
- $ref: '#/definitions/Datasource'
- $ref: '#/definitions/DatasourceBands'
responses:
204:
description: 'Update successful (no further processing needed)'
403:
description: 'Insufficient permissions or object does not exist'
schema:
$ref: '#/definitions/Error'
default:
description: 'Unexpected error'
schema:
$ref: '#/definitions/Error'
delete:
summary: 'Delete a datasource'
tags:
- Datasources
parameters:
- $ref: '#/parameters/datasourceID'
responses:
200:
description: 'Deletion successful (no content)'
403:
description: 'Insufficient permissions or object does not exist'
schema:
$ref: '#/definitions/Error'
default:
description: 'Unexpected error'
schema:
$ref: '#/definitions/Error'

/datasources/{datasourceID}/permissions/:
x-resource: Datasources
get:
Expand Down Expand Up @@ -4847,6 +4914,31 @@ definitions:
blueBand:
type: integer

DatasourceToCreate:
type: object
description: 'Datasource to be created'
allOf:
- $ref: '#/definitions/DatasourceCreated'
- $ref: '#/definitions/DatasourceBands'

DatasourceBands:
type: object
description: 'Band definitions of a datasource'
allOf:
- type: object
properties:
bands:
type: array
items:
type: object
properties:
name:
type: string
number:
type: string
wavelength:
type: number
format: float

DatasourceCreated:
type: object
Expand Down Expand Up @@ -4910,6 +5002,7 @@ definitions:
type: array
items:
$ref: '#/definitions/Datasource'

License:
type: object
description: 'A record of license'
Expand Down

0 comments on commit ea2f051

Please sign in to comment.