Documentation ¶
Index ¶
- Variables
- type BaseClientError
- type ErrorBodyResponse
- type LocationEntity
- type LocationEntityWrap
- type NICEntity
- type NetworkData
- type NetworkResponse
- type NetworkType
- type RequestError
- type SSClient
- func (c *SSClient) CreateNIC(serverID, networkID string, bandwidth int) (*TaskIDWrap, error)
- func (c *SSClient) CreateNICAndWait(serverID, networkID string, bandwidth int) (*NICEntity, error)
- func (c *SSClient) CreateNetwork(name string, locationID string, description string, networkPrefix string, ...) (*TaskIDWrap, error)
- func (c *SSClient) CreateNetworkAndWait(name string, locationID string, description string, networkPrefix string, ...) (*NetworkResponse, error)
- func (c *SSClient) CreateSSHKey(name string, publicKey string) (*SSHResponse, error)
- func (c *SSClient) CreateServer(name string, locationID string, imageID string, cpu int, ram int, ...) (*TaskIDWrap, error)
- func (c *SSClient) CreateServerAndWait(name string, locationID string, imageID string, cpu int, ram int, ...) (*ServerResponse, error)
- func (c *SSClient) CreateVolume(serverID, name string, size int) (*TaskIDWrap, error)
- func (c *SSClient) CreateVolumeAndWait(serverID string, name string, size int) (*VolumeEntity, error)
- func (c *SSClient) DeleteNIC(serverID string, nicID int) error
- func (c *SSClient) DeleteNetwork(networkID string) error
- func (c *SSClient) DeleteSSHKey(sshID int) error
- func (c *SSClient) DeleteServer(serverID string) error
- func (c *SSClient) DeleteVolume(serverID string, volumeID int) error
- func (c *SSClient) GetLocationList() ([]*LocationEntity, error)
- func (c *SSClient) GetNIC(serverID string, nicID int) (*NICEntity, error)
- func (c *SSClient) GetNICList(serverID string) ([]*NICEntity, error)
- func (c *SSClient) GetNetwork(networkID string) (*NetworkResponse, error)
- func (c *SSClient) GetSSHKey(sshID int) (*SSHResponse, error)
- func (c *SSClient) GetServer(serverID string) (*ServerResponse, error)
- func (c *SSClient) GetSnapshotList(serverID string) ([]*SnapshotEntity, error)
- func (c *SSClient) GetTask(taskID string) (*TaskResponse, error)
- func (c *SSClient) GetVolume(serverID string, volumeID int) (*VolumeEntity, error)
- func (c *SSClient) UpdateNetwork(networkID, name, description string) (*TaskIDWrap, error)
- func (c *SSClient) UpdateNetworkAndWait(networkID, name, description string) (*NetworkResponse, error)
- func (c *SSClient) UpdatePublicNIC(serverID string, nicID, bandwidth int) (*TaskIDWrap, error)
- func (c *SSClient) UpdatePublicNICAndWait(serverID string, nicID, bandwidth int) (*NICEntity, error)
- func (c *SSClient) UpdateServer(serverID string, cpu int, ram int) (*TaskIDWrap, error)
- func (c *SSClient) UpdateServerAndWait(serverID string, cpu int, ram int) (*ServerResponse, error)
- func (c *SSClient) UpdateVolume(serverID string, volumeID int, name string, size int) (*TaskIDWrap, error)
- func (c *SSClient) UpdateVolumeAndWait(serverID string, volumeID int, name string, size int) (*VolumeEntity, error)
- type SSHResponse
- type ServerResponse
- type SnapshotEntity
- type SnapshotEntityWrap
- type TaskIDWrap
- type TaskResponse
- type VolumeData
- type VolumeEntity
- type WrongKeyFormatError
Constants ¶
This section is empty.
Variables ¶
View Source
var HOST_MAP = map[string]string{
"02": "https://api.netooze.com",
"04": "https://api.netooze.com",
"06": "https://api.netooze.com",
"07": "https://api.netooze.com",
"08": "https://api.netooze.com",
"09": "https://api.netooze.com",
"0a": "https://api.netooze.com",
}
Functions ¶
This section is empty.
Types ¶
type BaseClientError ¶
func (*BaseClientError) Error ¶
func (e *BaseClientError) Error() string
func (*BaseClientError) Unwrap ¶
func (e *BaseClientError) Unwrap() error
type ErrorBodyResponse ¶
type LocationEntity ¶
type LocationEntity struct { ID string `json:"id,omitempty"` SystemVolumeMin int `json:"system_volume_min,omitempty"` AdditionalVolumeMin int `json:"additional_volume_min,omitempty"` VolumeMax int `json:"volume_max,omitempty"` WindowsSystemVolumeMin int `json:"windows_system_volume_min,omitempty"` BandwidthMin int `json:"bandwidth_min,omitempty"` BandwidthMax int `json:"bandwidth_max,omitempty"` CPUQuantityOptions []int `json:"cpu_quantity_options,omitempty"` RAMSizeOptions []int `json:"ram_size_options,omitempty"` }
type LocationEntityWrap ¶
type LocationEntityWrap struct {
Location *LocationEntity `json:"location,omitempty"`
}
type NICEntity ¶
type NICEntity struct { ID int `json:"id,omitempty"` ServerID string `json:"server_id,omitempty"` NetworkID string `json:"network_id,omitempty"` MAC string `json:"mac,omitempty"` IPAddress string `json:"ip_address,omitempty"` Mask int `json:"mask,omitempty"` Gateway string `json:"gateway,omitempty"` BandwidthMBPS int `json:"bandwidth_mbps,omitempty"` NetworkType NetworkType `json:"network_type,omitempty"` }
type NetworkData ¶
type NetworkResponse ¶
type NetworkResponse struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` LocationID string `json:"location_id,omitempty"` Description string `json:"description,omitempty"` NetworkPrefix string `json:"network_prefix,omitempty"` Mask int `json:"mask,omitempty"` ServerIDS []string `json:"server_ids,omitempty"` State string `json:"state,omitempty"` Created string `json:"created,omitempty"` }
type RequestError ¶
type RequestError struct { BaseClientError Response *resty.Response Status int Body string }
func NewRequestError ¶
func NewRequestError(response *resty.Response, err error) *RequestError
func (*RequestError) Error ¶
func (e *RequestError) Error() string
type SSClient ¶
func (*SSClient) CreateNIC ¶
func (c *SSClient) CreateNIC(serverID, networkID string, bandwidth int) (*TaskIDWrap, error)
func (*SSClient) CreateNICAndWait ¶
func (*SSClient) CreateNetwork ¶
func (*SSClient) CreateNetworkAndWait ¶
func (*SSClient) CreateSSHKey ¶
func (c *SSClient) CreateSSHKey( name string, publicKey string, ) (*SSHResponse, error)
func (*SSClient) CreateServer ¶
func (c *SSClient) CreateServer( name string, locationID string, imageID string, cpu int, ram int, volumes []*VolumeData, networks []*NetworkData, sshKeyIds []int, ) (*TaskIDWrap, error)
func (*SSClient) CreateServerAndWait ¶
func (c *SSClient) CreateServerAndWait( name string, locationID string, imageID string, cpu int, ram int, volumes []*VolumeData, networks []*NetworkData, sshKeyIds []int, ) (*ServerResponse, error)
func (*SSClient) CreateVolume ¶
func (c *SSClient) CreateVolume(serverID, name string, size int) (*TaskIDWrap, error)
func (*SSClient) CreateVolumeAndWait ¶
func (*SSClient) DeleteNetwork ¶
func (*SSClient) DeleteSSHKey ¶
func (*SSClient) DeleteServer ¶
func (*SSClient) DeleteVolume ¶
func (*SSClient) GetLocationList ¶
func (c *SSClient) GetLocationList() ([]*LocationEntity, error)
func (*SSClient) GetNetwork ¶
func (c *SSClient) GetNetwork(networkID string) (*NetworkResponse, error)
func (*SSClient) GetSnapshotList ¶
func (c *SSClient) GetSnapshotList(serverID string) ([]*SnapshotEntity, error)
func (*SSClient) GetVolume ¶
func (c *SSClient) GetVolume(serverID string, volumeID int) (*VolumeEntity, error)
func (*SSClient) UpdateNetwork ¶
func (c *SSClient) UpdateNetwork(networkID, name, description string) (*TaskIDWrap, error)
func (*SSClient) UpdateNetworkAndWait ¶
func (c *SSClient) UpdateNetworkAndWait(networkID, name, description string) (*NetworkResponse, error)
func (*SSClient) UpdatePublicNIC ¶
func (c *SSClient) UpdatePublicNIC(serverID string, nicID, bandwidth int) (*TaskIDWrap, error)
func (*SSClient) UpdatePublicNICAndWait ¶
func (*SSClient) UpdateServer ¶
func (*SSClient) UpdateServerAndWait ¶
func (*SSClient) UpdateVolume ¶
func (*SSClient) UpdateVolumeAndWait ¶
type SSHResponse ¶
type ServerResponse ¶
type ServerResponse struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` LocationID string `json:"location_id,omitempty"` State string `json:"state,omitempty"` CPU int `json:"cpu,omitempty"` RAM int `json:"ram_mb,omitempty"` Volumes []*VolumeEntity `json:"volumes,omitempty"` NICS []*NICEntity `json:"nics,omitempty"` SSHKeyIDS []int `json:"ssh_key_ids,omitempty"` }
type SnapshotEntity ¶
type SnapshotEntityWrap ¶
type SnapshotEntityWrap struct {
Snapshot *SnapshotEntity `json:"snapshot,omitempty"`
}
type TaskIDWrap ¶
type TaskIDWrap struct {
ID string `json:"task_id,omitempty"`
}
type TaskResponse ¶
type TaskResponse struct { ID string `json:"id,omitempty"` Created string `json:"created,omitempty"` Completed string `json:"completed,omitempty"` IsCompleted string `json:"is_completed,omitempty"` ServerID string `json:"server_id,omitempty"` LocationID string `json:"location_id,omitempty"` NetworkID string `json:"network_id,omitempty"` VolumeID int `json:"volume_id,omitempty"` NicID int `json:"nic_id,omitempty"` SnapshotID int `json:"snapshot_id,omitempty"` DomainID string `json:"domain_id,omitempty"` RecordID int `json:"record_id,omitempty"` }
type VolumeData ¶
type VolumeEntity ¶
type WrongKeyFormatError ¶
type WrongKeyFormatError struct {
BaseClientError
}
func NewWrongKeyFormatError ¶
func NewWrongKeyFormatError(err error) *WrongKeyFormatError
Click to show internal directories.
Click to hide internal directories.