Documentation ¶
Index ¶
- Constants
- Variables
- func Bool2Pointer(input bool) *bool
- func Int2Pointer(input int) *int
- func SetBaseUrl(newbaseurl string) string
- func SetToken(newtoken string) string
- type API
- func (api *API) AddBlockStorageServer(blockStorageId string, serverId string) (*BlockStorage, error)
- func (api *API) AddFirewallPolicyRules(fp_id string, fp_rules []FirewallPolicyRule) (*FirewallPolicy, error)
- func (api *API) AddFirewallPolicyServerIps(fp_id string, ip_ids []string) (*FirewallPolicy, error)
- func (api *API) AddLoadBalancerRules(lb_id string, lb_rules []LoadBalancerRule) (*LoadBalancer, error)
- func (api *API) AddLoadBalancerServerIps(lb_id string, ip_ids []string) (*LoadBalancer, error)
- func (api *API) AddMonitoringPolicyPorts(mp_id string, mp_ports []MonitoringPort) (*MonitoringPolicy, error)
- func (api *API) AddMonitoringPolicyProcesses(mp_id string, mp_procs []MonitoringProcess) (*MonitoringPolicy, error)
- func (api *API) AddServerHdds(server_id string, hdds *ServerHdds) (*Server, error)
- func (api *API) AddSharedStorageServers(st_id string, servers []SharedStorageServer) (*SharedStorage, error)
- func (api *API) AddUserApiAlowedIps(user_id string, ips []string) (*User, error)
- func (api *API) AssignRoleUsers(role_id string, user_ids []string) (*Role, error)
- func (api *API) AssignServerIp(server_id string, ip_type string) (*Server, error)
- func (api *API) AssignServerIpFirewallPolicy(server_id string, ip_id string, fp_id string) (*Server, error)
- func (api *API) AssignServerIpLoadBalancer(server_id string, ip_id string, lb_id string) (*Server, error)
- func (api *API) AssignServerPrivateNetwork(server_id string, pn_id string) (*Server, error)
- func (api *API) AttachMonitoringPolicyServers(mp_id string, sids []string) (*MonitoringPolicy, error)
- func (api *API) AttachPrivateNetworkServers(pn_id string, sids []string) (*PrivateNetwork, error)
- func (api *API) CloneRole(role_id string, name string) (*Role, error)
- func (api *API) CloneServer(server_id string, new_name string, datacenter_id string) (*Server, error)
- func (api *API) CreateBlockStorage(request *BlockStorageRequest) (string, *BlockStorage, error)
- func (api *API) CreateFirewallPolicy(fp_data *FirewallPolicyRequest) (string, *FirewallPolicy, error)
- func (api *API) CreateImage(request *ImageRequest) (string, *Image, error)
- func (api *API) CreateLoadBalancer(request *LoadBalancerRequest) (string, *LoadBalancer, error)
- func (api *API) CreateMonitoringPolicy(mp *MonitoringPolicy) (string, *MonitoringPolicy, error)
- func (api *API) CreatePrivateNetwork(request *PrivateNetworkRequest) (string, *PrivateNetwork, error)
- func (api *API) CreatePublicIp(ip_type string, reverse_dns string, datacenter_id string) (string, *PublicIp, error)
- func (api *API) CreateRole(name string) (string, *Role, error)
- func (api *API) CreateSSHKey(request *SSHKeyRequest) (string, *SSHKey, error)
- func (api *API) CreateServer(request *ServerRequest) (string, *Server, error)
- func (api *API) CreateServerEx(request *ServerRequest, timeout int) (string, string, error)
- func (api *API) CreateServerSnapshot(server_id string) (*Server, error)
- func (api *API) CreateSharedStorage(request *SharedStorageRequest) (string, *SharedStorage, error)
- func (api *API) CreateUser(user *UserRequest) (string, *User, error)
- func (api *API) CreateVPN(name string, description string, datacenter_id string) (string, *VPN, error)
- func (api *API) DeleteBlockStorage(id string) (*BlockStorage, error)
- func (api *API) DeleteFirewallPolicy(fp_id string) (*FirewallPolicy, error)
- func (api *API) DeleteFirewallPolicyRule(fp_id string, rule_id string) (*FirewallPolicy, error)
- func (api *API) DeleteImage(img_id string) (*Image, error)
- func (api *API) DeleteLoadBalancer(lb_id string) (*LoadBalancer, error)
- func (api *API) DeleteLoadBalancerRule(lb_id string, rule_id string) (*LoadBalancer, error)
- func (api *API) DeleteLoadBalancerServerIp(lb_id string, ip_id string) (*LoadBalancer, error)
- func (api *API) DeleteMonitoringPolicy(mp_id string) (*MonitoringPolicy, error)
- func (api *API) DeleteMonitoringPolicyPort(mp_id string, port_id string) (*MonitoringPolicy, error)
- func (api *API) DeleteMonitoringPolicyProcess(mp_id string, proc_id string) (*MonitoringPolicy, error)
- func (api *API) DeletePrivateNetwork(pn_id string) (*PrivateNetwork, error)
- func (api *API) DeletePublicIp(ip_id string) (*PublicIp, error)
- func (api *API) DeleteRole(role_id string) (*Role, error)
- func (api *API) DeleteSSHKey(id string) (*SSHKey, error)
- func (api *API) DeleteServer(server_id string, args ...interface{}) (*Server, error)
- func (api *API) DeleteServerHdd(server_id string, hdd_id string) (*Server, error)
- func (api *API) DeleteServerIp(server_id string, ip_id string, keep_ip bool) (*Server, error)
- func (api *API) DeleteServerSnapshot(server_id string, snapshot_id string) (*Server, error)
- func (api *API) DeleteSharedStorage(ss_id string) (*SharedStorage, error)
- func (api *API) DeleteSharedStorageServer(st_id string, ser_id string) (*SharedStorage, error)
- func (api *API) DeleteUser(user_id string) (*User, error)
- func (api *API) DeleteVPN(vpn_id string) (*VPN, error)
- func (api *API) DetachPrivateNetworkServer(pn_id string, pns_id string) (*PrivateNetwork, error)
- func (api *API) EjectServerDvd(server_id string) (*Server, error)
- func (api *API) GetBaremetalModel(bm_id string) (*BaremetalModel, error)
- func (api *API) GetBlockStorage(id string) (*BlockStorage, error)
- func (api *API) GetBlockStorageServer(id string) (*BlockStorageServer, error)
- func (api *API) GetCurrentUserPermissions() (*Permissions, error)
- func (api *API) GetDatacenter(dc_id string) (*Datacenter, error)
- func (api *API) GetDvdIso(dvd_id string) (*DvdIso, error)
- func (api *API) GetFirewallPolicy(fp_id string) (*FirewallPolicy, error)
- func (api *API) GetFirewallPolicyRule(fp_id string, rule_id string) (*FirewallPolicyRule, error)
- func (api *API) GetFirewallPolicyServerIp(fp_id string, ip_id string) (*ServerIpInfo, error)
- func (api *API) GetFixedInstanceSize(fis_id string) (*FixedInstanceInfo, error)
- func (api *API) GetImage(img_id string) (*Image, error)
- func (api *API) GetLoadBalancer(lb_id string) (*LoadBalancer, error)
- func (api *API) GetLoadBalancerRule(lb_id string, rule_id string) (*LoadBalancerRule, error)
- func (api *API) GetLoadBalancerServerIp(lb_id string, ip_id string) (*ServerIpInfo, error)
- func (api *API) GetLog(log_id string) (*Log, error)
- func (api *API) GetMonitoringPolicy(mp_id string) (*MonitoringPolicy, error)
- func (api *API) GetMonitoringPolicyPort(mp_id string, port_id string) (*MonitoringPort, error)
- func (api *API) GetMonitoringPolicyProcess(mp_id string, proc_id string) (*MonitoringProcess, error)
- func (api *API) GetMonitoringPolicyServer(mp_id string, ser_id string) (*Identity, error)
- func (api *API) GetMonitoringServerUsage(ser_id string, period string, dates ...time.Time) (*MonServerUsageDetails, error)
- func (api *API) GetPricing() (*Pricing, error)
- func (api *API) GetPrivateNetwork(pn_id string) (*PrivateNetwork, error)
- func (api *API) GetPrivateNetworkServer(pn_id string, server_id string) (*Identity, error)
- func (api *API) GetPublicIp(ip_id string) (*PublicIp, error)
- func (api *API) GetRecoveryAppliance(ra_id string) (*SingleRecoveryAppliance, error)
- func (api *API) GetRole(role_id string) (*Role, error)
- func (api *API) GetRolePermissions(role_id string) (*Permissions, error)
- func (api *API) GetRoleUser(role_id string, user_id string) (*Identity, error)
- func (api *API) GetSSHKey(id string) (*SSHKey, error)
- func (api *API) GetServer(server_id string) (*Server, error)
- func (api *API) GetServerAppliance(sa_id string) (*ServerAppliance, error)
- func (api *API) GetServerDvd(server_id string) (*Identity, error)
- func (api *API) GetServerHardware(server_id string) (*Hardware, error)
- func (api *API) GetServerHdd(server_id string, hdd_id string) (*Hdd, error)
- func (api *API) GetServerImage(server_id string) (*Identity, error)
- func (api *API) GetServerIp(server_id string, ip_id string) (*ServerIp, error)
- func (api *API) GetServerIpFirewallPolicy(server_id string, ip_id string) (*Identity, error)
- func (api *API) GetServerPrivateNetwork(server_id string, pn_id string) (*PrivateNetwork, error)
- func (api *API) GetServerSnapshot(server_id string) (*ServerSnapshot, error)
- func (api *API) GetServerStatus(server_id string) (*Status, error)
- func (api *API) GetSharedStorage(ss_id string) (*SharedStorage, error)
- func (api *API) GetSharedStorageCredentials() ([]SharedStorageAccess, error)
- func (api *API) GetSharedStorageServer(st_id string, ser_id string) (*SharedStorageServer, error)
- func (api *API) GetUser(user_id string) (*User, error)
- func (api *API) GetUserApi(user_id string) (*UserApi, error)
- func (api *API) GetUserApiKey(user_id string) (*UserApiKey, error)
- func (api *API) GetVPN(vpn_id string) (*VPN, error)
- func (api *API) GetVPNConfigFile(filepath string, vpn_id string) (string, error)
- func (api *API) ListBaremetalModels() ([]BaremetalModel, error)
- func (api *API) ListBlockStorages(args ...interface{}) ([]BlockStorage, error)
- func (api *API) ListDatacenters(args ...interface{}) ([]Datacenter, error)
- func (api *API) ListDvdIsos(args ...interface{}) ([]DvdIso, error)
- func (api *API) ListFirewallPolicies(args ...interface{}) ([]FirewallPolicy, error)
- func (api *API) ListFirewallPolicyRules(fp_id string) ([]FirewallPolicyRule, error)
- func (api *API) ListFirewallPolicyServerIps(fp_id string) ([]ServerIpInfo, error)
- func (api *API) ListFixedInstanceSizes() ([]FixedInstanceInfo, error)
- func (api *API) ListImageOs(args ...interface{}) ([]ImageOs, error)
- func (api *API) ListImages(args ...interface{}) ([]Image, error)
- func (api *API) ListLoadBalancerRules(lb_id string) ([]LoadBalancerRule, error)
- func (api *API) ListLoadBalancerServerIps(lb_id string) ([]ServerIpInfo, error)
- func (api *API) ListLoadBalancers(args ...interface{}) ([]LoadBalancer, error)
- func (api *API) ListLogs(period string, sd *time.Time, ed *time.Time, args ...interface{}) ([]Log, error)
- func (api *API) ListMonitoringPolicies(args ...interface{}) ([]MonitoringPolicy, error)
- func (api *API) ListMonitoringPolicyPorts(mp_id string) ([]MonitoringPort, error)
- func (api *API) ListMonitoringPolicyProcesses(mp_id string) ([]MonitoringProcess, error)
- func (api *API) ListMonitoringPolicyServers(mp_id string) ([]Identity, error)
- func (api *API) ListMonitoringServersUsages(args ...interface{}) ([]MonServerUsageSummary, error)
- func (api *API) ListPrivateNetworkServers(pn_id string) ([]Identity, error)
- func (api *API) ListPrivateNetworks(args ...interface{}) ([]PrivateNetwork, error)
- func (api *API) ListPublicIps(args ...interface{}) ([]PublicIp, error)
- func (api *API) ListRecoveryAppliances(args ...interface{}) ([]RecoveryAppliance, error)
- func (api *API) ListRoleUsers(role_id string) ([]Identity, error)
- func (api *API) ListRoles(args ...interface{}) ([]Role, error)
- func (api *API) ListSSHKeys(args ...interface{}) ([]SSHKey, error)
- func (api *API) ListServerAppliances(args ...interface{}) ([]ServerAppliance, error)
- func (api *API) ListServerHdds(server_id string) ([]Hdd, error)
- func (api *API) ListServerIpLoadBalancers(server_id string, ip_id string) ([]Identity, error)
- func (api *API) ListServerIps(server_id string) ([]ServerIp, error)
- func (api *API) ListServerPrivateNetworks(server_id string) ([]Identity, error)
- func (api *API) ListServers(args ...interface{}) ([]Server, error)
- func (api *API) ListSharedStorageServers(st_id string) ([]SharedStorageServer, error)
- func (api *API) ListSharedStorages(args ...interface{}) ([]SharedStorage, error)
- func (api *API) ListUsages(period string, sd *time.Time, ed *time.Time, args ...interface{}) (*Usages, error)
- func (api *API) ListUserApiAllowedIps(user_id string) ([]string, error)
- func (api *API) ListUsers(args ...interface{}) ([]User, error)
- func (api *API) ListVPNs(args ...interface{}) ([]VPN, error)
- func (api *API) LoadServerDvd(server_id string, dvd_id string) (*Server, error)
- func (api *API) ModifyMonitoringPolicyPort(mp_id string, port_id string, mp_port *MonitoringPort) (*MonitoringPolicy, error)
- func (api *API) ModifyMonitoringPolicyProcess(mp_id string, proc_id string, mp_proc *MonitoringProcess) (*MonitoringPolicy, error)
- func (api *API) ModifyRole(role_id string, name string, description string, state string) (*Role, error)
- func (api *API) ModifyRolePermissions(role_id string, perm *Permissions) (*Role, error)
- func (api *API) ModifyUser(user_id string, user *UserRequest) (*User, error)
- func (api *API) ModifyUserApi(user_id string, active bool) (*User, error)
- func (api *API) ModifyVPN(vpn_id string, name string, description string) (*VPN, error)
- func (api *API) Ping() ([]string, error)
- func (api *API) PingAuth() ([]string, error)
- func (api *API) RebootServer(server_id string, is_hardware bool) (*Server, error)
- func (api *API) RecoveryRebootServer(server_id string, is_hardware bool, recovery_image_id string) (*Server, error)
- func (api *API) ReinstallServerImage(server_id string, image_id string, password string, fp_id string) (*Server, error)
- func (api *API) RemoveBlockStorageServer(blockStorageId string, serverId string) (*BlockStorage, error)
- func (api *API) RemoveMonitoringPolicyServer(mp_id string, ser_id string) (*MonitoringPolicy, error)
- func (api *API) RemoveRoleUser(role_id string, user_id string) (*Role, error)
- func (api *API) RemoveServerPrivateNetwork(server_id string, pn_id string) (*Server, error)
- func (api *API) RemoveUserApiAllowedIp(user_id string, ip string) (*User, error)
- func (api *API) RenameSSHKey(id string, new_name string, new_desc string) (*SSHKey, error)
- func (api *API) RenameServer(server_id string, new_name string, new_desc string) (*Server, error)
- func (api *API) RenewUserApiKey(user_id string) (*User, error)
- func (api *API) ResizeServerHdd(server_id string, hdd_id string, new_size int) (*Server, error)
- func (api *API) RestoreServerSnapshot(server_id string, snapshot_id string) (*Server, error)
- func (api *API) ShutdownServer(server_id string, is_hardware bool) (*Server, error)
- func (api *API) StartServer(server_id string) (*Server, error)
- func (api *API) UnassignServerIpLoadBalancer(server_id string, ip_id string, lb_id string) (*Server, error)
- func (api *API) UpdateBlockStorage(id string, request *UpdateBlockStorageRequest) (*BlockStorage, error)
- func (api *API) UpdateFirewallPolicy(fp_id string, fp_new_name string, fp_new_desc string) (*FirewallPolicy, error)
- func (api *API) UpdateImage(img_id string, request *UpdateImageRequest) (*Image, error)
- func (api *API) UpdateLoadBalancer(lb_id string, request *LoadBalancerRequest) (*LoadBalancer, error)
- func (api *API) UpdateMonitoringPolicy(mp_id string, mp *MonitoringPolicy) (*MonitoringPolicy, error)
- func (api *API) UpdatePrivateNetwork(pn_id string, request *PrivateNetworkRequest) (*PrivateNetwork, error)
- func (api *API) UpdatePublicIp(ip_id string, reverse_dns string) (*PublicIp, error)
- func (api *API) UpdateServerHardware(server_id string, hardware *Hardware) (*Server, error)
- func (api *API) UpdateSharedStorage(ss_id string, request *SharedStorageRequest) (*SharedStorage, error)
- func (api *API) UpdateSharedStorageCredentials(new_pass string) ([]SharedStorageAccess, error)
- func (api *API) WaitForState(in ApiInstance, state string, sec time.Duration, count int) error
- func (api *API) WaitUntilDeleted(in ApiInstance) error
- type ApiError
- type ApiInstance
- type ApiPtr
- type BackupPerm
- type BaremetalHardware
- type BaremetalModel
- type BlockStorage
- type BlockStorageRequest
- type BlockStorageServer
- type Datacenter
- type DvdIso
- type FirewallPerm
- type FirewallPolicy
- type FirewallPolicyRequest
- type FirewallPolicyRule
- type FixedInstanceInfo
- type Hardware
- type Hdd
- type IPPerm
- type Identity
- type Image
- type ImageOs
- type ImagePerm
- type ImageRequest
- type InvoicePerm
- type License
- type LoadBalancer
- type LoadBalancerPerm
- type LoadBalancerRequest
- type LoadBalancerRule
- type Log
- type LogPerm
- type MonServerUsageDetails
- type MonServerUsageSummary
- type MonitorCenterPerm
- type MonitorPolicyPerm
- type MonitoringLevel
- type MonitoringPolicy
- type MonitoringPort
- type MonitoringProcess
- type MonitoringThreshold
- type MonitoringValue
- type Os
- type Permissions
- type Pricing
- type PrivateNetwork
- type PrivateNetworkPerm
- type PrivateNetworkRequest
- type PublicIp
- type RecoveryAppliance
- type Role
- type RolePerm
- type SSHKey
- type SSHKeyRequest
- type SSHServer
- type Server
- type ServerAction
- type ServerAlert
- type ServerAlerts
- type ServerAppliance
- type ServerHdds
- type ServerIp
- type ServerIpInfo
- type ServerPerm
- type ServerPrivateNetwork
- type ServerRequest
- type ServerSnapshot
- type SharedStorage
- type SharedStorageAccess
- type SharedStoragePerm
- type SharedStorageRequest
- type SharedStorageServer
- type SingleRecoveryAppliance
- type Status
- type UpdateBlockStorageRequest
- type UpdateImageRequest
- type UsagePerm
- type Usages
- type User
- type UserApi
- type UserApiKey
- type UserPerm
- type UserRequest
- type VPN
- type VPNPerm
Constants ¶
const ( IpTypeV4 = "IPV4" IpTypeV6 = "IPV6" )
Variables ¶
var BaseUrl = "https://cloudpanel-api.1and1.com/v1"
The base url for 1&1 Cloud Server REST API.
var Token string
Authentication token
Functions ¶
func Bool2Pointer ¶
Converts a given boolean value into a pointer of the same type.
func Int2Pointer ¶
Converts a given integer value into a pointer of the same type.
func SetBaseUrl ¶
SetBaseUrl is intended to set the REST base url. BaseUrl is declared in setup.go
Types ¶
type API ¶
type API struct { Endpoint string Client *restClient }
Struct to hold the required information for accessing the API.
Instances of this type contain the URL of the endpoint to access the API as well as the API access token to be used. They offer also all methods that allow to access the various objects that are returned by top level resources of the API.
func New ¶
Creates a new API instance.
Explanations about given token and url information can be found online under the following url TODO add url!
func (*API) AddBlockStorageServer ¶ added in v1.2.0
func (api *API) AddBlockStorageServer(blockStorageId string, serverId string) (*BlockStorage, error)
func (*API) AddFirewallPolicyRules ¶
func (api *API) AddFirewallPolicyRules(fp_id string, fp_rules []FirewallPolicyRule) (*FirewallPolicy, error)
POST /firewall_policies/{id}/rules
func (*API) AddFirewallPolicyServerIps ¶
func (api *API) AddFirewallPolicyServerIps(fp_id string, ip_ids []string) (*FirewallPolicy, error)
POST /firewall_policies/{id}/server_ips
func (*API) AddLoadBalancerRules ¶
func (api *API) AddLoadBalancerRules(lb_id string, lb_rules []LoadBalancerRule) (*LoadBalancer, error)
POST /load_balancers/{load_balancer_id}/rules
func (*API) AddLoadBalancerServerIps ¶
func (api *API) AddLoadBalancerServerIps(lb_id string, ip_ids []string) (*LoadBalancer, error)
POST /load_balancers/{id}/server_ips
func (*API) AddMonitoringPolicyPorts ¶
func (api *API) AddMonitoringPolicyPorts(mp_id string, mp_ports []MonitoringPort) (*MonitoringPolicy, error)
POST /monitoring_policies/{id}/ports
func (*API) AddMonitoringPolicyProcesses ¶
func (api *API) AddMonitoringPolicyProcesses(mp_id string, mp_procs []MonitoringProcess) (*MonitoringPolicy, error)
POST /monitoring_policies/{id}/processes
func (*API) AddServerHdds ¶
func (api *API) AddServerHdds(server_id string, hdds *ServerHdds) (*Server, error)
POST /servers/{id}/hardware/hdds
func (*API) AddSharedStorageServers ¶
func (api *API) AddSharedStorageServers(st_id string, servers []SharedStorageServer) (*SharedStorage, error)
POST /shared_storages/{id}/servers
func (*API) AddUserApiAlowedIps ¶
POST /users/{id}/api/ips
func (*API) AssignRoleUsers ¶
POST /roles/{role_id}/users
func (*API) AssignServerIp ¶
POST /servers/{id}/ips
func (*API) AssignServerIpFirewallPolicy ¶
func (api *API) AssignServerIpFirewallPolicy(server_id string, ip_id string, fp_id string) (*Server, error)
PUT /servers/{server_id}/ips/{ip_id}/firewall_policy
func (*API) AssignServerIpLoadBalancer ¶
func (api *API) AssignServerIpLoadBalancer(server_id string, ip_id string, lb_id string) (*Server, error)
POST /servers/{server_id}/ips/{ip_id}/load_balancers
func (*API) AssignServerPrivateNetwork ¶
POST /servers/{id}/private_networks
func (*API) AttachMonitoringPolicyServers ¶
func (api *API) AttachMonitoringPolicyServers(mp_id string, sids []string) (*MonitoringPolicy, error)
POST /monitoring_policies/{id}/servers
func (*API) AttachPrivateNetworkServers ¶
func (api *API) AttachPrivateNetworkServers(pn_id string, sids []string) (*PrivateNetwork, error)
POST /private_networks/{id}/servers
func (*API) CloneServer ¶
func (api *API) CloneServer(server_id string, new_name string, datacenter_id string) (*Server, error)
POST /servers/{server_id}/clone
func (*API) CreateBlockStorage ¶ added in v1.2.0
func (api *API) CreateBlockStorage(request *BlockStorageRequest) (string, *BlockStorage, error)
func (*API) CreateFirewallPolicy ¶
func (api *API) CreateFirewallPolicy(fp_data *FirewallPolicyRequest) (string, *FirewallPolicy, error)
POST /firewall_policies
func (*API) CreateImage ¶
func (api *API) CreateImage(request *ImageRequest) (string, *Image, error)
POST /images
func (*API) CreateLoadBalancer ¶
func (api *API) CreateLoadBalancer(request *LoadBalancerRequest) (string, *LoadBalancer, error)
POST /load_balancers
func (*API) CreateMonitoringPolicy ¶
func (api *API) CreateMonitoringPolicy(mp *MonitoringPolicy) (string, *MonitoringPolicy, error)
POST /monitoring_policies
func (*API) CreatePrivateNetwork ¶
func (api *API) CreatePrivateNetwork(request *PrivateNetworkRequest) (string, *PrivateNetwork, error)
POST /private_networks
func (*API) CreatePublicIp ¶
func (api *API) CreatePublicIp(ip_type string, reverse_dns string, datacenter_id string) (string, *PublicIp, error)
POST /public_ips
func (*API) CreateSSHKey ¶ added in v1.2.0
func (api *API) CreateSSHKey(request *SSHKeyRequest) (string, *SSHKey, error)
func (*API) CreateServer ¶
func (api *API) CreateServer(request *ServerRequest) (string, *Server, error)
POST /servers
func (*API) CreateServerEx ¶
This is a wrapper function for `CreateServer` that returns the server's IP address and first password. The function waits at most `timeout` seconds for the server to be created. The initial `POST /servers` response does not contain the IP address, so we need to wait until the server is created.
func (*API) CreateServerSnapshot ¶
POST /servers/{id}/snapshots
func (*API) CreateSharedStorage ¶
func (api *API) CreateSharedStorage(request *SharedStorageRequest) (string, *SharedStorage, error)
POST /shared_storages
func (*API) CreateUser ¶
func (api *API) CreateUser(user *UserRequest) (string, *User, error)
POST /users
func (*API) CreateVPN ¶
func (api *API) CreateVPN(name string, description string, datacenter_id string) (string, *VPN, error)
POST /vpns
func (*API) DeleteBlockStorage ¶ added in v1.2.0
func (api *API) DeleteBlockStorage(id string) (*BlockStorage, error)
func (*API) DeleteFirewallPolicy ¶
func (api *API) DeleteFirewallPolicy(fp_id string) (*FirewallPolicy, error)
DELETE /firewall_policies/{id}
func (*API) DeleteFirewallPolicyRule ¶
func (api *API) DeleteFirewallPolicyRule(fp_id string, rule_id string) (*FirewallPolicy, error)
DELETE /firewall_policies/{id}/rules/{id}
func (*API) DeleteImage ¶
DELETE /images/{id}
func (*API) DeleteLoadBalancer ¶
func (api *API) DeleteLoadBalancer(lb_id string) (*LoadBalancer, error)
DELETE /load_balancers/{id}
func (*API) DeleteLoadBalancerRule ¶
func (api *API) DeleteLoadBalancerRule(lb_id string, rule_id string) (*LoadBalancer, error)
DELETE /load_balancers/{load_balancer_id}/rules/{rule_id}
func (*API) DeleteLoadBalancerServerIp ¶
func (api *API) DeleteLoadBalancerServerIp(lb_id string, ip_id string) (*LoadBalancer, error)
DELETE /load_balancers/{id}/server_ips/{id}
func (*API) DeleteMonitoringPolicy ¶
func (api *API) DeleteMonitoringPolicy(mp_id string) (*MonitoringPolicy, error)
DELETE /monitoring_policies/{id}
func (*API) DeleteMonitoringPolicyPort ¶
func (api *API) DeleteMonitoringPolicyPort(mp_id string, port_id string) (*MonitoringPolicy, error)
DELETE /monitoring_policies/{id}/ports/{id}
func (*API) DeleteMonitoringPolicyProcess ¶
func (api *API) DeleteMonitoringPolicyProcess(mp_id string, proc_id string) (*MonitoringPolicy, error)
DELETE /monitoring_policies/{id}/processes/{id}
func (*API) DeletePrivateNetwork ¶
func (api *API) DeletePrivateNetwork(pn_id string) (*PrivateNetwork, error)
DELETE /private_networks/{id}
func (*API) DeletePublicIp ¶
DELETE /public_ips/{id}
func (*API) DeleteRole ¶
DELETE /roles/{role_id}
func (*API) DeleteServer ¶
DELETE /servers/{id}
func (*API) DeleteServerHdd ¶
DELETE /servers/{id}/hardware/hdds/{id}
func (*API) DeleteServerIp ¶
DELETE /servers/{id}/ips/{id}
func (*API) DeleteServerSnapshot ¶
DELETE /servers/{server_id}/snapshots/{snapshot_id}
func (*API) DeleteSharedStorage ¶
func (api *API) DeleteSharedStorage(ss_id string) (*SharedStorage, error)
DELETE /shared_storages/{id}
func (*API) DeleteSharedStorageServer ¶
func (api *API) DeleteSharedStorageServer(st_id string, ser_id string) (*SharedStorage, error)
DELETE /shared_storages/{id}/servers/{id}
func (*API) DeleteUser ¶
DELETE /users/{id}
func (*API) DetachPrivateNetworkServer ¶
func (api *API) DetachPrivateNetworkServer(pn_id string, pns_id string) (*PrivateNetwork, error)
DELETE /private_networks/{id}/servers/{id}
func (*API) EjectServerDvd ¶
DELETE /servers/{id}/dvd
func (*API) GetBaremetalModel ¶ added in v1.2.1
func (api *API) GetBaremetalModel(bm_id string) (*BaremetalModel, error)
GET /servers/baremetal_models/{id}
func (*API) GetBlockStorage ¶ added in v1.2.0
func (api *API) GetBlockStorage(id string) (*BlockStorage, error)
func (*API) GetBlockStorageServer ¶ added in v1.2.0
func (api *API) GetBlockStorageServer(id string) (*BlockStorageServer, error)
func (*API) GetCurrentUserPermissions ¶
func (api *API) GetCurrentUserPermissions() (*Permissions, error)
GET /users/{id}/api/ips
func (*API) GetDatacenter ¶
func (api *API) GetDatacenter(dc_id string) (*Datacenter, error)
GET /datacenters/{datacenter_id}
func (*API) GetFirewallPolicy ¶
func (api *API) GetFirewallPolicy(fp_id string) (*FirewallPolicy, error)
GET /firewall_policies/{id}
func (*API) GetFirewallPolicyRule ¶
func (api *API) GetFirewallPolicyRule(fp_id string, rule_id string) (*FirewallPolicyRule, error)
GET /firewall_policies/{id}/rules/{id}
func (*API) GetFirewallPolicyServerIp ¶
func (api *API) GetFirewallPolicyServerIp(fp_id string, ip_id string) (*ServerIpInfo, error)
GET /firewall_policies/{id}/server_ips/{id}
func (*API) GetFixedInstanceSize ¶
func (api *API) GetFixedInstanceSize(fis_id string) (*FixedInstanceInfo, error)
GET /servers/fixed_instance_sizes/{fixed_instance_size_id}
func (*API) GetLoadBalancer ¶
func (api *API) GetLoadBalancer(lb_id string) (*LoadBalancer, error)
GET /load_balancers/{id}
func (*API) GetLoadBalancerRule ¶
func (api *API) GetLoadBalancerRule(lb_id string, rule_id string) (*LoadBalancerRule, error)
GET /load_balancers/{load_balancer_id}/rules/{rule_id}
func (*API) GetLoadBalancerServerIp ¶
func (api *API) GetLoadBalancerServerIp(lb_id string, ip_id string) (*ServerIpInfo, error)
GET /load_balancers/{id}/server_ips/{id}
func (*API) GetMonitoringPolicy ¶
func (api *API) GetMonitoringPolicy(mp_id string) (*MonitoringPolicy, error)
GET /monitoring_policies/{id}
func (*API) GetMonitoringPolicyPort ¶
func (api *API) GetMonitoringPolicyPort(mp_id string, port_id string) (*MonitoringPort, error)
GET /monitoring_policies/{id}/ports/{id}
func (*API) GetMonitoringPolicyProcess ¶
func (api *API) GetMonitoringPolicyProcess(mp_id string, proc_id string) (*MonitoringProcess, error)
GET /monitoring_policies/{id}/processes/{id}
func (*API) GetMonitoringPolicyServer ¶
GET /monitoring_policies/{id}/servers/{id}
func (*API) GetMonitoringServerUsage ¶
func (api *API) GetMonitoringServerUsage(ser_id string, period string, dates ...time.Time) (*MonServerUsageDetails, error)
GET /monitoring_center/{server_id}
func (*API) GetPrivateNetwork ¶
func (api *API) GetPrivateNetwork(pn_id string) (*PrivateNetwork, error)
GET /private_networks/{id}
func (*API) GetPrivateNetworkServer ¶
GET /private_networks/{id}/servers/{id}
func (*API) GetPublicIp ¶
GET /public_ips/{id}
func (*API) GetRecoveryAppliance ¶ added in v1.2.1
func (api *API) GetRecoveryAppliance(ra_id string) (*SingleRecoveryAppliance, error)
GET /server_appliances/{id}
func (*API) GetRolePermissions ¶
func (api *API) GetRolePermissions(role_id string) (*Permissions, error)
GET /roles/{role_id}/permissions
func (*API) GetRoleUser ¶
GET /roles/{role_id}/users/{user_id}
func (*API) GetServerAppliance ¶
func (api *API) GetServerAppliance(sa_id string) (*ServerAppliance, error)
GET /server_appliances/{id}
func (*API) GetServerDvd ¶
GET /servers/{id}/dvd
func (*API) GetServerHardware ¶
GET /servers/{server_id}/hardware
func (*API) GetServerHdd ¶
GET /servers/{id}/hardware/hdds/{id}
func (*API) GetServerImage ¶
GET /servers/{id}/image
func (*API) GetServerIp ¶
GET /servers/{id}/ips/{id}
func (*API) GetServerIpFirewallPolicy ¶
GET /servers/{server_id}/ips/{ip_id}/firewall_policy
func (*API) GetServerPrivateNetwork ¶
func (api *API) GetServerPrivateNetwork(server_id string, pn_id string) (*PrivateNetwork, error)
GET /servers/{id}/private_networks/{id}
func (*API) GetServerSnapshot ¶
func (api *API) GetServerSnapshot(server_id string) (*ServerSnapshot, error)
GET /servers/{id}/snapshots
func (*API) GetServerStatus ¶
GET /servers/{id}/status
func (*API) GetSharedStorage ¶
func (api *API) GetSharedStorage(ss_id string) (*SharedStorage, error)
GET /shared_storages/{id}
func (*API) GetSharedStorageCredentials ¶
func (api *API) GetSharedStorageCredentials() ([]SharedStorageAccess, error)
GET /shared_storages/access
func (*API) GetSharedStorageServer ¶
func (api *API) GetSharedStorageServer(st_id string, ser_id string) (*SharedStorageServer, error)
GET /shared_storages/{id}/servers/{id}
func (*API) GetUserApi ¶
GET /users/{id}/api
func (*API) GetUserApiKey ¶
func (api *API) GetUserApiKey(user_id string) (*UserApiKey, error)
GET /users/{id}/api/key
func (*API) GetVPNConfigFile ¶
GET /vpns/{vpn_id}/configuration_file Returns VPN configuration files (in a zip arhive) as a base64 encoded string
func (*API) ListBaremetalModels ¶ added in v1.2.1
func (api *API) ListBaremetalModels() ([]BaremetalModel, error)
GET /servers/baremetal_models
func (*API) ListBlockStorages ¶ added in v1.2.0
func (api *API) ListBlockStorages(args ...interface{}) ([]BlockStorage, error)
func (*API) ListDatacenters ¶
func (api *API) ListDatacenters(args ...interface{}) ([]Datacenter, error)
GET /datacenters
func (*API) ListDvdIsos ¶
GET /dvd_isos
func (*API) ListFirewallPolicies ¶
func (api *API) ListFirewallPolicies(args ...interface{}) ([]FirewallPolicy, error)
GET /firewall_policies
func (*API) ListFirewallPolicyRules ¶
func (api *API) ListFirewallPolicyRules(fp_id string) ([]FirewallPolicyRule, error)
GET /firewall_policies/{id}/rules
func (*API) ListFirewallPolicyServerIps ¶
func (api *API) ListFirewallPolicyServerIps(fp_id string) ([]ServerIpInfo, error)
GET /firewall_policies/{id}/server_ips
func (*API) ListFixedInstanceSizes ¶
func (api *API) ListFixedInstanceSizes() ([]FixedInstanceInfo, error)
GET /servers/fixed_instance_sizes
func (*API) ListImageOs ¶ added in v1.1.0
GET /images/os
func (*API) ListImages ¶
GET /images
func (*API) ListLoadBalancerRules ¶
func (api *API) ListLoadBalancerRules(lb_id string) ([]LoadBalancerRule, error)
GET /load_balancers/{load_balancer_id}/rules
func (*API) ListLoadBalancerServerIps ¶
func (api *API) ListLoadBalancerServerIps(lb_id string) ([]ServerIpInfo, error)
GET /load_balancers/{id}/server_ips
func (*API) ListLoadBalancers ¶
func (api *API) ListLoadBalancers(args ...interface{}) ([]LoadBalancer, error)
GET /load_balancers
func (*API) ListLogs ¶
func (api *API) ListLogs(period string, sd *time.Time, ed *time.Time, args ...interface{}) ([]Log, error)
GET /logs
func (*API) ListMonitoringPolicies ¶
func (api *API) ListMonitoringPolicies(args ...interface{}) ([]MonitoringPolicy, error)
GET /monitoring_policies
func (*API) ListMonitoringPolicyPorts ¶
func (api *API) ListMonitoringPolicyPorts(mp_id string) ([]MonitoringPort, error)
GET /monitoring_policies/{id}/ports
func (*API) ListMonitoringPolicyProcesses ¶
func (api *API) ListMonitoringPolicyProcesses(mp_id string) ([]MonitoringProcess, error)
GET /monitoring_policies/{id}/processes
func (*API) ListMonitoringPolicyServers ¶
GET /monitoring_policies/{id}/servers
func (*API) ListMonitoringServersUsages ¶
func (api *API) ListMonitoringServersUsages(args ...interface{}) ([]MonServerUsageSummary, error)
GET /monitoring_center
func (*API) ListPrivateNetworkServers ¶
GET /private_networks/{id}/servers
func (*API) ListPrivateNetworks ¶
func (api *API) ListPrivateNetworks(args ...interface{}) ([]PrivateNetwork, error)
GET /private_networks
func (*API) ListPublicIps ¶
GET /public_ips
func (*API) ListRecoveryAppliances ¶ added in v1.2.1
func (api *API) ListRecoveryAppliances(args ...interface{}) ([]RecoveryAppliance, error)
GET /recovery_appliances
func (*API) ListRoleUsers ¶
GET /roles/{role_id}/users
func (*API) ListSSHKeys ¶ added in v1.2.0
func (*API) ListServerAppliances ¶
func (api *API) ListServerAppliances(args ...interface{}) ([]ServerAppliance, error)
GET /server_appliances
func (*API) ListServerHdds ¶
GET /servers/{id}/hardware/hdds
func (*API) ListServerIpLoadBalancers ¶
GET /servers/{server_id}/ips/{ip_id}/load_balancers
func (*API) ListServerIps ¶
GET /servers/{id}/ips
func (*API) ListServerPrivateNetworks ¶
GET /servers/{id}/private_networks
func (*API) ListServers ¶
GET /servers
func (*API) ListSharedStorageServers ¶
func (api *API) ListSharedStorageServers(st_id string) ([]SharedStorageServer, error)
GET /shared_storages/{id}/servers
func (*API) ListSharedStorages ¶
func (api *API) ListSharedStorages(args ...interface{}) ([]SharedStorage, error)
GET /shared_storages
func (*API) ListUsages ¶
func (api *API) ListUsages(period string, sd *time.Time, ed *time.Time, args ...interface{}) (*Usages, error)
GET /usages
func (*API) ListUserApiAllowedIps ¶
GET /users/{id}/api/ips
func (*API) LoadServerDvd ¶
PUT /servers/{id}/dvd
func (*API) ModifyMonitoringPolicyPort ¶
func (api *API) ModifyMonitoringPolicyPort(mp_id string, port_id string, mp_port *MonitoringPort) (*MonitoringPolicy, error)
PUT /monitoring_policies/{id}/ports/{id}
func (*API) ModifyMonitoringPolicyProcess ¶
func (api *API) ModifyMonitoringPolicyProcess(mp_id string, proc_id string, mp_proc *MonitoringProcess) (*MonitoringPolicy, error)
PUT /monitoring_policies/{id}/processes/{id}
func (*API) ModifyRole ¶
func (api *API) ModifyRole(role_id string, name string, description string, state string) (*Role, error)
PUT /roles/{role_id}
func (*API) ModifyRolePermissions ¶
func (api *API) ModifyRolePermissions(role_id string, perm *Permissions) (*Role, error)
PUT /roles/{role_id}/permissions
func (*API) ModifyUser ¶
func (api *API) ModifyUser(user_id string, user *UserRequest) (*User, error)
PUT /users/{id}
func (*API) ModifyUserApi ¶
PUT /users/{id}/api
func (*API) PingAuth ¶
GET /ping_auth Returns "PONG" if the API is running and the authentication token is valid
func (*API) RebootServer ¶
PUT /servers/{id}/status/action (action = REBOOT)
func (*API) RecoveryRebootServer ¶ added in v1.2.1
func (api *API) RecoveryRebootServer(server_id string, is_hardware bool, recovery_image_id string) (*Server, error)
PUT /servers/{id}/status/action (action = REBOOT)
func (*API) ReinstallServerImage ¶
func (api *API) ReinstallServerImage(server_id string, image_id string, password string, fp_id string) (*Server, error)
PUT /servers/{id}/image
func (*API) RemoveBlockStorageServer ¶ added in v1.2.0
func (api *API) RemoveBlockStorageServer(blockStorageId string, serverId string) (*BlockStorage, error)
func (*API) RemoveMonitoringPolicyServer ¶
func (api *API) RemoveMonitoringPolicyServer(mp_id string, ser_id string) (*MonitoringPolicy, error)
DELETE /monitoring_policies/{id}/servers/{id}
func (*API) RemoveRoleUser ¶
DELETE /roles/{role_id}/users/{user_id}
func (*API) RemoveServerPrivateNetwork ¶
DELETE /servers/{id}/private_networks/{id}
func (*API) RemoveUserApiAllowedIp ¶
DELETE /users/{id}/api/ips/{ip}
func (*API) RenameSSHKey ¶ added in v1.2.0
func (*API) RenameServer ¶
PUT /servers/{id}
func (*API) RenewUserApiKey ¶
PUT /users/{id}/api/key
func (*API) ResizeServerHdd ¶
PUT /servers/{id}/hardware/hdds/{id}
func (*API) RestoreServerSnapshot ¶
PUT /servers/{server_id}/snapshots/{snapshot_id}
func (*API) ShutdownServer ¶
PUT /servers/{id}/status/action (action = POWER_OFF)
func (*API) StartServer ¶
PUT /servers/{id}/status/action (action = POWER_ON)
func (*API) UnassignServerIpLoadBalancer ¶
func (api *API) UnassignServerIpLoadBalancer(server_id string, ip_id string, lb_id string) (*Server, error)
DELETE /servers/{server_id}/ips/{ip_id}/load_balancers
func (*API) UpdateBlockStorage ¶ added in v1.3.5
func (api *API) UpdateBlockStorage(id string, request *UpdateBlockStorageRequest) (*BlockStorage, error)
func (*API) UpdateFirewallPolicy ¶
func (api *API) UpdateFirewallPolicy(fp_id string, fp_new_name string, fp_new_desc string) (*FirewallPolicy, error)
PUT /firewall_policies/{id}
func (*API) UpdateImage ¶
func (api *API) UpdateImage(img_id string, request *UpdateImageRequest) (*Image, error)
PUT /images/{id}
func (*API) UpdateLoadBalancer ¶
func (api *API) UpdateLoadBalancer(lb_id string, request *LoadBalancerRequest) (*LoadBalancer, error)
PUT /load_balancers/{id}
func (*API) UpdateMonitoringPolicy ¶
func (api *API) UpdateMonitoringPolicy(mp_id string, mp *MonitoringPolicy) (*MonitoringPolicy, error)
PUT /monitoring_policies/{id}
func (*API) UpdatePrivateNetwork ¶
func (api *API) UpdatePrivateNetwork(pn_id string, request *PrivateNetworkRequest) (*PrivateNetwork, error)
PUT /private_networks/{id}
func (*API) UpdatePublicIp ¶
PUT /public_ips/{id}
func (*API) UpdateServerHardware ¶
PUT /servers/{server_id}/hardware
func (*API) UpdateSharedStorage ¶
func (api *API) UpdateSharedStorage(ss_id string, request *SharedStorageRequest) (*SharedStorage, error)
PUT /shared_storages/{id}
func (*API) UpdateSharedStorageCredentials ¶
func (api *API) UpdateSharedStorageCredentials(new_pass string) ([]SharedStorageAccess, error)
PUT /shared_storages/access
func (*API) WaitForState ¶
Performs busy-waiting for types that implement ApiInstance interface.
func (*API) WaitUntilDeleted ¶
func (api *API) WaitUntilDeleted(in ApiInstance) error
Waits until instance is deleted for types that implement ApiInstance interface.
type ApiError ¶ added in v1.3.6
type ApiError struct {
// contains filtered or unexported fields
}
func (*ApiError) HttpStatusCode ¶ added in v1.3.6
type ApiInstance ¶
type BackupPerm ¶
type BaremetalHardware ¶ added in v1.2.1
type BaremetalModel ¶ added in v1.2.1
type BaremetalModel struct { ApiPtr Identity Hardware *BaremetalHardware `json:"hardware,omitempty"` // contains filtered or unexported fields }
type BlockStorage ¶ added in v1.2.0
type BlockStorage struct { Identity Size int `json:"size"` State string `json:"state,omitempty"` // Name string `json:"name,omitempty"` CreationDate time.Time `json:"creation_date,omitempty"` Datacenter *Datacenter `json:"datacenter,omitempty"` Server *BlockStorageServer `json:"server,omitempty"` DiskID string `json:"disk_id,omitemtpy"` UUID string `json:"uuid,omitemtpy"` ApiPtr // contains filtered or unexported fields }
func (*BlockStorage) GetState ¶ added in v1.2.0
func (bs *BlockStorage) GetState() (string, error)
type BlockStorageRequest ¶ added in v1.2.0
type BlockStorageServer ¶ added in v1.2.0
type Datacenter ¶
type DvdIso ¶
type DvdIso struct { Identity OsFamily string `json:"os_family,omitempty"` Os string `json:"os,omitempty"` OsVersion string `json:"os_version,omitempty"` Type string `json:"type,omitempty"` AvailableDatacenters []string `json:"available_datacenters,omitempty"` Architecture interface{} `json:"os_architecture,omitempty"` ApiPtr }
Struct to describe a ISO image that can be used to boot a server.
Values of this type describe ISO images that can be inserted into the servers virtual DVD drive.
type FirewallPerm ¶
type FirewallPerm struct { Clone bool `json:"clone"` Create bool `json:"create"` Delete bool `json:"delete"` ManageAttachedServerIPs bool `json:"manage_attached_server_ips"` ManageRules bool `json:"manage_rules"` SetDescription bool `json:"set_description"` SetName bool `json:"set_name"` Show bool `json:"show"` }
func (*FirewallPerm) SetAll ¶
func (fp *FirewallPerm) SetAll(value bool)
Sets all firewall policies' permissions
type FirewallPolicy ¶
type FirewallPolicy struct { Identity DefaultPolicy uint8 `json:"default"` CreationDate string `json:"creation_date,omitempty"` State string `json:"state,omitempty"` Rules []FirewallPolicyRule `json:"rules,omitempty"` ServerIps []ServerIpInfo `json:"server_ips,omitempty"` ApiPtr // contains filtered or unexported fields }
func (*FirewallPolicy) GetState ¶
func (fp *FirewallPolicy) GetState() (string, error)
type FirewallPolicyRequest ¶
type FirewallPolicyRequest struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Rules []FirewallPolicyRule `json:"rules,omitempty"` }
type FirewallPolicyRule ¶
type FirewallPolicyRule struct { Protocol string `json:"protocol,omitempty"` PortFrom *int `json:"port_from,omitempty"` PortTo *int `json:"port_to,omitempty"` Port string `json:"port,omitempty"` Action string `json:"action,omitempty"` Description string `json:"description,omitempty"` SourceIp string `json:"source,omitempty"` // contains filtered or unexported fields }
type FixedInstanceInfo ¶
type Hardware ¶
type Hardware struct { Vcores int `json:"vcore,omitempty"` CoresPerProcessor int `json:"cores_per_processor"` Ram float32 `json:"ram"` Hdds []Hdd `json:"hdds,omitempty"` FixedInsSizeId string `json:"fixed_instance_size_id,omitempty"` BaremetalModelId interface{} `json:"baremetal_model_id,omitempty"` ApiPtr }
type IPPerm ¶
type Image ¶
type Image struct { MinHddSize int `json:"min_hdd_size"` Architecture *int `json:"architecture,omitempty"` NumImages *int `json:"num_images,omitempty"` Frequency string `json:"frequency,omitempty"` ServerId string `json:"server_id,omitempty"` CreationDate string `json:"creation_date,omitempty"` State string `json:"state,omitempty"` OsImageType string `json:"os_image_type,omitempty"` Os string `json:"os,omitempty"` OsFamily string `json:"os_family,omitempty"` OsVersion string `json:"os_version,omitempty"` Type string `json:"type,omitempty"` Licenses []License `json:"licenses,omitempty"` Hdds []Hdd `json:"hdds,omitempty"` Datacenter *Datacenter `json:"datacenter,omitempty"` ApiPtr // contains filtered or unexported fields }
type ImagePerm ¶
type ImageRequest ¶ added in v1.1.0
type ImageRequest struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Frequency string `json:"frequency,omitempty"` ServerId string `json:"server_id,omitempty"` DatacenterId string `json:"datacenter_id,omitempty"` Source string `json:"source,omitempty"` Url string `json:"url,omitempty"` OsId string `json:"os_id,omitempty"` Type string `json:"type,omitempty"` NumImages *int `json:"num_images,omitempty"` }
type InvoicePerm ¶
type InvoicePerm struct {
Show bool `json:"show"`
}
func (*InvoicePerm) SetAll ¶
func (inp *InvoicePerm) SetAll(value bool)
Sets all invoice's permissions
type LoadBalancer ¶
type LoadBalancer struct { ApiPtr Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` State string `json:"state,omitempty"` CreationDate string `json:"creation_date,omitempty"` Ip string `json:"ip,omitempty"` HealthCheckTest string `json:"health_check_test,omitempty"` HealthCheckInterval int `json:"health_check_interval"` HealthCheckPath string `json:"health_check_path,omitempty"` HealthCheckPathParser string `json:"health_check_path_parser,omitempty"` Persistence bool `json:"persistence"` PersistenceTime int `json:"persistence_time"` Method string `json:"method,omitempty"` Rules []LoadBalancerRule `json:"rules,omitempty"` ServerIps []ServerIpInfo `json:"server_ips,omitempty"` Datacenter *Datacenter `json:"datacenter,omitempty"` // contains filtered or unexported fields }
func (*LoadBalancer) GetState ¶
func (lb *LoadBalancer) GetState() (string, error)
type LoadBalancerPerm ¶
type LoadBalancerPerm struct { Create bool `json:"create"` Delete bool `json:"delete"` ManageAttachedServerIPs bool `json:"manage_attached_server_ips"` ManageRules bool `json:"manage_rules"` Modify bool `json:"modify"` SetDescription bool `json:"set_description"` SetName bool `json:"set_name"` Show bool `json:"show"` }
func (*LoadBalancerPerm) SetAll ¶
func (lbp *LoadBalancerPerm) SetAll(value bool)
Sets all load balancers' permissions
type LoadBalancerRequest ¶
type LoadBalancerRequest struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` DatacenterId string `json:"datacenter_id,omitempty"` HealthCheckTest string `json:"health_check_test,omitempty"` HealthCheckInterval *int `json:"health_check_interval"` HealthCheckPath string `json:"health_check_path,omitempty"` HealthCheckPathParser string `json:"health_check_path_parser,omitempty"` Persistence *bool `json:"persistence"` PersistenceTime *int `json:"persistence_time"` Method string `json:"method,omitempty"` Rules []LoadBalancerRule `json:"rules,omitempty"` }
type LoadBalancerRule ¶
type Log ¶
type Log struct { ApiPtr SiteId string `json:"site_id,omitempty"` StartDate string `json:"start_date,omitempty"` EndDate string `json:"end_date,omitempty"` Action string `json:"action,omitempty"` Duration int `json:"duration"` Status *Status `json:"Status,omitempty"` Resource *Identity `json:"resource,omitempty"` User *Identity `json:"user,omitempty"` // contains filtered or unexported fields }
type MonServerUsageDetails ¶
type MonServerUsageDetails struct { Identity Status *statusState `json:"status,omitempty"` Agent *monitoringAgent `json:"agent,omitempty"` Alerts *monitoringAlerts `json:"alerts,omitempty"` CpuStatus *utilizationStatus `json:"cpu,omitempty"` DiskStatus *utilizationStatus `json:"disk,omitempty"` RamStatus *utilizationStatus `json:"ram,omitempty"` PingStatus *pingStatus `json:"internal_ping,omitempty"` TransferStatus *transferStatus `json:"transfer,omitempty"` ApiPtr }
type MonServerUsageSummary ¶
type MonitorCenterPerm ¶
type MonitorCenterPerm struct {
Show bool `json:"show"`
}
func (*MonitorCenterPerm) SetAll ¶
func (mcp *MonitorCenterPerm) SetAll(value bool)
Sets all monitoring center's permissions
type MonitorPolicyPerm ¶
type MonitorPolicyPerm struct { Clone bool `json:"clone"` Create bool `json:"create"` Delete bool `json:"delete"` ManageAttachedServers bool `json:"manage_attached_servers"` ManagePorts bool `json:"manage_ports"` ManageProcesses bool `json:"manage_processes"` ModifyResources bool `json:"modify_resources"` SetDescription bool `json:"set_description"` SetEmail bool `json:"set_email"` SetName bool `json:"set_name"` Show bool `json:"show"` }
func (*MonitorPolicyPerm) SetAll ¶
func (mpp *MonitorPolicyPerm) SetAll(value bool)
Sets all monitoring policies' permissions
type MonitoringLevel ¶
type MonitoringLevel struct { Warning *MonitoringValue `json:"warning,omitempty"` Critical *MonitoringValue `json:"critical,omitempty"` }
type MonitoringPolicy ¶
type MonitoringPolicy struct { ApiPtr Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` State string `json:"state,omitempty"` Default *int `json:"default,omitempty"` CreationDate string `json:"creation_date,omitempty"` Email string `json:"email,omitempty"` Agent bool `json:"agent"` Servers []Identity `json:"servers,omitempty"` Thresholds *MonitoringThreshold `json:"thresholds,omitempty"` Ports []MonitoringPort `json:"ports,omitempty"` Processes []MonitoringProcess `json:"processes,omitempty"` // contains filtered or unexported fields }
func (*MonitoringPolicy) GetState ¶
func (mp *MonitoringPolicy) GetState() (string, error)
type MonitoringPort ¶
type MonitoringProcess ¶
type MonitoringThreshold ¶
type MonitoringThreshold struct { Cpu *MonitoringLevel `json:"cpu,omitempty"` Ram *MonitoringLevel `json:"ram,omitempty"` Disk *MonitoringLevel `json:"disk,omitempty"` Transfer *MonitoringLevel `json:"transfer,omitempty"` InternalPing *MonitoringLevel `json:"internal_ping,omitempty"` }
type MonitoringValue ¶
type Permissions ¶
type Permissions struct { Backups *BackupPerm `json:"backups,omitempty"` Firewalls *FirewallPerm `json:"firewall_policies,omitempty"` Images *ImagePerm `json:"images,omitempty"` Invoice *InvoicePerm `json:"interactive_invoices,omitempty"` IPs *IPPerm `json:"public_ips,omitempty"` LoadBalancers *LoadBalancerPerm `json:"load_balancers,omitempty"` Logs *LogPerm `json:"logs,omitempty"` MonitorCenter *MonitorCenterPerm `json:"monitoring_center,omitempty"` MonitorPolicies *MonitorPolicyPerm `json:"monitoring_policies,omitempty"` PrivateNetworks *PrivateNetworkPerm `json:"private_networks,omitempty"` Roles *RolePerm `json:"roles,omitempty"` Servers *ServerPerm `json:"servers,omitempty"` Usages *UsagePerm `json:"usages,omitempty"` Users *UserPerm `json:"users,omitempty"` VPNs *VPNPerm `json:"vpn,omitempty"` }
type Pricing ¶
type Pricing struct { Currency string `json:"currency,omitempty"` Plan *pricingPlan `json:"pricing_plans,omitempty"` }
type PrivateNetwork ¶
type PrivateNetwork struct { Identity NetworkAddress string `json:"network_address,omitempty"` SubnetMask string `json:"subnet_mask,omitempty"` State string `json:"state,omitempty"` SiteId string `json:"site_id,omitempty"` CreationDate string `json:"creation_date,omitempty"` Servers []Identity `json:"servers,omitempty"` Datacenter *Datacenter `json:"datacenter,omitempty"` ApiPtr // contains filtered or unexported fields }
func (*PrivateNetwork) GetState ¶
func (pn *PrivateNetwork) GetState() (string, error)
type PrivateNetworkPerm ¶
type PrivateNetworkPerm struct { Create bool `json:"create"` Delete bool `json:"delete"` ManageAttachedServers bool `json:"manage_attached_servers"` SetDescription bool `json:"set_description"` SetName bool `json:"set_name"` SetNetworkInfo bool `json:"set_network_info"` Show bool `json:"show"` }
func (*PrivateNetworkPerm) SetAll ¶
func (pnp *PrivateNetworkPerm) SetAll(value bool)
Sets all private networks' permissions
type PrivateNetworkRequest ¶
type PublicIp ¶
type PublicIp struct { IpAddress string `json:"ip,omitempty"` AssignedTo *assignedTo `json:"assigned_to,omitempty"` ReverseDns string `json:"reverse_dns,omitempty"` IsDhcp *bool `json:"is_dhcp,omitempty"` State string `json:"state,omitempty"` SiteId string `json:"site_id,omitempty"` CreationDate string `json:"creation_date,omitempty"` Datacenter *Datacenter `json:"datacenter,omitempty"` ApiPtr // contains filtered or unexported fields }
type RecoveryAppliance ¶ added in v1.2.1
type Role ¶
type Role struct { Identity CreationDate string `json:"creation_date,omitempty"` State string `json:"state,omitempty"` Default *int `json:"default,omitempty"` Permissions *Permissions `json:"permissions,omitempty"` Users []Identity `json:"users,omitempty"` ApiPtr // contains filtered or unexported fields }
type RolePerm ¶
type SSHKey ¶ added in v1.2.0
type SSHKey struct { Identity State string `json:"state,omitempty"` Servers *[]SSHServer `json:"servers,omitempty"` Md5 string `json:"md5,omitempty"` PublicKey string `json:"public_key,omitempty"` CreationDate string `json:"creation_date,omitempty"` ApiPtr // contains filtered or unexported fields }
type SSHKeyRequest ¶ added in v1.2.0
type Server ¶
type Server struct { ApiPtr Identity CreationDate string `json:"creation_date,omitempty"` FirstPassword string `json:"first_password,omitempty"` ServerType string `json:"server_type,omitempty"` Ipv6Range string `json:"ipv6_range,omitempty"` Hostname string `json:"hostname,omitempty"` Datacenter *Datacenter `json:"datacenter,omitempty"` Status *Status `json:"status,omitempty"` Hardware *Hardware `json:"hardware,omitempty"` Image *Identity `json:"image,omitempty"` Dvd *Identity `json:"dvd,omitempty"` MonPolicy *Identity `json:"monitoring_policy,omitempty"` Snapshot *ServerSnapshot `json:"snapshot,omitempty"` Ips []ServerIp `json:"ips,omitempty"` PrivateNets []ServerPrivateNetwork `json:"private_networks,omitempty"` Alerts *ServerAlerts `json:"-"` AlertsRaw *json.RawMessage `json:"alerts,omitempty"` // contains filtered or unexported fields }
type ServerAction ¶
type ServerAlert ¶
type ServerAlert struct { Date string `json:"date"` // contains filtered or unexported fields }
type ServerAlerts ¶
type ServerAlerts struct { AlertSummary []serverAlertSummary AlertDetails *serverAlertDetails }
type ServerAppliance ¶
type ServerAppliance struct { Identity OsInstallBase string `json:"os_installation_base,omitempty"` OsFamily string `json:"os_family,omitempty"` Os string `json:"os,omitempty"` OsVersion string `json:"os_version,omitempty"` Version string `json:"version,omitempty"` ServerTypeCompatibility []string `json:"server_type_compatibility,omitempty"` MinHddSize int `json:"min_hdd_size"` Architecture interface{} `json:"os_architecture"` Licenses interface{} `json:"licenses,omitempty"` Categories []string `json:"categories,omitempty"` // AvailableDatacenters []string `json:"available_datacenters,omitempty"` ApiPtr // contains filtered or unexported fields }
type ServerHdds ¶
type ServerHdds struct {
Hdds []Hdd `json:"hdds,omitempty"`
}
type ServerIpInfo ¶
type ServerPerm ¶
type ServerPerm struct { AccessKVMConsole bool `json:"access_kvm_console"` AssignIP bool `json:"assign_ip"` Clone bool `json:"clone"` Create bool `json:"create"` Delete bool `json:"delete"` ManageDVD bool `json:"manage_dvd"` ManageSnapshot bool `json:"manage_snapshot"` Reinstall bool `json:"reinstall"` Resize bool `json:"resize"` Restart bool `json:"restart"` SetDescription bool `json:"set_description"` SetName bool `json:"set_name"` Show bool `json:"show"` Shutdown bool `json:"shutdown"` Start bool `json:"start"` }
type ServerPrivateNetwork ¶ added in v1.3.6
type ServerRequest ¶
type ServerRequest struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Hardware Hardware `json:"hardware"` ApplianceId string `json:"appliance_id,omitempty"` Password string `json:"password,omitempty"` ServerType string `json:"server_type,omitempty"` Ipv6Range string `json:"ipv6_range,omitempty"` Hostname string `json:"hostname,omitempty"` PowerOn bool `json:"power_on"` FirewallPolicyId string `json:"firewall_policy_id,omitempty"` IpId string `json:"ip_id,omitempty"` LoadBalancerId string `json:"load_balancer_id,omitempty"` MonitoringPolicyId string `json:"monitoring_policy_id,omitempty"` DatacenterId string `json:"datacenter_id,omitempty"` SSHKey string `json:"rsa_key,omitempty"` SSHPassword *bool `json:"ssh_password,omitempty"` PublicKey []string `json:"public_key,omitempty"` PrivateNetworkId string `json:"private_network_id,omitempty"` }
type ServerSnapshot ¶
type SharedStorage ¶
type SharedStorage struct { // contains filtered or unexported fields }
func (*SharedStorage) GetState ¶
func (ss *SharedStorage) GetState() (string, error)
type SharedStorageAccess ¶
type SharedStorageAccess struct {}
type SharedStoragePerm ¶
type SharedStoragePerm struct {}
func (*SharedStoragePerm) SetAll ¶
func (ssp *SharedStoragePerm) SetAll(value bool)
Sets all shared storages' permissions
type SharedStorageRequest ¶
type SharedStorageRequest struct {}
type SharedStorageServer ¶
type SharedStorageServer struct {}
type SingleRecoveryAppliance ¶ added in v1.2.1
type Status ¶
Struct to hold the status of an API object.
Values of this type are used to represent the status of API objects like servers, firewall policies and the like.
The value of the "State" field can represent fixed states like "ACTIVE" or "POWERED_ON" but also transitional states like "POWERING_ON" or "CONFIGURING".
For fixed states the "Percent" field is empty where as for transitional states it contains the progress of the transition in percent.
type UpdateBlockStorageRequest ¶ added in v1.3.5
type UpdateImageRequest ¶ added in v1.3.4
type Usages ¶
type Usages struct { Images []usage `json:"IMAGES,omitempty"` LoadBalancers []usage `json:"LOAD BALANCERS,omitempty"` PublicIPs []usage `json:"PUBLIC IP,omitempty"` Servers []usage `json:"SERVERS,omitempty"` ApiPtr }
type User ¶
type UserApi ¶
type UserApi struct { Active bool `json:"active"` AllowedIps []string `json:"allowed_ips,omitempty"` UserApiKey ApiPtr }
type UserApiKey ¶
type UserApiKey struct {
Key string `json:"key,omitempty"`
}
type UserPerm ¶
type UserPerm struct { ChangeRole bool `json:"change_role"` Create bool `json:"create"` Delete bool `json:"delete"` Disable bool `json:"disable"` Enable bool `json:"enable"` ManageAPI bool `json:"manage_api"` SetDescription bool `json:"set_description"` SetEmail bool `json:"set_email"` SetPassword bool `json:"set_password"` Show bool `json:"show"` }
type UserRequest ¶
type VPN ¶
Source Files ¶
- blockstorages.go
- datacenters.go
- dvdisos.go
- errors.go
- firewallpolicies.go
- images.go
- loadbalancers.go
- logs.go
- monitoringcenter.go
- monitoringpolicies.go
- oneandone.go
- ping.go
- pricing.go
- privatenetworks.go
- publicips.go
- recoveryappliances.go
- restclient.go
- roles.go
- serverappliances.go
- servers.go
- setup.go
- sharedstorages.go
- sshkeys.go
- usages.go
- users.go
- vpns.go