Documentation
¶
Index ¶
- type Client
- func (client *Client) CreateHost(name, iqn 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) DeleteVolume(name string) (*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) UnmapVolume(name, host string) (*Response, *ResponseStatus, error)
- type Object
- type Property
- type Request
- type Response
- type ResponseStatus
- type Volume
Constants ¶
This section is empty.
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 // 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) CreateHost ¶
func (client *Client) CreateHost(name, iqn string) (*Response, *ResponseStatus, error)
CreateHost : creates a host
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 hotst by its ID or nickname
func (*Client) DeleteVolume ¶
func (client *Client) DeleteVolume(name string) (*Response, *ResponseStatus, error)
DeleteVolume : deletes a volume
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
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) UnmapVolume ¶
func (client *Client) UnmapVolume(name, host string) (*Response, *ResponseStatus, error)
UnmapVolume : unmap a volume from host
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