Documentation ¶
Overview ¶
Package xelon provides a client for using the Xelon API.
Index ¶
- Variables
- func CheckResponse(resp *Response) error
- func Stringify(message interface{}) string
- type APIResponse
- type Client
- type ClientOption
- type Cloud
- type CloudsService
- type Device
- type DeviceCreateRequest
- type DeviceCreateResponse
- type DeviceCreationInfo
- type DeviceListOptions
- type DeviceLocalVMDetails
- type DeviceNetwork
- type DeviceRoot
- type DevicesService
- func (s *DevicesService) Create(ctx context.Context, createRequest *DeviceCreateRequest) (*DeviceCreateResponse, *Response, error)
- func (s *DevicesService) Delete(ctx context.Context, localVMID string) (*Response, error)
- func (s *DevicesService) Get(ctx context.Context, tenantID, localVMID string) (*DeviceRoot, *Response, error)
- func (s *DevicesService) GetDeviceCreationInfo(ctx context.Context, tenantID, deviceCategory, deviceType string, ...) (*DeviceCreationInfo, *Response, error)
- func (s *DevicesService) List(ctx context.Context, tenantID string, opts *DeviceListOptions) ([]DeviceLocalVMDetails, *Response, error)
- func (s *DevicesService) Start(ctx context.Context, localVMID string) (*Response, error)
- func (s *DevicesService) Stop(ctx context.Context, localVMID string) (*Response, error)
- type Error
- type ErrorElement
- type ErrorResponse
- type ErrorWrapper
- type IP
- type ListOptions
- type LoadBalancer
- type LoadBalancerCluster
- type LoadBalancerClusterCreateRequest
- type LoadBalancerClusterCreateResponse
- type LoadBalancerClusterForwardingRule
- type LoadBalancerClusterForwardingRuleConfiguration
- type LoadBalancerClusterNodesSpec
- type LoadBalancerClusterVirtualIP
- type LoadBalancerClustersService
- func (s *LoadBalancerClustersService) Create(ctx context.Context, createRequest *LoadBalancerClusterCreateRequest) (*LoadBalancerClusterCreateResponse, *Response, error)
- func (s *LoadBalancerClustersService) CreateForwardingRules(ctx context.Context, loadBalancerClusterID, virtualIPID string, ...) ([]LoadBalancerClusterForwardingRule, *Response, error)
- func (s *LoadBalancerClustersService) Delete(ctx context.Context, loadBalancerClusterID string) (*Response, error)
- func (s *LoadBalancerClustersService) DeleteForwardingRule(ctx context.Context, ...) (*Response, error)
- func (s *LoadBalancerClustersService) Get(ctx context.Context, loadBalancerClusterID string) (*LoadBalancerCluster, *Response, error)
- func (s *LoadBalancerClustersService) GetVirtualIP(ctx context.Context, loadBalancerClusterID, virtualIPID string) (*LoadBalancerClusterVirtualIP, *Response, error)
- func (s *LoadBalancerClustersService) List(ctx context.Context) ([]LoadBalancerCluster, *Response, error)
- func (s *LoadBalancerClustersService) ListForwardingRules(ctx context.Context, loadBalancerClusterID, virtualIPID string) ([]LoadBalancerClusterForwardingRule, *Response, error)
- func (s *LoadBalancerClustersService) ListVirtualIPs(ctx context.Context, loadBalancerClusterID string) ([]LoadBalancerClusterVirtualIP, *Response, error)
- func (s *LoadBalancerClustersService) UpdateForwardingRule(ctx context.Context, ...) (*APIResponse, *Response, error)
- type LoadBalancerCreateRequest
- type LoadBalancerForwardingRule
- type LoadBalancerHealthCheck
- type LoadBalancerUpdateForwardingRulesRequest
- type LoadBalancersService
- func (s *LoadBalancersService) Create(ctx context.Context, tenantID string, createRequest *LoadBalancerCreateRequest) (*APIResponse, *Response, error)
- func (s *LoadBalancersService) Delete(ctx context.Context, tenantID, localID string) (*Response, error)
- func (s *LoadBalancersService) Get(ctx context.Context, tenantID, localID string) (*LoadBalancer, *Response, error)
- func (s *LoadBalancersService) List(ctx context.Context, tenantID string) ([]LoadBalancer, *Response, error)
- func (s *LoadBalancersService) UpdateForwardingRules(ctx context.Context, tenantID, localID string, ...) (*APIResponse, *Response, error)
- type Meta
- type NIC
- type NICIP
- type NICNetwork
- type Network
- type NetworkAddIPRequest
- type NetworkDetails
- type NetworkInfo
- type NetworkLANCreateRequest
- type NetworkUpdateRequest
- type NetworksService
- func (s *NetworksService) AddIPAddress(ctx context.Context, networkID int, addIPRequest *NetworkAddIPRequest) (*APIResponse, *Response, error)
- func (s *NetworksService) CreateLAN(ctx context.Context, tenantID string, createRequest *NetworkLANCreateRequest) (*APIResponse, *Response, error)
- func (s *NetworksService) Delete(ctx context.Context, networkID int) (*Response, error)
- func (s *NetworksService) DeleteIPAddress(ctx context.Context, networkID, ipAddressID int) (*Response, error)
- func (s *NetworksService) Get(ctx context.Context, tenantID string, networkID int) (*NetworkInfo, *Response, error)
- func (s *NetworksService) List(ctx context.Context, tenantID string) ([]Network, *Response, error)
- func (s *NetworksService) Update(ctx context.Context, networkID int, updateRequest *NetworkUpdateRequest) (*APIResponse, *Response, error)
- type PersistentStorage
- type PersistentStorageAttachDetachRequest
- type PersistentStorageCreateRequest
- type PersistentStorageExtendRequest
- type PersistentStoragesService
- func (s *PersistentStoragesService) AttachToDevice(ctx context.Context, tenantID, localID string, ...) (*APIResponse, *Response, error)
- func (s *PersistentStoragesService) Create(ctx context.Context, tenantID string, ...) (*APIResponse, *Response, error)
- func (s *PersistentStoragesService) Delete(ctx context.Context, tenantID, localID string) (*Response, error)
- func (s *PersistentStoragesService) DetachFromDevice(ctx context.Context, tenantID, localID string, ...) (*APIResponse, *Response, error)
- func (s *PersistentStoragesService) Extend(ctx context.Context, localID string, ...) (*APIResponse, *Response, error)
- func (s *PersistentStoragesService) Get(ctx context.Context, tenantID, localID string) (*PersistentStorage, *Response, error)
- func (s *PersistentStoragesService) GetByName(ctx context.Context, tenantID, name string) (*PersistentStorage, *Response, error)
- func (s *PersistentStoragesService) List(ctx context.Context, tenantID string) ([]PersistentStorage, *Response, error)
- type Response
- type SSHKey
- type SSHKeyCreateRequest
- type SSHKeysService
- type Template
- type Templates
- type TemplatesService
- type Tenant
- type TenantsService
- type ToolsStatus
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmptyArgument = errors.New("xelon-sdk-go: argument cannot be empty") ErrEmptyPayloadNotAllowed = errors.New("xelon-sdk-go: empty payload is not allowed") )
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.
Types ¶
type APIResponse ¶
type APIResponse struct { Message string `json:"message,omitempty"` PersistentStorage *PersistentStorage `json:"persistentStorage,omitempty"` }
APIResponse is a generic Xelon API response.
type Client ¶
type Client struct { BaseURL *url.URL // Base URL for API requests. BaseURL should always be specified with a trailing slash. ClientID string // ClientID for IP ranges. UserAgent string // User agent used when communicating with Xelon API. Clouds *CloudsService Devices *DevicesService LoadBalancerClusters *LoadBalancerClustersService LoadBalancers *LoadBalancersService Networks *NetworksService PersistentStorages *PersistentStoragesService SSHKeys *SSHKeysService Templates *TemplatesService Tenants *TenantsService // contains filtered or unexported fields }
A Client manages communication with the Xelon API.
func NewClient ¶
func NewClient(token string, opts ...ClientOption) *Client
NewClient returns a new Xelon 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.
func (*Client) NewRequest ¶
NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.
func (*Client) SetBaseURL
deprecated
func (*Client) SetUserAgent
deprecated
type ClientOption ¶ added in v0.7.0
type ClientOption func(*Client)
func WithBaseURL ¶ added in v0.7.0
func WithBaseURL(baseURL string) ClientOption
WithBaseURL configures Client to use a specific API endpoint.
func WithClientID ¶ added in v0.8.0
func WithClientID(clientID string) ClientOption
WithClientID configures Client to use "X-User-Id" http header by all API requests.
func WithHTTPClient ¶ added in v0.7.0
func WithHTTPClient(httpClient *http.Client) ClientOption
WithHTTPClient configures Client to use a specific http client for communication.
func WithUserAgent ¶ added in v0.7.0
func WithUserAgent(ua string) ClientOption
WithUserAgent configures Client to use a specific user agent.
type CloudsService ¶ added in v0.12.0
type CloudsService service
CloudsService handles communication with the organization's cloud related methods of the Xelon API.
type Device ¶
type Device struct { CPU int `json:"cpu"` LocalVMDetails *DeviceLocalVMDetails `json:"localvmdetails,omitempty"` Networks []DeviceNetwork `json:"networks,omitempty"` PowerState bool `json:"powerstate"` RAM int `json:"ram"` }
Device represents a Xelon device.
type DeviceCreateRequest ¶ added in v0.8.0
type DeviceCreateRequest struct { CloudID int `json:"cloudId"` CPUCores int `json:"cpucores"` DiskSize int `json:"disksize"` DisplayName string `json:"displayname"` Hostname string `json:"hostname"` IPAddressID int `json:"ipaddr1"` Memory int `json:"memory"` NetworkID int `json:"networkid1"` NICControllerKey int `json:"niccontrollerkey1"` NICKey int `json:"nickey1"` NICNumber int `json:"nicnumber"` NICUnit int `json:"nicunit1"` Password string `json:"password"` PasswordConfirmation string `json:"password_confirmation"` SwapDiskSize int `json:"swapdisksize"` TemplateID int `json:"template"` TenantID string `json:"tenant_identifier"` }
type DeviceCreateResponse ¶ added in v0.8.0
type DeviceCreateResponse struct { LocalVMDetails *DeviceLocalVMDetails `json:"device,omitempty"` IPs []string `json:"ips,omitempty"` }
type DeviceCreationInfo ¶ added in v0.9.0
type DeviceListOptions ¶ added in v0.12.1
type DeviceListOptions struct {
ListOptions
}
type DeviceLocalVMDetails ¶ added in v0.8.0
type DeviceLocalVMDetails struct { CreatedAt string `json:"created_at,omitempty"` CPU int `json:"cpu,omitempty"` HVSystemID int `json:"hv_system_id,omitempty"` ISOMounted string `json:"iso_mounted,omitempty"` LocalVMID string `json:"localvmid,omitempty"` Memory int `json:"memory,omitempty"` State int `json:"state,omitempty"` TemplateID int `json:"template_id,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` UserID int `json:"user_id,omitempty"` VMDisplayName string `json:"vmdisplayname,omitempty"` VMHostname string `json:"vmhostname,omitempty"` }
DeviceLocalVMDetails represents a Xelon device's details.
type DeviceNetwork ¶ added in v0.8.0
type DeviceNetwork struct { IPAddress string `json:"ip,omitempty"` Label string `json:"label,omitempty"` MacAddress string `json:"macAddress,omitempty"` }
DeviceNetwork represents a Xelon device's network information.
type DeviceRoot ¶
type DeviceRoot struct { Device *Device `json:"device,omitempty"` ToolsStatus *ToolsStatus `json:"toolsStatus,omitempty"` }
DeviceRoot represents a Xelon device root object.
type DevicesService ¶
type DevicesService service
DevicesService handles communication with the devices related methods of the Xelon API.
func (*DevicesService) Create ¶ added in v0.8.0
func (s *DevicesService) Create(ctx context.Context, createRequest *DeviceCreateRequest) (*DeviceCreateResponse, *Response, error)
Create makes a new device with given payload.
func (*DevicesService) Get ¶
func (s *DevicesService) Get(ctx context.Context, tenantID, localVMID string) (*DeviceRoot, *Response, error)
Get provides detailed information for a device identified by tenant and localvmid.
func (*DevicesService) GetDeviceCreationInfo ¶ added in v0.9.0
func (s *DevicesService) GetDeviceCreationInfo(ctx context.Context, tenantID, deviceCategory, deviceType string, templateID int) (*DeviceCreationInfo, *Response, error)
GetDeviceCreationInfo retrieves a list of available templates, NICs, and scripts when creating a new device.
func (*DevicesService) List ¶ added in v0.12.1
func (s *DevicesService) List(ctx context.Context, tenantID string, opts *DeviceListOptions) ([]DeviceLocalVMDetails, *Response, error)
List provides a list of all devices.
type Error ¶ added in v0.6.0
Error represents an error object in Xelon business logic. It can be a string or array of validation messages.
type ErrorElement ¶
type ErrorElement struct { Code int `json:"code,omitempty"` Error ErrorWrapper `json:"error,omitempty"` }
func (ErrorElement) String ¶ added in v0.6.0
func (e ErrorElement) String() string
type ErrorResponse ¶
type ErrorResponse struct { Response *Response // HTTP response that caused this error. ErrorElement ErrorElement }
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type ErrorWrapper ¶ added in v0.6.0
ErrorWrapper wraps a Error object with additional functionality.
func (*ErrorWrapper) UnmarshalJSON ¶ added in v0.6.0
func (w *ErrorWrapper) UnmarshalJSON(data []byte) error
type ListOptions ¶ added in v0.12.1
type ListOptions struct { // Page of results to retrieve. Page int `url:"page,omitempty"` // PerPage specifies the number of results to include per page. PerPage int `url:"per_page,omitempty"` }
ListOptions specifies the optional parameters to various List methods that support pagination.
type LoadBalancer ¶
type LoadBalancer struct { ForwardingRules []LoadBalancerForwardingRule `json:"forwarding_rules,omitempty"` Health string `json:"health,omitempty"` HealthCheck LoadBalancerHealthCheck `json:"health_check,omitempty"` ID int `json:"id,omitempty"` InternalIP string `json:"internalIp,omitempty"` IP string `json:"ip,omitempty"` LocalID string `json:"local_id,omitempty"` Name string `json:"name,omitempty"` Type int `json:"type,omitempty"` }
LoadBalancer represents a Xelon load balancer.
type LoadBalancerCluster ¶ added in v0.13.0
type LoadBalancerCluster struct { Cloud *Cloud `json:"hv_system,omitempty"` ID string `json:"identifier,omitempty"` KubernetesClusterID string `json:"kubernetesClusterIdentifier,omitempty"` Name string `json:"name,omitempty"` Nodes []string `json:"nodes,omitempty"` Status string `json:"status,omitempty"` TenantID string `json:"tenantIdentifier,omitempty"` }
LoadBalancerCluster represents a Xelon load balancer cluster.
type LoadBalancerClusterCreateRequest ¶ added in v0.13.0
type LoadBalancerClusterCreateRequest struct { CloudID int `json:"cloudId"` KubernetesClusterIdentifier string `json:"kubernetesClusterIdentifier"` Name string `json:"name"` NodesSpec *LoadBalancerClusterNodesSpec `json:"nodesSpec"` }
type LoadBalancerClusterCreateResponse ¶ added in v0.13.0
type LoadBalancerClusterForwardingRule ¶ added in v0.13.0
type LoadBalancerClusterForwardingRule struct { Backend *LoadBalancerClusterForwardingRuleConfiguration `json:"backend,omitempty"` Frontend *LoadBalancerClusterForwardingRuleConfiguration `json:"frontend,omitempty"` }
type LoadBalancerClusterForwardingRuleConfiguration ¶ added in v0.13.0
type LoadBalancerClusterNodesSpec ¶ added in v0.13.0
type LoadBalancerClusterVirtualIP ¶ added in v0.13.0
type LoadBalancerClustersService ¶ added in v0.13.0
type LoadBalancerClustersService service
LoadBalancerClustersService handles communication with the load balancer cluster related methods of the Xelon API.
func (*LoadBalancerClustersService) Create ¶ added in v0.13.0
func (s *LoadBalancerClustersService) Create(ctx context.Context, createRequest *LoadBalancerClusterCreateRequest) (*LoadBalancerClusterCreateResponse, *Response, error)
Create makes a new load balancer cluster.
func (*LoadBalancerClustersService) CreateForwardingRules ¶ added in v0.13.0
func (s *LoadBalancerClustersService) CreateForwardingRules(ctx context.Context, loadBalancerClusterID, virtualIPID string, createRequest []LoadBalancerClusterForwardingRule) ([]LoadBalancerClusterForwardingRule, *Response, error)
CreateForwardingRules makes a new forwarding rule.
func (*LoadBalancerClustersService) Delete ¶ added in v0.13.0
func (s *LoadBalancerClustersService) Delete(ctx context.Context, loadBalancerClusterID string) (*Response, error)
Delete removes a load balancer.
func (*LoadBalancerClustersService) DeleteForwardingRule ¶ added in v0.13.1
func (s *LoadBalancerClustersService) DeleteForwardingRule(ctx context.Context, loadBalancerClusterID, virtualIPID, forwardingRuleID string) (*Response, error)
DeleteForwardingRule removes a forwarding rule.
func (*LoadBalancerClustersService) Get ¶ added in v0.13.0
func (s *LoadBalancerClustersService) Get(ctx context.Context, loadBalancerClusterID string) (*LoadBalancerCluster, *Response, error)
Get provides information about a load balancer cluster identified by id.
func (*LoadBalancerClustersService) GetVirtualIP ¶ added in v0.13.3
func (s *LoadBalancerClustersService) GetVirtualIP(ctx context.Context, loadBalancerClusterID, virtualIPID string) (*LoadBalancerClusterVirtualIP, *Response, error)
GetVirtualIP provides information about a virtual IP address identified by id.
func (*LoadBalancerClustersService) List ¶ added in v0.13.0
func (s *LoadBalancerClustersService) List(ctx context.Context) ([]LoadBalancerCluster, *Response, error)
List provides information about load balancer clusters.
func (*LoadBalancerClustersService) ListForwardingRules ¶ added in v0.13.0
func (s *LoadBalancerClustersService) ListForwardingRules(ctx context.Context, loadBalancerClusterID, virtualIPID string) ([]LoadBalancerClusterForwardingRule, *Response, error)
ListForwardingRules provides information about forwarding rules.
func (*LoadBalancerClustersService) ListVirtualIPs ¶ added in v0.13.0
func (s *LoadBalancerClustersService) ListVirtualIPs(ctx context.Context, loadBalancerClusterID string) ([]LoadBalancerClusterVirtualIP, *Response, error)
ListVirtualIPs provides information about virtual IP addresses.
func (*LoadBalancerClustersService) UpdateForwardingRule ¶ added in v0.13.1
func (s *LoadBalancerClustersService) UpdateForwardingRule(ctx context.Context, loadBalancerClusterID, virtualIPID, forwardingRuleID string, updateRequest *LoadBalancerClusterForwardingRuleConfiguration) (*APIResponse, *Response, error)
UpdateForwardingRule changes the configuration of a forwarding rule.
type LoadBalancerCreateRequest ¶
type LoadBalancerCreateRequest struct { CloudID string `json:"cloudId,omitempty"` ForwardingRules []LoadBalancerForwardingRule `json:"forwarding_rules,omitempty"` Name string `json:"name,omitempty"` ServerID []string `json:"server_id,omitempty"` Type int `json:"type,omitempty"` }
type LoadBalancerForwardingRule ¶
type LoadBalancerForwardingRule struct { ID int `json:"id,omitempty"` IP []string `json:"ip,omitempty"` Ports []int `json:"ports,omitempty"` Type string `json:"type,omitempty"` }
LoadBalancerForwardingRule represents a Xelon load balancer forwarding rule.
type LoadBalancerHealthCheck ¶
type LoadBalancerHealthCheck struct { BadThreshold int `json:"bad_threshold,omitempty"` GoodThreshold int `json:"good_threshold,omitempty"` Interval int `json:"interval,omitempty"` Path string `json:"path,omitempty"` Port int `json:"port,omitempty"` Timeout int `json:"timeout,omitempty"` }
LoadBalancerHealthCheck represents a Xelon load balancer health check.
type LoadBalancerUpdateForwardingRulesRequest ¶
type LoadBalancerUpdateForwardingRulesRequest struct {
ForwardingRules []LoadBalancerForwardingRule `json:"forwarding_rules,omitempty"`
}
type LoadBalancersService ¶
type LoadBalancersService service
LoadBalancersService handles communication with the load balancer related methods of the Xelon API.
func (*LoadBalancersService) Create ¶
func (s *LoadBalancersService) Create(ctx context.Context, tenantID string, createRequest *LoadBalancerCreateRequest) (*APIResponse, *Response, error)
Create makes a new load balancer with given payload.
func (*LoadBalancersService) Delete ¶
func (s *LoadBalancersService) Delete(ctx context.Context, tenantID, localID string) (*Response, error)
Delete removes a load balancer.
func (*LoadBalancersService) Get ¶
func (s *LoadBalancersService) Get(ctx context.Context, tenantID, localID string) (*LoadBalancer, *Response, error)
Get provides information about a load balancer identified by local id.
func (*LoadBalancersService) List ¶
func (s *LoadBalancersService) List(ctx context.Context, tenantID string) ([]LoadBalancer, *Response, error)
List provides information about load balancers.
func (*LoadBalancersService) UpdateForwardingRules ¶
func (s *LoadBalancersService) UpdateForwardingRules(ctx context.Context, tenantID, localID string, updateRequest *LoadBalancerUpdateForwardingRulesRequest) (*APIResponse, *Response, error)
type NIC ¶ added in v0.9.0
type NIC struct { ControllerKey int `json:"niccontrollerkey1,omitempty"` Key int `json:"nickey1,omitempty"` IPs map[string][]NICIP `json:"ips,omitempty"` Name string `json:"nicname,omitempty"` Networks []NICNetwork `json:"networks,omitempty"` Number int `json:"nicnumber,omitempty"` Unit int `json:"nicunit1,omitempty"` }
type NICNetwork ¶ added in v0.9.0
type NetworkAddIPRequest ¶ added in v0.11.0
type NetworkAddIPRequest struct {
IPAddress string `json:"ipaddress"`
}
type NetworkDetails ¶ added in v0.11.0
type NetworkDetails struct { Broadcast string `json:"broadcast,omitempty"` DefaultGateway string `json:"defgw,omitempty"` DNSPrimary string `json:"dns1,omitempty"` DNSSecondary string `json:"dns2,omitempty"` ID int `json:"id,omitempty"` HVSystemID int `json:"hv_system_id,omitempty"` Name string `json:"displayname,omitempty"` Netmask string `json:"netmask,omitempty"` Network string `json:"network,omitempty"` NetworkID int `json:"networkid,omitempty"` Subnet string `json:"subnet,omitempty"` Type string `json:"type,omitempty"` }
type NetworkInfo ¶ added in v0.11.0
type NetworkInfo struct { Details *NetworkDetails `json:"localnetid,omitempty"` IPs []IP `json:"getiplist,omitempty"` }
type NetworkLANCreateRequest ¶ added in v0.11.0
type NetworkLANCreateRequest struct { CloudID int `json:"cloudId"` DisplayName string `json:"displayname"` DNSPrimary string `json:"dns1"` DNSSecondary string `json:"dns2"` Gateway string `json:"gateway"` Network string `json:"network"` IPAddresses string `json:"ip_addresses,omitempty"` }
NetworkLANCreateRequest represents a request to create a LAN network.
IPAddresses is optional, can either be single "10.0.0.1" or multiple "10.0.0.1-10.0.0.254" entries.
type NetworkUpdateRequest ¶ added in v0.11.0
type NetworkUpdateRequest struct {
*NetworkDetails
}
NetworkUpdateRequest represents a request to update a network.
Following fields are mandatory:
- NetworkDetails.DefaultGateway
- NetworkDetails.DNSPrimary
- NetworkDetails.DNSSecondary
- NetworkDetails.Name
- NetworkDetails.Network
type NetworksService ¶ added in v0.11.0
type NetworksService service
NetworksService handles communication with the network related methods of the Xelon API.
func (*NetworksService) AddIPAddress ¶ added in v0.11.0
func (s *NetworksService) AddIPAddress(ctx context.Context, networkID int, addIPRequest *NetworkAddIPRequest) (*APIResponse, *Response, error)
AddIPAddress adds a new IP address to the specific network.
func (*NetworksService) CreateLAN ¶ added in v0.11.0
func (s *NetworksService) CreateLAN(ctx context.Context, tenantID string, createRequest *NetworkLANCreateRequest) (*APIResponse, *Response, error)
CreateLAN makes a new LAN network with given payload.
func (*NetworksService) DeleteIPAddress ¶ added in v0.11.0
func (s *NetworksService) DeleteIPAddress(ctx context.Context, networkID, ipAddressID int) (*Response, error)
DeleteIPAddress removes an IP from the specific network.
func (*NetworksService) Get ¶ added in v0.11.0
func (s *NetworksService) Get(ctx context.Context, tenantID string, networkID int) (*NetworkInfo, *Response, error)
Get provides information about a network identified by local id.
func (*NetworksService) Update ¶ added in v0.11.0
func (s *NetworksService) Update(ctx context.Context, networkID int, updateRequest *NetworkUpdateRequest) (*APIResponse, *Response, error)
Update changes the configuration of a network.
type PersistentStorage ¶
type PersistentStorage struct { AssignedServers []DeviceLocalVMDetails `json:"assigned_servers,omitempty"` Capacity int `json:"capacity,omitempty"` Formatted int `json:"formatted,omitempty"` ID int `json:"id,omitempty"` LocalID string `json:"local_id,omitempty"` Name string `json:"name,omitempty"` Type int `json:"type,omitempty"` UUID string `json:"uuid,omitempty"` }
type PersistentStorageAttachDetachRequest ¶
type PersistentStorageAttachDetachRequest struct {
ServerID []string `json:"server_id"`
}
type PersistentStorageCreateRequest ¶
type PersistentStorageCreateRequest struct { *PersistentStorage CloudID string `json:"cloudId,omitempty"` Size int `json:"size,omitempty"` }
type PersistentStorageExtendRequest ¶ added in v0.10.1
type PersistentStorageExtendRequest struct {
Size int `json:"size"`
}
type PersistentStoragesService ¶
type PersistentStoragesService service
PersistentStoragesService handles communication with the persistent storage related methods of the Xelon API.
func (*PersistentStoragesService) AttachToDevice ¶
func (s *PersistentStoragesService) AttachToDevice(ctx context.Context, tenantID, localID string, attachRequest *PersistentStorageAttachDetachRequest) (*APIResponse, *Response, error)
func (*PersistentStoragesService) Create ¶
func (s *PersistentStoragesService) Create(ctx context.Context, tenantID string, createRequest *PersistentStorageCreateRequest) (*APIResponse, *Response, error)
func (*PersistentStoragesService) DetachFromDevice ¶
func (s *PersistentStoragesService) DetachFromDevice(ctx context.Context, tenantID, localID string, detachRequest *PersistentStorageAttachDetachRequest) (*APIResponse, *Response, error)
func (*PersistentStoragesService) Extend ¶ added in v0.10.1
func (s *PersistentStoragesService) Extend(ctx context.Context, localID string, extendRequest *PersistentStorageExtendRequest) (*APIResponse, *Response, error)
func (*PersistentStoragesService) Get ¶
func (s *PersistentStoragesService) Get(ctx context.Context, tenantID, localID string) (*PersistentStorage, *Response, error)
func (*PersistentStoragesService) GetByName ¶ added in v0.5.0
func (s *PersistentStoragesService) GetByName(ctx context.Context, tenantID, name string) (*PersistentStorage, *Response, error)
func (*PersistentStoragesService) List ¶
func (s *PersistentStoragesService) List(ctx context.Context, tenantID string) ([]PersistentStorage, *Response, error)
type Response ¶ added in v0.5.0
type Response struct { *http.Response Meta *Meta // Meta describes generic information about the response. StackifyID string // StackifyID returned from the API, useful to contact support. }
Response is a Xelon response. This wraps the standard http.Response.
type SSHKey ¶ added in v0.5.0
type SSHKey struct { CreatedAt string `json:"created_at,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` PublicKey string `json:"ssh_key,omitempty"` }
SSHKey represents a Xelon ssh key.
type SSHKeyCreateRequest ¶ added in v0.5.0
type SSHKeyCreateRequest struct {
*SSHKey
}
SSHKeyCreateRequest represents a request to create a ssh key.
type SSHKeysService ¶ added in v0.5.0
type SSHKeysService service
SSHKeysService handles communication with the ssh keys related methods of the Xelon API.
func (*SSHKeysService) Create ¶ added in v0.5.0
func (s *SSHKeysService) Create(ctx context.Context, createRequest *SSHKeyCreateRequest) (*SSHKey, *Response, error)
Create makes a new ssh key with given payload.
type Template ¶ added in v0.9.0
type Template struct { Description string `json:"description,omitempty"` Category string `json:"category,omitempty"` Cloud *Cloud `json:"hv_system,omitempty"` ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` NICUnit int `json:"nicunit,omitempty"` TemplateType int `json:"templatetype,omitempty"` Type string `json:"type,omitempty"` }
type TemplatesService ¶ added in v0.9.0
type TemplatesService service
TemplatesService handles communication with the template related methods of the Xelon API.
type TenantsService ¶ added in v0.10.0
type TenantsService service
TenantsService handles communication with the user related methods of the Xelon API.
func (*TenantsService) GetCurrent ¶ added in v0.10.0
GetCurrent provides information about organization.
Note, after calling this method only TenantID field is filled.