Documentation ¶
Index ¶
- Constants
- func LoadShare(svc iaas.Service, ref string) (share string, err error)
- func RemoveHost(svc iaas.Service, host *resources.Host) (err error)
- func RemoveNetwork(svc iaas.Service, net *resources.Network) (err error)
- func RemoveShare(svc iaas.Service, hostID, hostName, shareID, shareName string) error
- func RemoveVolume(svc iaas.Service, volumeID string) (err error)
- type Gateway
- func (mg *Gateway) Acquire()
- func (mg *Gateway) Carry(host *resources.Host) (gw *Gateway, err error)
- func (mg *Gateway) Delete() (err error)
- func (mg *Gateway) Get() (*resources.Host, error)
- func (mg *Gateway) Read() (err error)
- func (mg *Gateway) Release()
- func (mg *Gateway) Reload() (err error)
- func (mg *Gateway) Write() error
- type Host
- func (mh *Host) Acquire()
- func (mh *Host) Browse(callback func(*resources.Host) error) (err error)
- func (mh *Host) Carry(host *resources.Host) (*Host, error)
- func (mh *Host) Delete() (err error)
- func (mh *Host) Get() (*resources.Host, error)
- func (mh *Host) ReadByID(id string) (err error)
- func (mh *Host) ReadByName(name string) (err error)
- func (mh *Host) ReadByReference(id string) (err error)
- func (mh *Host) Release()
- func (mh *Host) Write() (err error)
- type Network
- func (m *Network) Acquire()
- func (m *Network) AttachHost(host *resources.Host) (err error)
- func (m *Network) Browse(callback func(*resources.Network) error) (err error)
- func (m *Network) Carry(network *resources.Network) (*Network, error)
- func (m *Network) Delete() (err error)
- func (m *Network) DetachHost(hostID string) (err error)
- func (m *Network) Get() (*resources.Network, error)
- func (m *Network) GetPath() (string, error)
- func (m *Network) GetService() iaas.Service
- func (m *Network) ListHosts() (list []*resources.Host, err error)
- func (m *Network) ReadByID(id string) (err error)
- func (m *Network) ReadByName(name string) (err error)
- func (m *Network) ReadByReference(ref string) (err error)
- func (m *Network) Release()
- func (m *Network) Reload() (err error)
- func (m *Network) Write() (err error)
- type Share
- func (ms *Share) Acquire()
- func (ms *Share) Browse(callback func(string, string) error) error
- func (ms *Share) Carry(hostID, hostName, shareID, shareName string) (*Share, error)
- func (ms *Share) Delete() error
- func (ms *Share) Get() (string, error)
- func (ms *Share) ReadByID(id string) error
- func (ms *Share) ReadByName(name string) error
- func (ms *Share) ReadByReference(id string) (err error)
- func (ms *Share) Release()
- func (ms *Share) Write() error
- type Volume
- func (mv *Volume) Browse(callback func(*resources.Volume) error) (err error)
- func (mv *Volume) Carry(volume *resources.Volume) (*Volume, error)
- func (mv *Volume) Delete() (err error)
- func (mv *Volume) Get() (*resources.Volume, error)
- func (mv *Volume) ReadByID(id string) error
- func (mv *Volume) ReadByName(name string) error
- func (mv *Volume) ReadByReference(ref string) (err error)
- func (mv *Volume) Reload() error
- func (mv *Volume) Write() error
Constants ¶
const ( //ByIDFolderName tells in what folder to put 'byID' information ByIDFolderName = "byID" //ByNameFolderName tells in what folder to store 'byName' information ByNameFolderName = "byName" // BucketNamePrefix is the beginning of the name of the bucket for Metadata BucketNamePrefix = "0.safescale" )
Variables ¶
This section is empty.
Functions ¶
func LoadShare ¶
LoadShare returns the name of the host owing the share 'ref', read from Object Storage logic: Read by ID; if error is ErrNotFound then read by name; if error is ErrNotFound return this error
In case of any other error, abort the retry to propagate the error If retry times out, return errNotFound
func RemoveHost ¶
RemoveHost removes the host definition from Object Storage
func RemoveNetwork ¶
RemoveNetwork removes the Network definition from Object Storage
func RemoveShare ¶
RemoveShare removes the share definition from Object Storage
Types ¶
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway links Object Storage folder and Network
func LoadGateway ¶
LoadGateway returns the metadata of the Gateway of a network
func NewGateway ¶
NewGateway creates an instance of metadata.Gateway
func SaveGateway ¶
SaveGateway saves the metadata of a gateway
func (*Gateway) Acquire ¶
func (mg *Gateway) Acquire()
Acquire waits until the write lock is available, then locks the metadata
func (*Gateway) Read ¶
Read reads the metadata of a gateway of a network identified by ID from Object Storage
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
Host links Object Storage folder and Network
func LoadHost ¶
LoadHost gets the host definition from Object Storage logic: Read by ID; if error is ErrNotFound then read by name; if error is ErrNotFound return this error
In case of any other error, abort the retry to propagate the error If retry times out, return errNotFound
func (*Host) Acquire ¶
func (mh *Host) Acquire()
Acquire waits until the write lock is available, then locks the metadata
func (*Host) ReadByID ¶
ReadByID reads the metadata of a network identified by ID from Object Storage
func (*Host) ReadByName ¶
ReadByName reads the metadata of a host identified by name
func (*Host) ReadByReference ¶
ReadByReference ...
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network links Object Storage folder and Network
func LoadNetwork ¶
LoadNetwork gets the Network definition from Object Storage logic: Read by ID; if error is ErrNotFound then read by name; if error is ErrNotFound return this error
In case of any other error, abort the retry to propagate the error If retry times out, return errNotFound
func NewNetwork ¶
NewNetwork creates an instance of network.Metadata
func SaveNetwork ¶
SaveNetwork saves the Network definition in Object Storage
func (*Network) Acquire ¶
func (m *Network) Acquire()
Acquire waits until the write lock is available, then locks the metadata
func (*Network) AttachHost ¶
AttachHost links host ID to the network
func (*Network) DetachHost ¶
DetachHost unlinks host ID from network
func (*Network) GetService ¶
GetService returns the provider service used
func (*Network) ListHosts ¶
ListHosts returns the list of resources.Host attached to the network (excluding gateway)
func (*Network) ReadByID ¶
ReadByID reads the metadata of a network identified by ID from Object Storage
func (*Network) ReadByName ¶
ReadByName reads the metadata of a network identified by name
func (*Network) ReadByReference ¶
ReadByReference tries to read first using 'ref' as an ID then as a name
type Share ¶
type Share struct {
// contains filtered or unexported fields
}
Share contains information to maintain in Object Storage a list of shared folders
func (*Share) Acquire ¶
func (ms *Share) Acquire()
Acquire waits until the write lock is available, then locks the metadata.
May panic (see scerr.OnPanic() usage to intercept and translate it to an error)
func (*Share) ReadByID ¶
ReadByID reads the metadata of an export identified by ID from Object Storage
func (*Share) ReadByName ¶
ReadByName reads the metadata of a nas identified by name
func (*Share) ReadByReference ¶
ReadByReference tries to read 'ref' as an ID, and if not found as a name
type Volume ¶
type Volume struct {
// contains filtered or unexported fields
}
Volume links Object Storage folder and Volumes
func LoadVolume ¶
LoadVolume gets the Volume definition from Object Storage logic: Read by ID; if error is ErrNotFound then read by name; if error is ErrNotFound return this error
In case of any other error, abort the retry to propagate the error If retry times out, return errNotFound
func SaveVolume ¶
SaveVolume saves the Volume definition in Object Storage
func (*Volume) ReadByID ¶
ReadByID reads the metadata of a volume identified by ID from Object Storage
func (*Volume) ReadByName ¶
ReadByName reads the metadata of a volume identified by name
func (*Volume) ReadByReference ¶
ReadByReference tries to read with 'ref' as id, then if not found as name