Documentation
¶
Index ¶
- func CheckResponse(r *http.Response, data []byte) error
- func NewPurchasedVLanAttachRequest(network_adapter_id int, vlan_resource_id int) *purchasedVLANAttachRequest
- func WaitForServerCreationDone(client *Client, serverId int) error
- func WaitForServerStatus(client *Client, serverId int, status ServerStatus) error
- type ActiveJob
- type ArgError
- type CPUQuantity
- type Client
- type CloudServer
- type CloudServerActionsService
- type CloudServerActionsServiceOp
- func (s *CloudServerActionsServiceOp) Archive(serverId int) (*Response, error)
- func (s *CloudServerActionsServiceOp) PowerCycle(serverId int) (*Response, error)
- func (s *CloudServerActionsServiceOp) PowerOff(serverId int) (*Response, error)
- func (s *CloudServerActionsServiceOp) PowerOn(serverId int) (*Response, error)
- func (s *CloudServerActionsServiceOp) Reinitialize(serverReinitializeRequest *ServerReinitializeRequest) (*Response, error)
- func (s *CloudServerActionsServiceOp) Restore(serverId int, qpu_quantity int, ram_quantity int) (*Response, error)
- type CloudServerCreateVirtualDisk
- type CloudServerCreator
- type CloudServerDetails
- type CloudServerProCreator
- type CloudServerSmartSize
- type CloudServersService
- type CloudServersServiceOp
- func (s *CloudServersServiceOp) Create(requestCreator CloudServerCreator) (*CloudServer, *Response, error)
- func (s *CloudServersServiceOp) Delete(serverId int) (*Response, error)
- func (s *CloudServersServiceOp) Get(serverId int) (*CloudServerDetails, *Response, error)
- func (s *CloudServersServiceOp) List() ([]CloudServer, *Response, error)
- type DataCenterRegion
- type DataCentersService
- type DataCentersServiceOp
- type EasyCloudIPAddress
- type ErrorResponse
- type Hypervisor
- type HypervisorType
- type HypervisorsService
- type HypervisorsServiceOp
- type Interval
- type IpAddress
- type NetworkAdapter
- type NetworkAdapterCreateConfiguration
- type OSTemplate
- type OSTemplateDetails
- type PublicIpAddress
- type PurchasedIP
- type PurchasedIPsService
- type PurchasedIPsServiceOp
- type PurchasedIpRemoveRequest
- type PurchasedVLAN
- type RAMQuantity
- type RequestCompletionCallback
- type ResourceBounds
- type Response
- type ScheduledPlan
- type ScheduledTask
- type ScheduledTaskCreateRequest
- type ScheduledTaskIdCreate
- type ScheduledTaskType
- type ScheduledTaskUpdateRequest
- type ScheduledTasksService
- type ScheduledTasksServiceOp
- func (s ScheduledTasksServiceOp) Add() (*Response, error)
- func (s ScheduledTasksServiceOp) Delete(scheduledOperationId int) (*Response, error)
- func (s ScheduledTasksServiceOp) List(interval *Interval) ([]ScheduledTask, *Response, error)
- func (s ScheduledTasksServiceOp) Update(scheduledOperationId int) (*Response, error)
- type ServerIdCreate
- type ServerReinitializeRequest
- type ServerStatus
- type SnapshotsService
- type SnapshotsServiceOp
- type VLANsService
- type VLANsServiceOp
- func (s *VLANsServiceOp) Attach(attachRequest *purchasedVLANAttachRequest) (*PurchasedVLAN, *Response, error)
- func (s *VLANsServiceOp) Delete(vlan_resource_id int) (*Response, error)
- func (s *VLANsServiceOp) Detach(network_adapter_id int, vlan_resource_id int) (*Response, error)
- func (s *VLANsServiceOp) List() ([]PurchasedVLAN, *Response, error)
- func (s *VLANsServiceOp) Purchase(name string) (*PurchasedVLAN, *Response, error)
- type VirtualDatacenter
- type VirtualDisk
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored.
func NewPurchasedVLanAttachRequest ¶ added in v0.4.0
func WaitForServerCreationDone ¶ added in v0.4.0
func WaitForServerStatus ¶
func WaitForServerStatus(client *Client, serverId int, status ServerStatus) error
WaitForServerStatus waits for a cloud servers status
Types ¶
type ArgError ¶
type ArgError struct {
// contains filtered or unexported fields
}
ArgError is an error that represents an error with an input to goarubacloud. It identifies the argument and the cause (if possible).
func NewArgError ¶
NewArgError creates an InputError.
type CPUQuantity ¶
type Client ¶
type Client struct {
// Data center region
Datacenter DataCenterRegion
// Base URL for API requests.
BaseURL *url.URL
// Control panel username
Username string
// Control panel password
Password string
// User agent for client
UserAgent string
// Services used for communicating with the API
DataCenters DataCentersService
Hypervisors HypervisorsService
CloudServers CloudServersService
CloudServerActions CloudServerActionsService
ScheduledTasks ScheduledTasksService
Snapshots SnapshotsService
PurchasedIPs PurchasedIPsService
VLANs VLANsService
// contains filtered or unexported fields
}
Client manages communication with Arubacloud API.
func NewClient ¶
func NewClient(datacenter DataCenterRegion, username, password string) *Client
NewClient returns a new Arubacloud API client.
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.
func (*Client) NewRequest ¶
NewRequest creates an API request
func (*Client) OnRequestCompleted ¶
func (c *Client) OnRequestCompleted(rc RequestCompletionCallback)
OnRequestCompleted sets the API request completion callback
type CloudServer ¶
type CloudServer struct {
Busy bool
CPUQuantity int
CompanyId int
DatacenterId DataCenterRegion
HDQuantity int
HDTotalSize int
HypervisorServerType int
HypervisorType HypervisorType
Name string
OSTemplateId int
RAMQuantity int
ServerId int
ServerStatus ServerStatus
UserId int
}
CloudServer represents a Arubacloud Cloud Server
func WaitForServerWithName ¶ added in v0.3.0
func WaitForServerWithName(client *Client, serverName string) (*CloudServer, error)
WaitForServerWithName waits for a server with specified name appears in the list
type CloudServerActionsService ¶
type CloudServerActionsService interface {
PowerOff(int) (*Response, error)
PowerOn(int) (*Response, error)
PowerCycle(int) (*Response, error)
Archive(int) (*Response, error)
Restore(serverId int, CPUQuantity int, RAMQuantity int) (*Response, error)
Reinitialize(*ServerReinitializeRequest) (*Response, error)
}
CloudServerActionsService is an interface for interfacing with the Cloud Server actions endpoints of the Arubacloud API
type CloudServerActionsServiceOp ¶
type CloudServerActionsServiceOp struct {
// contains filtered or unexported fields
}
CloudServerActionsServiceOp handles communication with the Cloud Server action related methods of the Arubacloud API.
func (*CloudServerActionsServiceOp) Archive ¶
func (s *CloudServerActionsServiceOp) Archive(serverId int) (*Response, error)
Archive Cloud Server
func (*CloudServerActionsServiceOp) PowerCycle ¶
func (s *CloudServerActionsServiceOp) PowerCycle(serverId int) (*Response, error)
PowerCycle a Cloud Server
func (*CloudServerActionsServiceOp) PowerOff ¶
func (s *CloudServerActionsServiceOp) PowerOff(serverId int) (*Response, error)
PowerOff a Cloud Server
func (*CloudServerActionsServiceOp) PowerOn ¶
func (s *CloudServerActionsServiceOp) PowerOn(serverId int) (*Response, error)
PowerOn a Cloud Server
func (*CloudServerActionsServiceOp) Reinitialize ¶
func (s *CloudServerActionsServiceOp) Reinitialize(serverReinitializeRequest *ServerReinitializeRequest) (*Response, error)
Restore Cloud Server
type CloudServerCreateVirtualDisk ¶
CloudServerCreateVirtualDisk identifies a VirtualDisk to attach for the create request.
type CloudServerCreator ¶ added in v0.3.0
type CloudServerCreator interface {
GetServerName() string
GetRequest() interface{}
SetNote(string) error
}
func NewCloudServerSmartCreateRequest ¶ added in v0.3.0
func NewCloudServerSmartCreateRequest(smart_server_size CloudServerSmartSize, name string, admin_password string, os_template_id int) CloudServerCreator
type CloudServerDetails ¶
type CloudServerDetails struct {
ActiveJobs []ActiveJob
CPUQuantity CPUQuantity
CompanyId int
ControlToolActivationDate string
ControlToolInstalled bool
CreationDate string
DatacenterId DataCenterRegion
EasyCloudIPAddress EasyCloudIPAddress
EasyCloudPackageID int
HypervisorServerType int
HypervisorType HypervisorType
Name string
NetworkAdapters []NetworkAdapter
Note string
OSTemplate OSTemplateDetails
Parameters []interface{}
RAMQuantity RAMQuantity
RenewDateSmart string
ScheduledOperations []ScheduledTask
ServerId int
ServerStatus ServerStatus
Snapshots []interface{}
ToolsAvailable bool
UserId int
VirtualDVDs []interface{}
VirtualDisks []VirtualDisk
VncPort int
}
func (*CloudServerDetails) GetPublicIpAddress ¶ added in v0.3.1
func (s *CloudServerDetails) GetPublicIpAddress() (string, error)
type CloudServerProCreator ¶ added in v0.3.0
type CloudServerProCreator interface {
AddVirtualDisk(int) error
AddPublicIp(int) error
SetCPUQuantity(int) error
SetRAMQuantity(int) error
SetNote(string) error
GetServerName() string
GetRequest() interface{}
}
func NewCloudServerProCreateRequest ¶ added in v0.3.0
func NewCloudServerProCreateRequest(name string, admin_password string, os_template_id int) CloudServerProCreator
type CloudServerSmartSize ¶ added in v0.4.0
type CloudServerSmartSize int
const ( SMALL CloudServerSmartSize = 1 + iota MEDIUM LARGE EXTRALARGE )
func GetServerSmartSize ¶ added in v0.4.0
func GetServerSmartSize(size string) (CloudServerSmartSize, error)
type CloudServersService ¶
type CloudServersService interface {
List() ([]CloudServer, *Response, error)
Get(int) (*CloudServerDetails, *Response, error)
Create(CloudServerCreator) (*CloudServer, *Response, error)
Delete(int) (*Response, error)
}
CloudServersService is an interface for interfacing with the Cloud Server endpoints of the Arubacloud API
type CloudServersServiceOp ¶
type CloudServersServiceOp struct {
// contains filtered or unexported fields
}
CloudServersServiceOp handles communication with the Cloud Server related methods of the Arubacloud API.
func (*CloudServersServiceOp) Create ¶
func (s *CloudServersServiceOp) Create(requestCreator CloudServerCreator) (*CloudServer, *Response, error)
Create cloudServer
func (*CloudServersServiceOp) Delete ¶
func (s *CloudServersServiceOp) Delete(serverId int) (*Response, error)
Delete CloudServer
func (*CloudServersServiceOp) Get ¶
func (s *CloudServersServiceOp) Get(serverId int) (*CloudServerDetails, *Response, error)
Get individual CloudServer
func (*CloudServersServiceOp) List ¶
func (s *CloudServersServiceOp) List() ([]CloudServer, *Response, error)
List all CloudServers
type DataCenterRegion ¶
type DataCenterRegion int
const ( Italy_1 DataCenterRegion = 1 + iota Italy_2 Czech_Republic France Germany UK )
func (DataCenterRegion) String ¶
func (m DataCenterRegion) String() string
String returns the name of the Datacenter.
type DataCentersService ¶
type DataCentersServiceOp ¶
type DataCentersServiceOp struct {
// contains filtered or unexported fields
}
func (*DataCentersServiceOp) GetJobs ¶
func (s *DataCentersServiceOp) GetJobs() ([]ActiveJob, *Response, error)
Get active jobs
func (*DataCentersServiceOp) GetVirtualDatacenter ¶
func (s *DataCentersServiceOp) GetVirtualDatacenter() (*VirtualDatacenter, *Response, error)
Get info about used services in the datacenter
type EasyCloudIPAddress ¶
type ErrorResponse ¶
type ErrorResponse struct {
Success bool
// HTTP response that caused this error
Response *http.Response
// Error message
Message string `json:"ResultMessage"`
// ResultCode returned from the API
ResultCode int `json:"ResultCode"`
}
An ErrorResponse reports the error caused by an API request
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type Hypervisor ¶
type Hypervisor struct {
HypervisorServerType int
HypervisorType HypervisorType
Templates []OSTemplate `json:"Templates"`
}
type HypervisorType ¶
type HypervisorType int
const ( Microsoft_Hyper_V HypervisorType = 1 + iota VMWare_Cloud_Pro Microsoft_Hyper_V_Low_Cost VMWare_Cloud_Smart )
func (HypervisorType) String ¶
func (m HypervisorType) String() string
String returns the name of the Hypervisor.
type HypervisorsService ¶ added in v0.2.0
type HypervisorsService interface {
GetHypervisors() ([]Hypervisor, *Response, error)
FindOsTemplate(HypervisorType, string) (*OSTemplate, error)
}
HypervisorsService is an interface for interfacing with the Hypervisors endpoints of the Arubacloud API
type HypervisorsServiceOp ¶ added in v0.2.0
type HypervisorsServiceOp struct {
// contains filtered or unexported fields
}
HypervisorsServiceOp handles communication with the Hypervisor related methods of the Arubacloud API.
func (*HypervisorsServiceOp) FindOsTemplate ¶ added in v0.2.0
func (s *HypervisorsServiceOp) FindOsTemplate(hypervisorType HypervisorType, name string) (*OSTemplate, error)
func (*HypervisorsServiceOp) GetHypervisors ¶ added in v0.2.0
func (s *HypervisorsServiceOp) GetHypervisors() ([]Hypervisor, *Response, error)
type NetworkAdapter ¶
type NetworkAdapter struct {
Id int
NetworkAdapterType int
IPAddresses []IpAddress
PublicIpAddresses []PublicIpAddress
MacAddress string
ServerId int
VLan PurchasedVLAN
}
type NetworkAdapterCreateConfiguration ¶ added in v0.3.1
type NetworkAdapterCreateConfiguration struct {
NetworkAdapterType int
PublicIpAddresses []PublicIpAddress
}
type OSTemplate ¶
type OSTemplate struct {
ApplianceType int
ArchitectureType int
CompanyID int
CompatiblePreConfiguredPackages []interface{}
Description string
Enabled bool
ExportEnabled bool
FeatureTypes []interface{}
Icon interface{}
Id int
IdentificationCode string
Ipv6Compatible bool
Name string
OSFamily int
OSVersion string
OwnerUserId string
ParentTemplateID int
ProductId int
ResourceBounds []ResourceBounds
Revision string
SshKeyInitializationSupported bool
TemplateExtendedDescription string
TemplateOwnershipType int
TemplatePassword string
TemplateSellingStatus int
TemplateStatus interface{}
TemplateType int
TemplateUsername string
ToolsAvailable bool
}
type OSTemplateDetails ¶
type PublicIpAddress ¶
type PurchasedIP ¶
type PurchasedIP struct {
Value string
SubNetMask string
Gateway string
GatewayIPv6 string
PrefixIPv6 int
SubnetPrefixIPv6 string
StartRangeIPv6 string
EndRangeIPv6 string
ServerId int
UserId int
CompanyId int
ProductId int
ResourceId int
ResourceType int
LoadBalancerID interface{}
}
PurchasedIP represents an Arubacloud purchased IP.
type PurchasedIPsService ¶
type PurchasedIPsService interface {
List() ([]PurchasedIP, *Response, error)
Purchase() (*PurchasedIP, *Response, error)
Delete(int) (*Response, error)
}
type PurchasedIPsServiceOp ¶
type PurchasedIPsServiceOp struct {
// contains filtered or unexported fields
}
PurchasedIPsServiceOp handles communication with the purchased IPs related methods of the Arubacloud API.
func (*PurchasedIPsServiceOp) Delete ¶
func (s *PurchasedIPsServiceOp) Delete(IpAddressResourceId int) (*Response, error)
Delete purchased IP.
func (*PurchasedIPsServiceOp) List ¶
func (s *PurchasedIPsServiceOp) List() ([]PurchasedIP, *Response, error)
List all purchased IPs.
func (*PurchasedIPsServiceOp) Purchase ¶
func (s *PurchasedIPsServiceOp) Purchase() (*PurchasedIP, *Response, error)
Purchase a new IP.
type PurchasedIpRemoveRequest ¶
type PurchasedIpRemoveRequest struct {
IpAddressResourceId int
}
type PurchasedVLAN ¶
type RAMQuantity ¶
type RequestCompletionCallback ¶
RequestCompletionCallback defines the type of the request callback function
type Response ¶
Response is a Arubacloud API response. This wraps the standard http.Response returned from Arubacloud.
type ScheduledPlan ¶
type ScheduledPlan struct {
FirstExecutionTime string
LastExecutionTime string
ScheduleDaysOfMonth interface{}
ScheduleEndDateTime interface{}
ScheduleFrequency interface{}
ScheduleFrequencyType int
ScheduleOperationLabel string
ScheduleStartDateTime string
ScheduleWeekDays []interface{}
ScheduledMontlyRecurrence interface{}
ScheduledOwnerType int
ScheduledPlanId int
ScheduledPlanStatus int
}
type ScheduledTask ¶
type ScheduledTask struct {
ServerId int
ServerName string
OperationType ScheduledTaskType
OperationParameter []interface{}
ScheduledOperationID int
ScheduledPlan ScheduledPlan
}
type ScheduledTaskIdCreate ¶
type ScheduledTaskIdCreate struct {
ScheduledOperationId int
}
type ScheduledTaskType ¶
type ScheduledTaskType int
const ( SWITCH_ON ScheduledTaskType = 2 FORCE_SHUTDOWN ScheduledTaskType = 3 SWITCH_OFF ScheduledTaskType = 25 CREATE_SNAPSHOT ScheduledTaskType = 27 RESTORE_SNAPSHOT ScheduledTaskType = 28 DELETE_SNAPSHOT ScheduledTaskType = 29 )
func (ScheduledTaskType) String ¶
func (m ScheduledTaskType) String() string
String returns the name of the Datacenter.
type ScheduledTaskUpdateRequest ¶
type ScheduledTaskUpdateRequest struct {
SetUpdateServerScheduledOperation ScheduledTaskIdCreate `json:"SetUpdateServerScheduledOperation"`
}
type ScheduledTasksService ¶
type ScheduledTasksService interface {
List(*Interval) ([]ScheduledTask, *Response, error)
Add() (*Response, error)
Update(int) (*Response, error)
Delete(int) (*Response, error)
}
ScheduledTasksService is an interface for interfacing with the cloud server actions endpoints of the Arubacloud API
type ScheduledTasksServiceOp ¶
type ScheduledTasksServiceOp struct {
// contains filtered or unexported fields
}
ScheduledTasksServiceOp handles communication with the cloud server action related methods of the Arubacloud API.
func (ScheduledTasksServiceOp) Add ¶
func (s ScheduledTasksServiceOp) Add() (*Response, error)
func (ScheduledTasksServiceOp) Delete ¶
func (s ScheduledTasksServiceOp) Delete(scheduledOperationId int) (*Response, error)
func (ScheduledTasksServiceOp) List ¶
func (s ScheduledTasksServiceOp) List(interval *Interval) ([]ScheduledTask, *Response, error)
type ServerIdCreate ¶
type ServerStatus ¶
type ServerStatus int
const ( CREATION_IN_PROGRESS ServerStatus = 1 + iota OFF ON )
func (ServerStatus) String ¶
func (m ServerStatus) String() string
String returns the name of the Datacenter.
type SnapshotsService ¶
type SnapshotsService interface {
Create(int) (*Response, error)
Restore(int) (*Response, error)
Delete(int) (*Response, error)
}
SnapshotsService is an interface for interfacing with the cloud server actions endpoints of the Arubacloud API
type SnapshotsServiceOp ¶
type SnapshotsServiceOp struct {
// contains filtered or unexported fields
}
SnapshotsServiceOp handles communication with the cloud server action related methods of the Arubacloud API.
func (*SnapshotsServiceOp) Create ¶
func (s *SnapshotsServiceOp) Create(serverId int) (*Response, error)
type VLANsService ¶
type VLANsService interface {
List() ([]PurchasedVLAN, *Response, error)
Purchase(name string) (*PurchasedVLAN, *Response, error)
Delete(vlan_resource_id int) (*Response, error)
Attach(attachRequest *purchasedVLANAttachRequest) (*PurchasedVLAN, *Response, error)
Detach(network_adapter_id int, vlan_resource_id int) (*Response, error)
}
VLANsService is an interface for interfacing with the purchased VLANs endpoint of the Arubacloud API
type VLANsServiceOp ¶
type VLANsServiceOp struct {
// contains filtered or unexported fields
}
VLANsServiceOp handles communication with the purchased VLANs related methods of the Arubacloud API.
func (*VLANsServiceOp) Attach ¶
func (s *VLANsServiceOp) Attach(attachRequest *purchasedVLANAttachRequest) (*PurchasedVLAN, *Response, error)
func (*VLANsServiceOp) Delete ¶
func (s *VLANsServiceOp) Delete(vlan_resource_id int) (*Response, error)
func (*VLANsServiceOp) Detach ¶
func (s *VLANsServiceOp) Detach(network_adapter_id int, vlan_resource_id int) (*Response, error)
func (*VLANsServiceOp) List ¶
func (s *VLANsServiceOp) List() ([]PurchasedVLAN, *Response, error)
List all purchased VLANs.
func (*VLANsServiceOp) Purchase ¶
func (s *VLANsServiceOp) Purchase(name string) (*PurchasedVLAN, *Response, error)
type VirtualDatacenter ¶
type VirtualDatacenter struct {
CustomProductEntities []interface{}
DatacenterRegion DataCenterRegion `json:"DatacenterId"`
FTP interface{}
IpAddresses []interface{}
LoadBalancers []interface{}
PleskLicenses []interface{}
PrivateCloudEntities []interface{}
PublicIpAddresses []interface{}
Servers []CloudServerDetails
VLans []interface{}
}