Skip to content

Instantly share code, notes, and snippets.

@akutz
Created February 15, 2016 23:22
Show Gist options
  • Save akutz/96654eb489c8c451ef85 to your computer and use it in GitHub Desktop.
Save akutz/96654eb489c8c451ef85 to your computer and use it in GitHub Desktop.
swagger: '2.0'
# document metadata
info:
version: "0.0.1"
title: libStorage
description: |
`libStorage` provides a vendor agnostic storage
orchestration model, API, and reference client
and server implementations.
schemes:
- http
- https
basePath: /
produces:
- application/json
- application/x-gzip
consumes:
- application/json
# the paths
paths:
# services
/services:
get:
description: |
Gets information about all of the registered services.
responses:
200:
description: A list of `serviceInfo` objects.
schema:
type: array
items:
$ref: '#/definitions/serviceInfo'
/services/{serviceName}:
get:
description: |
Gets information about the service with the specified name.
parameters:
- name: serviceName
in: path
description: The service name
required: true
type: string
responses:
200:
description: A `serviceInfo` object.
schema:
$ref: '#/definitions/serviceInfo'
# volumes
/volumes:
get:
description: |
Gets information about all volumes across all services.
responses:
200:
description: A list of `volume` objects.
schema:
type: array
items:
$ref: '#/definitions/volume'
/volumes/{serviceName}:
get:
description: |
Gets information about all volumes for a service.
parameters:
- name: serviceName
in: path
description: The service name
required: true
type: string
responses:
200:
description: A list of `volume` objects.
schema:
type: array
items:
$ref: '#/definitions/volume'
/volumes/{serviceName}/{volumeID}:
get:
description: |
Gets information about all volumes for a service.
parameters:
- name: serviceName
in: path
description: The service name
required: true
type: string
- name: volumeID
in: path
description: The volume ID
required: true
type: string
responses:
200:
description: A volume object.
schema:
$ref: '#/definitions/volume'
# the object model
definitions:
storageTypes:
type: string
enum:
- block
- nas
- object
serviceInfo:
type: object
properties:
name:
type: string
driver:
$ref: '#/definitions/driverInfo'
driverInfo:
type: object
properties:
name:
type: string
type:
$ref: '#/definitions/storageTypes'
nextDevice:
$ref: '#/definitions/nextDeviceInfo'
clientTools:
type: array
items:
$ref: '#/definitions/clientToolInfo'
nextDeviceInfo:
type: object
properties:
ignore:
type: boolean
prefix:
type: string
pattern:
type: string
clientToolInfo:
type: object
properties:
name:
type: string
md5Checksum:
type: string
volume:
type: object
properties:
id:
type: string
name:
type: string
type:
$ref: '#/definitions/storageTypes'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment