Documentation
¶
Overview ¶
Example ¶
// Example readers, Ignore this bit of setup code needed to record test fixtures linodeClient, teardown := createTestClient(nil, "fixtures/Example") defer teardown() var linode *linodego.Instance linode, err := linodeClient.GetInstance(1231) fmt.Println("## Instance request with Invalid ID") fmt.Println("### Linode:", linode) fmt.Println("### Error:", err) if spendMoney { linode, err = linodeClient.CreateInstance(&linodego.InstanceCreateOptions{Region: "us-central", Type: "g5-nanode-1"}) if err != nil { log.Fatalln("* While creating instance: ", err) } linode, err = linodeClient.UpdateInstance(linode.ID, &linodego.InstanceUpdateOptions{Label: linode.Label + "-renamed"}) if err != nil { log.Fatalln("* While renaming instance: ", err) } fmt.Println("## Created Instance") event, err := linodeClient.WaitForEventFinished(linode.ID, linodego.EntityLinode, linodego.ActionLinodeCreate, *linode.Created, 240) if err != nil { log.Fatalf("* Failed to wait for Linode %d to finish creation: %s", linode.ID, err) } if err := linodeClient.MarkEventRead(event); err != nil { log.Fatalln("* Failed to mark Linode create event seen", err) } diskSwap, err := linodeClient.CreateInstanceDisk(linode.ID, linodego.InstanceDiskCreateOptions{Size: 50, Filesystem: "swap", Label: "linodego_swap"}) if err != nil { log.Fatalln("* While creating swap disk:", err) } eventSwap, err := linodeClient.WaitForEventFinished(linode.ID, linodego.EntityLinode, linodego.ActionDiskCreate, diskSwap.Created, 240) // @TODO it is not sufficient that a disk was created. Which disk was it? // Sounds like we'll need a WaitForEntityStatus function. if err != nil { log.Fatalf("* Failed to wait for swap disk %d to finish creation: %s", diskSwap.ID, err) } if err := linodeClient.MarkEventRead(eventSwap); err != nil { log.Fatalln("* Failed to mark swap disk create event seen", err) } diskRaw, err := linodeClient.CreateInstanceDisk(linode.ID, linodego.InstanceDiskCreateOptions{Size: 50, Filesystem: "raw", Label: "linodego_raw"}) if err != nil { log.Fatalln("* While creating raw disk:", err) } eventRaw, err := linodeClient.WaitForEventFinished(linode.ID, linodego.EntityLinode, linodego.ActionDiskCreate, diskRaw.Created, 240) // @TODO it is not sufficient that a disk was created. Which disk was it? // Sounds like we'll need a WaitForEntityStatus function. if err != nil { log.Fatalf("* Failed to wait for raw disk %d to finish creation: %s", diskRaw.ID, err) } if err := linodeClient.MarkEventRead(eventRaw); err != nil { log.Fatalln("* Failed to mark raw disk create event seen", err) } diskDebian, err := linodeClient.CreateInstanceDisk( linode.ID, linodego.InstanceDiskCreateOptions{ Size: 1500, Filesystem: "ext4", Image: "linode/debian9", Label: "linodego_debian", RootPass: randPassword(), }, ) if err != nil { log.Fatalln("* While creating Debian disk:", err) } eventDebian, err := linodeClient.WaitForEventFinished(linode.ID, linodego.EntityLinode, linodego.ActionDiskCreate, diskDebian.Created, 240) // @TODO it is not sufficient that a disk was created. Which disk was it? // Sounds like we'll need a WaitForEntityStatus function. if err != nil { log.Fatalf("* Failed to wait for Debian disk %d to finish creation: %s", diskDebian.ID, err) } if err := linodeClient.MarkEventRead(eventDebian); err != nil { log.Fatalln("* Failed to mark Debian disk create event seen", err) } fmt.Println("### Created Disks") createOpts := linodego.InstanceConfigCreateOptions{ Devices: &linodego.InstanceConfigDeviceMap{ SDA: &linodego.InstanceConfigDevice{DiskID: diskDebian.ID}, SDB: &linodego.InstanceConfigDevice{DiskID: diskRaw.ID}, SDC: &linodego.InstanceConfigDevice{DiskID: diskSwap.ID}, }, Kernel: "linode/direct-disk", Label: "example config label", // RunLevel: "default", // VirtMode: "paravirt", Comments: "example config comment", // RootDevice: "/dev/sda", Helpers: &linodego.InstanceConfigHelpers{ Network: true, ModulesDep: false, }, } config, err := linodeClient.CreateInstanceConfig(linode.ID, createOpts) if err != nil { log.Fatalln("* Failed to create Config", err) } fmt.Println("### Created Config:") updateOpts := linodego.InstanceConfigUpdateOptions{ Comments: "updated example config comment", } config, err = linodeClient.UpdateInstanceConfig(linode.ID, config.ID, updateOpts) if err != nil { log.Fatalln("* Failed to update Config", err) } fmt.Println("### Updated Config:") booted, err := linodeClient.BootInstance(linode.ID, config.ID) if err != nil || !booted { log.Fatalln("* Failed to boot Instance", err) } fmt.Println("### Booted Instance") eventBooted, err := linodeClient.WaitForEventFinished(linode.ID, linodego.EntityLinode, linodego.ActionLinodeBoot, *config.Updated, 240) if err != nil { fmt.Println("### Boot Instance failed as expected:", err) } else { log.Fatalln("* Expected boot Instance to fail") } if err := linodeClient.MarkEventRead(eventBooted); err != nil { log.Fatalln("* Failed to mark boot event seen", err) } err = linodeClient.DeleteInstanceConfig(linode.ID, config.ID) if err != nil { log.Fatalln("* Failed to delete Config", err) } fmt.Println("### Deleted Config") err = linodeClient.DeleteInstanceDisk(linode.ID, diskSwap.ID) if err != nil { log.Fatalln("* Failed to delete Disk", err) } fmt.Println("### Deleted Disk") err = linodeClient.DeleteInstance(linode.ID) if err != nil { log.Fatalln("* Failed to delete Instance", err) } fmt.Println("### Deleted Instance") } linodes, err := linodeClient.ListInstances(nil) fmt.Println("## List Instances") if len(linodes) == 0 { log.Println("No Linodes to inspect.") } else { // This is redundantly used for illustrative purposes linode, err = linodeClient.GetInstance(linodes[0].ID) if err != nil { log.Fatal(err) } fmt.Println("## First Linode") configs, err := linodeClient.ListInstanceConfigs(linode.ID, nil) if err != nil { log.Fatal(err) } else if len(configs) > 0 { config, err := linodeClient.GetInstanceConfig(linode.ID, configs[0].ID) if err != nil { log.Fatal(err) } fmt.Println("### First Config:", config.ID > 0) } else { fmt.Println("### No Configs") } disks, err := linodeClient.ListInstanceDisks(linode.ID, nil) if err != nil { log.Fatal(err) } else if len(disks) > 0 { disk, err := linodeClient.GetInstanceDisk(linode.ID, disks[0].ID) if err != nil { log.Fatal(err) } fmt.Println("### First Disk:", disk.ID > 0) } else { fmt.Println("### No Disks") } backups, err := linodeClient.GetInstanceBackups(linode.ID) if err != nil { log.Fatal(err) } if len(backups.Automatic) > 0 { fmt.Println("### First Auto Backup") } else { fmt.Println("### No Auto Backups") } fmt.Println("### Snapshots") if backups.Snapshot.Current != nil { // snapshot fetched will be exactly the same as backups.Snapshot.Current // just being redundant for illustrative purposes if snapshot, err := linodeClient.GetInstanceSnapshot(linode.ID, backups.Snapshot.Current.ID); err == nil { fmt.Println("#### Current:", snapshot.ID > 0) } else { fmt.Println("#### No Current Snapshot:", err) } } else { fmt.Println("### No Current Snapshot") } volumes, err := linodeClient.ListInstanceVolumes(linode.ID, nil) if err != nil { log.Fatal(err) } else if len(volumes) > 0 { volume, err := linodeClient.GetVolume(volumes[0].ID) if err != nil { log.Fatal(err) } fmt.Println("### First Volume:", volume.ID > 0) } else { fmt.Println("### No Volumes") } stackscripts, err := linodeClient.ListStackscripts(&linodego.ListOptions{Filter: "{\"mine\":true}"}) if err != nil { log.Fatal(err) } fmt.Println("## Your Stackscripts:", len(stackscripts) > 0) }
Output: ## Instance request with Invalid ID ### Linode: <nil> ### Error: [404] Not found ## List Instances ## First Linode ### First Config: true ### First Disk: true ### No Auto Backups ### Snapshots #### Current: true ### First Volume: true ## Your Stackscripts: true
Index ¶
- Constants
- func WaitForInstanceStatus(client *Client, instanceID int, status InstanceStatus, timeoutSeconds int) error
- func WaitForVolumeLinodeID(client *Client, volumeID int, linodeID *int, timeoutSeconds int) error
- func WaitForVolumeStatus(client *Client, volumeID int, status VolumeStatus, timeoutSeconds int) error
- type APIError
- type APIErrorReason
- type Account
- type Client
- func (c *Client) AddInstanceIPAddress(linodeID int, public bool) (*InstanceIP, error)
- func (c *Client) AttachVolume(id int, options *VolumeAttachOptions) (bool, error)
- func (c *Client) BootInstance(id int, configID int) (bool, error)
- func (c *Client) CloneInstance(id int, options *InstanceCloneOptions) (*Instance, error)
- func (c *Client) CloneVolume(id int, label string) (*Volume, error)
- func (c *Client) CreateDomain(domain *DomainCreateOptions) (*Domain, error)
- func (c *Client) CreateInstance(instance *InstanceCreateOptions) (*Instance, error)
- func (c *Client) CreateInstanceConfig(linodeID int, createOpts InstanceConfigCreateOptions) (*InstanceConfig, error)
- func (c *Client) CreateInstanceDisk(linodeID int, createOpts InstanceDiskCreateOptions) (*InstanceDisk, error)
- func (c *Client) CreateNodeBalancer(nodebalancer *NodeBalancerCreateOptions) (*NodeBalancer, error)
- func (c *Client) CreateNodeBalancerConfig(nodebalancerID int, nodebalancerConfig *NodeBalancerConfigCreateOptions) (*NodeBalancerConfig, error)
- func (c *Client) CreateNodeBalancerNode(nodebalancerID int, configID int, createOpts *NodeBalancerNodeCreateOptions) (*NodeBalancerNode, error)
- func (c *Client) CreateStackscript(createOpts *StackscriptCreateOptions) (*Stackscript, error)
- func (c *Client) CreateVolume(createOpts VolumeCreateOptions) (*Volume, error)
- func (c *Client) DeleteDomain(id int) error
- func (c *Client) DeleteInstance(id int) error
- func (c *Client) DeleteInstanceConfig(linodeID int, configID int) error
- func (c *Client) DeleteInstanceDisk(linodeID int, diskID int) error
- func (c *Client) DeleteNodeBalancer(id int) error
- func (c *Client) DeleteNodeBalancerConfig(nodebalancerID int, configID int) error
- func (c *Client) DeleteNodeBalancerNode(nodebalancerID int, configID int, nodeID int) error
- func (c *Client) DeleteStackscript(id int) error
- func (c *Client) DeleteVolume(id int) error
- func (c *Client) DetachVolume(id int) (bool, error)
- func (c *Client) GetAccount() (*Account, error)
- func (c *Client) GetDomain(id string) (*Domain, error)
- func (c *Client) GetDomainRecord(id string) (*DomainRecord, error)
- func (c *Client) GetEvent(id int) (*Event, error)
- func (c *Client) GetIPAddress(id string) (*InstanceIP, error)
- func (c *Client) GetIPv6Pool(id string) (*IPv6Range, error)
- func (c *Client) GetIPv6Range(id string) (*IPv6Range, error)
- func (c *Client) GetImage(id string) (*Image, error)
- func (c *Client) GetInstance(linodeID int) (*Instance, error)
- func (c *Client) GetInstanceBackups(linodeID int) (*InstanceBackupsResponse, error)
- func (c *Client) GetInstanceConfig(linodeID int, configID int) (*InstanceConfig, error)
- func (c *Client) GetInstanceDisk(linodeID int, configID int) (*InstanceDisk, error)
- func (c *Client) GetInstanceIPAddress(linodeID int, ipaddress string) (*InstanceIP, error)
- func (c *Client) GetInstanceIPAddresses(linodeID int) (*InstanceIPAddressResponse, error)
- func (c *Client) GetInstanceSnapshot(linodeID int, snapshotID int) (*InstanceSnapshot, error)
- func (c *Client) GetInvoice(id int) (*Invoice, error)
- func (c *Client) GetKernel(kernelID string) (*LinodeKernel, error)
- func (c *Client) GetLongviewClient(id string) (*LongviewClient, error)
- func (c *Client) GetLongviewSubscription(id string) (*LongviewSubscription, error)
- func (c *Client) GetNodeBalancer(id int) (*NodeBalancer, error)
- func (c *Client) GetNodeBalancerConfig(nodebalancerID int, configID int) (*NodeBalancerConfig, error)
- func (c *Client) GetNodeBalancerNode(nodebalancerID int, configID int, nodeID int) (*NodeBalancerNode, error)
- func (c *Client) GetRegion(id string) (*Region, error)
- func (c *Client) GetStackscript(id int) (*Stackscript, error)
- func (c *Client) GetTicket(id int) (*Ticket, error)
- func (c *Client) GetType(typeID string) (*LinodeType, error)
- func (c *Client) GetVolume(id int) (*Volume, error)
- func (c *Client) ListDomainRecords(opts *ListOptions) ([]*DomainRecord, error)
- func (c *Client) ListDomains(opts *ListOptions) ([]*Domain, error)
- func (c *Client) ListEvents(opts *ListOptions) ([]*Event, error)
- func (c *Client) ListIPAddresses(opts *ListOptions) ([]*InstanceIP, error)
- func (c *Client) ListIPv6Pools(opts *ListOptions) ([]*IPv6Range, error)
- func (c *Client) ListIPv6Ranges(opts *ListOptions) ([]*IPv6Range, error)
- func (c *Client) ListImages(opts *ListOptions) ([]*Image, error)
- func (c *Client) ListInstanceConfigs(linodeID int, opts *ListOptions) ([]*InstanceConfig, error)
- func (c *Client) ListInstanceDisks(linodeID int, opts *ListOptions) ([]*InstanceDisk, error)
- func (c *Client) ListInstanceSnapshots(linodeID int, opts *ListOptions) ([]*InstanceSnapshot, error)
- func (c *Client) ListInstanceVolumes(linodeID int, opts *ListOptions) ([]*Volume, error)
- func (c *Client) ListInstances(opts *ListOptions) ([]*Instance, error)
- func (c *Client) ListInvoiceItems(id int, opts *ListOptions) ([]*InvoiceItem, error)
- func (c *Client) ListInvoices(opts *ListOptions) ([]*Invoice, error)
- func (c *Client) ListKernels(opts *ListOptions) ([]*LinodeKernel, error)
- func (c *Client) ListLongviewClients(opts *ListOptions) ([]*LongviewClient, error)
- func (c *Client) ListLongviewSubscriptions(opts *ListOptions) ([]*LongviewSubscription, error)
- func (c *Client) ListNodeBalancerConfigs(nodebalancerID int, opts *ListOptions) ([]*NodeBalancerConfig, error)
- func (c *Client) ListNodeBalancerNodes(nodebalancerID int, configID int, opts *ListOptions) ([]*NodeBalancerNode, error)
- func (c *Client) ListNodeBalancers(opts *ListOptions) ([]*NodeBalancer, error)
- func (c *Client) ListNotifications(opts *ListOptions) ([]*Notification, error)
- func (c *Client) ListRegions(opts *ListOptions) ([]*Region, error)
- func (c *Client) ListStackscripts(opts *ListOptions) ([]*Stackscript, error)
- func (c *Client) ListTickets(opts *ListOptions) ([]*Ticket, error)
- func (c *Client) ListTypes(opts *ListOptions) ([]*LinodeType, error)
- func (c *Client) ListVolumes(opts *ListOptions) ([]*Volume, error)
- func (c *Client) MarkEventRead(event *Event) error
- func (c *Client) MarkEventsSeen(event *Event) error
- func (c *Client) MutateInstance(id int) (bool, error)
- func (c *Client) R() *resty.Request
- func (c *Client) RebootInstance(id int, configID int) (bool, error)
- func (c *Client) RebuildInstance(id int, opts *RebuildInstanceOptions) (*Instance, error)
- func (c *Client) RenameInstance(linodeID int, label string) (*Instance, error)
- func (c *Client) RenameInstanceConfig(linodeID int, configID int, label string) (*InstanceConfig, error)
- func (c *Client) RenameInstanceDisk(linodeID int, diskID int, label string) (*InstanceDisk, error)
- func (c *Client) RenameVolume(id int, label string) (*Volume, error)
- func (c *Client) ResizeInstance(id int, linodeType string) (bool, error)
- func (c *Client) ResizeInstanceDisk(linodeID int, diskID int, size int) (*InstanceDisk, error)
- func (c *Client) ResizeVolume(id int, size int) (bool, error)
- func (c Client) Resource(resourceName string) *Resource
- func (c *Client) SetDebug(debug bool) *Client
- func (c *Client) SetUserAgent(ua string) *Client
- func (c *Client) ShutdownInstance(id int) (bool, error)
- func (c *Client) UpdateDomain(id int, domain DomainUpdateOptions) (*Domain, error)
- func (c *Client) UpdateInstance(id int, instance *InstanceUpdateOptions) (*Instance, error)
- func (c *Client) UpdateInstanceConfig(linodeID int, configID int, updateOpts InstanceConfigUpdateOptions) (*InstanceConfig, error)
- func (c *Client) UpdateInstanceDisk(linodeID int, diskID int, updateOpts InstanceDiskUpdateOptions) (*InstanceDisk, error)
- func (c *Client) UpdateNodeBalancer(id int, updateOpts NodeBalancerUpdateOptions) (*NodeBalancer, error)
- func (c *Client) UpdateNodeBalancerConfig(nodebalancerID int, configID int, updateOpts NodeBalancerConfigUpdateOptions) (*NodeBalancerConfig, error)
- func (c *Client) UpdateNodeBalancerNode(nodebalancerID int, configID int, nodeID int, ...) (*NodeBalancerNode, error)
- func (c *Client) UpdateStackscript(id int, updateOpts StackscriptUpdateOptions) (*Stackscript, error)
- func (c Client) WaitForEventFinished(id interface{}, entityType EntityType, action EventAction, minStart time.Time, ...) (*Event, error)
- type ConfigAlgorithm
- type ConfigCheck
- type ConfigCipher
- type ConfigProtocol
- type ConfigStickiness
- type CreditCard
- type Domain
- type DomainCreateOptions
- type DomainRecord
- type DomainRecordsPagedResponse
- type DomainUpdateOptions
- type DomainsPagedResponse
- type EntityType
- type Error
- type Event
- type EventAction
- type EventEntity
- type EventStatus
- type EventsPagedResponse
- type IPAddressesPagedResponse
- type IPv6PoolsPagedResponse
- type IPv6Range
- type IPv6RangesPagedResponse
- type Image
- type ImagesPagedResponse
- type Instance
- type InstanceAlert
- type InstanceBackup
- type InstanceBackupSnapshotResponse
- type InstanceBackupsResponse
- type InstanceCloneOptions
- type InstanceConfig
- type InstanceConfigCreateOptions
- type InstanceConfigDevice
- type InstanceConfigDeviceMap
- type InstanceConfigHelpers
- type InstanceConfigUpdateOptions
- type InstanceConfigsPagedResponse
- type InstanceCreateOptions
- type InstanceDisk
- type InstanceDiskCreateOptions
- type InstanceDiskUpdateOptions
- type InstanceDisksPagedResponse
- type InstanceIP
- type InstanceIPAddressResponse
- type InstanceIPv4Response
- type InstanceIPv6Response
- type InstanceSnapshot
- type InstanceSnapshotDisk
- type InstanceSnapshotsPagedResponse
- type InstanceSpec
- type InstanceStatus
- type InstanceUpdateOptions
- type InstanceVolumesPagedResponse
- type InstancesPagedResponse
- type Invoice
- type InvoiceItem
- type InvoiceItemsPagedResponse
- type InvoicesPagedResponse
- type LinodeAddons
- type LinodeBackupsAddon
- type LinodeKernel
- type LinodeKernelsPagedResponse
- type LinodePrice
- type LinodeType
- type LinodeTypesPagedResponse
- type ListOptions
- type LongviewClient
- type LongviewClientsPagedResponse
- type LongviewSubscription
- type LongviewSubscriptionsPagedResponse
- type NodeBalancer
- type NodeBalancerConfig
- type NodeBalancerConfigCreateOptions
- type NodeBalancerConfigUpdateOptions
- type NodeBalancerConfigsPagedResponse
- type NodeBalancerCreateOptions
- type NodeBalancerNode
- type NodeBalancerNodeCreateOptions
- type NodeBalancerNodeStatus
- type NodeBalancerNodeUpdateOptions
- type NodeBalancerNodesPagedResponse
- type NodeBalancerTransfer
- type NodeBalancerUpdateOptions
- type NodeBalancersPagedResponse
- type Notification
- type NotificationEntity
- type NotificationsPagedResponse
- type PageOptions
- type RebuildInstanceOptions
- type Region
- type RegionsPagedResponse
- type Resource
- type Stackscript
- type StackscriptCreateOptions
- type StackscriptUpdateOptions
- type StackscriptsPagedResponse
- type Ticket
- type TicketEntity
- type TicketsPagedResponse
- type Volume
- type VolumeAttachOptions
- type VolumeCreateOptions
- type VolumeStatus
- type VolumesPagedResponse
Examples ¶
Constants ¶
const ( // APIHost Linode API hostname APIHost = "api.linode.com" // APIVersion Linode API version APIVersion = "v4" // APIProto connect to API with http(s) APIProto = "https" // Version of linodego Version = "0.0.1" // APIEnvVar environment var to check for API token APIEnvVar = "LINODE_TOKEN" // APISecondsPerPoll how frequently to poll for new Events APISecondsPerPoll = 10 )
const ( // ErrorFromString is the Code identifying Errors created by string types ErrorFromString = 1 // ErrorFromError is the Code identifying Errors created by error types ErrorFromError = 2 // ErrorFromStringer is the Code identifying Errors created by fmt.Stringer types ErrorFromStringer = 3 )
const ( TicketClosed = "closed" TicketOpen = "open" TicketNew = "new" )
Ticket Statuses
Variables ¶
This section is empty.
Functions ¶
func WaitForInstanceStatus ¶
func WaitForInstanceStatus(client *Client, instanceID int, status InstanceStatus, timeoutSeconds int) error
waitForInstanceStatus waits for the Linode instance to reach the desired state before returning. It will timeout with an error after timeoutSeconds.
func WaitForVolumeLinodeID ¶
WaitForVolumeLinodeID waits for the Volume to match the desired LinodeID before returning. An active Instance will not immediately attach or detach a volume, so the the LinodeID must be polled to determine volume readiness from the API. WaitForVolumeLinodeID will timeout with an error after timeoutSeconds.
func WaitForVolumeStatus ¶
func WaitForVolumeStatus(client *Client, volumeID int, status VolumeStatus, timeoutSeconds int) error
WaitForVolumeStatus waits for the Volume to reach the desired state before returning. It will timeout with an error after timeoutSeconds.
Types ¶
type APIError ¶
type APIError struct {
Errors []APIErrorReason `json:"errors"`
}
APIError is the error-set returned by the Linode API when presented with an invalid request
type APIErrorReason ¶
APIErrorReason is an individual invalid request message returned by the Linode API
func (APIErrorReason) Error ¶
func (r APIErrorReason) Error() string
type Account ¶
type Account struct { FirstName string `json:"first_name"` LastName string `json:"last_name"` Email string Company string Address1 string Address2 string Balance float32 City string State string Zip string Country string TaxID string `json:"tax_id"` CreditCard *CreditCard `json:"credit_card"` }
Account associated with the token in use
type Client ¶
type Client struct { Images *Resource InstanceDisks *Resource InstanceConfigs *Resource InstanceSnapshots *Resource InstanceIPs *Resource InstanceVolumes *Resource Instances *Resource IPAddresses *Resource IPv6Pools *Resource IPv6Ranges *Resource Regions *Resource StackScripts *Resource Volumes *Resource Kernels *Resource Types *Resource Domains *Resource DomainRecords *Resource Longview *Resource LongviewClients *Resource LongviewSubscriptions *Resource NodeBalancers *Resource NodeBalancerConfigs *Resource NodeBalancerNodes *Resource Tickets *Resource Account *Resource Invoices *Resource InvoiceItems *Resource Events *Resource Notifications *Resource Profile *Resource Managed *Resource // contains filtered or unexported fields }
Client is a wrapper around the Resty client
func NewClient ¶
func NewClient(codeAPIToken *string, transport http.RoundTripper) (client Client)
NewClient factory to create new Client struct
func (*Client) AddInstanceIPAddress ¶
func (c *Client) AddInstanceIPAddress(linodeID int, public bool) (*InstanceIP, error)
AddInstanceIPAddress adds a public or private IP to a Linode instance
func (*Client) AttachVolume ¶
func (c *Client) AttachVolume(id int, options *VolumeAttachOptions) (bool, error)
AttachVolume attaches volume to linode instance
func (*Client) BootInstance ¶
BootInstance will boot a Linode instance A configID of 0 will cause Linode to choose the last/best config
func (*Client) CloneInstance ¶
func (c *Client) CloneInstance(id int, options *InstanceCloneOptions) (*Instance, error)
CloneInstance clones a Linode instance
func (*Client) CloneVolume ¶
CloneVolume clones a Linode volume
func (*Client) CreateDomain ¶
func (c *Client) CreateDomain(domain *DomainCreateOptions) (*Domain, error)
CreateDomain creates a Domain
func (*Client) CreateInstance ¶
func (c *Client) CreateInstance(instance *InstanceCreateOptions) (*Instance, error)
CreateInstance creates a Linode instance
func (*Client) CreateInstanceConfig ¶
func (c *Client) CreateInstanceConfig(linodeID int, createOpts InstanceConfigCreateOptions) (*InstanceConfig, error)
CreateInstanceConfig creates a new InstanceConfig for the given Instance
func (*Client) CreateInstanceDisk ¶
func (c *Client) CreateInstanceDisk(linodeID int, createOpts InstanceDiskCreateOptions) (*InstanceDisk, error)
CreateInstanceDisk creates a new InstanceDisk for the given Instance
func (*Client) CreateNodeBalancer ¶
func (c *Client) CreateNodeBalancer(nodebalancer *NodeBalancerCreateOptions) (*NodeBalancer, error)
CreateNodeBalancer creates a NodeBalancer
func (*Client) CreateNodeBalancerConfig ¶
func (c *Client) CreateNodeBalancerConfig(nodebalancerID int, nodebalancerConfig *NodeBalancerConfigCreateOptions) (*NodeBalancerConfig, error)
CreateNodeBalancerConfig creates a NodeBalancerConfig
func (*Client) CreateNodeBalancerNode ¶
func (c *Client) CreateNodeBalancerNode(nodebalancerID int, configID int, createOpts *NodeBalancerNodeCreateOptions) (*NodeBalancerNode, error)
CreateNodeBalancerNode creates a NodeBalancerNode
func (*Client) CreateStackscript ¶
func (c *Client) CreateStackscript(createOpts *StackscriptCreateOptions) (*Stackscript, error)
CreateStackscript creates a StackScript
func (*Client) CreateVolume ¶
func (c *Client) CreateVolume(createOpts VolumeCreateOptions) (*Volume, error)
CreateVolume creates a Linode Volume
func (*Client) DeleteDomain ¶
DeleteDomain deletes the Domain with the specified id
func (*Client) DeleteInstance ¶
DeleteInstance deletes a Linode instance
func (*Client) DeleteInstanceConfig ¶
DeleteInstanceConfig deletes a Linode InstanceConfig
func (*Client) DeleteInstanceDisk ¶
DeleteInstanceDisk deletes a Linode Instance Disk
func (*Client) DeleteNodeBalancer ¶
DeleteNodeBalancer deletes the NodeBalancer with the specified id
func (*Client) DeleteNodeBalancerConfig ¶
DeleteNodeBalancerConfig deletes the NodeBalancerConfig with the specified id
func (*Client) DeleteNodeBalancerNode ¶
DeleteNodeBalancerNode deletes the NodeBalancerNode with the specified id
func (*Client) DeleteStackscript ¶
DeleteStackscript deletes the StackScript with the specified id
func (*Client) DeleteVolume ¶
DeleteVolume deletes the Volume with the specified id
func (*Client) DetachVolume ¶
DetachVolume detaches a Linode volume
func (*Client) GetAccount ¶
GetAccount gets the contact and billing information related to the Account
func (*Client) GetDomainRecord ¶
func (c *Client) GetDomainRecord(id string) (*DomainRecord, error)
GetDomainRecord gets the template with the provided ID
func (*Client) GetIPAddress ¶
func (c *Client) GetIPAddress(id string) (*InstanceIP, error)
GetIPAddress gets the template with the provided ID
func (*Client) GetIPv6Pool ¶
GetIPv6Pool gets the template with the provided ID
func (*Client) GetIPv6Range ¶
GetIPv6Range gets the template with the provided ID
func (*Client) GetInstance ¶
GetInstance gets the instance with the provided ID
func (*Client) GetInstanceBackups ¶
func (c *Client) GetInstanceBackups(linodeID int) (*InstanceBackupsResponse, error)
GetInstanceBackups gets the Instance's available Backups
func (*Client) GetInstanceConfig ¶
func (c *Client) GetInstanceConfig(linodeID int, configID int) (*InstanceConfig, error)
GetInstanceConfig gets the template with the provided ID
func (*Client) GetInstanceDisk ¶
func (c *Client) GetInstanceDisk(linodeID int, configID int) (*InstanceDisk, error)
GetInstanceDisk gets the template with the provided ID
func (*Client) GetInstanceIPAddress ¶
func (c *Client) GetInstanceIPAddress(linodeID int, ipaddress string) (*InstanceIP, error)
GetInstanceIPAddress gets the IPAddress for a Linode instance matching a supplied IP address
func (*Client) GetInstanceIPAddresses ¶
func (c *Client) GetInstanceIPAddresses(linodeID int) (*InstanceIPAddressResponse, error)
GetInstanceIPAddresses gets the IPAddresses for a Linode instance
func (*Client) GetInstanceSnapshot ¶
func (c *Client) GetInstanceSnapshot(linodeID int, snapshotID int) (*InstanceSnapshot, error)
GetInstanceSnapshot gets the snapshot with the provided ID
func (*Client) GetInvoice ¶
GetInvoice gets the a single Invoice matching the provided ID
func (*Client) GetKernel ¶
func (c *Client) GetKernel(kernelID string) (*LinodeKernel, error)
GetKernel gets the kernel with the provided ID
func (*Client) GetLongviewClient ¶
func (c *Client) GetLongviewClient(id string) (*LongviewClient, error)
GetLongviewClient gets the template with the provided ID
func (*Client) GetLongviewSubscription ¶
func (c *Client) GetLongviewSubscription(id string) (*LongviewSubscription, error)
GetLongviewSubscription gets the template with the provided ID
func (*Client) GetNodeBalancer ¶
func (c *Client) GetNodeBalancer(id int) (*NodeBalancer, error)
GetNodeBalancer gets the NodeBalancer with the provided ID
func (*Client) GetNodeBalancerConfig ¶
func (c *Client) GetNodeBalancerConfig(nodebalancerID int, configID int) (*NodeBalancerConfig, error)
GetNodeBalancerConfig gets the template with the provided ID
func (*Client) GetNodeBalancerNode ¶
func (c *Client) GetNodeBalancerNode(nodebalancerID int, configID int, nodeID int) (*NodeBalancerNode, error)
GetNodeBalancerNode gets the template with the provided ID
func (*Client) GetStackscript ¶
func (c *Client) GetStackscript(id int) (*Stackscript, error)
GetStackscript gets the Stackscript with the provided ID
func (*Client) GetType ¶
func (c *Client) GetType(typeID string) (*LinodeType, error)
GetType gets the type with the provided ID
func (*Client) ListDomainRecords ¶
func (c *Client) ListDomainRecords(opts *ListOptions) ([]*DomainRecord, error)
ListDomainRecords lists DomainRecords
func (*Client) ListDomains ¶
func (c *Client) ListDomains(opts *ListOptions) ([]*Domain, error)
ListDomains lists Domains
func (*Client) ListEvents ¶
func (c *Client) ListEvents(opts *ListOptions) ([]*Event, error)
ListEvents gets a collection of Event objects representing actions taken on the Account. The Events returned depend on the token grants and the grants of the associated user.
func (*Client) ListIPAddresses ¶
func (c *Client) ListIPAddresses(opts *ListOptions) ([]*InstanceIP, error)
ListIPAddresses lists IPAddresses
func (*Client) ListIPv6Pools ¶
func (c *Client) ListIPv6Pools(opts *ListOptions) ([]*IPv6Range, error)
ListIPv6Pools lists IPv6Pools
func (*Client) ListIPv6Ranges ¶
func (c *Client) ListIPv6Ranges(opts *ListOptions) ([]*IPv6Range, error)
ListIPv6Ranges lists IPv6Ranges
func (*Client) ListImages ¶
func (c *Client) ListImages(opts *ListOptions) ([]*Image, error)
ListImages lists Images
func (*Client) ListInstanceConfigs ¶
func (c *Client) ListInstanceConfigs(linodeID int, opts *ListOptions) ([]*InstanceConfig, error)
ListInstanceConfigs lists InstanceConfigs
func (*Client) ListInstanceDisks ¶
func (c *Client) ListInstanceDisks(linodeID int, opts *ListOptions) ([]*InstanceDisk, error)
ListInstanceDisks lists InstanceDisks
func (*Client) ListInstanceSnapshots ¶
func (c *Client) ListInstanceSnapshots(linodeID int, opts *ListOptions) ([]*InstanceSnapshot, error)
ListInstanceSnapshots lists InstanceSnapshots
func (*Client) ListInstanceVolumes ¶
func (c *Client) ListInstanceVolumes(linodeID int, opts *ListOptions) ([]*Volume, error)
ListInstanceVolumes lists InstanceVolumes
func (*Client) ListInstances ¶
func (c *Client) ListInstances(opts *ListOptions) ([]*Instance, error)
ListInstances lists linode instances
func (*Client) ListInvoiceItems ¶
func (c *Client) ListInvoiceItems(id int, opts *ListOptions) ([]*InvoiceItem, error)
ListInvoiceItems gets the invoice items associated with a specific Invoice
func (*Client) ListInvoices ¶
func (c *Client) ListInvoices(opts *ListOptions) ([]*Invoice, error)
ListInvoices gets a paginated list of Invoices against the Account
func (*Client) ListKernels ¶
func (c *Client) ListKernels(opts *ListOptions) ([]*LinodeKernel, error)
ListKernels lists linode kernels
func (*Client) ListLongviewClients ¶
func (c *Client) ListLongviewClients(opts *ListOptions) ([]*LongviewClient, error)
ListLongviewClients lists LongviewClients
func (*Client) ListLongviewSubscriptions ¶
func (c *Client) ListLongviewSubscriptions(opts *ListOptions) ([]*LongviewSubscription, error)
ListLongviewSubscriptions lists LongviewSubscriptions
func (*Client) ListNodeBalancerConfigs ¶
func (c *Client) ListNodeBalancerConfigs(nodebalancerID int, opts *ListOptions) ([]*NodeBalancerConfig, error)
ListNodeBalancerConfigs lists NodeBalancerConfigs
func (*Client) ListNodeBalancerNodes ¶
func (c *Client) ListNodeBalancerNodes(nodebalancerID int, configID int, opts *ListOptions) ([]*NodeBalancerNode, error)
ListNodeBalancerNodes lists NodeBalancerNodes
func (*Client) ListNodeBalancers ¶
func (c *Client) ListNodeBalancers(opts *ListOptions) ([]*NodeBalancer, error)
ListNodeBalancers lists NodeBalancers
func (*Client) ListNotifications ¶
func (c *Client) ListNotifications(opts *ListOptions) ([]*Notification, error)
ListNotifications gets a collection of Notification objects representing important, often time-sensitive items related to the Account. An account cannot interact directly with Notifications, and a Notification will disappear when the circumstances causing it have been resolved. For example, if the account has an important Ticket open, a response to the Ticket will dismiss the Notification.
func (*Client) ListRegions ¶
func (c *Client) ListRegions(opts *ListOptions) ([]*Region, error)
ListRegions lists Regions
func (*Client) ListStackscripts ¶
func (c *Client) ListStackscripts(opts *ListOptions) ([]*Stackscript, error)
ListStackscripts lists Stackscripts
func (*Client) ListTickets ¶
func (c *Client) ListTickets(opts *ListOptions) ([]*Ticket, error)
ListTickets returns a collection of Support Tickets on the Account. Support Tickets can be both tickets opened with Linode for support, as well as tickets generated by Linode regarding the Account. This collection includes all Support Tickets generated on the Account, with open tickets returned first.
func (*Client) ListTypes ¶
func (c *Client) ListTypes(opts *ListOptions) ([]*LinodeType, error)
ListTypes lists linode types
func (*Client) ListVolumes ¶
func (c *Client) ListVolumes(opts *ListOptions) ([]*Volume, error)
ListVolumes lists Volumes
func (*Client) MarkEventRead ¶
MarkEventRead marks a single Event as read.
func (*Client) MarkEventsSeen ¶
MarkEventsSeen marks all Events up to and including this Event by ID as seen.
func (*Client) MutateInstance ¶
MutateInstance Upgrades a Linode to its next generation.
func (*Client) RebootInstance ¶
RebootInstance reboots a Linode instance A configID of 0 will cause Linode to choose the last/best config
func (*Client) RebuildInstance ¶
func (c *Client) RebuildInstance(id int, opts *RebuildInstanceOptions) (*Instance, error)
RebuildInstance Deletes all Disks and Configs on this Linode, then deploys a new Image to this Linode with the given attributes.
func (*Client) RenameInstance ¶
RenameInstance renames an Instance
func (*Client) RenameInstanceConfig ¶
func (c *Client) RenameInstanceConfig(linodeID int, configID int, label string) (*InstanceConfig, error)
RenameInstanceConfig renames an InstanceConfig
func (*Client) RenameInstanceDisk ¶
RenameInstanceDisk renames an InstanceDisk
func (*Client) RenameVolume ¶
RenameVolume renames the label of a Linode volume There is no UpdateVolume because the label is the only alterable field.
func (*Client) ResizeInstance ¶
ResizeInstance resizes an instance to new Linode type
func (*Client) ResizeInstanceDisk ¶
ResizeInstanceDisk resizes the size of the Instance disk
func (*Client) ResizeVolume ¶
ResizeVolume resizes an instance to new Linode type
func (*Client) SetUserAgent ¶
SetUserAgent sets a custom user-agent for HTTP requests
func (*Client) ShutdownInstance ¶
ShutdownInstance - Shutdown an instance
func (*Client) UpdateDomain ¶
func (c *Client) UpdateDomain(id int, domain DomainUpdateOptions) (*Domain, error)
UpdateDomain updates the Domain with the specified id
func (*Client) UpdateInstance ¶
func (c *Client) UpdateInstance(id int, instance *InstanceUpdateOptions) (*Instance, error)
UpdateInstance creates a Linode instance
func (*Client) UpdateInstanceConfig ¶
func (c *Client) UpdateInstanceConfig(linodeID int, configID int, updateOpts InstanceConfigUpdateOptions) (*InstanceConfig, error)
UpdateInstanceConfig update an InstanceConfig for the given Instance
func (*Client) UpdateInstanceDisk ¶
func (c *Client) UpdateInstanceDisk(linodeID int, diskID int, updateOpts InstanceDiskUpdateOptions) (*InstanceDisk, error)
UpdateInstanceDisk creates a new InstanceDisk for the given Instance
func (*Client) UpdateNodeBalancer ¶
func (c *Client) UpdateNodeBalancer(id int, updateOpts NodeBalancerUpdateOptions) (*NodeBalancer, error)
UpdateNodeBalancer updates the NodeBalancer with the specified id
func (*Client) UpdateNodeBalancerConfig ¶
func (c *Client) UpdateNodeBalancerConfig(nodebalancerID int, configID int, updateOpts NodeBalancerConfigUpdateOptions) (*NodeBalancerConfig, error)
UpdateNodeBalancerConfig updates the NodeBalancerConfig with the specified id
func (*Client) UpdateNodeBalancerNode ¶
func (c *Client) UpdateNodeBalancerNode(nodebalancerID int, configID int, nodeID int, updateOpts NodeBalancerNodeUpdateOptions) (*NodeBalancerNode, error)
UpdateNodeBalancerNode updates the NodeBalancerNode with the specified id
func (*Client) UpdateStackscript ¶
func (c *Client) UpdateStackscript(id int, updateOpts StackscriptUpdateOptions) (*Stackscript, error)
UpdateStackscript updates the StackScript with the specified id
func (Client) WaitForEventFinished ¶
func (c Client) WaitForEventFinished(id interface{}, entityType EntityType, action EventAction, minStart time.Time, timeoutSeconds int) (*Event, error)
WaitForEventFinished waits for an entity action to reach the 'finished' state before returning. It will timeout with an error after timeoutSeconds. If the event indicates a failure both the failed event and the error will be returned.
type ConfigAlgorithm ¶
type ConfigAlgorithm string
var ( AlgorithmRoundRobin ConfigAlgorithm = "roundrobin" AlgorithmLeastConn ConfigAlgorithm = "leastconn" AlgorithmSource ConfigAlgorithm = "source" )
type ConfigCheck ¶
type ConfigCheck string
var ( CheckNone ConfigCheck = "none" CheckConnection ConfigCheck = "connection" CheckHTTP ConfigCheck = "http" CheckHTTPBody ConfigCheck = "http_body" )
type ConfigCipher ¶
type ConfigCipher string
var ( CipherRecommended ConfigCipher = "recommended" CipherLegacy ConfigCipher = "legacy" )
type ConfigProtocol ¶
type ConfigProtocol string
var ( ProtocolHTTP ConfigProtocol = "http" ProtocolHTTPS ConfigProtocol = "https" ProtocolTCP ConfigProtocol = "tcp" )
type ConfigStickiness ¶
type ConfigStickiness string
var ( StickinessNone ConfigStickiness = "none" StickinessTable ConfigStickiness = "table" StickinessHTTPCookie ConfigStickiness = "http_cookie" )
type CreditCard ¶
CreditCard information associated with the Account.
type Domain ¶
type Domain struct { // This Domain's unique ID ID int // The domain this Domain represents. These must be unique in our system; you cannot have two Domains representing the same domain. Domain string // If this Domain represents the authoritative source of information for the domain it describes, or if it is a read-only copy of a master (also called a slave). Type string // Enum:"master" "slave" // Deprecated: The group this Domain belongs to. This is for display purposes only. Group string // Used to control whether this Domain is currently being rendered. Status string // Enum:"disabled" "active" "edit_mode" "has_errors" // A description for this Domain. This is for display purposes only. Description string // Start of Authority email address. This is required for master Domains. SOAEmail string `json:"soa_email"` // The interval, in seconds, at which a failed refresh should be retried. // Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. RetrySec int `json:"retry_sec"` // The IP addresses representing the master DNS for this Domain. MasterIPs []string `json:"master_ips"` // The list of IPs that may perform a zone transfer for this Domain. This is potentially dangerous, and should be set to an empty list unless you intend to use it. AXfrIPs []string `json:"axfr_ips"` // The amount of time in seconds that may pass before this Domain is no longer authoritative. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. ExpireSec int `json:"expire_sec"` // The amount of time in seconds before this Domain should be refreshed. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. RefreshSec int `json:"refresh_sec"` // "Time to Live" - the amount of time in seconds that this Domain's records may be cached by resolvers or other domain servers. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. TTLSec int `json:"ttl_sec"` }
Domain represents a Domain object
func (Domain) GetUpdateOptions ¶
func (d Domain) GetUpdateOptions() (du DomainUpdateOptions)
type DomainCreateOptions ¶
type DomainCreateOptions DomainUpdateOptions
type DomainRecord ¶
type DomainRecord struct { ID int Type string Name string Target string Priority int Weight int Port int Service string Protocol string TTLSec int `json:"ttl_sec"` Tag string }
DomainRecord represents a DomainRecord object
type DomainRecordsPagedResponse ¶
type DomainRecordsPagedResponse struct { *PageOptions Data []*DomainRecord }
DomainRecordsPagedResponse represents a paginated DomainRecord API response
type DomainUpdateOptions ¶
type DomainUpdateOptions struct { // The domain this Domain represents. These must be unique in our system; you cannot have two Domains representing the same domain. Domain string `json:"domain,omitempty"` // If this Domain represents the authoritative source of information for the domain it describes, or if it is a read-only copy of a master (also called a slave). // Enum:"master" "slave" Type string `json:"type,omitempty"` // Deprecated: The group this Domain belongs to. This is for display purposes only. Group string `json:"group,omitempty"` // Used to control whether this Domain is currently being rendered. // Enum:"disabled" "active" "edit_mode" "has_errors" Status string `json:"status,omitempty"` // A description for this Domain. This is for display purposes only. Description string `json:"description,omitempty"` // Start of Authority email address. This is required for master Domains. SOAEmail string `json:"soa_email,omitempty"` // The interval, in seconds, at which a failed refresh should be retried. // Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. RetrySec int `json:"retry_sec,omitempty"` // The IP addresses representing the master DNS for this Domain. MasterIPs []string `json:"master_ips,omitempty"` // The list of IPs that may perform a zone transfer for this Domain. This is potentially dangerous, and should be set to an empty list unless you intend to use it. AXfrIPs []string `json:"axfr_ips,omitempty"` // The amount of time in seconds that may pass before this Domain is no longer authoritative. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. ExpireSec int `json:"expire_sec,omitempty"` // The amount of time in seconds before this Domain should be refreshed. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. RefreshSec int `json:"refresh_sec,omitempty"` // "Time to Live" - the amount of time in seconds that this Domain's records may be cached by resolvers or other domain servers. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. TTLSec int `json:"ttl_sec,omitempty"` }
type DomainsPagedResponse ¶
type DomainsPagedResponse struct { *PageOptions Data []*Domain }
DomainsPagedResponse represents a paginated Domain API response
type EntityType ¶
type EntityType string
EntityType constants start with Entity and include Linode API Event Entity Types
const ( EntityLinode EntityType = "linode" EntityDisk EntityType = "disk" )
type Error ¶
Error wraps the LinodeGo error with the relevant http.Response
type Event ¶
type Event struct { CreatedStr string `json:"created"` // The unique ID of this Event. ID int // Current status of the Event, Enum: "failed" "finished" "notification" "scheduled" "started" Status EventStatus // The action that caused this Event. New actions may be added in the future. Action EventAction // A percentage estimating the amount of time remaining for an Event. Returns null for notification events. PercentComplete int `json:"percent_complete"` // The rate of completion of the Event. Only some Events will return rate; for example, migration and resize Events. Rate string // If this Event has been read. Read bool // If this Event has been seen. Seen bool // The estimated time remaining until the completion of this Event. This value is only returned for in-progress events. TimeRemaining int // The username of the User who caused the Event. Username string // Detailed information about the Event's entity, including ID, type, label, and URL used to access it. Entity *EventEntity // When this Event was created. Created *time.Time `json:"-"` }
Event represents an action taken on the Account.
type EventAction ¶
type EventAction string
EventAction constants start with Action and include all known Linode API Event Actions.
const ( ActionBackupsEnable EventAction = "backups_enable" ActionBackupsCancel EventAction = "backups_cancel" ActionBackupsRestore EventAction = "backups_restore" ActionCommunityQuestionReply EventAction = "community_question_reply" ActionCreateCardUpdated EventAction = "credit_card_updated" ActionDiskCreate EventAction = "disk_create" ActionDiskDelete EventAction = "disk_delete" ActionDiskDuplicate EventAction = "disk_duplicate" ActionDiskImagize EventAction = "disk_imagize" ActionDiskResize EventAction = "disk_resize" ActionDNSRecordCreate EventAction = "dns_record_create" ActionDNSRecordDelete EventAction = "dns_record_delete" ActionDNSZoneCreate EventAction = "dns_zone_create" ActionDNSZoneDelete EventAction = "dns_zone_delete" ActionImageDelete EventAction = "image_delete" ActionLinodeAddIP EventAction = "linode_addip" ActionLinodeBoot EventAction = "linode_boot" ActionLinodeClone EventAction = "linode_clone" ActionLinodeCreate EventAction = "linode_create" ActionLinodeDelete EventAction = "linode_delete" ActionLinodeDeleteIP EventAction = "linode_deleteip" ActionLinodeMigrate EventAction = "linode_migrate" ActionLinodeMutate EventAction = "linode_mutate" ActionLinodeReboot EventAction = "linode_reboot" ActionLinodeRebuild EventAction = "linode_rebuild" ActionLinodeResize EventAction = "linode_resize" ActionLinodeShutdown EventAction = "linode_shutdown" ActionLinodeSnapshot EventAction = "linode_snapshot" ActionLongviewClientCreate EventAction = "longviewclient_create" ActionLongviewClientDelete EventAction = "longviewclient_delete" ActionManagedDisabled EventAction = "managed_disabled" ActionManagedEnabled EventAction = "managed_enabled" ActionManagedServiceCreate EventAction = "managed_service_create" ActionManagedServiceDelete EventAction = "managed_service_delete" ActionNodebalancerCreate EventAction = "nodebalancer_create" ActionNodebalancerDelete EventAction = "nodebalancer_delete" ActionNodebalancerConfigCreate EventAction = "nodebalancer_config_create" ActionNodebalancerConfigDelete EventAction = "nodebalancer_config_delete" ActionPasswordReset EventAction = "password_reset" ActionPaymentSubmitted EventAction = "payment_submitted" ActionStackScriptCreate EventAction = "stackscript_create" ActionStackScriptDelete EventAction = "stackscript_delete" ActionStackScriptPublicize EventAction = "stackscript_publicize" ActionStackScriptRevise EventAction = "stackscript_revise" ActionTFADisabled EventAction = "tfa_disabled" ActionTFAEnabled EventAction = "tfa_enabled" ActionTicketAttachmentUpload EventAction = "ticket_attachment_upload" ActionTicketCreate EventAction = "ticket_create" ActionTicketReply EventAction = "ticket_reply" ActionVolumeAttach EventAction = "volume_attach" ActionVolumeClone EventAction = "volume_clone" ActionVolumeCreate EventAction = "volume_create" ActionVolumeDelte EventAction = "volume_delete" ActionVolumeDetach EventAction = "volume_detach" ActionVolumeResize EventAction = "volume_resize" )
type EventEntity ¶
type EventEntity struct { // ID may be a string or int, it depends on the EntityType ID interface{} Label string Type EntityType URL string }
EventEntity provides detailed information about the Event's associated entity, including ID, Type, Label, and a URL that can be used to access it.
type EventStatus ¶
type EventStatus string
EventStatus constants start with Event and include Linode API Event Status values
const ( EventFailed EventStatus = "failed" EventFinished EventStatus = "finished" EventNotification EventStatus = "notification" EventScheduled EventStatus = "scheduled" EventStarted EventStatus = "started" )
type EventsPagedResponse ¶
type EventsPagedResponse struct { *PageOptions Data []*Event }
EventsPagedResponse represents a paginated Events API response
type IPAddressesPagedResponse ¶
type IPAddressesPagedResponse struct { *PageOptions Data []*InstanceIP }
IPAddressesPagedResponse represents a paginated IPAddress API response
type IPv6PoolsPagedResponse ¶
type IPv6PoolsPagedResponse struct { *PageOptions Data []*IPv6Range }
IPv6PoolsPagedResponse represents a paginated IPv6Pool API response
type IPv6RangesPagedResponse ¶
type IPv6RangesPagedResponse struct { *PageOptions Data []*IPv6Range }
IPv6RangesPagedResponse represents a paginated IPv6Range API response
type Image ¶
type Image struct { CreatedStr string `json:"created"` UpdatedStr string `json:"updated"` ID string Label string Description string Type string IsPublic bool Size int Vendor string Deprecated bool CreatedBy string `json:"created_by"` Created *time.Time `json:"-"` Updated *time.Time `json:"-"` }
Image represents a deployable Image object for use with Linode Instances
type ImagesPagedResponse ¶
type ImagesPagedResponse struct { *PageOptions Data []*Image }
ImagesPagedResponse represents a linode API response for listing of images
type Instance ¶
type Instance struct { CreatedStr string `json:"created"` UpdatedStr string `json:"updated"` ID int Created *time.Time `json:"-"` Updated *time.Time `json:"-"` Region string Alerts *InstanceAlert Backups *InstanceBackup Image string Group string IPv4 []*net.IP IPv6 string Label string Type string Status InstanceStatus Hypervisor string Specs *InstanceSpec }
Instance represents a linode object
type InstanceAlert ¶
type InstanceAlert struct { CPU int `json:"cpu"` IO int `json:"io"` NetworkIn int `json:"network_in"` NetworkOut int `json:"network_out"` TransferQuote int `json:"transfer_queue"` }
InstanceAlert represents a metric alert
type InstanceBackup ¶
type InstanceBackup struct { Enabled bool `json:"enabled"` Schedule struct { Day string `json:"day,omitempty"` Window string `json:"window,omitempty"` } }
InstanceBackup represents backup settings for an instance
type InstanceBackupSnapshotResponse ¶
type InstanceBackupSnapshotResponse struct { Current *InstanceSnapshot InProgress *InstanceSnapshot `json:"in_progress"` }
type InstanceBackupsResponse ¶
type InstanceBackupsResponse struct { Automatic []*InstanceSnapshot Snapshot *InstanceBackupSnapshotResponse }
InstanceBackupsResponse response struct for backup snapshot
type InstanceCloneOptions ¶
type InstanceCloneOptions struct { Region string `json:"region"` Type string `json:"type"` LinodeID int `json:"linode_id"` Label string `json:"label"` Group string `json:"group"` BackupsEnabled bool `json:"backups_enabled"` Disks []string `json:"disks"` Configs []string `json:"configs"` }
InstanceCloneOptions is an options struct when sending a clone request to the API
type InstanceConfig ¶
type InstanceConfig struct { CreatedStr string `json:"created"` UpdatedStr string `json:"updated"` ID int Label string `json:"label"` Comments string `json:"comments"` Devices *InstanceConfigDeviceMap `json:"devices"` Helpers *InstanceConfigHelpers `json:"helpers"` MemoryLimit int `json:"memory_limit"` Kernel string `json:"kernel"` InitRD int `json:"init_rd"` RootDevice string `json:"root_device"` RunLevel string `json:"run_level"` VirtMode string `json:"virt_mode"` Created *time.Time `json:"-"` Updated *time.Time `json:"-"` }
func (InstanceConfig) GetCreateOptions ¶
func (i InstanceConfig) GetCreateOptions() InstanceConfigCreateOptions
func (InstanceConfig) GetUpdateOptions ¶
func (i InstanceConfig) GetUpdateOptions() InstanceConfigUpdateOptions
type InstanceConfigCreateOptions ¶
type InstanceConfigCreateOptions struct { Label string `json:"label,omitempty"` Comments string `json:"comments,omitempty"` Devices *InstanceConfigDeviceMap `json:"devices,omitempty"` Helpers *InstanceConfigHelpers `json:"helpers,omitempty"` MemoryLimit int `json:"memory_limit"` Kernel string `json:"kernel,omitempty"` InitRD int `json:"init_rd"` RootDevice string `json:"root_device,omitempty"` RunLevel string `json:"run_level,omitempty"` VirtMode string `json:"virt_mode,omitempty"` }
InstanceConfigCreateOptions are InstanceConfig settings that can be used at creation
type InstanceConfigDevice ¶
type InstanceConfigDeviceMap ¶
type InstanceConfigDeviceMap struct { SDA *InstanceConfigDevice `json:"sda,omitempty"` SDB *InstanceConfigDevice `json:"sdb,omitempty"` SDC *InstanceConfigDevice `json:"sdc,omitempty"` SDD *InstanceConfigDevice `json:"sdd,omitempty"` SDE *InstanceConfigDevice `json:"sde,omitempty"` SDF *InstanceConfigDevice `json:"sdf,omitempty"` SDG *InstanceConfigDevice `json:"sdg,omitempty"` SDH *InstanceConfigDevice `json:"sdh,omitempty"` }
type InstanceConfigHelpers ¶
type InstanceConfigUpdateOptions ¶
type InstanceConfigUpdateOptions InstanceConfigCreateOptions
InstanceConfigUpdateOptions are InstanceConfig settings that can be used in updates
type InstanceConfigsPagedResponse ¶
type InstanceConfigsPagedResponse struct { *PageOptions Data []*InstanceConfig }
InstanceConfigsPagedResponse represents a paginated InstanceConfig API response
type InstanceCreateOptions ¶
type InstanceCreateOptions struct { Region string `json:"region"` Type string `json:"type"` Label string `json:"label,omitempty"` Group string `json:"group,omitempty"` RootPass string `json:"root_pass,omitempty"` AuthorizedKeys []string `json:"authorized_keys,omitempty"` StackScriptID int `json:"stackscript_id,omitempty"` StackScriptData map[string]string `json:"stackscript_data,omitempty"` BackupID int `json:"backup_id,omitempty"` Image string `json:"image,omitempty"` BackupsEnabled bool `json:"backups_enabled,omitempty"` SwapSize *int `json:"swap_size,omitempty"` Booted bool `json:"booted,omitempty"` }
InstanceCreateOptions require only Region and Type
type InstanceDisk ¶
type InstanceDiskCreateOptions ¶
type InstanceDiskCreateOptions struct { Label string `json:"label"` Size int `json:"size"` // Image is optional, but requires RootPass if provided Image string `json:"image,omitempty"` RootPass string `json:"root_pass,omitempty"` Filesystem string `json:"filesystem,omitempty"` AuthorizedKeys []string `json:"authorized_keys,omitempty"` ReadOnly bool `json:"read_only,omitempty"` StackscriptID int `json:"stackscript_id,omitempty"` StackscriptData map[string]string `json:"stackscript_data,omitempty"` }
InstanceDiskCreateOptions are InstanceDisk settings that can be used at creation
type InstanceDiskUpdateOptions ¶
type InstanceDiskUpdateOptions struct { Label string `json:"label"` ReadOnly bool `json:"read_only"` }
InstanceDiskUpdateOptions are InstanceDisk settings that can be used in updates
type InstanceDisksPagedResponse ¶
type InstanceDisksPagedResponse struct { *PageOptions Data []*InstanceDisk }
InstanceDisksPagedResponse represents a paginated InstanceDisk API response
type InstanceIP ¶
type InstanceIPAddressResponse ¶
type InstanceIPAddressResponse struct { IPv4 *InstanceIPv4Response IPv6 *InstanceIPv6Response }
type InstanceIPv4Response ¶
type InstanceIPv4Response struct { Public []*InstanceIP Private []*InstanceIP }
type InstanceIPv6Response ¶
type InstanceIPv6Response struct { LinkLocal *InstanceIP `json:"link_local"` SLAAC *InstanceIP Global []*IPv6Range }
type InstanceSnapshot ¶
type InstanceSnapshot struct { CreatedStr string `json:"created"` UpdatedStr string `json:"updated"` FinishedStr string `json:"finished"` ID int Label string Status string Type string Created *time.Time `json:"-"` Updated *time.Time `json:"-"` Finished *time.Time `json:"-"` Configs []string Disks []*InstanceSnapshotDisk }
InstanceSnapshot represents a linode backup snapshot
type InstanceSnapshotDisk ¶
type InstanceSnapshotsPagedResponse ¶
type InstanceSnapshotsPagedResponse struct { *PageOptions Data []*InstanceSnapshot }
InstanceSnapshotsPagedResponse represents a paginated InstanceSnapshot API response
type InstanceSpec ¶
InstanceSpec represents a linode spec
type InstanceStatus ¶
type InstanceStatus string
const ( InstanceBooting InstanceStatus = "booting" InstanceRunning InstanceStatus = "running" InstanceOffline InstanceStatus = "offline" InstanceShuttingDown InstanceStatus = "shutting_down" InstanceRebooting InstanceStatus = "rebooting" InstanceProvisioning InstanceStatus = "provisioning" InstanceDeleting InstanceStatus = "deleting" InstanceMigrating InstanceStatus = "migrating" InstanceRebuilding InstanceStatus = "rebuilding" InstanceCloning InstanceStatus = "cloning" InstanceRestoring InstanceStatus = "restoring" )
InstanceStatus enum represents potential Instance.Status values
type InstanceUpdateOptions ¶
type InstanceUpdateOptions struct { Label string `json:"label,omitempty"` Group string `json:"group,omitempty"` Backups InstanceBackup `json:"backups,omitempty"` Alerts InstanceAlert `json:"alerts,omitempty"` }
InstanceUpdateOptions is an options struct used when Updating an Instance
type InstanceVolumesPagedResponse ¶
type InstanceVolumesPagedResponse struct { *PageOptions Data []*Volume }
InstanceVolumesPagedResponse represents a paginated InstanceVolume API response
type InstancesPagedResponse ¶
type InstancesPagedResponse struct { *PageOptions Data []*Instance }
InstancesPagedResponse represents a linode API response for listing
type Invoice ¶
type Invoice struct { DateStr string `json:"date"` ID int Label string Total float32 Date *time.Time `json:"-"` }
Invoice structs reflect an invoice for billable activity on the account.
type InvoiceItem ¶
type InvoiceItem struct { FromStr string `json:"from"` ToStr string `json:"to"` Label string Type string UnitPrice int Quantity int Amount float32 From *time.Time `json:"-"` To *time.Time `json:"-"` }
InvoiceItem structs reflect an single billable activity associate with an Invoice
type InvoiceItemsPagedResponse ¶
type InvoiceItemsPagedResponse struct { *PageOptions Data []*InvoiceItem }
InvoiceItemsPagedResponse represents a paginated Invoice Item API response
type InvoicesPagedResponse ¶
type InvoicesPagedResponse struct { *PageOptions Data []*Invoice }
InvoicesPagedResponse represents a paginated Invoice API response
type LinodeAddons ¶
type LinodeAddons struct {
Backups *LinodeBackupsAddon
}
LinodeAddons represent the linode addons object
type LinodeBackupsAddon ¶
type LinodeBackupsAddon struct {
Price *LinodePrice
}
LinodeBackupsAddon represents a linode backups addon object
type LinodeKernel ¶
type LinodeKernel struct { ID string Label string Version string KVM bool XEN bool Architecture string PVOPS bool }
LinodeKernel represents a linode kernel object
type LinodeKernelsPagedResponse ¶
type LinodeKernelsPagedResponse struct { *PageOptions Data []*LinodeKernel }
LinodeKernelsPagedResponse represents a linode kernels API response for listing
type LinodePrice ¶
LinodePrice represents a linode type price object
type LinodeType ¶
type LinodeType struct { ID string Disk int Class string // enum: nanode, standard, highmem Price *LinodePrice Label string Addons *LinodeAddons NetworkOut int `json:"network_out"` Memory int Transfer int VCPUs int }
LinodeType represents a linode type object
type LinodeTypesPagedResponse ¶
type LinodeTypesPagedResponse struct { *PageOptions Data []*LinodeType }
LinodeTypesPagedResponse represents a linode types API response for listing
type ListOptions ¶
type ListOptions struct { *PageOptions Filter string }
ListOptions are the pagination and filtering (TODO) parameters for endpoints
func NewListOptions ¶
func NewListOptions(Page int, Filter string) *ListOptions
NewListOptions simplified construction of ListOptions using only the two writable properties, Page and Filter
type LongviewClient ¶
type LongviewClient struct {
ID int
}
LongviewClient represents a LongviewClient object
type LongviewClientsPagedResponse ¶
type LongviewClientsPagedResponse struct { *PageOptions Data []*LongviewClient }
LongviewClientsPagedResponse represents a paginated LongviewClient API response
type LongviewSubscription ¶
type LongviewSubscription struct { ID string Label string ClientsIncluded int `json:"clients_included"` Price *LinodePrice }
LongviewSubscription represents a LongviewSubscription object
type LongviewSubscriptionsPagedResponse ¶
type LongviewSubscriptionsPagedResponse struct { *PageOptions Data []*LongviewSubscription }
LongviewSubscriptionsPagedResponse represents a paginated LongviewSubscription API response
type NodeBalancer ¶
type NodeBalancer struct { CreatedStr string `json:"created"` UpdatedStr string `json:"updated"` // This NodeBalancer's unique ID. ID int // This NodeBalancer's label. These must be unique on your Account. Label *string // The Region where this NodeBalancer is located. NodeBalancers only support backends in the same Region. Region string // This NodeBalancer's hostname, ending with .nodebalancer.linode.com Hostname *string // This NodeBalancer's public IPv4 address. IPv4 *string // This NodeBalancer's public IPv6 address. IPv6 *string // Throttle connections per second (0-20). Set to 0 (zero) to disable throttling. ClientConnThrottle int `json:"client_conn_throttle"` // Information about the amount of transfer this NodeBalancer has had so far this month. Transfer NodeBalancerTransfer Created *time.Time `json:"-"` Updated *time.Time `json:"-"` }
NodeBalancer represents a NodeBalancer object
func (NodeBalancer) GetCreateOptions ¶
func (i NodeBalancer) GetCreateOptions() NodeBalancerCreateOptions
func (NodeBalancer) GetUpdateOptions ¶
func (i NodeBalancer) GetUpdateOptions() NodeBalancerUpdateOptions
type NodeBalancerConfig ¶
type NodeBalancerConfig struct { ID int Port int Protocol ConfigProtocol Algorithm ConfigAlgorithm Stickiness ConfigStickiness Check ConfigCheck CheckInterval int `json:"check_interval"` CheckAttempts int `json:"check_attempts"` CheckPath string `json:"check_path"` CheckBody string `json:"check_body"` CheckPassive bool `json:"check_passive"` CheckTimeout int `json:"check_timeout"` CipherSuite ConfigCipher `json:"cipher_suite"` NodeBalancerID int `json:"nodebalancer_id"` SSLCommonName string `json:"ssl_commonname"` SSLFingerprint string `json:"ssl_fingerprint"` SSLCert string `json:"ssl_cert"` SSLKey string `json:"ssl_key"` NodesStatus *NodeBalancerNodeStatus `json:"nodes_status"` }
func (NodeBalancerConfig) GetCreateOptions ¶
func (i NodeBalancerConfig) GetCreateOptions() NodeBalancerConfigCreateOptions
func (NodeBalancerConfig) GetUpdateOptions ¶
func (i NodeBalancerConfig) GetUpdateOptions() NodeBalancerConfigUpdateOptions
type NodeBalancerConfigCreateOptions ¶
type NodeBalancerConfigCreateOptions struct { Port int `json:"port"` Protocol ConfigProtocol `json:"protocol,omitempty"` Algorithm ConfigAlgorithm `json:"algorithm,omitempty"` Stickiness ConfigStickiness `json:"stickiness,omitempty"` Check ConfigCheck `json:"check,omitempty"` CheckInterval int `json:"check_interval,omitempty"` CheckAttempts int `json:"check_attempts,omitempty"` CheckPath string `json:"check_path,omitempty"` CheckBody string `json:"check_body,omitempty"` CheckPassive *bool `json:"check_passive,omitempty"` CheckTimeout int `json:"check_timeout,omitempty"` CipherSuite ConfigCipher `json:"cipher_suite,omitempty"` SSLCert string `json:"ssl_cert,omitempty"` SSLKey string `json:"ssl_key,omitempty"` }
NodeBalancerConfigUpdateOptions are permitted by CreateNodeBalancerConfig
type NodeBalancerConfigUpdateOptions ¶
type NodeBalancerConfigUpdateOptions NodeBalancerConfigCreateOptions
NodeBalancerConfigUpdateOptions are permitted by UpdateNodeBalancerConfig
type NodeBalancerConfigsPagedResponse ¶
type NodeBalancerConfigsPagedResponse struct { *PageOptions Data []*NodeBalancerConfig }
NodeBalancerConfigsPagedResponse represents a paginated NodeBalancerConfig API response
type NodeBalancerCreateOptions ¶
type NodeBalancerCreateOptions struct { Label *string `json:"label,omitempty"` Region string `json:"region,omitempty"` ClientConnThrottle *int `json:"client_conn_throttle,omitempty"` }
NodeBalancerCreateOptions are the options permitted for CreateNodeBalancer
type NodeBalancerNode ¶
type NodeBalancerNode struct { ID int Address string Label string Status string Weight int Mode string ConfigID int `json:"config_id"` NodeBalancerID int `json:"nodebalancer_id"` }
func (NodeBalancerNode) GetCreateOptions ¶
func (i NodeBalancerNode) GetCreateOptions() NodeBalancerNodeCreateOptions
func (NodeBalancerNode) GetUpdateOptions ¶
func (i NodeBalancerNode) GetUpdateOptions() NodeBalancerNodeUpdateOptions
type NodeBalancerNodeStatus ¶
type NodeBalancerNodesPagedResponse ¶
type NodeBalancerNodesPagedResponse struct { *PageOptions Data []*NodeBalancerNode }
NodeBalancerNodesPagedResponse represents a paginated NodeBalancerNode API response
type NodeBalancerTransfer ¶
type NodeBalancerUpdateOptions ¶
type NodeBalancerUpdateOptions struct { Label *string `json:"label,omitempty"` ClientConnThrottle *int `json:"client_conn_throttle,omitempty"` }
NodeBalancerUpdateOptions are the options permitted for UpdateNodeBalancer
type NodeBalancersPagedResponse ¶
type NodeBalancersPagedResponse struct { *PageOptions Data []*NodeBalancer }
NodeBalancersPagedResponse represents a paginated NodeBalancer API response
type Notification ¶
type NotificationEntity ¶
NotificationEntity adds detailed information about the Notification. This could refer to the ticket that triggered the notification, for example.
type NotificationsPagedResponse ¶
type NotificationsPagedResponse struct { *PageOptions Data []*Notification }
NotificationsPagedResponse represents a paginated Notifications API response
type PageOptions ¶
type PageOptions struct { Page int `url:"page,omitempty"` Pages int `url:"pages,omitempty"` Results int `url:"results,omitempty"` }
PageOptions are the pagination parameters for List endpoints
type RebuildInstanceOptions ¶
type RebuildInstanceOptions struct { Image string `json:"image"` RootPass string `json:"root_pass"` AuthorizedKeys []string `json:"authorized_keys"` StackscriptID int `json:"stackscript_id"` StackscriptData map[string]string `json:"stackscript_data"` Booted bool `json:"booted"` }
RebuildInstanceOptions is a struct representing the options to send to the rebuild linode endpoint
type RegionsPagedResponse ¶
type RegionsPagedResponse struct { *PageOptions Data []*Region }
LinodeRegionsPagedResponse represents a linode API response for listing
type Resource ¶
type Resource struct { R func() *resty.Request PR func() *resty.Request // contains filtered or unexported fields }
Resource represents a linode API resource
type Stackscript ¶
type Stackscript struct { CreatedStr string `json:"created"` UpdatedStr string `json:"updated"` ID int Username string Label string Description string Images []string DeploymentsTotal int DeploymentsActive int IsPublic bool Created *time.Time `json:"-"` Updated *time.Time `json:"-"` RevNote string Script string UserDefinedFields *map[string]string UserGravatarID string }
Stackscript represents a Linode StackScript
func (Stackscript) GetCreateOptions ¶
func (i Stackscript) GetCreateOptions() StackscriptCreateOptions
func (Stackscript) GetUpdateOptions ¶
func (i Stackscript) GetUpdateOptions() StackscriptUpdateOptions
type StackscriptUpdateOptions ¶
type StackscriptUpdateOptions StackscriptCreateOptions
type StackscriptsPagedResponse ¶
type StackscriptsPagedResponse struct { *PageOptions Data []*Stackscript }
StackscriptsPagedResponse represents a paginated Stackscript API response
type Ticket ¶
type Ticket struct { ID int Attachments []string Closed *time.Time `json:"-"` Description string Entity *TicketEntity GravatarID string Opened *time.Time `json:"-"` OpenedBy string Status string Summary string Updated *time.Time `json:"-"` UpdatedBy string }
Ticket represents a support ticket object
type TicketEntity ¶
TicketEntity refers a ticket to a specific entity
type TicketsPagedResponse ¶
type TicketsPagedResponse struct { *PageOptions Data []*Ticket }
TicketsPagedResponse represents a paginated ticket API response
type Volume ¶
type Volume struct { CreatedStr string `json:"created"` UpdatedStr string `json:"updated"` ID int Label string Status VolumeStatus Region string Size int LinodeID *int `json:"linode_id"` FilesystemPath string `json:"filesystem_path"` Created time.Time `json:"-"` Updated time.Time `json:"-"` }
Volume represents a linode volume object
type VolumeAttachOptions ¶
type VolumeCreateOptions ¶
type VolumeCreateOptions struct { Label string `json:"label,omitempty"` Region string `json:"region,omitempty"` LinodeID int `json:"linode_id,omitempty"` ConfigID int `json:"config_id,omitempty"` // The Volume's size, in GiB. Minimum size is 10GiB, maximum size is 10240GiB. A "0" value will result in the default size. Size int `json:"size,omitempty"` }
type VolumeStatus ¶
type VolumeStatus string
VolumeStatus indicates the status of the Volume
const ( // VolumeCreating indicates the Volume is being created and is not yet available for use VolumeCreating VolumeStatus = "creating" // VolumeActive indicates the Volume is online and available for use VolumeActive VolumeStatus = "active" // VolumeResizing indicates the Volume is in the process of upgrading its current capacity VolumeResizing VolumeStatus = "resizing" // VolumeContactSupport indicates there is a problem with the Volume. A support ticket must be opened to resolve the issue VolumeContactSupport VolumeStatus = "contact_support" )
type VolumesPagedResponse ¶
type VolumesPagedResponse struct { *PageOptions Data []*Volume }
VolumesPagedResponse represents a linode API response for listing of volumes
Source Files
¶
- account.go
- account_events.go
- account_invoices.go
- account_notifications.go
- backups.go
- client.go
- domain_records.go
- domains.go
- errors.go
- images.go
- instance_configs.go
- instance_disks.go
- instance_ips.go
- instance_snapshots.go
- instance_volumes.go
- instances.go
- kernels.go
- longview.go
- longview_subscriptions.go
- managed.go
- network_ips.go
- network_pools.go
- network_ranges.go
- nodebalancer.go
- nodebalancer_config_nodes.go
- nodebalancer_configs.go
- pagination.go
- profile.go
- regions.go
- resources.go
- stackscripts.go
- support.go
- types.go
- util.go
- volumes.go