Documentation ¶
Index ¶
- type APIKey
- type Account
- type AccountService
- type AccountServiceHandler
- type Application
- type ApplicationService
- type ApplicationServiceHandler
- type BMBareMetalBase
- type Backup
- type BackupSchedule
- type BackupScheduleReq
- type BackupService
- type BackupServiceHandler
- type Bandwidth
- type BareMetalPlan
- type BareMetalReq
- type BareMetalServer
- type BareMetalServerBandwidth
- type BareMetalServerService
- type BareMetalServerServiceHandler
- func (b *BareMetalServerServiceHandler) Create(ctx context.Context, bmCreate *BareMetalReq) (*BareMetalServer, error)
- func (b *BareMetalServerServiceHandler) Delete(ctx context.Context, serverID string) error
- func (b *BareMetalServerServiceHandler) Get(ctx context.Context, serverID string) (*BareMetalServer, error)
- func (b *BareMetalServerServiceHandler) GetBandwidth(ctx context.Context, serverID string) (*Bandwidth, error)
- func (b *BareMetalServerServiceHandler) Halt(ctx context.Context, serverID string) error
- func (b *BareMetalServerServiceHandler) List(ctx context.Context, options *ListOptions) ([]BareMetalServer, *Meta, error)
- func (b *BareMetalServerServiceHandler) ListIPv4s(ctx context.Context, serverID string, options *ListOptions) ([]IPv4, *Meta, error)
- func (b *BareMetalServerServiceHandler) ListIPv6s(ctx context.Context, serverID string, options *ListOptions) ([]IPv6, *Meta, error)
- func (b *BareMetalServerServiceHandler) MassHalt(ctx context.Context, serverList []string) error
- func (b *BareMetalServerServiceHandler) MassReboot(ctx context.Context, serverList []string) error
- func (b *BareMetalServerServiceHandler) MassStart(ctx context.Context, serverList []string) error
- func (b *BareMetalServerServiceHandler) Reboot(ctx context.Context, serverID string) error
- func (b *BareMetalServerServiceHandler) Reinstall(ctx context.Context, serverID string) error
- func (b *BareMetalServerServiceHandler) Update(ctx context.Context, serverID string, bmReq *BareMetalReq) error
- type BlockStorage
- type BlockStorageReq
- type BlockStorageService
- type BlockStorageServiceHandler
- func (b *BlockStorageServiceHandler) Attach(ctx context.Context, blockID, instanceID string, liveAttach string) error
- func (b *BlockStorageServiceHandler) Create(ctx context.Context, blockReq *BlockStorageReq) (*BlockStorage, error)
- func (b *BlockStorageServiceHandler) Delete(ctx context.Context, blockID string) error
- func (b *BlockStorageServiceHandler) Detach(ctx context.Context, blockID string, liveDetach string) error
- func (b *BlockStorageServiceHandler) Get(ctx context.Context, blockID string) (*BlockStorage, error)
- func (b *BlockStorageServiceHandler) List(ctx context.Context, options *ListOptions) ([]BlockStorage, *Meta, error)
- func (b *BlockStorageServiceHandler) Resize(ctx context.Context, blockID string, sizeGB int) error
- func (b *BlockStorageServiceHandler) Update(ctx context.Context, blockID string, label string) error
- type Client
- func (c *Client) DoWithContext(ctx context.Context, r *http.Request, data interface{}) error
- func (c *Client) NewRequest(ctx context.Context, method, uri string, body interface{}) (*http.Request, error)
- func (c *Client) OnRequestCompleted(rc RequestCompletionCallback)
- func (c *Client) SetBaseURL(baseURL string) error
- func (c *Client) SetRateLimit(time time.Duration)
- func (c *Client) SetRetryLimit(n int)
- func (c *Client) SetUserAgent(ua string)
- type Domain
- type DomainRecord
- type DomainRecordReq
- type DomainRecordService
- type DomainRecordsServiceHandler
- func (d *DomainRecordsServiceHandler) Create(ctx context.Context, domain string, domainRecordReq *DomainRecordReq) (*DomainRecord, error)
- func (d *DomainRecordsServiceHandler) Delete(ctx context.Context, domain, recordID string) error
- func (d *DomainRecordsServiceHandler) Get(ctx context.Context, domain, recordID string) (*DomainRecord, error)
- func (d *DomainRecordsServiceHandler) List(ctx context.Context, domain string, options *ListOptions) ([]DomainRecord, *Meta, error)
- func (d *DomainRecordsServiceHandler) Update(ctx context.Context, domain, recordID string, domainRecordReq *DomainRecordReq) error
- type DomainReq
- type DomainService
- type DomainServiceHandler
- func (d *DomainServiceHandler) Create(ctx context.Context, domainReq *DomainReq) (*Domain, error)
- func (d *DomainServiceHandler) Delete(ctx context.Context, domain string) error
- func (d *DomainServiceHandler) Get(ctx context.Context, domain string) (*Domain, error)
- func (d *DomainServiceHandler) GetDnsSec(ctx context.Context, domain string) ([]string, error)
- func (d *DomainServiceHandler) GetSoa(ctx context.Context, domain string) (*Soa, error)
- func (d *DomainServiceHandler) List(ctx context.Context, options *ListOptions) ([]Domain, *Meta, error)
- func (d *DomainServiceHandler) Update(ctx context.Context, domain, dnsSec string) error
- func (d *DomainServiceHandler) UpdateSoa(ctx context.Context, domain string, soaReq *Soa) error
- type FireWallGroupServiceHandler
- func (f *FireWallGroupServiceHandler) Create(ctx context.Context, fwGroupReq *FirewallGroupReq) (*FirewallGroup, error)
- func (f *FireWallGroupServiceHandler) Delete(ctx context.Context, fwGroupID string) error
- func (f *FireWallGroupServiceHandler) Get(ctx context.Context, fwGroupID string) (*FirewallGroup, error)
- func (f *FireWallGroupServiceHandler) List(ctx context.Context, options *ListOptions) ([]FirewallGroup, *Meta, error)
- func (f *FireWallGroupServiceHandler) Update(ctx context.Context, fwGroupID string, fwGroupReq *FirewallGroupReq) error
- type FireWallRuleService
- type FireWallRuleServiceHandler
- func (f *FireWallRuleServiceHandler) Create(ctx context.Context, fwGroupID string, fwRuleReq *FirewallRuleReq) (*FirewallRule, error)
- func (f *FireWallRuleServiceHandler) Delete(ctx context.Context, fwGroupID string, fwRuleID int) error
- func (f *FireWallRuleServiceHandler) List(ctx context.Context, fwGroupID string, options *ListOptions) ([]FirewallRule, *Meta, error)
- type FirewallGroup
- type FirewallGroupReq
- type FirewallGroupService
- type FirewallRule
- type FirewallRuleReq
- type ForwardingRule
- type ForwardingRules
- type GenericInfo
- type HealthCheck
- type IPv4
- type IPv6
- type ISO
- type ISOReq
- type ISOService
- type ISOServiceHandler
- func (i *ISOServiceHandler) Create(ctx context.Context, isoReq *ISOReq) (*ISO, error)
- func (i *ISOServiceHandler) Delete(ctx context.Context, isoID int) error
- func (i *ISOServiceHandler) Get(ctx context.Context, isoID int) (*ISO, error)
- func (i *ISOServiceHandler) List(ctx context.Context, options *ListOptions) ([]ISO, *Meta, error)
- func (i *ISOServiceHandler) ListPublic(ctx context.Context, options *ListOptions) ([]PublicISO, *Meta, error)
- type Instance
- type InstanceList
- type InstanceReq
- type InstanceService
- type InstanceServiceHandler
- func (i *InstanceServiceHandler) AttachISO(ctx context.Context, instanceID, isoID string) error
- func (i *InstanceServiceHandler) AttachPrivateNetwork(ctx context.Context, instanceID, networkID string) error
- func (i *InstanceServiceHandler) Create(ctx context.Context, instanceReq *InstanceReq) (*Instance, error)
- func (i *InstanceServiceHandler) CreateIPv4(ctx context.Context, instanceID string, reboot bool) (*IPv4, error)
- func (i *InstanceServiceHandler) CreateReverseIPv4(ctx context.Context, instanceID string, reverseReq *ReverseIP) error
- func (i *InstanceServiceHandler) CreateReverseIPv6(ctx context.Context, instanceID string, reverseReq *ReverseIP) error
- func (i *InstanceServiceHandler) DefaultReverseIPv4(ctx context.Context, instanceID, ip string) error
- func (i *InstanceServiceHandler) Delete(ctx context.Context, instanceID string) error
- func (i *InstanceServiceHandler) DeleteIPv4(ctx context.Context, instanceID, ip string) error
- func (i *InstanceServiceHandler) DeleteReverseIPv6(ctx context.Context, instanceID, ip string) error
- func (i *InstanceServiceHandler) DetachISO(ctx context.Context, instanceID string) error
- func (i *InstanceServiceHandler) DetachPrivateNetwork(ctx context.Context, instanceID, networkID string) error
- func (i *InstanceServiceHandler) Get(ctx context.Context, instanceID string) (*Instance, error)
- func (i *InstanceServiceHandler) GetBackupSchedule(ctx context.Context, instanceID string) (*BackupSchedule, error)
- func (i *InstanceServiceHandler) GetBandwidth(ctx context.Context, instanceID string) (*Bandwidth, error)
- func (i *InstanceServiceHandler) GetNeighbors(ctx context.Context, instanceID string) (*Neighbors, error)
- func (i *InstanceServiceHandler) GetUserData(ctx context.Context, instanceID string) (*UserData, error)
- func (i *InstanceServiceHandler) Halt(ctx context.Context, instanceID string) error
- func (i *InstanceServiceHandler) ISOStatus(ctx context.Context, instanceID string) (*Iso, error)
- func (i *InstanceServiceHandler) List(ctx context.Context, options *ListOptions) ([]Instance, *Meta, error)
- func (i *InstanceServiceHandler) ListIPv4(ctx context.Context, instanceID string, options *ListOptions) ([]IPv4, *Meta, error)
- func (i *InstanceServiceHandler) ListIPv6(ctx context.Context, instanceID string, options *ListOptions) ([]IPv6, *Meta, error)
- func (i *InstanceServiceHandler) ListPrivateNetworks(ctx context.Context, instanceID string) ([]PrivateNetwork, *Meta, error)
- func (i *InstanceServiceHandler) ListReverseIPv6(ctx context.Context, instanceID string) ([]ReverseIP, error)
- func (i *InstanceServiceHandler) MassHalt(ctx context.Context, instanceList []string) error
- func (i *InstanceServiceHandler) MassReboot(ctx context.Context, instanceList []string) error
- func (i *InstanceServiceHandler) MassStart(ctx context.Context, instanceList []string) error
- func (i *InstanceServiceHandler) Reboot(ctx context.Context, instanceID string) error
- func (i *InstanceServiceHandler) Reinstall(ctx context.Context, instanceID string) error
- func (i *InstanceServiceHandler) Restore(ctx context.Context, instanceID string, restoreReq *RestoreReq) error
- func (i *InstanceServiceHandler) SetBackupSchedule(ctx context.Context, instanceID string, backup *BackupScheduleReq) error
- func (i *InstanceServiceHandler) Start(ctx context.Context, instanceID string) error
- func (i *InstanceServiceHandler) Update(ctx context.Context, instanceID string, instanceReq *InstanceReq) error
- type Iso
- type Links
- type ListOptions
- type LoadBalancer
- type LoadBalancerHandler
- func (l *LoadBalancerHandler) Create(ctx context.Context, createReq *LoadBalancerReq) (*LoadBalancer, error)
- func (l *LoadBalancerHandler) CreateForwardingRule(ctx context.Context, ID string, rule *ForwardingRule) (*ForwardingRule, error)
- func (l *LoadBalancerHandler) Delete(ctx context.Context, ID string) error
- func (l *LoadBalancerHandler) DeleteForwardingRule(ctx context.Context, ID string, RuleID string) error
- func (l *LoadBalancerHandler) Get(ctx context.Context, ID string) (*LoadBalancer, error)
- func (l *LoadBalancerHandler) GetForwardingRule(ctx context.Context, ID string, ruleID string) (*ForwardingRule, error)
- func (l *LoadBalancerHandler) List(ctx context.Context, options *ListOptions) ([]LoadBalancer, *Meta, error)
- func (l *LoadBalancerHandler) ListForwardingRules(ctx context.Context, ID string, options *ListOptions) ([]ForwardingRule, *Meta, error)
- func (l *LoadBalancerHandler) Update(ctx context.Context, ID string, updateReq *LoadBalancerReq) error
- type LoadBalancerReq
- type LoadBalancerService
- type Meta
- type Neighbors
- type Network
- type NetworkReq
- type NetworkService
- type NetworkServiceHandler
- func (n *NetworkServiceHandler) Create(ctx context.Context, createReq *NetworkReq) (*Network, error)
- func (n *NetworkServiceHandler) Delete(ctx context.Context, networkID string) error
- func (n *NetworkServiceHandler) Get(ctx context.Context, networkID string) (*Network, error)
- func (n *NetworkServiceHandler) List(ctx context.Context, options *ListOptions) ([]Network, *Meta, error)
- func (n *NetworkServiceHandler) Update(ctx context.Context, networkID string, updateReq *NetworkReq) error
- type OS
- type OSService
- type OSServiceHandler
- type ObjectStorage
- type ObjectStorageCluster
- type ObjectStorageService
- type ObjectStorageServiceHandler
- func (o *ObjectStorageServiceHandler) Create(ctx context.Context, clusterID int, label string) (*ObjectStorage, error)
- func (o *ObjectStorageServiceHandler) Delete(ctx context.Context, id int) error
- func (o *ObjectStorageServiceHandler) Get(ctx context.Context, id int) (*ObjectStorage, error)
- func (o *ObjectStorageServiceHandler) List(ctx context.Context, options *ListOptions) ([]ObjectStorage, *Meta, error)
- func (o *ObjectStorageServiceHandler) ListCluster(ctx context.Context, options *ListOptions) ([]ObjectStorageCluster, *Meta, error)
- func (o *ObjectStorageServiceHandler) RegenerateKeys(ctx context.Context, id int) (*S3Keys, error)
- func (o *ObjectStorageServiceHandler) Update(ctx context.Context, id int, label string) error
- type Plan
- type PlanService
- type PlanServiceHandler
- type PrivateNetwork
- type PublicISO
- type Region
- type RegionService
- type RegionServiceHandler
- type RequestBody
- type RequestCompletionCallback
- type ReservedIP
- type ReservedIPReq
- type ReservedIPService
- type ReservedIPServiceHandler
- func (r *ReservedIPServiceHandler) Attach(ctx context.Context, id string, ripAttach *ReservedIPReq) error
- func (r *ReservedIPServiceHandler) Convert(ctx context.Context, ripConvert *ReservedIPReq) (*ReservedIP, error)
- func (r *ReservedIPServiceHandler) Create(ctx context.Context, ripCreate *ReservedIPReq) (*ReservedIP, error)
- func (r *ReservedIPServiceHandler) Delete(ctx context.Context, id string) error
- func (r *ReservedIPServiceHandler) Detach(ctx context.Context, id string) error
- func (r *ReservedIPServiceHandler) Get(ctx context.Context, id string) (*ReservedIP, error)
- func (r *ReservedIPServiceHandler) List(ctx context.Context, options *ListOptions) ([]ReservedIP, *Meta, error)
- type RestoreReq
- type ReverseIP
- type S3Keys
- type SSHKey
- type SSHKeyReq
- type SSHKeyService
- type SSHKeyServiceHandler
- func (s *SSHKeyServiceHandler) Create(ctx context.Context, sshKeyReq *SSHKeyReq) (*SSHKey, error)
- func (s *SSHKeyServiceHandler) Delete(ctx context.Context, sshKeyID string) error
- func (s *SSHKeyServiceHandler) Get(ctx context.Context, sshKeyID string) (*SSHKey, error)
- func (s *SSHKeyServiceHandler) List(ctx context.Context, options *ListOptions) ([]SSHKey, *Meta, error)
- func (s *SSHKeyServiceHandler) Update(ctx context.Context, sshKeyID string, sshKeyReq *SSHKeyReq) error
- type SSL
- type Snapshot
- type SnapshotReq
- type SnapshotService
- type SnapshotServiceHandler
- func (s *SnapshotServiceHandler) Create(ctx context.Context, snapshotReq *SnapshotReq) (*Snapshot, error)
- func (s *SnapshotServiceHandler) CreateFromURL(ctx context.Context, snapshotURLReq SnapshotURLReq) (*Snapshot, error)
- func (s *SnapshotServiceHandler) Delete(ctx context.Context, snapshotID string) error
- func (s *SnapshotServiceHandler) Get(ctx context.Context, snapshotID string) (*Snapshot, error)
- func (s *SnapshotServiceHandler) List(ctx context.Context, options *ListOptions) ([]Snapshot, *Meta, error)
- type SnapshotURLReq
- type Soa
- type StartupScript
- type StartupScriptReq
- type StartupScriptService
- type StartupScriptServiceHandler
- func (s *StartupScriptServiceHandler) Create(ctx context.Context, scriptReq *StartupScriptReq) (*StartupScript, error)
- func (s *StartupScriptServiceHandler) Delete(ctx context.Context, scriptID string) error
- func (s *StartupScriptServiceHandler) Get(ctx context.Context, scriptID string) (*StartupScript, error)
- func (s *StartupScriptServiceHandler) List(ctx context.Context, options *ListOptions) ([]StartupScript, *Meta, error)
- func (s *StartupScriptServiceHandler) Update(ctx context.Context, scriptID string, scriptReq *StartupScriptReq) error
- type StickySessions
- type User
- type UserData
- type UserReq
- type UserService
- type UserServiceHandler
- func (u *UserServiceHandler) Create(ctx context.Context, userCreate *UserReq) (*User, error)
- func (u *UserServiceHandler) Delete(ctx context.Context, userID string) error
- func (u *UserServiceHandler) Get(ctx context.Context, userID string) (*User, error)
- func (u *UserServiceHandler) List(ctx context.Context, options *ListOptions) ([]User, *Meta, error)
- func (u *UserServiceHandler) Update(ctx context.Context, userID string, userReq *UserReq) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKey ¶
type APIKey struct {
// contains filtered or unexported fields
}
APIKey contains a users API Key for interacting with the API
type Account ¶
type Account struct { Balance string `json:"balance"` PendingCharges string `json:"pending_charges"` LastPaymentDate string `json:"last_payment_date"` LastPaymentAmount string `json:"last_payment_amount"` Name string `json:"name"` Email string `json:"email"` ACL []string `json:"acls"` }
Account represents a Vultr account
type AccountService ¶
AccountService is the interface to interact with Accounts endpoint on the Vultr API
type AccountServiceHandler ¶
type AccountServiceHandler struct {
// contains filtered or unexported fields
}
AccountServiceHandler handles interaction with the account methods for the Vultr API
type Application ¶
type Application struct { ID int `json:"id"` Name string `json:"name"` ShortName string `json:"short_name"` DeployName string `json:"deploy_name"` }
Application represents all available apps that can be used to deployed with vultr Instances.
type ApplicationService ¶
type ApplicationService interface {
List(ctx context.Context, options *ListOptions) ([]Application, *Meta, error)
}
ApplicationService is the interface to interact with the Application endpoint on the Vultr API.
type ApplicationServiceHandler ¶
type ApplicationServiceHandler struct {
// contains filtered or unexported fields
}
ApplicationServiceHandler handles interaction with the application methods for the Vultr API.
func (*ApplicationServiceHandler) List ¶
func (a *ApplicationServiceHandler) List(ctx context.Context, options *ListOptions) ([]Application, *Meta, error)
List retrieves a list of available applications that can be launched when creating a Vultr instance
type BMBareMetalBase ¶
type BMBareMetalBase struct {
BareMetalBandwidth map[string]BareMetalServerBandwidth `json:"bandwidth"`
}
type Backup ¶
type Backup struct { ID string `json:"id"` DateCreated string `json:"date_created"` Description string `json:"description"` Size int `json:"size"` Status string `json:"status"` }
Backup represents a Vultr backup
type BackupSchedule ¶
type BackupScheduleReq ¶
type BackupService ¶
type BackupService interface { Get(ctx context.Context, backupID string) (*Backup, error) List(ctx context.Context, options *ListOptions) ([]Backup, *Meta, error) }
BackupService is the interface to interact with the backup endpoint on the Vultr API
type BackupServiceHandler ¶
type BackupServiceHandler struct {
// contains filtered or unexported fields
}
BackupServiceHandler handles interaction with the backup methods for the Vultr API
func (*BackupServiceHandler) List ¶
func (b *BackupServiceHandler) List(ctx context.Context, options *ListOptions) ([]Backup, *Meta, error)
List retrieves a list of all backups on the current account
type BareMetalPlan ¶
type BareMetalPlan struct { ID string `json:"id"` CPUCount int `json:"cpu_count"` CPUModel string `json:"cpu_model"` CPUThreads int `json:"cpu_threads"` Ram int `json:"ram"` Disk int `json:"disk"` Bandwidth int `json:"bandwidth"` MonthlyCost int `json:"monthly_cost"` Type string `json:"type"` Locations []Region `json:"locations"` }
BareMetalPlan represents bare metal plans
type BareMetalReq ¶
type BareMetalReq struct { Region string `json:"region,omitempty"` Plan string `json:"plan,omitempty"` OsID int `json:"os_id,omitempty"` StartupScriptID string `json:"script_id,omitempty"` SnapshotID string `json:"snapshot_id,omitempty"` EnableIPv6 string `json:"enable_ipv6,omitempty"` Label string `json:"label,omitempty"` SSHKeyIDs []string `json:"sshkey_id,omitempty"` AppID int `json:"app_id,omitempty"` UserData string `json:"user_data,omitempty"` NotifyActivate string `json:"notify_activate,omitempty"` Hostname string `json:"hostname,omitempty"` Tag string `json:"tag,omitempty"` ReservedIPv4 string `json:"reserved_ipv4,omitempty"` }
BareMetalReq represents the optional parameters that can be set when creating or updating a bare metal server
type BareMetalServer ¶
type BareMetalServer struct { ID string `json:"id"` Os string `json:"os"` RAM string `json:"ram"` Disk string `json:"disk"` MainIP string `json:"main_ip"` CPUCount int `json:"cpu_count"` Region string `json:"region"` DefaultPassword string `json:"default_password"` DateCreated string `json:"date_created"` Status string `json:"status"` NetmaskV4 string `json:"netmask_v4"` GatewayV4 string `json:"gateway_v4"` Plan string `json:"plan"` V6Network string `json:"v6_network"` V6MainIP string `json:"v6_main_ip"` V6Subnet int `json:"v6_subnet"` Label string `json:"label"` Tag string `json:"tag"` OsID int `json:"os_id"` AppID int `json:"app_id"` Features []string `json:"features"` }
BareMetalServer represents a bare metal server on Vultr
type BareMetalServerBandwidth ¶
type BareMetalServerBandwidth struct { IncomingBytes int `json:"incoming_bytes"` OutgoingBytes int `json:"outgoing_bytes"` }
BareMetalServerBandwidth represents bandwidth information for a bare metal server
type BareMetalServerService ¶
type BareMetalServerService interface { Create(ctx context.Context, bmCreate *BareMetalReq) (*BareMetalServer, error) Get(ctx context.Context, serverID string) (*BareMetalServer, error) Update(ctx context.Context, serverID string, bmReq *BareMetalReq) error Delete(ctx context.Context, serverID string) error List(ctx context.Context, options *ListOptions) ([]BareMetalServer, *Meta, error) GetBandwidth(ctx context.Context, serverID string) (*Bandwidth, error) ListIPv4s(ctx context.Context, serverID string, options *ListOptions) ([]IPv4, *Meta, error) ListIPv6s(ctx context.Context, serverID string, options *ListOptions) ([]IPv6, *Meta, error) Halt(ctx context.Context, serverID string) error Reboot(ctx context.Context, serverID string) error Reinstall(ctx context.Context, serverID string) error MassStart(ctx context.Context, serverList []string) error MassHalt(ctx context.Context, serverList []string) error MassReboot(ctx context.Context, serverList []string) error }
BareMetalServerService is the interface to interact with the bare metal endpoints on the Vultr API
type BareMetalServerServiceHandler ¶
type BareMetalServerServiceHandler struct {
// contains filtered or unexported fields
}
BareMetalServerServiceHandler handles interaction with the bare metal methods for the Vultr API
func (*BareMetalServerServiceHandler) Create ¶
func (b *BareMetalServerServiceHandler) Create(ctx context.Context, bmCreate *BareMetalReq) (*BareMetalServer, error)
Create a new bare metal server.
func (*BareMetalServerServiceHandler) Delete ¶
func (b *BareMetalServerServiceHandler) Delete(ctx context.Context, serverID string) error
Delete a bare metal server. All data will be permanently lost, and the IP address will be released. There is no going back from this call.
func (*BareMetalServerServiceHandler) Get ¶
func (b *BareMetalServerServiceHandler) Get(ctx context.Context, serverID string) (*BareMetalServer, error)
Get gets the server with the given ID
func (*BareMetalServerServiceHandler) GetBandwidth ¶
func (b *BareMetalServerServiceHandler) GetBandwidth(ctx context.Context, serverID string) (*Bandwidth, error)
Bandwidth will get the bandwidth used by a bare metal server
func (*BareMetalServerServiceHandler) Halt ¶
func (b *BareMetalServerServiceHandler) Halt(ctx context.Context, serverID string) error
Halt a bare metal server. This is a hard power off, meaning that the power to the machine is severed. The data on the machine will not be modified, and you will still be billed for the machine.
func (*BareMetalServerServiceHandler) List ¶
func (b *BareMetalServerServiceHandler) List(ctx context.Context, options *ListOptions) ([]BareMetalServer, *Meta, error)
List lists all bare metal servers on the current account. This includes both pending and active servers.
func (*BareMetalServerServiceHandler) ListIPv4s ¶
func (b *BareMetalServerServiceHandler) ListIPv4s(ctx context.Context, serverID string, options *ListOptions) ([]IPv4, *Meta, error)
ListIPv4s will List the IPv4 information of a bare metal server. IP information is only available for bare metal servers in the "active" state.
func (*BareMetalServerServiceHandler) ListIPv6s ¶
func (b *BareMetalServerServiceHandler) ListIPv6s(ctx context.Context, serverID string, options *ListOptions) ([]IPv6, *Meta, error)
ListIPv6s lists the IPv6 information of a bare metal server. IP information is only available for bare metal servers in the "active" state. If the bare metal server does not have IPv6 enabled, then an empty array is returned.
func (*BareMetalServerServiceHandler) MassHalt ¶
func (b *BareMetalServerServiceHandler) MassHalt(ctx context.Context, serverList []string) error
Halt will pause a list of bare metals.
func (*BareMetalServerServiceHandler) MassReboot ¶
func (b *BareMetalServerServiceHandler) MassReboot(ctx context.Context, serverList []string) error
MassReboot reboots a list of instances.
func (*BareMetalServerServiceHandler) MassStart ¶
func (b *BareMetalServerServiceHandler) MassStart(ctx context.Context, serverList []string) error
Start will start a list of bare metal servers the machine is already running, it will be restarted.
func (*BareMetalServerServiceHandler) Reboot ¶
func (b *BareMetalServerServiceHandler) Reboot(ctx context.Context, serverID string) error
Reboot a bare metal server. This is a hard reboot, which means that the server is powered off, then back on.
func (*BareMetalServerServiceHandler) Reinstall ¶
func (b *BareMetalServerServiceHandler) Reinstall(ctx context.Context, serverID string) error
Reinstall the operating system on a bare metal server. All data will be permanently lost, but the IP address will remain the same. There is no going back from this call.
func (*BareMetalServerServiceHandler) Update ¶
func (b *BareMetalServerServiceHandler) Update(ctx context.Context, serverID string, bmReq *BareMetalReq) error
Update will update the given bare metal. Empty values are ignored
type BlockStorage ¶
type BlockStorage struct { ID string `json:"id"` Cost int `json:"cost"` Status string `json:"status"` SizeGB int `json:"size_gb"` Region string `json:"region"` DateCreated string `json:"date_created"` AttachedToInstance string `json:"attached_to_instance"` Label string `json:"label"` }
BlockStorage represents Vultr Block-Storage
type BlockStorageReq ¶
type BlockStorageReq struct { Region string `json:"region"` SizeGB int `json:"size_gb"` Label string `json:"label,omitempty"` }
BlockStorageReq
type BlockStorageService ¶
type BlockStorageService interface { Create(ctx context.Context, blockReq *BlockStorageReq) (*BlockStorage, error) Get(ctx context.Context, blockID string) (*BlockStorage, error) Update(ctx context.Context, blockID string, label string) error Delete(ctx context.Context, blockID string) error List(ctx context.Context, options *ListOptions) ([]BlockStorage, *Meta, error) Attach(ctx context.Context, blockID, instanceID string, liveAttach string) error Detach(ctx context.Context, blockID string, liveDetach string) error Resize(ctx context.Context, blockID string, sizeGB int) error }
BlockStorageService is the interface to interact with Block-Storage endpoint on the Vultr API
type BlockStorageServiceHandler ¶
type BlockStorageServiceHandler struct {
// contains filtered or unexported fields
}
BlockStorageServiceHandler handles interaction with the block-storage methods for the Vultr API
func (*BlockStorageServiceHandler) Attach ¶
func (b *BlockStorageServiceHandler) Attach(ctx context.Context, blockID, instanceID string, liveAttach string) error
Attach will link a given block storage to a given Vultr vps If liveAttach is set to "yes" the block storage will be attached without reloading the instance
func (*BlockStorageServiceHandler) Create ¶
func (b *BlockStorageServiceHandler) Create(ctx context.Context, blockReq *BlockStorageReq) (*BlockStorage, error)
Create builds out a block storage
func (*BlockStorageServiceHandler) Delete ¶
func (b *BlockStorageServiceHandler) Delete(ctx context.Context, blockID string) error
Delete will remove block storage instance from your Vultr account
func (*BlockStorageServiceHandler) Detach ¶
func (b *BlockStorageServiceHandler) Detach(ctx context.Context, blockID string, liveDetach string) error
Detach will de-link a given block storage to the Vultr instance it is attached to If liveDetach is set to "yes" the block storage will be detached without reloading the instance
func (*BlockStorageServiceHandler) Get ¶
func (b *BlockStorageServiceHandler) Get(ctx context.Context, blockID string) (*BlockStorage, error)
Get returns a single block storage instance based ony our blockID you provide from your Vultr Account
func (*BlockStorageServiceHandler) List ¶
func (b *BlockStorageServiceHandler) List(ctx context.Context, options *ListOptions) ([]BlockStorage, *Meta, error)
List returns a list of all block storage instances on your Vultr Account
type Client ¶
type Client struct { // BASE URL for APIs BaseURL *url.URL // User Agent for the client UserAgent string // API Key APIKey APIKey // Services used to interact with the API Account AccountService Application ApplicationService Backup BackupService //BareMetalServer BareMetalServerService BlockStorage BlockStorageService Domain DomainService DomainRecord DomainRecordService FirewallGroup FirewallGroupService FirewallRule FireWallRuleService Instance InstanceService ISO ISOService LoadBalancer LoadBalancerService Network NetworkService ObjectStorage ObjectStorageService OS OSService Plan PlanService Region RegionService ReservedIP ReservedIPService Snapshot SnapshotService SSHKey SSHKeyService StartupScript StartupScriptService User UserService // contains filtered or unexported fields }
Client manages interaction with the Vultr V1 API
func (*Client) DoWithContext ¶
DoWithContext sends an API Request and returns back the response. The API response is checked to see if it was a successful call. A successful call is then checked to see if we need to unmarshal since some resources have their own implements of unmarshal.
func (*Client) NewRequest ¶
func (c *Client) NewRequest(ctx context.Context, method, uri string, body interface{}) (*http.Request, error)
NewRequest creates an API Request
func (*Client) OnRequestCompleted ¶
func (c *Client) OnRequestCompleted(rc RequestCompletionCallback)
OnRequestCompleted sets the API request completion callback
func (*Client) SetBaseURL ¶
SetBaseURL Overrides the default BaseUrl
func (*Client) SetRateLimit ¶
SetRateLimit Overrides the default rateLimit. For performance, exponential backoff is used with the minimum wait being 2/3rds the time provided.
func (*Client) SetRetryLimit ¶
SetRetryLimit overrides the default RetryLimit
func (*Client) SetUserAgent ¶
SetUserAgent Overrides the default UserAgent
type Domain ¶
type Domain struct { Domain string `json:"domain,omitempty"` DateCreated string `json:"date_created,omitempty"` }
Domain represents a Domain entry on Vultr
type DomainRecord ¶
type DomainRecord struct { ID string `json:"id,omitempty"` Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` Data string `json:"data,omitempty"` Priority int `json:"priority,omitempty"` TTL int `json:"ttl,omitempty"` }
DomainRecord represents a DNS record on Vultr
type DomainRecordReq ¶
type DomainRecordReq struct { Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Data string `json:"data,omitempty"` TTL int `json:"ttl,omitempty"` Priority int `json:"priority,omitempty"` }
DomainRecordReq struct to use for create/update domain record calls.
type DomainRecordService ¶
type DomainRecordService interface { Create(ctx context.Context, domain string, domainRecordReq *DomainRecordReq) (*DomainRecord, error) Get(ctx context.Context, domain, recordID string) (*DomainRecord, error) Update(ctx context.Context, domain, recordID string, domainRecordReq *DomainRecordReq) error Delete(ctx context.Context, domain, recordID string) error List(ctx context.Context, domain string, options *ListOptions) ([]DomainRecord, *Meta, error) }
DomainRecordService is the interface to interact with the DNS Records endpoints on the Vultr API Link: https://www.vultr.com/api/v2/#tag/dns
type DomainRecordsServiceHandler ¶
type DomainRecordsServiceHandler struct {
// contains filtered or unexported fields
}
DNSRecordsServiceHandler handles interaction with the DNS Records methods for the Vultr API
func (*DomainRecordsServiceHandler) Create ¶
func (d *DomainRecordsServiceHandler) Create(ctx context.Context, domain string, domainRecordReq *DomainRecordReq) (*DomainRecord, error)
Create will add a DNS record.
func (*DomainRecordsServiceHandler) Delete ¶
func (d *DomainRecordsServiceHandler) Delete(ctx context.Context, domain, recordID string) error
Delete will delete a domain name and all associated records.
func (*DomainRecordsServiceHandler) Get ¶
func (d *DomainRecordsServiceHandler) Get(ctx context.Context, domain, recordID string) (*DomainRecord, error)
Get record from a domain
func (*DomainRecordsServiceHandler) List ¶
func (d *DomainRecordsServiceHandler) List(ctx context.Context, domain string, options *ListOptions) ([]DomainRecord, *Meta, error)
List will list all the records associated with a particular domain on Vultr.
func (*DomainRecordsServiceHandler) Update ¶
func (d *DomainRecordsServiceHandler) Update(ctx context.Context, domain, recordID string, domainRecordReq *DomainRecordReq) error
Update will update a Domain record
type DomainReq ¶
type DomainReq struct { Domain string `json:"domain,omitempty"` IP string `json:"ip,omitempty"` DNSSec string `json:"dns_sec,omitempty"` }
DomainReq is the struct to create a domain If IP is omitted then an empty DNS entry will be created. If supplied the domain will be pre populated with entries
type DomainService ¶
type DomainService interface { Create(ctx context.Context, domainReq *DomainReq) (*Domain, error) Get(ctx context.Context, domain string) (*Domain, error) Update(ctx context.Context, domain, dnsSec string) error Delete(ctx context.Context, domain string) error List(ctx context.Context, options *ListOptions) ([]Domain, *Meta, error) GetSoa(ctx context.Context, domain string) (*Soa, error) UpdateSoa(ctx context.Context, domain string, soaReq *Soa) error GetDnsSec(ctx context.Context, domain string) ([]string, error) }
DNSDomainService is the interface to interact with the DNS endpoints on the Vultr API https://www.vultr.com/api/v2/#tag/dns
type DomainServiceHandler ¶
type DomainServiceHandler struct {
// contains filtered or unexported fields
}
DNSDomainServiceHandler handles interaction with the DNS methods for the Vultr API
func (*DomainServiceHandler) Delete ¶
func (d *DomainServiceHandler) Delete(ctx context.Context, domain string) error
Delete a domain with all associated records.
func (*DomainServiceHandler) List ¶
func (d *DomainServiceHandler) List(ctx context.Context, options *ListOptions) ([]Domain, *Meta, error)
List gets all domains associated with the current Vultr account.
type FireWallGroupServiceHandler ¶
type FireWallGroupServiceHandler struct {
// contains filtered or unexported fields
}
FireWallGroupServiceHandler handles interaction with the firewall group methods for the Vultr API
func (*FireWallGroupServiceHandler) Create ¶
func (f *FireWallGroupServiceHandler) Create(ctx context.Context, fwGroupReq *FirewallGroupReq) (*FirewallGroup, error)
Create will create a new firewall group on your Vultr account
func (*FireWallGroupServiceHandler) Delete ¶
func (f *FireWallGroupServiceHandler) Delete(ctx context.Context, fwGroupID string) error
Delete will delete a firewall group from your Vultr account
func (*FireWallGroupServiceHandler) Get ¶
func (f *FireWallGroupServiceHandler) Get(ctx context.Context, fwGroupID string) (*FirewallGroup, error)
Get will return a firewall group based on provided groupID from your Vultr account
func (*FireWallGroupServiceHandler) List ¶
func (f *FireWallGroupServiceHandler) List(ctx context.Context, options *ListOptions) ([]FirewallGroup, *Meta, error)
List will return a list of all firewall groups on your Vultr account
func (*FireWallGroupServiceHandler) Update ¶
func (f *FireWallGroupServiceHandler) Update(ctx context.Context, fwGroupID string, fwGroupReq *FirewallGroupReq) error
Update will change the description of a firewall group
type FireWallRuleService ¶
type FireWallRuleService interface { Create(ctx context.Context, fwGroupID string, fwRuleReq *FirewallRuleReq) (*FirewallRule, error) Delete(ctx context.Context, fwGroupID string, fwRuleID int) error List(ctx context.Context, fwGroupID string, options *ListOptions) ([]FirewallRule, *Meta, error) }
FireWallRuleService is the interface to interact with the firewall rule endpoints on the Vultr API
type FireWallRuleServiceHandler ¶
type FireWallRuleServiceHandler struct {
// contains filtered or unexported fields
}
FireWallRuleServiceHandler handles interaction with the firewall rule methods for the Vultr API
func (*FireWallRuleServiceHandler) Create ¶
func (f *FireWallRuleServiceHandler) Create(ctx context.Context, fwGroupID string, fwRuleReq *FirewallRuleReq) (*FirewallRule, error)
Create will create a rule in a firewall group.
func (*FireWallRuleServiceHandler) Delete ¶
func (f *FireWallRuleServiceHandler) Delete(ctx context.Context, fwGroupID string, fwRuleID int) error
Delete will delete a firewall rule on your Vultr account
func (*FireWallRuleServiceHandler) List ¶
func (f *FireWallRuleServiceHandler) List(ctx context.Context, fwGroupID string, options *ListOptions) ([]FirewallRule, *Meta, error)
List will return both ipv4 an ipv6 firewall rules that are defined within a firewall group
type FirewallGroup ¶
type FirewallGroup struct { ID string `json:"id"` Description string `json:"description"` DateCreated string `json:"date_created"` DateModified string `json:"date_modified"` InstanceCount int `json:"instance_count"` RuleCount int `json:"rule_count"` MaxRuleCount int `json:"max_rule_count"` }
FirewallGroup represents a Vultr firewall group
type FirewallGroupReq ¶
type FirewallGroupReq struct {
Description string `json:"description"`
}
FirewallGroupReq
type FirewallGroupService ¶
type FirewallGroupService interface { Create(ctx context.Context, fwGroupReq *FirewallGroupReq) (*FirewallGroup, error) Get(ctx context.Context, groupID string) (*FirewallGroup, error) Update(ctx context.Context, fwGroupID string, fwGroupReq *FirewallGroupReq) error Delete(ctx context.Context, fwGroupID string) error List(ctx context.Context, options *ListOptions) ([]FirewallGroup, *Meta, error) }
FirewallGroupService is the interface to interact with the firewall group endpoints on the Vultr API
type FirewallRule ¶
type FirewallRule struct { ID int `json:"id"` Action string `json:"action"` Type string `json:"type"` Protocol string `json:"protocol"` Port string `json:"port"` Subnet string `json:"subnet"` SubnetSize int `json:"subnet_size"` Source string `json:"source"` Notes string `json:"notes"` }
FirewallRule represents a Vultr firewall rule
type FirewallRuleReq ¶
type FirewallRuleReq struct { IPType string `json:"ip_type"` Protocol string `json:"protocol"` Subnet string `json:"subnet"` SubnetSize int `json:"subnet_size"` Port string `json:"port,omitempty"` Source string `json:"source,omitempty"` Notes string `json:"notes,omitempty"` }
FirewallRuleReq
type ForwardingRule ¶
type ForwardingRule struct { RuleID string `json:"id,omitempty"` FrontendProtocol string `json:"frontend_protocol,omitempty"` FrontendPort int `json:"frontend_port,omitempty"` BackendProtocol string `json:"backend_protocol,omitempty"` BackendPort int `json:"backend_port,omitempty"` }
ForwardingRule represent a single forwarding rule
type ForwardingRules ¶
type ForwardingRules struct {
ForwardRuleList []ForwardingRule `json:"forwarding_rules,omitempty"`
}
ForwardingRules represent a list of forwarding rules
type GenericInfo ¶
type GenericInfo struct { BalancingAlgorithm string `json:"balancing_algorithm,omitempty"` SSLRedirect bool `json:"ssl_redirect,omitempty"` StickySessions *StickySessions `json:"sticky_sessions,omitempty"` ProxyProtocol string `json:"proxy_protocol,omitempty"` }
GenericInfo represents generic configuration of your load balancer
type HealthCheck ¶
type HealthCheck struct { Protocol string `json:"protocol,omitempty"` Port int `json:"port,omitempty"` Path string `json:"path,omitempty"` CheckInterval int `json:"check_interval,omitempty"` ResponseTimeout int `json:"response_timeout,omitempty"` UnhealthyThreshold int `json:"unhealthy_threshold,omitempty"` HealthyThreshold int `json:"healthy_threshold,omitempty"` }
HealthCheck represents your health check configuration for your load balancer.
type ISO ¶
type ISO struct { ID int `json:"id"` DateCreated string `json:"date_created"` FileName string `json:"filename"` Size int `json:"size,omitempty"` MD5Sum string `json:"md5sum,omitempty"` SHA512Sum string `json:"sha512sum,omitempty"` Status string `json:"status"` }
ISO represents ISOs currently available on this account.
type ISOService ¶
type ISOService interface { Create(ctx context.Context, isoReq *ISOReq) (*ISO, error) Get(ctx context.Context, isoID int) (*ISO, error) Delete(ctx context.Context, isoID int) error List(ctx context.Context, options *ListOptions) ([]ISO, *Meta, error) ListPublic(ctx context.Context, options *ListOptions) ([]PublicISO, *Meta, error) }
ISOService is the interface to interact with the ISO endpoints on the Vultr API
type ISOServiceHandler ¶
type ISOServiceHandler struct {
Client *Client
}
ISOServiceHandler handles interaction with the ISO methods for the Vultr API
func (*ISOServiceHandler) Delete ¶
func (i *ISOServiceHandler) Delete(ctx context.Context, isoID int) error
Delete will delete an ISO image from your account
func (*ISOServiceHandler) List ¶
func (i *ISOServiceHandler) List(ctx context.Context, options *ListOptions) ([]ISO, *Meta, error)
List will list all ISOs currently available on your account
func (*ISOServiceHandler) ListPublic ¶
func (i *ISOServiceHandler) ListPublic(ctx context.Context, options *ListOptions) ([]PublicISO, *Meta, error)
GetPublicList will list public ISOs offered in the Vultr ISO library.
type Instance ¶
type Instance struct { ID string `json:"id"` Os string `json:"os"` Ram int `json:"ram"` Disk int `json:"disk"` Plan string `json:"plan"` MainIP string `json:"main_ip"` VCPUCount int `json:"vcpu_count"` Region string `json:"region"` DefaultPassword string `json:"default_password,omitempty"` DateCreated string `json:"date_created"` Status string `json:"status"` AllowedBandwidth int `json:"allowed_bandwidth"` NetmaskV4 string `json:"netmask_v4"` GatewayV4 string `json:"gateway_v4"` PowerStatus string `json:"power_status"` ServerStatus string `json:"server_status"` V6Network string `json:"v6_network"` V6MainIP string `json:"v6_main_ip"` V6NetworkSize int `json:"v6_network_size"` Label string `json:"label"` InternalIP string `json:"internal_ip"` KVM string `json:"kvm"` Tag string `json:"tag"` OsID int `json:"os_id"` AppID int `json:"app_id"` FirewallGroupID string `json:"firewall_group_id"` Features []string `json:"features"` }
Instance represents a VPS
type InstanceList ¶
type InstanceList struct {
InstanceList []int
}
InstanceList represents instances that are attached to your load balancer
type InstanceReq ¶
type InstanceReq struct { Region string `json:"region,omitempty"` Plan string `json:"plan,omitempty"` UpgradePlan string `json:"upgrade_plan,omitempty"` Label string `json:"label,omitempty"` Tag string `json:"tag,omitempty"` OsID int `json:"os_id,omitempty"` ISOID string `json:"iso_id,omitempty"` AppID int `json:"app_id,omitempty"` FirewallGroupID string `json:"firewall_group_id,omitempty"` Hostname string `json:"hostname,omitempty"` IPXEChainURL string `json:"ipxe_chain_url,omitempty"` ScriptID string `json:"script_id,omitempty"` SnapshotID string `json:"snapshot_id,omitempty"` EnableIPv6 bool `json:"enable_ipv6,omitempty"` AttachPrivateNetwork []string `json:"attach_private_network,omitempty"` DetachPrivateNetwork []string `json:"detach_private_network,omitempty"` SSHKey []string `json:"sshkey_id,omitempty"` Backups bool `json:"backups,omitempty"` DDOSProtection bool `json:"ddos_protection,omitempty"` UserData string `json:"user_data,omitempty"` ReservedIPv4 string `json:"reserved_ipv4,omitempty"` ActivationEmail bool `json:"activation_email,omitempty"` }
InstanceReq
type InstanceService ¶
type InstanceService interface { Create(ctx context.Context, instanceReq *InstanceReq) (*Instance, error) Get(ctx context.Context, instanceID string) (*Instance, error) Update(ctx context.Context, instanceID string, instanceReq *InstanceReq) error Delete(ctx context.Context, instanceID string) error List(ctx context.Context, options *ListOptions) ([]Instance, *Meta, error) Start(ctx context.Context, instanceID string) error Halt(ctx context.Context, instanceID string) error Reboot(ctx context.Context, instanceID string) error Reinstall(ctx context.Context, instanceID string) error MassStart(ctx context.Context, instanceList []string) error MassHalt(ctx context.Context, instanceList []string) error MassReboot(ctx context.Context, instanceList []string) error Restore(ctx context.Context, instanceID string, restoreReq *RestoreReq) error GetBandwidth(ctx context.Context, instanceID string) (*Bandwidth, error) GetNeighbors(ctx context.Context, instanceID string) (*Neighbors, error) ListPrivateNetworks(ctx context.Context, instanceID string) ([]PrivateNetwork, *Meta, error) AttachPrivateNetwork(ctx context.Context, instanceID, networkID string) error DetachPrivateNetwork(ctx context.Context, instanceID, networkID string) error ISOStatus(ctx context.Context, instanceID string) (*Iso, error) AttachISO(ctx context.Context, instanceID, isoID string) error DetachISO(ctx context.Context, instanceID string) error GetBackupSchedule(ctx context.Context, instanceID string) (*BackupSchedule, error) SetBackupSchedule(ctx context.Context, instanceID string, backup *BackupScheduleReq) error CreateIPv4(ctx context.Context, instanceID string, reboot bool) (*IPv4, error) ListIPv4(ctx context.Context, instanceID string, option *ListOptions) ([]IPv4, *Meta, error) DeleteIPv4(ctx context.Context, instanceID, ip string) error ListIPv6(ctx context.Context, instanceID string, option *ListOptions) ([]IPv6, *Meta, error) CreateReverseIPv6(ctx context.Context, instanceID string, reverseReq *ReverseIP) error ListReverseIPv6(ctx context.Context, instanceID string) ([]ReverseIP, error) DeleteReverseIPv6(ctx context.Context, instanceID, ip string) error CreateReverseIPv4(ctx context.Context, instanceID string, reverseReq *ReverseIP) error DefaultReverseIPv4(ctx context.Context, instanceID, ip string) error GetUserData(ctx context.Context, instanceID string) (*UserData, error) }
InstanceService is the interface to interact with the instance endpoints on the Vultr API Link: https://www.vultr.com/api/v2/#tag/instances
type InstanceServiceHandler ¶
type InstanceServiceHandler struct {
// contains filtered or unexported fields
}
ServerServiceHandler handles interaction with the server methods for the Vultr API
func (*InstanceServiceHandler) AttachISO ¶
func (i *InstanceServiceHandler) AttachISO(ctx context.Context, instanceID, isoID string) error
AttachISO will attach an ISO to the given instance and reboot it
func (*InstanceServiceHandler) AttachPrivateNetwork ¶
func (i *InstanceServiceHandler) AttachPrivateNetwork(ctx context.Context, instanceID, networkID string) error
AttachPrivateNetwork to an instance
func (*InstanceServiceHandler) Create ¶
func (i *InstanceServiceHandler) Create(ctx context.Context, instanceReq *InstanceReq) (*Instance, error)
Create will create the server with the given parameters
func (*InstanceServiceHandler) CreateIPv4 ¶
func (*InstanceServiceHandler) CreateReverseIPv4 ¶
func (i *InstanceServiceHandler) CreateReverseIPv4(ctx context.Context, instanceID string, reverseReq *ReverseIP) error
CreateReverseIPv4 for a given IP on a given instance.
func (*InstanceServiceHandler) CreateReverseIPv6 ¶
func (*InstanceServiceHandler) DefaultReverseIPv4 ¶
func (i *InstanceServiceHandler) DefaultReverseIPv4(ctx context.Context, instanceID, ip string) error
DefaultReverseIPv4 will set the IPs reverse setting back to the original one supplied by Vultr.
func (*InstanceServiceHandler) Delete ¶
func (i *InstanceServiceHandler) Delete(ctx context.Context, instanceID string) error
Delete an instance. All data will be permanently lost, and the IP address will be released
func (*InstanceServiceHandler) DeleteIPv4 ¶
func (i *InstanceServiceHandler) DeleteIPv4(ctx context.Context, instanceID, ip string) error
func (*InstanceServiceHandler) DeleteReverseIPv6 ¶
func (i *InstanceServiceHandler) DeleteReverseIPv6(ctx context.Context, instanceID, ip string) error
DeleteReverseIPv6 a given reverse IPv6.
func (*InstanceServiceHandler) DetachISO ¶
func (i *InstanceServiceHandler) DetachISO(ctx context.Context, instanceID string) error
DetachISO will detach the currently mounted ISO and reboot the instance.
func (*InstanceServiceHandler) DetachPrivateNetwork ¶
func (i *InstanceServiceHandler) DetachPrivateNetwork(ctx context.Context, instanceID, networkID string) error
DetachedPrivateNetwork from an instance.
func (*InstanceServiceHandler) GetBackupSchedule ¶
func (i *InstanceServiceHandler) GetBackupSchedule(ctx context.Context, instanceID string) (*BackupSchedule, error)
GetBackupSchedule retrieves the backup schedule for a given instance - all time values are in UTC
func (*InstanceServiceHandler) GetBandwidth ¶
func (*InstanceServiceHandler) GetNeighbors ¶
func (i *InstanceServiceHandler) GetNeighbors(ctx context.Context, instanceID string) (*Neighbors, error)
GetNeighbors gets a list of other instances in the same location as this Instance.
func (*InstanceServiceHandler) GetUserData ¶
func (i *InstanceServiceHandler) GetUserData(ctx context.Context, instanceID string) (*UserData, error)
GetUserData from given instance. The userdata returned will be in base64 encoding.
func (*InstanceServiceHandler) Halt ¶
func (i *InstanceServiceHandler) Halt(ctx context.Context, instanceID string) error
Halt will pause an instance.
func (*InstanceServiceHandler) ISOStatus ¶
// IsoStatus retrieves the current ISO state for a given VPS. // The returned state may be one of: ready | isomounting | isomounted.
func (*InstanceServiceHandler) List ¶
func (i *InstanceServiceHandler) List(ctx context.Context, options *ListOptions) ([]Instance, *Meta, error)
List all instances on your account.
func (*InstanceServiceHandler) ListIPv4 ¶
func (i *InstanceServiceHandler) ListIPv4(ctx context.Context, instanceID string, options *ListOptions) ([]IPv4, *Meta, error)
func (*InstanceServiceHandler) ListIPv6 ¶
func (i *InstanceServiceHandler) ListIPv6(ctx context.Context, instanceID string, options *ListOptions) ([]IPv6, *Meta, error)
func (*InstanceServiceHandler) ListPrivateNetworks ¶
func (i *InstanceServiceHandler) ListPrivateNetworks(ctx context.Context, instanceID string) ([]PrivateNetwork, *Meta, error)
func (*InstanceServiceHandler) ListReverseIPv6 ¶
func (*InstanceServiceHandler) MassHalt ¶
func (i *InstanceServiceHandler) MassHalt(ctx context.Context, instanceList []string) error
Halt will pause a list of instances.
func (*InstanceServiceHandler) MassReboot ¶
func (i *InstanceServiceHandler) MassReboot(ctx context.Context, instanceList []string) error
MassReboot reboots a list of instances.
func (*InstanceServiceHandler) MassStart ¶
func (i *InstanceServiceHandler) MassStart(ctx context.Context, instanceList []string) error
Start will start a list of vps instances the machine is already running, it will be restarted.
func (*InstanceServiceHandler) Reboot ¶
func (i *InstanceServiceHandler) Reboot(ctx context.Context, instanceID string) error
Reboot an instance.
func (*InstanceServiceHandler) Reinstall ¶
func (i *InstanceServiceHandler) Reinstall(ctx context.Context, instanceID string) error
Reinstall an instance.
func (*InstanceServiceHandler) Restore ¶
func (i *InstanceServiceHandler) Restore(ctx context.Context, instanceID string, restoreReq *RestoreReq) error
Restore an instance.
func (*InstanceServiceHandler) SetBackupSchedule ¶
func (i *InstanceServiceHandler) SetBackupSchedule(ctx context.Context, instanceID string, backup *BackupScheduleReq) error
SetBackupSchedule sets the backup schedule for a given instance - all time values are in UTC.
func (*InstanceServiceHandler) Start ¶
func (i *InstanceServiceHandler) Start(ctx context.Context, instanceID string) error
Start will start a vps instance the machine is already running, it will be restarted.
func (*InstanceServiceHandler) Update ¶
func (i *InstanceServiceHandler) Update(ctx context.Context, instanceID string, instanceReq *InstanceReq) error
Update will update the server with the given parameters
type ListOptions ¶
type ListOptions struct { PerPage int `url:"per_page,omitempty"` Cursor string `url:"cursor,omitempty"` }
ListOptions
type LoadBalancer ¶
type LoadBalancer struct { ID string `json:"id,omitempty"` DateCreated string `json:"date_created,omitempty"` Region string `json:"region,omitempty"` Label string `json:"label,omitempty"` Status string `json:"status,omitempty"` IPV4 string `json:"ipv4,omitempty"` IPV6 string `json:"ipv6,omitempty"` Instances []int `json:"instances,omitempty"` HealthCheck *HealthCheck `json:"health_check,omitempty"` GenericInfo *GenericInfo `json:"generic_info,omitempty"` SSLInfo bool `json:"has_ssl,omitempty"` ForwardingRules []ForwardingRule `json:"forwarding_rules,omitempty"` }
LoadBalancer represent the structure of a load balancer
type LoadBalancerHandler ¶
type LoadBalancerHandler struct {
// contains filtered or unexported fields
}
LoadBalancerHandler handles interaction with the server methods for the Vultr API
func (*LoadBalancerHandler) Create ¶
func (l *LoadBalancerHandler) Create(ctx context.Context, createReq *LoadBalancerReq) (*LoadBalancer, error)
Create a load balancer
func (*LoadBalancerHandler) CreateForwardingRule ¶
func (l *LoadBalancerHandler) CreateForwardingRule(ctx context.Context, ID string, rule *ForwardingRule) (*ForwardingRule, error)
CreateForwardingRule will create a new forwarding rule for your load balancer subscription. Note the RuleID will be returned in the ForwardingRule struct
func (*LoadBalancerHandler) Delete ¶
func (l *LoadBalancerHandler) Delete(ctx context.Context, ID string) error
Delete a load balancer subscription.
func (*LoadBalancerHandler) DeleteForwardingRule ¶
func (l *LoadBalancerHandler) DeleteForwardingRule(ctx context.Context, ID string, RuleID string) error
DeleteForwardingRule removes a forwarding rule from a load balancer subscription
func (*LoadBalancerHandler) Get ¶
func (l *LoadBalancerHandler) Get(ctx context.Context, ID string) (*LoadBalancer, error)
Get a load balancer
func (*LoadBalancerHandler) GetForwardingRule ¶
func (l *LoadBalancerHandler) GetForwardingRule(ctx context.Context, ID string, ruleID string) (*ForwardingRule, error)
GetForwardingRule will get a forwarding rule from your load balancer subscription.
func (*LoadBalancerHandler) List ¶
func (l *LoadBalancerHandler) List(ctx context.Context, options *ListOptions) ([]LoadBalancer, *Meta, error)
List all load balancer subscriptions on the current account.
func (*LoadBalancerHandler) ListForwardingRules ¶
func (l *LoadBalancerHandler) ListForwardingRules(ctx context.Context, ID string, options *ListOptions) ([]ForwardingRule, *Meta, error)
ListForwardingRules lists all forwarding rules for a load balancer subscription
func (*LoadBalancerHandler) Update ¶
func (l *LoadBalancerHandler) Update(ctx context.Context, ID string, updateReq *LoadBalancerReq) error
Update updates your your load balancer
type LoadBalancerReq ¶
type LoadBalancerReq struct { Region string `json:"region,omitempty"` Label string `json:"label,omitempty"` Instances []int `json:"instances,omitempty"` HealthCheck *HealthCheck `json:"health_check,omitempty"` StickySessions *StickySessions `json:"sticky_session,omitempty"` ForwardingRules []ForwardingRule `json:"forwarding_rules,omitempty"` SSL *SSL `json:"ssl,omitempty"` SSLRedirect bool `json:"ssl_redirect,omitempty"` ProxyProtocol string `json:"proxy_protocol,omitempty"` BalancingAlgorithm string `json:"balancing_algorithm,omitempty"` }
LoadBalancerReq gives options for creating or updating a load balancer
type LoadBalancerService ¶
type LoadBalancerService interface { Create(ctx context.Context, createReq *LoadBalancerReq) (*LoadBalancer, error) Get(ctx context.Context, ID string) (*LoadBalancer, error) Update(ctx context.Context, ID string, updateReq *LoadBalancerReq) error Delete(ctx context.Context, ID string) error List(ctx context.Context, options *ListOptions) ([]LoadBalancer, *Meta, error) CreateForwardingRule(ctx context.Context, ID string, rule *ForwardingRule) (*ForwardingRule, error) GetForwardingRule(ctx context.Context, ID string, ruleID string) (*ForwardingRule, error) DeleteForwardingRule(ctx context.Context, ID string, RuleID string) error ListForwardingRules(ctx context.Context, ID string, options *ListOptions) ([]ForwardingRule, *Meta, error) }
LoadBalancerService is the interface to interact with the server endpoints on the Vultr API
type Network ¶
type Network struct { NetworkID string `json:"id"` Region string `json:"region"` Description string `json:"description"` V4Subnet string `json:"v4_subnet"` V4SubnetMask int `json:"v4_subnet_mask"` DateCreated string `json:"date_created"` }
Network represents a Vultr private network
type NetworkReq ¶
type NetworkReq struct { Region string `json:"region"` Description string `json:"description"` V4Subnet string `json:"v4_subnet"` V4SubnetMask int `json:"v4_subnet_mask"` }
NetworkReq represents parameters to create or update Network resource
type NetworkService ¶
type NetworkService interface { Create(ctx context.Context, createReq *NetworkReq) (*Network, error) Get(ctx context.Context, networkID string) (*Network, error) Update(ctx context.Context, networkID string, updateReq *NetworkReq) error Delete(ctx context.Context, networkID string) error List(ctx context.Context, options *ListOptions) ([]Network, *Meta, error) }
NetworkService is the interface to interact with the network endpoints on the Vultr API
type NetworkServiceHandler ¶
type NetworkServiceHandler struct {
// contains filtered or unexported fields
}
NetworkServiceHandler handles interaction with the network methods for the Vultr API
func (*NetworkServiceHandler) Create ¶
func (n *NetworkServiceHandler) Create(ctx context.Context, createReq *NetworkReq) (*Network, error)
Create a new private network. A private network can only be used at the location for which it was created.
func (*NetworkServiceHandler) Delete ¶
func (n *NetworkServiceHandler) Delete(ctx context.Context, networkID string) error
Delete a private network. Before deleting, a network must be disabled from all instances
func (*NetworkServiceHandler) List ¶
func (n *NetworkServiceHandler) List(ctx context.Context, options *ListOptions) ([]Network, *Meta, error)
List lists all private networks on the current account
func (*NetworkServiceHandler) Update ¶
func (n *NetworkServiceHandler) Update(ctx context.Context, networkID string, updateReq *NetworkReq) error
Update updates a private network
type OS ¶
type OS struct { ID int `json:"id"` Name string `json:"name"` Arch string `json:"arch"` Family string `json:"family"` }
OS represents a Vultr operating system
type OSService ¶
OSService is the interface to interact with the operating system endpoint on the Vultr API
type OSServiceHandler ¶
type OSServiceHandler struct {
// contains filtered or unexported fields
}
OSServiceHandler handles interaction with the operating system methods for the Vultr API
func (*OSServiceHandler) List ¶
func (o *OSServiceHandler) List(ctx context.Context, options *ListOptions) ([]OS, *Meta, error)
List retrieves a list of available operating systems.
type ObjectStorage ¶
type ObjectStorage struct { ID int `json:"id"` DateCreated string `json:"date_created"` ObjectStoreClusterID int `json:"cluster_id"` Region string `json:"region"` Label string `json:"label"` Status string S3Keys }
ObjectStorage represents a Vultr Object Storage subscription.
type ObjectStorageCluster ¶
type ObjectStorageCluster struct { ID int `json:"id"` Region string `json:"region"` Hostname string `json:"hostname"` Deploy string `json:"deploy"` }
ObjectStorageCluster represents a Vultr Object Storage cluster.
type ObjectStorageService ¶
type ObjectStorageService interface { Create(ctx context.Context, clusterID int, label string) (*ObjectStorage, error) Get(ctx context.Context, id int) (*ObjectStorage, error) Update(ctx context.Context, id int, label string) error Delete(ctx context.Context, id int) error List(ctx context.Context, options *ListOptions) ([]ObjectStorage, *Meta, error) ListCluster(ctx context.Context, options *ListOptions) ([]ObjectStorageCluster, *Meta, error) RegenerateKeys(ctx context.Context, id int) (*S3Keys, error) }
ObjectStorageService is the interface to interact with the object storage endpoints on the Vultr API.
type ObjectStorageServiceHandler ¶
type ObjectStorageServiceHandler struct {
// contains filtered or unexported fields
}
ObjectStorageServiceHandler handles interaction with the firewall rule methods for the Vultr API.
func (*ObjectStorageServiceHandler) Create ¶
func (o *ObjectStorageServiceHandler) Create(ctx context.Context, clusterID int, label string) (*ObjectStorage, error)
Create an object storage subscription
func (*ObjectStorageServiceHandler) Delete ¶
func (o *ObjectStorageServiceHandler) Delete(ctx context.Context, id int) error
Delete an object storage subscription.
func (*ObjectStorageServiceHandler) Get ¶
func (o *ObjectStorageServiceHandler) Get(ctx context.Context, id int) (*ObjectStorage, error)
Get returns a specified object storage by the provided ID
func (*ObjectStorageServiceHandler) List ¶
func (o *ObjectStorageServiceHandler) List(ctx context.Context, options *ListOptions) ([]ObjectStorage, *Meta, error)
List returns all object storage subscriptions on the current account. This includes both pending and active subscriptions.
func (*ObjectStorageServiceHandler) ListCluster ¶
func (o *ObjectStorageServiceHandler) ListCluster(ctx context.Context, options *ListOptions) ([]ObjectStorageCluster, *Meta, error)
ListCluster returns back your object storage clusters. Clusters may be removed over time. The "deploy" field can be used to determine whether or not new deployments are allowed in the cluster.
func (*ObjectStorageServiceHandler) RegenerateKeys ¶
RegenerateKeys of the S3 API Keys for an object storage subscription
type Plan ¶
type Plan struct { ID string `json:"id"` VCPUCount int `json:"vcpu_count"` Ram int `json:"ram"` Disk int `json:"disk"` Bandwidth int `json:"bandwidth"` MonthlyCost string `json:"monthly_cost"` Type string `json:"type"` Locations []Region `json:"locations"` }
Plans represents vc2, vdc, or vhf
type PlanService ¶
type PlanService interface { List(ctx context.Context, planType string, options *ListOptions) ([]Plan, *Meta, error) ListBareMetal(ctx context.Context, options *ListOptions) ([]BareMetalPlan, *Meta, error) }
PlanService is the interface to interact with the Plans endpoints on the Vultr API
type PlanServiceHandler ¶
type PlanServiceHandler struct {
Client *Client
}
PlanServiceHandler handles interaction with the Plans methods for the Vultr API
func (*PlanServiceHandler) List ¶
func (p *PlanServiceHandler) List(ctx context.Context, planType string, options *ListOptions) ([]Plan, *Meta, error)
List retrieves a list of all active plans. planType is optional - pass an empty string to get all plans
func (*PlanServiceHandler) ListBareMetal ¶
func (p *PlanServiceHandler) ListBareMetal(ctx context.Context, options *ListOptions) ([]BareMetalPlan, *Meta, error)
GetBareMetalList retrieves a list of all active bare metal plans.
type PrivateNetwork ¶
type PublicISO ¶
type PublicISO struct { ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` }
PublicISO represents public ISOs offered in the Vultr ISO library.
type Region ¶
type Region struct { ID string `json:"id"` City string `json:"city"` Country string `json:"country"` Continent string `json:"continent,omitempty"` Options []string `json:"options"` }
Region represents a Vultr region
type RegionService ¶
type RegionService interface { Availability(ctx context.Context, regionID string, planType string) (*planAvailability, error) List(ctx context.Context, options *ListOptions) ([]Region, *Meta, error) }
RegionService is the interface to interact with Region endpoints on the Vultr API
type RegionServiceHandler ¶
type RegionServiceHandler struct {
Client *Client
}
RegionServiceHandler handles interaction with the region methods for the Vultr API
func (*RegionServiceHandler) Availability ¶
func (r *RegionServiceHandler) Availability(ctx context.Context, regionID string, planType string) (*planAvailability, error)
Availability retrieves a list of the plan IDs currently available for a given location.
func (*RegionServiceHandler) List ¶
func (r *RegionServiceHandler) List(ctx context.Context, options *ListOptions) ([]Region, *Meta, error)
List returns all available regions
type RequestBody ¶
type RequestBody map[string]interface{}
type RequestCompletionCallback ¶
RequestCompletionCallback defines the type of the request callback function
type ReservedIP ¶
type ReservedIP struct { ID string `json:"id"` Region string `json:"region"` IPType string `json:"ip_type"` Subnet string `json:"subnet"` SubnetSize int `json:"subnet_size"` Label string `json:"label"` InstanceID string `json:"instance_id"` }
ReservedIP represents an reserved IP on Vultr
type ReservedIPReq ¶
type ReservedIPReq struct { Region string `json:"region,omitempty"` IPType string `json:"ip_type,omitempty"` IPAddress string `json:"ip_address,omitempty"` Label string `json:"label,omitempty"` InstanceID string `json:"instance_id,omitempty"` }
ReservedIPReq represents the parameters for creating a new Reserved IP on Vultr
type ReservedIPService ¶
type ReservedIPService interface { Create(ctx context.Context, ripCreate *ReservedIPReq) (*ReservedIP, error) Get(ctx context.Context, id string) (*ReservedIP, error) Delete(ctx context.Context, id string) error List(ctx context.Context, options *ListOptions) ([]ReservedIP, *Meta, error) Convert(ctx context.Context, ripConvert *ReservedIPReq) (*ReservedIP, error) Attach(ctx context.Context, id string, ripAttach *ReservedIPReq) error Detach(ctx context.Context, id string) error }
ReservedIPService is the interface to interact with the reserved IP endpoints on the Vultr API
type ReservedIPServiceHandler ¶
type ReservedIPServiceHandler struct {
// contains filtered or unexported fields
}
ReservedIPServiceHandler handles interaction with the reserved IP methods for the Vultr API
func (*ReservedIPServiceHandler) Attach ¶
func (r *ReservedIPServiceHandler) Attach(ctx context.Context, id string, ripAttach *ReservedIPReq) error
Attach a reserved IP to an existing subscription
func (*ReservedIPServiceHandler) Convert ¶
func (r *ReservedIPServiceHandler) Convert(ctx context.Context, ripConvert *ReservedIPReq) (*ReservedIP, error)
Convert an existing IP on a subscription to a reserved IP.
func (*ReservedIPServiceHandler) Create ¶
func (r *ReservedIPServiceHandler) Create(ctx context.Context, ripCreate *ReservedIPReq) (*ReservedIP, error)
Create adds the specified reserved IP to your Vultr account
func (*ReservedIPServiceHandler) Delete ¶
func (r *ReservedIPServiceHandler) Delete(ctx context.Context, id string) error
Delete removes the specified reserved IP from your Vultr account
func (*ReservedIPServiceHandler) Detach ¶
func (r *ReservedIPServiceHandler) Detach(ctx context.Context, id string) error
Detach a reserved IP from an existing subscription.
func (*ReservedIPServiceHandler) Get ¶
func (r *ReservedIPServiceHandler) Get(ctx context.Context, id string) (*ReservedIP, error)
Get gets the reserved IP associated with provided ID
func (*ReservedIPServiceHandler) List ¶
func (r *ReservedIPServiceHandler) List(ctx context.Context, options *ListOptions) ([]ReservedIP, *Meta, error)
List lists all the reserved IPs associated with your Vultr account
type RestoreReq ¶
type S3Keys ¶
type S3Keys struct { S3Hostname string `json:"s3_hostname"` S3AccessKey string `json:"s3_access_key"` S3SecretKey string `json:"s3_secret_key"` }
S3Keys define your api access to your cluster
type SSHKey ¶
type SSHKey struct { ID string `json:"id"` Name string `json:"name"` SSHKey string `json:"ssh_key"` DateCreated string `json:"date_created"` }
SSHKey represents an SSH Key on Vultr
type SSHKeyReq ¶
type SSHKeyReq struct { Name string `json:"name,omitempty"` SSHKey string `json:"ssh_key,omitempty"` }
SSHKeyReq is the ssh key struct for create and update calls
type SSHKeyService ¶
type SSHKeyService interface { Create(ctx context.Context, sshKeyReq *SSHKeyReq) (*SSHKey, error) Get(ctx context.Context, sshKeyID string) (*SSHKey, error) Update(ctx context.Context, sshKeyID string, sshKeyReq *SSHKeyReq) error Delete(ctx context.Context, sshKeyID string) error List(ctx context.Context, options *ListOptions) ([]SSHKey, *Meta, error) }
SSHKeyService is the interface to interact with the SSH Key endpoints on the Vultr API
type SSHKeyServiceHandler ¶
type SSHKeyServiceHandler struct {
// contains filtered or unexported fields
}
SSHKeyServiceHandler handles interaction with the SSH Key methods for the Vultr API
func (*SSHKeyServiceHandler) Delete ¶
func (s *SSHKeyServiceHandler) Delete(ctx context.Context, sshKeyID string) error
Delete a specific ssh-key.
func (*SSHKeyServiceHandler) List ¶
func (s *SSHKeyServiceHandler) List(ctx context.Context, options *ListOptions) ([]SSHKey, *Meta, error)
List all available SSH Keys.
type SSL ¶
type SSL struct { PrivateKey string `json:"ssl_private_key,omitempty"` Certificate string `json:"ssl_certificate,omitempty"` Chain string `json:"chain,omitempty"` }
SSL represents valid SSL config
type Snapshot ¶
type Snapshot struct { ID string `json:"id"` DateCreated string `json:"date_created"` Description string `json:"description"` Size int `json:"size"` Status string `json:"status"` OsID int `json:"os_id"` AppID int `json:"app_id"` }
Snapshot represents a Vultr snapshot
type SnapshotReq ¶
type SnapshotReq struct { InstanceID int `json:"instance_id,omitempty"` Description string `json:"description,omitempty"` }
SnapshotReq
type SnapshotService ¶
type SnapshotService interface { Create(ctx context.Context, snapshotReq *SnapshotReq) (*Snapshot, error) CreateFromURL(ctx context.Context, snapshotURLReq SnapshotURLReq) (*Snapshot, error) Get(ctx context.Context, snapshotID string) (*Snapshot, error) Delete(ctx context.Context, snapshotID string) error List(ctx context.Context, options *ListOptions) ([]Snapshot, *Meta, error) }
SnapshotService is the interface to interact with Snapshot endpoints on the Vultr API
type SnapshotServiceHandler ¶
type SnapshotServiceHandler struct {
Client *Client
}
SnapshotServiceHandler handles interaction with the snapshot methods for the Vultr API
func (*SnapshotServiceHandler) Create ¶
func (s *SnapshotServiceHandler) Create(ctx context.Context, snapshotReq *SnapshotReq) (*Snapshot, error)
Create makes a snapshot of a provided server
func (*SnapshotServiceHandler) CreateFromURL ¶
func (s *SnapshotServiceHandler) CreateFromURL(ctx context.Context, snapshotURLReq SnapshotURLReq) (*Snapshot, error)
CreateFromURL will create a snapshot based on an image iso from a URL you provide
func (*SnapshotServiceHandler) Delete ¶
func (s *SnapshotServiceHandler) Delete(ctx context.Context, snapshotID string) error
Delete a snapshot.
func (*SnapshotServiceHandler) List ¶
func (s *SnapshotServiceHandler) List(ctx context.Context, options *ListOptions) ([]Snapshot, *Meta, error)
List all available snapshots.
type Soa ¶
type Soa struct { NSPrimary string `json:"nsprimary,omitempty"` Email string `json:"email,omitempty"` }
Soa information for the Domain
type StartupScript ¶
type StartupScript struct { ID string `json:"id"` DateCreated string `json:"date_created"` DateModified string `json:"date_modified"` Name string `json:"name"` Type string `json:"type"` Script string `json:"script"` }
StartupScript represents an startup script on Vultr
type StartupScriptReq ¶
type StartupScriptReq struct { Name string `json:"name"` Type string `json:"type"` Script string `json:"script"` }
StartupScriptReq is the user struct for create and update calls
type StartupScriptService ¶
type StartupScriptService interface { Create(ctx context.Context, req *StartupScriptReq) (*StartupScript, error) Get(ctx context.Context, scriptID string) (*StartupScript, error) Update(ctx context.Context, scriptID string, scriptReq *StartupScriptReq) error Delete(ctx context.Context, scriptID string) error List(ctx context.Context, options *ListOptions) ([]StartupScript, *Meta, error) }
StartupScriptService is the interface to interact with the startup script endpoints on the Vultr API
type StartupScriptServiceHandler ¶
type StartupScriptServiceHandler struct {
// contains filtered or unexported fields
}
StartupScriptServiceHandler handles interaction with the startup script methods for the Vultr API
func (*StartupScriptServiceHandler) Create ¶
func (s *StartupScriptServiceHandler) Create(ctx context.Context, scriptReq *StartupScriptReq) (*StartupScript, error)
Create a startup script
func (*StartupScriptServiceHandler) Delete ¶
func (s *StartupScriptServiceHandler) Delete(ctx context.Context, scriptID string) error
Delete the specified startup script from your account.
func (*StartupScriptServiceHandler) Get ¶
func (s *StartupScriptServiceHandler) Get(ctx context.Context, scriptID string) (*StartupScript, error)
Get a single startup script
func (*StartupScriptServiceHandler) List ¶
func (s *StartupScriptServiceHandler) List(ctx context.Context, options *ListOptions) ([]StartupScript, *Meta, error)
List will list all the startup scripts associated with your Vultr account
func (*StartupScriptServiceHandler) Update ¶
func (s *StartupScriptServiceHandler) Update(ctx context.Context, scriptID string, scriptReq *StartupScriptReq) error
Update will update the given startup script. Empty strings will be ignored.
type StickySessions ¶
type StickySessions struct { StickySessionsEnabled string `json:"sticky_sessions,omitempty"` CookieName string `json:"cookie_name,omitempty"` }
StickySessions represents cookie for your load balancer
type User ¶
type User struct { ID string `json:"id"` Name string `json:"name"` Email string `json:"email"` APIEnabled string `json:"api_enabled"` APIKey string `json:"api_key,omitempty"` ACL []string `json:"acls,omitempty"` }
User represents an user on Vultr
type UserReq ¶
type UserReq struct { Email string `json:"email,omitempty"` Name string `json:"name,omitempty"` APIEnabled string `json:"api_enabled,omitempty"` ACL []string `json:"acl,omitempty"` Password string `json:"password,omitempty"` }
UserReq is the user struct for create and update calls
type UserService ¶
type UserService interface { Create(ctx context.Context, userCreate *UserReq) (*User, error) Get(ctx context.Context, userID string) (*User, error) Update(ctx context.Context, userID string, userReq *UserReq) error Delete(ctx context.Context, userID string) error List(ctx context.Context, options *ListOptions) ([]User, *Meta, error) }
UserService is the interface to interact with the user management endpoints on the Vultr API
type UserServiceHandler ¶
type UserServiceHandler struct {
// contains filtered or unexported fields
}
UserServiceHandler handles interaction with the user methods for the Vultr API
func (*UserServiceHandler) Delete ¶
func (u *UserServiceHandler) Delete(ctx context.Context, userID string) error
Delete will remove the specified user from your Vultr account
func (*UserServiceHandler) List ¶
func (u *UserServiceHandler) List(ctx context.Context, options *ListOptions) ([]User, *Meta, error)
List will list all the users associated with your Vultr account
Source Files ¶
- account.go
- application.go
- backup.go
- bare_metal_server.go
- block_storage.go
- domain_records.go
- domains.go
- firewall_group.go
- firewall_rule.go
- govultr.go
- instance.go
- ip.go
- iso.go
- listOptions.go
- load_balancer.go
- meta.go
- network.go
- object_storage.go
- os.go
- plans.go
- regions.go
- reserved_ip.go
- snapshot.go
- ssh_key.go
- startup_script.go
- user.go