Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save akutz/db384078562dfa468524 to your computer and use it in GitHub Desktop.
Save akutz/db384078562dfa468524 to your computer and use it in GitHub Desktop.
package volume
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-swagger/go-swagger/client"
"github.com/go-swagger/go-swagger/errors"
"github.com/go-swagger/go-swagger/strfmt"
"github.com/go-swagger/go-swagger/swag"
)
// NewGetVolumesServiceNameVolumeIDParams creates a new GetVolumesServiceNameVolumeIDParams object
// with the default values initialized.
func NewGetVolumesServiceNameVolumeIDParams() *GetVolumesServiceNameVolumeIDParams {
var ()
return &GetVolumesServiceNameVolumeIDParams{}
}
/*GetVolumesServiceNameVolumeIDParams contains all the parameters to send to the API endpoint
for the get volumes service name volume ID operation typically these are written to a http.Request
*/
type GetVolumesServiceNameVolumeIDParams struct {
/*Attachments*/
Attachments *bool
/*InstanceID
The base64-encoded instance ID associated
with the request
*/
InstanceID string
/*ServiceName
The service name
*/
ServiceName string
/*VolumeID
The volume ID
*/
VolumeID string
}
// WithAttachments adds the attachments to the get volumes service name volume ID params
func (o *GetVolumesServiceNameVolumeIDParams) WithAttachments(attachments *bool) *GetVolumesServiceNameVolumeIDParams {
o.Attachments = attachments
return o
}
// WithInstanceID adds the instanceId to the get volumes service name volume ID params
func (o *GetVolumesServiceNameVolumeIDParams) WithInstanceID(instanceId string) *GetVolumesServiceNameVolumeIDParams {
o.InstanceID = instanceId
return o
}
// WithServiceName adds the serviceName to the get volumes service name volume ID params
func (o *GetVolumesServiceNameVolumeIDParams) WithServiceName(serviceName string) *GetVolumesServiceNameVolumeIDParams {
o.ServiceName = serviceName
return o
}
// WithVolumeID adds the volumeId to the get volumes service name volume ID params
func (o *GetVolumesServiceNameVolumeIDParams) WithVolumeID(volumeId string) *GetVolumesServiceNameVolumeIDParams {
o.VolumeID = volumeId
return o
}
// WriteToRequest writes these params to a swagger request
func (o *GetVolumesServiceNameVolumeIDParams) WriteToRequest(r client.Request, reg strfmt.Registry) error {
var res []error
if o.Attachments != nil {
// query param attachments
var qrAttachments bool
if o.Attachments != nil {
qrAttachments = *o.Attachments
}
qAttachments := swag.FormatBool(qrAttachments)
if qAttachments != "" {
if err := r.SetQueryParam("attachments", qAttachments); err != nil {
return err
}
}
}
// header param instanceID
if err := r.SetHeaderParam("instanceID", o.InstanceID); err != nil {
return err
}
// path param serviceName
if err := r.SetPathParam("serviceName", o.ServiceName); err != nil {
return err
}
// path param volumeID
if err := r.SetPathParam("volumeID", o.VolumeID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
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:
# root
/:
get:
summary: List Root Resources
description: |
Gets a list of the available resource paths.
responses:
200:
description: A list of the API's resource paths
schema:
type: array
items:
type: string
# services
/services:
get:
tags:
- service
summary: List Services
description: |
Gets information about all of the configured services.
responses:
200:
description: |
A list of objects containing information about
the configured services
schema:
type: array
items:
$ref: '#/definitions/serviceInfo'
/services/{serviceName}:
get:
tags:
- service
summary: Inspect Service
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: Information about the configured service
schema:
$ref: '#/definitions/serviceInfo'
/services/{serviceName}/instance:
get:
tags:
- service
- instance
summary: Inspect Instance
description: |
Gets the service's instance information.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: serviceName
in: path
description: The service name
required: true
type: string
responses:
200:
description: The service's instance information
schema:
$ref: '#/definitions/instance'
# drivers
/drivers:
get:
tags:
- driver
summary: List Drivers
description: |
Gets information about all of the registered drivers.
responses:
200:
description: |
A list of objects containing information about
the registered drivers
schema:
type: array
items:
$ref: '#/definitions/driverInfo'
/drivers/{driverName}:
get:
tags:
- driver
summary: Inspect Driver
description: |
Gets information about the driver with the specified name.
parameters:
- name: driverName
in: path
description: The driver name
required: true
type: string
responses:
200:
description: Information about the registered driver
schema:
$ref: '#/definitions/driverInfo'
/drivers/{driverName}/tools:
get:
tags:
- driver
summary: List Executors By Driver
description: |
Gets information about the driver's client-side
executors.
parameters:
- name: driverName
in: path
description: The driver name
required: true
type: string
responses:
200:
description: |
Information about the driver's client-side
executors
schema:
type: array
items:
$ref: '#/definitions/driverInfo'
/drivers/{driverName}/tools/{toolName}:
get:
tags:
- driver
summary: Download Executor
description: |
Downloads a driver's client-side executor that
matches the provided name.
produces:
- application/octet-stream
parameters:
- name: driverName
in: path
description: The driver name
required: true
type: string
- name: toolName
in: path
description: The tool name
required: true
type: string
responses:
200:
description: |
A driver's client-side executor
schema:
type: file
# volumes
/volumes:
get:
tags:
- volume
summary: List Volumes
description: |
Gets information about all volumes across all services.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
responses:
200:
description: A list of `volume` objects.
schema:
type: array
items:
$ref: '#/definitions/volume'
/volumes/{serviceName}:
get:
tags:
- volume
summary: List Volumes By Service
description: |
Gets information about all volumes for a service.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- 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:
tags:
- volume
summary: Inspect Volume
description: |
Gets information about all volumes for a service.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: serviceName
in: path
description: The service name
required: true
type: string
- name: volumeID
in: path
description: The volume ID
required: true
type: string
- name: attachments
in: query
type: boolean
responses:
200:
description: A volume object.
schema:
$ref: '#/definitions/volume'
put:
tags:
- volume
summary: Update Volume
description: |
Updates an existing volume.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: serviceName
in: path
description: The service name
required: true
type: string
- name: volumeID
in: path
description: The volume ID
required: true
type: string
- name: body
in: body
description: The request payload.
required: true
schema:
type: object
properties:
name:
type: string
availabilityZone:
type: string
iops:
type: integer
format: int64
size:
type: integer
format: int64
type:
type: string
opts:
$ref: '#/definitions/opts'
responses:
201:
description: A volume object.
schema:
$ref: '#/definitions/volume'
delete:
tags:
- volume
summary: Remove Volume
description: |
Removes an existing volume.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: serviceName
in: path
description: The service name
required: true
type: string
- name: volumeID
in: path
description: The volume ID
required: true
type: string
- name: body
in: body
description: The request payload
required: true
schema:
type: object
properties:
opts:
$ref: '#/definitions/opts'
responses:
200:
description: Volume successfully removed
/volumes/{serviceName}/create:
post:
tags:
- volume
summary: Create Volume
description: |
Creates a new volume.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: serviceName
in: path
description: The service name
required: true
type: string
- name: body
in: body
description: The request payload.
required: true
schema:
type: object
properties:
name:
type: string
availabilityZone:
type: string
iops:
type: integer
format: int64
size:
type: integer
format: int64
type:
type: string
opts:
$ref: '#/definitions/opts'
responses:
201:
description: A volume object.
schema:
$ref: '#/definitions/volume'
/volumes/{serviceName}/{volumeID}/copy:
post:
tags:
- volume
summary: Copy Volume
description: |
Creates a new volume using the existing one
as a baseline.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: serviceName
in: path
description: The service name
required: true
type: string
- name: volumeID
in: path
description: The volume ID
required: true
type: string
- name: body
in: body
description: The request payload.
required: true
schema:
type: object
properties:
volumeName:
type: string
opts:
$ref: '#/definitions/opts'
responses:
201:
description: A volume object.
schema:
$ref: '#/definitions/volume'
/volumes/{serviceName}/{volumeID}/snapshot:
post:
tags:
- volume
- snapshot
summary: Snapshot Volume
description: |
Snapshots an existing volume.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: serviceName
in: path
description: The service name
required: true
type: string
- name: volumeID
in: path
description: The volume ID
required: true
type: string
- name: body
in: body
description: The request payload.
required: true
schema:
type: object
properties:
snapshotName:
type: string
opts:
$ref: '#/definitions/opts'
responses:
201:
description: A snapshot object.
schema:
$ref: '#/definitions/snapshot'
/volumes/{serviceName}/{volumeID}/attach:
post:
tags:
- volume
summary: Attach Volume
description: |
Attaches an existing volume.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: serviceName
in: path
description: The service name
required: true
type: string
- name: volumeID
in: path
description: The volume ID
required: true
type: string
- name: body
in: body
description: The request payload.
required: true
schema:
type: object
properties:
nextDeviceName:
type: string
opts:
$ref: '#/definitions/opts'
responses:
200:
description: Volume was successfully attached.
/volumes/detach:
post:
tags:
- volume
summary: Detach Volumes
description: |
Detaches all volumes for all services.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: body
in: body
description: The request payload.
required: true
schema:
type: object
properties:
opts:
$ref: '#/definitions/opts'
responses:
200:
description: A list of the detached volumes.
schema:
type: array
items:
$ref: '#/definitions/volumeRef'
/volumes/{serviceName}/detach:
post:
tags:
- volume
summary: Detach Volumes By Service
description: |
Detaches all volumes for a specific service.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: serviceName
in: path
description: The service name
required: true
type: string
- name: body
in: body
description: The request payload.
required: true
schema:
type: object
properties:
opts:
$ref: '#/definitions/opts'
responses:
200:
description: A list of the detached volumes.
schema:
type: array
items:
$ref: '#/definitions/volumeRef'
# snapshots
/snapshots:
get:
tags:
- snapshot
summary: List Snapshots
description: |
Gets information about all snapshots across all services.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
responses:
200:
description: A list of snapshot references.
schema:
type: array
items:
$ref: '#/definitions/snapshotRef'
/snapshots/{serviceName}:
get:
tags:
- snapshot
summary: List Snapshots By Service
description: |
Gets information about all snapshots for a service.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: serviceName
in: path
description: The service name
required: true
type: string
responses:
200:
description: A list of snapshots.
schema:
type: array
items:
$ref: '#/definitions/snapshot'
/snapshots/{serviceName}/{snapshotID}:
get:
tags:
- snapshot
summary: Inspect Snapshot
description: |
Gets information about a snapshot.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: serviceName
in: path
description: The service name
required: true
type: string
- name: snapshotID
in: path
description: The snapshot ID
required: true
type: string
responses:
200:
description: A snapshot object.
schema:
$ref: '#/definitions/snapshot'
delete:
tags:
- snapshot
summary: Remove Snapshot
description: |
Removes a snapshot.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: serviceName
in: path
description: The service name
required: true
type: string
- name: snapshotID
in: path
description: The snapshot ID
required: true
type: string
- name: body
in: body
description: The request payload
required: true
schema:
type: object
properties:
opts:
$ref: '#/definitions/opts'
responses:
200:
description: The snapshot has been sucessfully removed.
/snapshots/{serviceName}/{snapshotID}/create:
post:
tags:
- snapshot
- volume
summary: Create Volume
description: |
Creates a new volume from an existing snapshot.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: serviceName
in: path
description: The service name
required: true
type: string
- name: snapshotID
in: path
description: The snapshot ID
required: true
type: string
- name: body
in: body
description: The request payload
required: true
schema:
type: object
properties:
opts:
$ref: '#/definitions/opts'
responses:
201:
description: A volume object.
schema:
$ref: '#/definitions/volume'
/snapshots/{serviceName}/{snapshotID}/copy:
post:
tags:
- snapshot
summary: Copy Snapshot
description: |
Copies a snapshot.
parameters:
- name: instanceID
in: header
description: |
The base64-encoded instance ID associated
with the request
required: true
type: string
- name: serviceName
in: path
description: The service name
required: true
type: string
- name: snapshotID
in: path
description: The snapshot ID
required: true
type: string
- name: body
in: body
description: The request payload
required: true
schema:
type: object
properties:
snapshotName:
type: string
destinationID:
type: string
opts:
$ref: '#/definitions/opts'
responses:
201:
description: A snapshot object.
schema:
$ref: '#/definitions/snapshot'
# the object model
definitions:
opts:
type: object
additionalProperties:
type: string
fields:
type: object
additionalProperties:
type: string
storageTypes:
type: string
enum:
- block
- nas
- object
instanceID:
type: object
properties:
id:
type: string
metadata:
type: object
instance:
type: object
properties:
instanceID:
$ref: '#/definitions/instanceID'
name:
type: string
providerName:
type: string
region:
type: string
fields:
$ref: '#/definitions/fields'
snapshotRef:
type: object
properties:
serviceName:
type: string
volume:
$ref: '#/definitions/snapshot'
snapshot:
type: object
properties:
id:
type: string
name:
type: string
description:
type: string
startTime:
type: string
status:
type: string
volumeID:
type: string
volumeSize:
type: string
fields:
$ref: '#/definitions/fields'
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
volumeRef:
type: object
properties:
serviceName:
type: string
volume:
$ref: '#/definitions/volume'
volume:
type: object
properties:
id:
type: string
name:
type: string
type:
$ref: '#/definitions/storageTypes'
attachments:
type: array
items:
$ref: '#/definitions/volumeAttachment'
availabilityZone:
type: string
iops:
type: integer
format: int64
networkName:
type: string
sie:
type: string
status:
type: string
type:
type: string
fields:
$ref: '#/definitions/fields'
volumeAttachment:
type: object
properties:
deviceName:
type: string
instanceID:
$ref: '#/definitions/instanceID'
status:
type: string
volumeID:
type: string
fields:
$ref: '#/definitions/fields'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment