Documentation ¶
Index ¶
- Constants
- type Client
- func (client *Client) CopyVolume(sourceName string, destinationName string, pool string) (*Response, *ResponseStatus, error)
- func (client *Client) CreateHost(name, iqn string) (*Response, *ResponseStatus, error)
- func (client *Client) CreateSnapshot(name string, snapshotName string) (*Response, *ResponseStatus, error)
- func (client *Client) CreateVolume(name, size, pool string) (*Response, *ResponseStatus, error)
- func (client *Client) DeleteHost(name string) (*Response, *ResponseStatus, error)
- func (client *Client) DeleteSnapshot(names ...string) (*Response, *ResponseStatus, error)
- func (client *Client) DeleteVolume(name string) (*Response, *ResponseStatus, error)
- func (client *Client) ExpandVolume(name, size string) (*Response, *ResponseStatus, error)
- func (client *Client) FormattedRequest(endpointFormat string, opts ...interface{}) (*Response, *ResponseStatus, error)
- func (client *Client) Login() error
- func (client *Client) MapVolume(name, host, access string, lun int) (*Response, *ResponseStatus, error)
- func (client *Client) Request(endpoint string) (*Response, *ResponseStatus, error)
- func (client *Client) ShowHostMaps(host string) ([]Volume, *ResponseStatus, error)
- func (client *Client) ShowSnapshots(names ...string) (*Response, *ResponseStatus, error)
- func (client *Client) ShowVolumes(volumes ...string) (*Response, *ResponseStatus, error)
- func (client *Client) UnmapVolume(name, host string) (*Response, *ResponseStatus, error)
- type Collector
- type Object
- type Property
- type Request
- type Response
- type ResponseStatus
- type Volume
Constants ¶
const ( APICallMetric = "dothill_api_appliance_api_call" APICallHelp = "How many API calls have been executed" APICallDurationMetric = "dothill_api_appliance_api_call_duration" APICallDurationHelp = "The total duration of API calls" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Username string Password string Addr string HTTPClient http.Client Collector *Collector // contains filtered or unexported fields }
Client : Can be used to request the dothill API
func NewClient ¶
func NewClient() *Client
NewClient : Creates a dothill client by setting up its HTTP client
func (*Client) CopyVolume ¶ added in v1.7.0
func (client *Client) CopyVolume(sourceName string, destinationName string, pool string) (*Response, *ResponseStatus, error)
CopyVolume : create an new volume by copying another one or a snapshot
func (*Client) CreateHost ¶
func (client *Client) CreateHost(name, iqn string) (*Response, *ResponseStatus, error)
CreateHost : creates a host
func (*Client) CreateSnapshot ¶ added in v1.7.0
func (client *Client) CreateSnapshot(name string, snapshotName string) (*Response, *ResponseStatus, error)
CreateSnapshot : create a snapshot in a snap pool and the snap pool if it doesn't exsits
func (*Client) CreateVolume ¶
func (client *Client) CreateVolume(name, size, pool string) (*Response, *ResponseStatus, error)
CreateVolume : creates a volume with the given name, capacity in the given pool
func (*Client) DeleteHost ¶ added in v1.3.0
func (client *Client) DeleteHost(name string) (*Response, *ResponseStatus, error)
DeleteHost : deletes a host by its ID or nickname
func (*Client) DeleteSnapshot ¶ added in v1.7.0
func (client *Client) DeleteSnapshot(names ...string) (*Response, *ResponseStatus, error)
DeleteSnapshot : delete a snapshot
func (*Client) DeleteVolume ¶
func (client *Client) DeleteVolume(name string) (*Response, *ResponseStatus, error)
DeleteVolume : deletes a volume
func (*Client) ExpandVolume ¶ added in v1.4.0
func (client *Client) ExpandVolume(name, size string) (*Response, *ResponseStatus, error)
ExpandVolume : extend a volume if there is enough space on the vdisk
func (*Client) FormattedRequest ¶ added in v1.6.0
func (client *Client) FormattedRequest(endpointFormat string, opts ...interface{}) (*Response, *ResponseStatus, error)
FormattedRequest : Format and execute the given request with client's configuration
func (*Client) MapVolume ¶
func (client *Client) MapVolume(name, host, access string, lun int) (*Response, *ResponseStatus, error)
MapVolume : map a volume to host + LUN
func (*Client) Request ¶
func (client *Client) Request(endpoint string) (*Response, *ResponseStatus, error)
Request : Execute the given request with client's configuration Deprecated: Use FormattedRequest instead
func (*Client) ShowHostMaps ¶
func (client *Client) ShowHostMaps(host string) ([]Volume, *ResponseStatus, error)
ShowHostMaps : list the volume mappings for given host If host is an empty string, mapping for all hosts is shown
func (*Client) ShowSnapshots ¶ added in v1.7.0
func (client *Client) ShowSnapshots(names ...string) (*Response, *ResponseStatus, error)
ShowSnapshots : list snapshots
func (*Client) ShowVolumes ¶ added in v1.5.0
func (client *Client) ShowVolumes(volumes ...string) (*Response, *ResponseStatus, error)
ShowVolumes : get informations about volumes
func (*Client) UnmapVolume ¶
func (client *Client) UnmapVolume(name, host string) (*Response, *ResponseStatus, error)
UnmapVolume : unmap a volume from host
type Collector ¶ added in v1.6.0
type Collector struct {
// contains filtered or unexported fields
}
func (*Collector) Collect ¶ added in v1.6.0
func (collector *Collector) Collect(ch chan<- prometheus.Metric)
func (*Collector) Describe ¶ added in v1.6.0
func (collector *Collector) Describe(ch chan<- *prometheus.Desc)
type Object ¶
type Object struct { Typ string `xml:"basetype,attr"` Name string `xml:"name,attr"` OID int32 `xml:"oid,attr"` Format string `xml:"format,attr,omitempty"` Objects []Object `xml:"OBJECT"` Properties []Property `xml:"PROPERTY"` ObjectsMap map[string]*Object PropertiesMap map[string]*Property }
Object : Typed representation of any XML API object
type Property ¶
type Property struct { Name string `xml:"name,attr"` Typ string `xml:"type,attr"` Size int32 `xml:"size,attr"` Draw bool `xml:"draw,attr"` Sort string `xml:"sort,attr"` DisplayName string `xml:"display-name,attr"` Data string `xml:",chardata"` }
Property : Typed representation of any XML API property
type Request ¶
type Request struct { Endpoint string Data interface{} }
Request : Used internally, and can be used to send custom requests (see Client.Request())
type Response ¶
type Response struct { Version string `xml:"VERSION,attr"` Objects []Object `xml:"OBJECT"` ObjectsMap map[string]*Object }
Response : Typed representation of any XML API response
func NewResponse ¶
NewResponse : Unmarshals the raw data into a typed response object and generate a hash map from fields for optimization
func (*Response) GetStatus ¶
func (res *Response) GetStatus() *ResponseStatus
GetStatus : Creates and returns the final ResponseStatus struct from the raw status object in response
type ResponseStatus ¶
type ResponseStatus struct { ResponseType string ResponseTypeNumeric int Response string ReturnCode int Time time.Time }
ResponseStatus : Final representation of the "status" object in every API response
func NewErrorStatus ¶ added in v1.5.1
func NewErrorStatus(err string) *ResponseStatus
NewErrorStatus : Creates an error status when response is not available