Documentation ¶
Index ¶
- Constants
- type APIError
- type APIErrorReason
- type Account
- type Client
- func (c *Client) AddInstanceIPAddress(ctx context.Context, linodeID int, public bool) (*InstanceIP, error)
- func (c *Client) AttachVolume(ctx context.Context, id int, options *VolumeAttachOptions) (*Volume, error)
- func (c *Client) BootInstance(ctx context.Context, id int, configID int) error
- func (c *Client) CancelInstanceBackups(ctx context.Context, linodeID int) error
- func (c *Client) CloneInstance(ctx context.Context, id int, options InstanceCloneOptions) (*Instance, error)
- func (c *Client) CloneVolume(ctx context.Context, id int, label string) (*Volume, error)
- func (c *Client) CreateDomain(ctx context.Context, domain DomainCreateOptions) (*Domain, error)
- func (c *Client) CreateDomainRecord(ctx context.Context, domainID int, domainrecord DomainRecordCreateOptions) (*DomainRecord, error)
- func (c *Client) CreateImage(ctx context.Context, createOpts ImageCreateOptions) (*Image, error)
- func (c *Client) CreateInstance(ctx context.Context, instance InstanceCreateOptions) (*Instance, error)
- func (c *Client) CreateInstanceConfig(ctx context.Context, linodeID int, createOpts InstanceConfigCreateOptions) (*InstanceConfig, error)
- func (c *Client) CreateInstanceDisk(ctx context.Context, linodeID int, createOpts InstanceDiskCreateOptions) (*InstanceDisk, error)
- func (c *Client) CreateInstanceSnapshot(ctx context.Context, linodeID int, label string) (*InstanceSnapshot, error)
- func (c *Client) CreateNodeBalancer(ctx context.Context, nodebalancer NodeBalancerCreateOptions) (*NodeBalancer, error)
- func (c *Client) CreateNodeBalancerConfig(ctx context.Context, nodebalancerID int, ...) (*NodeBalancerConfig, error)
- func (c *Client) CreateNodeBalancerNode(ctx context.Context, nodebalancerID int, configID int, ...) (*NodeBalancerNode, error)
- func (c *Client) CreateSSHKey(ctx context.Context, createOpts SSHKeyCreateOptions) (*SSHKey, error)
- func (c *Client) CreateStackscript(ctx context.Context, createOpts StackscriptCreateOptions) (*Stackscript, error)
- func (c *Client) CreateTag(ctx context.Context, createOpts TagCreateOptions) (*Tag, error)
- func (c *Client) CreateToken(ctx context.Context, createOpts TokenCreateOptions) (*Token, error)
- func (c *Client) CreateUser(ctx context.Context, createOpts UserCreateOptions) (*User, error)
- func (c *Client) CreateVolume(ctx context.Context, createOpts VolumeCreateOptions) (*Volume, error)
- func (c *Client) DeleteDomain(ctx context.Context, id int) error
- func (c *Client) DeleteDomainRecord(ctx context.Context, domainID int, id int) error
- func (c *Client) DeleteImage(ctx context.Context, id string) error
- func (c *Client) DeleteInstance(ctx context.Context, id int) error
- func (c *Client) DeleteInstanceConfig(ctx context.Context, linodeID int, configID int) error
- func (c *Client) DeleteInstanceDisk(ctx context.Context, linodeID int, diskID int) error
- func (c *Client) DeleteNodeBalancer(ctx context.Context, id int) error
- func (c *Client) DeleteNodeBalancerConfig(ctx context.Context, nodebalancerID int, configID int) error
- func (c *Client) DeleteNodeBalancerNode(ctx context.Context, nodebalancerID int, configID int, nodeID int) error
- func (c *Client) DeleteSSHKey(ctx context.Context, id int) error
- func (c *Client) DeleteStackscript(ctx context.Context, id int) error
- func (c *Client) DeleteTag(ctx context.Context, label string) error
- func (c *Client) DeleteToken(ctx context.Context, id int) error
- func (c *Client) DeleteUser(ctx context.Context, id string) error
- func (c *Client) DeleteVolume(ctx context.Context, id int) error
- func (c *Client) DetachVolume(ctx context.Context, id int) error
- func (c *Client) EnableInstanceBackups(ctx context.Context, linodeID int) error
- func (c *Client) GetAccount(ctx context.Context) (*Account, error)
- func (c *Client) GetDomain(ctx context.Context, id int) (*Domain, error)
- func (c *Client) GetDomainRecord(ctx context.Context, domainID int, id int) (*DomainRecord, error)
- func (c *Client) GetEvent(ctx context.Context, id int) (*Event, error)
- func (c *Client) GetIPAddress(ctx context.Context, id string) (*InstanceIP, error)
- func (c *Client) GetIPv6Pool(ctx context.Context, id string) (*IPv6Range, error)
- func (c *Client) GetIPv6Range(ctx context.Context, id string) (*IPv6Range, error)
- func (c *Client) GetImage(ctx context.Context, id string) (*Image, error)
- func (c *Client) GetInstance(ctx context.Context, linodeID int) (*Instance, error)
- func (c *Client) GetInstanceBackups(ctx context.Context, linodeID int) (*InstanceBackupsResponse, error)
- func (c *Client) GetInstanceConfig(ctx context.Context, linodeID int, configID int) (*InstanceConfig, error)
- func (c *Client) GetInstanceDisk(ctx context.Context, linodeID int, configID int) (*InstanceDisk, error)
- func (c *Client) GetInstanceIPAddress(ctx context.Context, linodeID int, ipaddress string) (*InstanceIP, error)
- func (c *Client) GetInstanceIPAddresses(ctx context.Context, linodeID int) (*InstanceIPAddressResponse, error)
- func (c *Client) GetInstanceSnapshot(ctx context.Context, linodeID int, snapshotID int) (*InstanceSnapshot, error)
- func (c *Client) GetInvoice(ctx context.Context, id int) (*Invoice, error)
- func (c *Client) GetKernel(ctx context.Context, kernelID string) (*LinodeKernel, error)
- func (c *Client) GetLongviewClient(ctx context.Context, id string) (*LongviewClient, error)
- func (c *Client) GetLongviewSubscription(ctx context.Context, id string) (*LongviewSubscription, error)
- func (c *Client) GetNodeBalancer(ctx context.Context, id int) (*NodeBalancer, error)
- func (c *Client) GetNodeBalancerConfig(ctx context.Context, nodebalancerID int, configID int) (*NodeBalancerConfig, error)
- func (c *Client) GetNodeBalancerNode(ctx context.Context, nodebalancerID int, configID int, nodeID int) (*NodeBalancerNode, error)
- func (c *Client) GetProfile(ctx context.Context) (*Profile, error)
- func (c *Client) GetRegion(ctx context.Context, id string) (*Region, error)
- func (c *Client) GetSSHKey(ctx context.Context, id int) (*SSHKey, error)
- func (c *Client) GetStackscript(ctx context.Context, id int) (*Stackscript, error)
- func (c *Client) GetTicket(ctx context.Context, id int) (*Ticket, error)
- func (c *Client) GetToken(ctx context.Context, id int) (*Token, error)
- func (c *Client) GetType(ctx context.Context, typeID string) (*LinodeType, error)
- func (c *Client) GetUser(ctx context.Context, id string) (*User, error)
- func (c *Client) GetVolume(ctx context.Context, id int) (*Volume, error)
- func (c *Client) ListDomainRecords(ctx context.Context, domainID int, opts *ListOptions) ([]DomainRecord, error)
- func (c *Client) ListDomains(ctx context.Context, opts *ListOptions) ([]Domain, error)
- func (c *Client) ListEvents(ctx context.Context, opts *ListOptions) ([]Event, error)
- func (c *Client) ListIPAddresses(ctx context.Context, opts *ListOptions) ([]InstanceIP, error)
- func (c *Client) ListIPv6Pools(ctx context.Context, opts *ListOptions) ([]IPv6Range, error)
- func (c *Client) ListIPv6Ranges(ctx context.Context, opts *ListOptions) ([]IPv6Range, error)
- func (c *Client) ListImages(ctx context.Context, opts *ListOptions) ([]Image, error)
- func (c *Client) ListInstanceConfigs(ctx context.Context, linodeID int, opts *ListOptions) ([]InstanceConfig, error)
- func (c *Client) ListInstanceDisks(ctx context.Context, linodeID int, opts *ListOptions) ([]InstanceDisk, error)
- func (c *Client) ListInstanceVolumes(ctx context.Context, linodeID int, opts *ListOptions) ([]Volume, error)
- func (c *Client) ListInstances(ctx context.Context, opts *ListOptions) ([]Instance, error)
- func (c *Client) ListInvoiceItems(ctx context.Context, id int, opts *ListOptions) ([]InvoiceItem, error)
- func (c *Client) ListInvoices(ctx context.Context, opts *ListOptions) ([]Invoice, error)
- func (c *Client) ListKernels(ctx context.Context, opts *ListOptions) ([]LinodeKernel, error)
- func (c *Client) ListLongviewClients(ctx context.Context, opts *ListOptions) ([]LongviewClient, error)
- func (c *Client) ListLongviewSubscriptions(ctx context.Context, opts *ListOptions) ([]LongviewSubscription, error)
- func (c *Client) ListNodeBalancerConfigs(ctx context.Context, nodebalancerID int, opts *ListOptions) ([]NodeBalancerConfig, error)
- func (c *Client) ListNodeBalancerNodes(ctx context.Context, nodebalancerID int, configID int, opts *ListOptions) ([]NodeBalancerNode, error)
- func (c *Client) ListNodeBalancers(ctx context.Context, opts *ListOptions) ([]NodeBalancer, error)
- func (c *Client) ListNotifications(ctx context.Context, opts *ListOptions) ([]Notification, error)
- func (c *Client) ListRegions(ctx context.Context, opts *ListOptions) ([]Region, error)
- func (c *Client) ListSSHKeys(ctx context.Context, opts *ListOptions) ([]SSHKey, error)
- func (c *Client) ListStackscripts(ctx context.Context, opts *ListOptions) ([]Stackscript, error)
- func (c *Client) ListTaggedObjects(ctx context.Context, label string, opts *ListOptions) (TaggedObjectList, error)
- func (c *Client) ListTags(ctx context.Context, opts *ListOptions) ([]Tag, error)
- func (c *Client) ListTickets(ctx context.Context, opts *ListOptions) ([]Ticket, error)
- func (c *Client) ListTokens(ctx context.Context, opts *ListOptions) ([]Token, error)
- func (c *Client) ListTypes(ctx context.Context, opts *ListOptions) ([]LinodeType, error)
- func (c *Client) ListUsers(ctx context.Context, opts *ListOptions) ([]User, error)
- func (c *Client) ListVolumes(ctx context.Context, opts *ListOptions) ([]Volume, error)
- func (c *Client) MarkEventRead(ctx context.Context, event *Event) error
- func (c *Client) MarkEventsSeen(ctx context.Context, event *Event) error
- func (c *Client) MigrateInstance(ctx context.Context, id int) error
- func (c *Client) MutateInstance(ctx context.Context, id int) error
- func (c *Client) PasswordResetInstanceDisk(ctx context.Context, linodeID int, diskID int, password string) error
- func (c *Client) R(ctx context.Context) *resty.Request
- func (c *Client) RebootInstance(ctx context.Context, id int, configID int) error
- func (c *Client) RebuildInstance(ctx context.Context, id int, opts RebuildInstanceOptions) (*Instance, error)
- func (c *Client) RebuildNodeBalancerConfig(ctx context.Context, nodeBalancerID int, configID int, ...) (*NodeBalancerConfig, error)
- func (c *Client) RenameInstance(ctx context.Context, linodeID int, label string) (*Instance, error)
- func (c *Client) RenameInstanceConfig(ctx context.Context, linodeID int, configID int, label string) (*InstanceConfig, error)
- func (c *Client) RenameInstanceDisk(ctx context.Context, linodeID int, diskID int, label string) (*InstanceDisk, error)
- func (c *Client) RenameVolume(ctx context.Context, id int, label string) (*Volume, error)
- func (c *Client) RescueInstance(ctx context.Context, id int, opts RescueInstanceOptions) error
- func (c *Client) ResizeInstance(ctx context.Context, id int, linodeType string) error
- func (c *Client) ResizeInstanceDisk(ctx context.Context, linodeID int, diskID int, size int) error
- func (c *Client) ResizeVolume(ctx context.Context, id int, size int) error
- func (c Client) Resource(resourceName string) *Resource
- func (c *Client) RestoreInstanceBackup(ctx context.Context, linodeID int, backupID int, opts RestoreInstanceOptions) error
- func (c *Client) SetBaseURL(url string) *Client
- func (c *Client) SetDebug(debug bool) *Client
- func (c *Client) SetPollDelay(delay time.Duration) *Client
- func (c *Client) SetUserAgent(ua string) *Client
- func (c *Client) ShutdownInstance(ctx context.Context, id int) error
- func (c *Client) UpdateDomain(ctx context.Context, id int, domain DomainUpdateOptions) (*Domain, error)
- func (c *Client) UpdateDomainRecord(ctx context.Context, domainID int, id int, ...) (*DomainRecord, error)
- func (c *Client) UpdateIPAddress(ctx context.Context, id string, updateOpts IPAddressUpdateOptions) (*InstanceIP, error)
- func (c *Client) UpdateImage(ctx context.Context, id string, updateOpts ImageUpdateOptions) (*Image, error)
- func (c *Client) UpdateInstance(ctx context.Context, id int, instance InstanceUpdateOptions) (*Instance, error)
- func (c *Client) UpdateInstanceConfig(ctx context.Context, linodeID int, configID int, ...) (*InstanceConfig, error)
- func (c *Client) UpdateInstanceDisk(ctx context.Context, linodeID int, diskID int, ...) (*InstanceDisk, error)
- func (c *Client) UpdateNodeBalancer(ctx context.Context, id int, updateOpts NodeBalancerUpdateOptions) (*NodeBalancer, error)
- func (c *Client) UpdateNodeBalancerConfig(ctx context.Context, nodebalancerID int, configID int, ...) (*NodeBalancerConfig, error)
- func (c *Client) UpdateNodeBalancerNode(ctx context.Context, nodebalancerID int, configID int, nodeID int, ...) (*NodeBalancerNode, error)
- func (c *Client) UpdateProfile(ctx context.Context, updateOpts ProfileUpdateOptions) (*Profile, error)
- func (c *Client) UpdateSSHKey(ctx context.Context, id int, updateOpts SSHKeyUpdateOptions) (*SSHKey, error)
- func (c *Client) UpdateStackscript(ctx context.Context, id int, updateOpts StackscriptUpdateOptions) (*Stackscript, error)
- func (c *Client) UpdateToken(ctx context.Context, id int, updateOpts TokenUpdateOptions) (*Token, error)
- func (c *Client) UpdateUser(ctx context.Context, id string, updateOpts UserUpdateOptions) (*User, error)
- func (c *Client) UpdateVolume(ctx context.Context, id int, volume VolumeUpdateOptions) (*Volume, error)
- func (client Client) WaitForEventFinished(ctx context.Context, id interface{}, entityType EntityType, action EventAction, ...) (*Event, error)
- func (client Client) WaitForInstanceDiskStatus(ctx context.Context, instanceID int, diskID int, status DiskStatus, ...) (*InstanceDisk, error)
- func (client Client) WaitForInstanceStatus(ctx context.Context, instanceID int, status InstanceStatus, timeoutSeconds int) (*Instance, error)
- func (client Client) WaitForSnapshotStatus(ctx context.Context, instanceID int, snapshotID int, ...) (*InstanceSnapshot, error)
- func (client Client) WaitForVolumeLinodeID(ctx context.Context, volumeID int, linodeID *int, timeoutSeconds int) (*Volume, error)
- func (client Client) WaitForVolumeStatus(ctx context.Context, volumeID int, status VolumeStatus, timeoutSeconds int) (*Volume, error)
- type ConfigAlgorithm
- type ConfigCheck
- type ConfigCipher
- type ConfigProtocol
- type ConfigStickiness
- type CreditCard
- type DiskFilesystem
- type DiskStatus
- type Domain
- type DomainCreateOptions
- type DomainRecord
- type DomainRecordCreateOptions
- type DomainRecordType
- type DomainRecordUpdateOptions
- type DomainRecordsPagedResponse
- type DomainStatus
- type DomainType
- type DomainUpdateOptions
- type DomainsPagedResponse
- type EntityType
- type Error
- type Event
- type EventAction
- type EventEntity
- type EventStatus
- type EventsPagedResponse
- type IPAddressUpdateOptions
- type IPAddressesPagedResponse
- type IPv6PoolsPagedResponse
- type IPv6Range
- type IPv6RangesPagedResponse
- type Image
- type ImageCreateOptions
- type ImageUpdateOptions
- 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 InstanceSnapshotStatus
- 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 LinodeTypeClass
- type LinodeTypesPagedResponse
- type LishAuthMethod
- type ListOptions
- type LongviewClient
- type LongviewClientsPagedResponse
- type LongviewSubscription
- type LongviewSubscriptionsPagedResponse
- type NodeBalancer
- type NodeBalancerConfig
- type NodeBalancerConfigCreateOptions
- type NodeBalancerConfigRebuildOptions
- type NodeBalancerConfigUpdateOptions
- type NodeBalancerConfigsPagedResponse
- type NodeBalancerCreateOptions
- type NodeBalancerNode
- type NodeBalancerNodeCreateOptions
- type NodeBalancerNodeStatus
- type NodeBalancerNodeUpdateOptions
- type NodeBalancerNodesPagedResponse
- type NodeBalancerTransfer
- type NodeBalancerUpdateOptions
- type NodeBalancersPagedResponse
- type NodeMode
- type Notification
- type NotificationEntity
- type NotificationSeverity
- type NotificationType
- type NotificationsPagedResponse
- type PageOptions
- type Profile
- type ProfileReferrals
- type ProfileUpdateOptions
- type RebuildInstanceOptions
- type Region
- type RegionsPagedResponse
- type RescueInstanceOptions
- type Resource
- type RestoreInstanceOptions
- type SSHKey
- type SSHKeyCreateOptions
- type SSHKeyUpdateOptions
- type SSHKeysPagedResponse
- type SortedObjects
- type Stackscript
- type StackscriptCreateOptions
- type StackscriptUDF
- type StackscriptUpdateOptions
- type StackscriptsPagedResponse
- type Tag
- type TagCreateOptions
- type TaggedObject
- type TaggedObjectList
- type TaggedObjectsPagedResponse
- type TagsPagedResponse
- type Ticket
- type TicketEntity
- type TicketStatus
- type TicketsPagedResponse
- type Token
- type TokenCreateOptions
- type TokenUpdateOptions
- type TokensPagedResponse
- type User
- type UserCreateOptions
- type UserUpdateOptions
- type UsersPagedResponse
- type Volume
- type VolumeAttachOptions
- type VolumeCreateOptions
- type VolumeStatus
- type VolumeUpdateOptions
- type VolumesPagedResponse
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.7.0" // APIEnvVar environment var to check for API token APIEnvVar = "LINODE_TOKEN" // APISecondsPerPoll how frequently to poll for new Events or Status in WaitFor functions APISecondsPerPoll = 3 // DefaultUserAgent is the default User-Agent sent in HTTP request headers DefaultUserAgent = "linodego " + Version + " https://github.com/linode/linodego" )
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 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 `json:"email"` Company string `json:"company"` Address1 string `json:"address_1"` Address2 string `json:"address_2"` Balance float32 `json:"balance"` City string `json:"city"` State string `json:"state"` Zip string `json:"zip"` Country string `json:"country"` TaxID string `json:"tax_id"` Phone string `json:"phone"` 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 SSHKeys *Resource Tickets *Resource Tokens *Resource Token *Resource Account *Resource Invoices *Resource InvoiceItems *Resource Events *Resource Notifications *Resource Profile *Resource Managed *Resource Tags *Resource Users *Resource // contains filtered or unexported fields }
Client is a wrapper around the Resty client
func (*Client) AddInstanceIPAddress ¶
func (c *Client) AddInstanceIPAddress(ctx context.Context, linodeID int, public bool) (*InstanceIP, error)
AddInstanceIPAddress adds a public or private IP to a Linode instance
func (*Client) AttachVolume ¶
func (c *Client) AttachVolume(ctx context.Context, id int, options *VolumeAttachOptions) (*Volume, error)
AttachVolume attaches a volume to a 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) CancelInstanceBackups ¶
CancelInstanceBackups Cancels backups for the specified Linode.
func (*Client) CloneInstance ¶
func (c *Client) CloneInstance(ctx context.Context, id int, options InstanceCloneOptions) (*Instance, error)
CloneInstance clone an existing Instances Disks and Configuration profiles to another Linode Instance
func (*Client) CloneVolume ¶
CloneVolume clones a Linode volume
func (*Client) CreateDomain ¶
CreateDomain creates a Domain
func (*Client) CreateDomainRecord ¶
func (c *Client) CreateDomainRecord(ctx context.Context, domainID int, domainrecord DomainRecordCreateOptions) (*DomainRecord, error)
CreateDomainRecord creates a DomainRecord
func (*Client) CreateImage ¶
CreateImage creates a Image
func (*Client) CreateInstance ¶
func (c *Client) CreateInstance(ctx context.Context, instance InstanceCreateOptions) (*Instance, error)
CreateInstance creates a Linode instance
func (*Client) CreateInstanceConfig ¶
func (c *Client) CreateInstanceConfig(ctx context.Context, linodeID int, createOpts InstanceConfigCreateOptions) (*InstanceConfig, error)
CreateInstanceConfig creates a new InstanceConfig for the given Instance
func (*Client) CreateInstanceDisk ¶
func (c *Client) CreateInstanceDisk(ctx context.Context, linodeID int, createOpts InstanceDiskCreateOptions) (*InstanceDisk, error)
CreateInstanceDisk creates a new InstanceDisk for the given Instance
func (*Client) CreateInstanceSnapshot ¶
func (c *Client) CreateInstanceSnapshot(ctx context.Context, linodeID int, label string) (*InstanceSnapshot, error)
CreateInstanceSnapshot Creates or Replaces the snapshot Backup of a Linode. If a previous snapshot exists for this Linode, it will be deleted.
func (*Client) CreateNodeBalancer ¶
func (c *Client) CreateNodeBalancer(ctx context.Context, nodebalancer NodeBalancerCreateOptions) (*NodeBalancer, error)
CreateNodeBalancer creates a NodeBalancer
func (*Client) CreateNodeBalancerConfig ¶
func (c *Client) CreateNodeBalancerConfig(ctx context.Context, nodebalancerID int, nodebalancerConfig NodeBalancerConfigCreateOptions) (*NodeBalancerConfig, error)
CreateNodeBalancerConfig creates a NodeBalancerConfig
func (*Client) CreateNodeBalancerNode ¶
func (c *Client) CreateNodeBalancerNode(ctx context.Context, nodebalancerID int, configID int, createOpts NodeBalancerNodeCreateOptions) (*NodeBalancerNode, error)
CreateNodeBalancerNode creates a NodeBalancerNode
func (*Client) CreateSSHKey ¶
CreateSSHKey creates a SSHKey
func (*Client) CreateStackscript ¶
func (c *Client) CreateStackscript(ctx context.Context, createOpts StackscriptCreateOptions) (*Stackscript, error)
CreateStackscript creates a StackScript
func (*Client) CreateToken ¶
CreateToken creates a Token
func (*Client) CreateUser ¶
CreateUser creates a User. The email address must be confirmed before the User account can be accessed.
func (*Client) CreateVolume ¶
CreateVolume creates a Linode Volume
func (*Client) DeleteDomain ¶
DeleteDomain deletes the Domain with the specified id
func (*Client) DeleteDomainRecord ¶
DeleteDomainRecord deletes the DomainRecord with the specified id
func (*Client) DeleteImage ¶
DeleteImage deletes the Image 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 ¶
func (c *Client) DeleteNodeBalancerConfig(ctx context.Context, nodebalancerID int, configID int) error
DeleteNodeBalancerConfig deletes the NodeBalancerConfig with the specified id
func (*Client) DeleteNodeBalancerNode ¶
func (c *Client) DeleteNodeBalancerNode(ctx context.Context, nodebalancerID int, configID int, nodeID int) error
DeleteNodeBalancerNode deletes the NodeBalancerNode with the specified id
func (*Client) DeleteSSHKey ¶
DeleteSSHKey deletes the SSHKey with the specified id
func (*Client) DeleteStackscript ¶
DeleteStackscript deletes the StackScript with the specified id
func (*Client) DeleteToken ¶
DeleteToken deletes the Token with the specified id
func (*Client) DeleteUser ¶
DeleteUser deletes the User 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) EnableInstanceBackups ¶
EnableInstanceBackups Enables backups for the specified Linode.
func (*Client) GetAccount ¶
GetAccount gets the contact and billing information related to the Account
func (*Client) GetDomainRecord ¶
GetDomainRecord gets the domainrecord with the provided ID
func (*Client) GetIPAddress ¶
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(ctx context.Context, linodeID int) (*InstanceBackupsResponse, error)
GetInstanceBackups gets the Instance's available Backups. This is not called ListInstanceBackups because a single object is returned, matching the API response.
func (*Client) GetInstanceConfig ¶
func (c *Client) GetInstanceConfig(ctx context.Context, linodeID int, configID int) (*InstanceConfig, error)
GetInstanceConfig gets the template with the provided ID
func (*Client) GetInstanceDisk ¶
func (c *Client) GetInstanceDisk(ctx context.Context, linodeID int, configID int) (*InstanceDisk, error)
GetInstanceDisk gets the template with the provided ID
func (*Client) GetInstanceIPAddress ¶
func (c *Client) GetInstanceIPAddress(ctx context.Context, 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(ctx context.Context, linodeID int) (*InstanceIPAddressResponse, error)
GetInstanceIPAddresses gets the IPAddresses for a Linode instance
func (*Client) GetInstanceSnapshot ¶
func (c *Client) GetInstanceSnapshot(ctx context.Context, 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) GetLongviewClient ¶
GetLongviewClient gets the template with the provided ID
func (*Client) GetLongviewSubscription ¶
func (c *Client) GetLongviewSubscription(ctx context.Context, id string) (*LongviewSubscription, error)
GetLongviewSubscription gets the template with the provided ID
func (*Client) GetNodeBalancer ¶
GetNodeBalancer gets the NodeBalancer with the provided ID
func (*Client) GetNodeBalancerConfig ¶
func (c *Client) GetNodeBalancerConfig(ctx context.Context, nodebalancerID int, configID int) (*NodeBalancerConfig, error)
GetNodeBalancerConfig gets the template with the provided ID
func (*Client) GetNodeBalancerNode ¶
func (c *Client) GetNodeBalancerNode(ctx context.Context, nodebalancerID int, configID int, nodeID int) (*NodeBalancerNode, error)
GetNodeBalancerNode gets the template with the provided ID
func (*Client) GetProfile ¶
GetProfile gets the profile with the provided ID
func (*Client) GetStackscript ¶
GetStackscript gets the Stackscript with the provided ID
func (*Client) ListDomainRecords ¶
func (c *Client) ListDomainRecords(ctx context.Context, domainID int, opts *ListOptions) ([]DomainRecord, error)
ListDomainRecords lists DomainRecords
func (*Client) ListDomains ¶
ListDomains lists Domains
func (*Client) ListEvents ¶
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(ctx context.Context, opts *ListOptions) ([]InstanceIP, error)
ListIPAddresses lists IPAddresses
func (*Client) ListIPv6Pools ¶
ListIPv6Pools lists IPv6Pools
func (*Client) ListIPv6Ranges ¶
ListIPv6Ranges lists IPv6Ranges
func (*Client) ListImages ¶
ListImages lists Images
func (*Client) ListInstanceConfigs ¶
func (c *Client) ListInstanceConfigs(ctx context.Context, linodeID int, opts *ListOptions) ([]InstanceConfig, error)
ListInstanceConfigs lists InstanceConfigs
func (*Client) ListInstanceDisks ¶
func (c *Client) ListInstanceDisks(ctx context.Context, linodeID int, opts *ListOptions) ([]InstanceDisk, error)
ListInstanceDisks lists InstanceDisks
func (*Client) ListInstanceVolumes ¶
func (c *Client) ListInstanceVolumes(ctx context.Context, linodeID int, opts *ListOptions) ([]Volume, error)
ListInstanceVolumes lists InstanceVolumes
func (*Client) ListInstances ¶
ListInstances lists linode instances
func (*Client) ListInvoiceItems ¶
func (c *Client) ListInvoiceItems(ctx context.Context, id int, opts *ListOptions) ([]InvoiceItem, error)
ListInvoiceItems gets the invoice items associated with a specific Invoice
func (*Client) ListInvoices ¶
ListInvoices gets a paginated list of Invoices against the Account
func (*Client) ListKernels ¶
func (c *Client) ListKernels(ctx context.Context, opts *ListOptions) ([]LinodeKernel, error)
ListKernels lists linode kernels
func (*Client) ListLongviewClients ¶
func (c *Client) ListLongviewClients(ctx context.Context, opts *ListOptions) ([]LongviewClient, error)
ListLongviewClients lists LongviewClients
func (*Client) ListLongviewSubscriptions ¶
func (c *Client) ListLongviewSubscriptions(ctx context.Context, opts *ListOptions) ([]LongviewSubscription, error)
ListLongviewSubscriptions lists LongviewSubscriptions
func (*Client) ListNodeBalancerConfigs ¶
func (c *Client) ListNodeBalancerConfigs(ctx context.Context, nodebalancerID int, opts *ListOptions) ([]NodeBalancerConfig, error)
ListNodeBalancerConfigs lists NodeBalancerConfigs
func (*Client) ListNodeBalancerNodes ¶
func (c *Client) ListNodeBalancerNodes(ctx context.Context, nodebalancerID int, configID int, opts *ListOptions) ([]NodeBalancerNode, error)
ListNodeBalancerNodes lists NodeBalancerNodes
func (*Client) ListNodeBalancers ¶
func (c *Client) ListNodeBalancers(ctx context.Context, opts *ListOptions) ([]NodeBalancer, error)
ListNodeBalancers lists NodeBalancers
func (*Client) ListNotifications ¶
func (c *Client) ListNotifications(ctx context.Context, 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 ¶
ListRegions lists Regions
func (*Client) ListSSHKeys ¶
ListSSHKeys lists SSHKeys
func (*Client) ListStackscripts ¶
func (c *Client) ListStackscripts(ctx context.Context, opts *ListOptions) ([]Stackscript, error)
ListStackscripts lists Stackscripts
func (*Client) ListTaggedObjects ¶
func (c *Client) ListTaggedObjects(ctx context.Context, label string, opts *ListOptions) (TaggedObjectList, error)
ListTaggedObjects lists Tagged Objects
func (*Client) ListTickets ¶
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) ListTokens ¶
ListTokens lists Tokens
func (*Client) ListTypes ¶
func (c *Client) ListTypes(ctx context.Context, opts *ListOptions) ([]LinodeType, error)
ListTypes lists linode types
func (*Client) ListVolumes ¶
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) MigrateInstance ¶
MigrateInstance - Migrate an instance
func (*Client) MutateInstance ¶
MutateInstance Upgrades a Linode to its next generation.
func (*Client) PasswordResetInstanceDisk ¶
func (c *Client) PasswordResetInstanceDisk(ctx context.Context, linodeID int, diskID int, password string) error
PasswordResetInstanceDisk resets the "root" account password on the Instance disk
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(ctx context.Context, 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) RebuildNodeBalancerConfig ¶
func (c *Client) RebuildNodeBalancerConfig(ctx context.Context, nodeBalancerID int, configID int, rebuildOpts NodeBalancerConfigRebuildOptions) (*NodeBalancerConfig, error)
RebuildNodeBalancerConfig updates the NodeBalancer with the specified id
func (*Client) RenameInstance ¶
RenameInstance renames an Instance
func (*Client) RenameInstanceConfig ¶
func (c *Client) RenameInstanceConfig(ctx context.Context, linodeID int, configID int, label string) (*InstanceConfig, error)
RenameInstanceConfig renames an InstanceConfig
func (*Client) RenameInstanceDisk ¶
func (c *Client) RenameInstanceDisk(ctx context.Context, linodeID int, diskID int, label string) (*InstanceDisk, error)
RenameInstanceDisk renames an InstanceDisk
func (*Client) RenameVolume ¶
RenameVolume renames the label of a Linode volume DEPRECATED: use UpdateVolume
func (*Client) RescueInstance ¶
RescueInstance reboots an instance into a safe environment for performing many system recovery and disk management tasks. Rescue Mode is based on the Finnix recovery distribution, a self-contained and bootable Linux distribution. You can also use Rescue Mode for tasks other than disaster recovery, such as formatting disks to use different filesystems, copying data between disks, and downloading files from a disk via SSH and SFTP.
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) RestoreInstanceBackup ¶
func (c *Client) RestoreInstanceBackup(ctx context.Context, linodeID int, backupID int, opts RestoreInstanceOptions) error
RestoreInstanceBackup Restores a Linode's Backup to the specified Linode.
func (*Client) SetBaseURL ¶
SetBaseURL sets the base URL of the Linode v4 API (https://api.linode.com/v4)
func (*Client) SetPollDelay ¶
SetPollDelay sets the number of milliseconds to wait between events or status polls. Affects all WaitFor* functions.
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(ctx context.Context, id int, domain DomainUpdateOptions) (*Domain, error)
UpdateDomain updates the Domain with the specified id
func (*Client) UpdateDomainRecord ¶
func (c *Client) UpdateDomainRecord(ctx context.Context, domainID int, id int, domainrecord DomainRecordUpdateOptions) (*DomainRecord, error)
UpdateDomainRecord updates the DomainRecord with the specified id
func (*Client) UpdateIPAddress ¶
func (c *Client) UpdateIPAddress(ctx context.Context, id string, updateOpts IPAddressUpdateOptions) (*InstanceIP, error)
UpdateIPAddress updates the IPAddress with the specified id
func (*Client) UpdateImage ¶
func (c *Client) UpdateImage(ctx context.Context, id string, updateOpts ImageUpdateOptions) (*Image, error)
UpdateImage updates the Image with the specified id
func (*Client) UpdateInstance ¶
func (c *Client) UpdateInstance(ctx context.Context, id int, instance InstanceUpdateOptions) (*Instance, error)
UpdateInstance creates a Linode instance
func (*Client) UpdateInstanceConfig ¶
func (c *Client) UpdateInstanceConfig(ctx context.Context, linodeID int, configID int, updateOpts InstanceConfigUpdateOptions) (*InstanceConfig, error)
UpdateInstanceConfig update an InstanceConfig for the given Instance
func (*Client) UpdateInstanceDisk ¶
func (c *Client) UpdateInstanceDisk(ctx context.Context, linodeID int, diskID int, updateOpts InstanceDiskUpdateOptions) (*InstanceDisk, error)
UpdateInstanceDisk creates a new InstanceDisk for the given Instance
func (*Client) UpdateNodeBalancer ¶
func (c *Client) UpdateNodeBalancer(ctx context.Context, id int, updateOpts NodeBalancerUpdateOptions) (*NodeBalancer, error)
UpdateNodeBalancer updates the NodeBalancer with the specified id
func (*Client) UpdateNodeBalancerConfig ¶
func (c *Client) UpdateNodeBalancerConfig(ctx context.Context, nodebalancerID int, configID int, updateOpts NodeBalancerConfigUpdateOptions) (*NodeBalancerConfig, error)
UpdateNodeBalancerConfig updates the NodeBalancerConfig with the specified id
func (*Client) UpdateNodeBalancerNode ¶
func (c *Client) UpdateNodeBalancerNode(ctx context.Context, nodebalancerID int, configID int, nodeID int, updateOpts NodeBalancerNodeUpdateOptions) (*NodeBalancerNode, error)
UpdateNodeBalancerNode updates the NodeBalancerNode with the specified id
func (*Client) UpdateProfile ¶
func (c *Client) UpdateProfile(ctx context.Context, updateOpts ProfileUpdateOptions) (*Profile, error)
UpdateProfile updates the Profile with the specified id
func (*Client) UpdateSSHKey ¶
func (c *Client) UpdateSSHKey(ctx context.Context, id int, updateOpts SSHKeyUpdateOptions) (*SSHKey, error)
UpdateSSHKey updates the SSHKey with the specified id
func (*Client) UpdateStackscript ¶
func (c *Client) UpdateStackscript(ctx context.Context, id int, updateOpts StackscriptUpdateOptions) (*Stackscript, error)
UpdateStackscript updates the StackScript with the specified id
func (*Client) UpdateToken ¶
func (c *Client) UpdateToken(ctx context.Context, id int, updateOpts TokenUpdateOptions) (*Token, error)
UpdateToken updates the Token with the specified id
func (*Client) UpdateUser ¶
func (c *Client) UpdateUser(ctx context.Context, id string, updateOpts UserUpdateOptions) (*User, error)
UpdateUser updates the User with the specified id
func (*Client) UpdateVolume ¶
func (c *Client) UpdateVolume(ctx context.Context, id int, volume VolumeUpdateOptions) (*Volume, error)
UpdateVolume updates the Volume with the specified id
func (Client) WaitForEventFinished ¶
func (client Client) WaitForEventFinished(ctx context.Context, 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.
func (Client) WaitForInstanceDiskStatus ¶
func (client Client) WaitForInstanceDiskStatus(ctx context.Context, instanceID int, diskID int, status DiskStatus, timeoutSeconds int) (*InstanceDisk, error)
WaitForInstanceDiskStatus waits for the Linode instance disk to reach the desired state before returning. It will timeout with an error after timeoutSeconds.
func (Client) WaitForInstanceStatus ¶
func (client Client) WaitForInstanceStatus(ctx context.Context, instanceID int, status InstanceStatus, timeoutSeconds int) (*Instance, error)
WaitForInstanceStatus waits for the Linode instance to reach the desired state before returning. It will timeout with an error after timeoutSeconds.
func (Client) WaitForSnapshotStatus ¶
func (client Client) WaitForSnapshotStatus(ctx context.Context, instanceID int, snapshotID int, status InstanceSnapshotStatus, timeoutSeconds int) (*InstanceSnapshot, error)
WaitForSnapshotStatus waits for the Snapshot to reach the desired state before returning. It will timeout with an error after timeoutSeconds.
func (Client) WaitForVolumeLinodeID ¶
func (client Client) WaitForVolumeLinodeID(ctx context.Context, volumeID int, linodeID *int, timeoutSeconds int) (*Volume, error)
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 (Client) WaitForVolumeStatus ¶
func (client Client) WaitForVolumeStatus(ctx context.Context, volumeID int, status VolumeStatus, timeoutSeconds int) (*Volume, error)
WaitForVolumeStatus waits for the Volume to reach the desired state before returning. It will timeout with an error after timeoutSeconds.
type ConfigAlgorithm ¶
type ConfigAlgorithm string
ConfigAlgorithm constants start with Algorithm and include Linode API NodeBalancer Config Algorithms
const ( AlgorithmRoundRobin ConfigAlgorithm = "roundrobin" AlgorithmLeastConn ConfigAlgorithm = "leastconn" AlgorithmSource ConfigAlgorithm = "source" )
ConfigAlgorithm constants reflect the NodeBalancer Config Algorithm
type ConfigCheck ¶
type ConfigCheck string
ConfigCheck constants start with Check and include Linode API NodeBalancer Config Check methods
const ( CheckNone ConfigCheck = "none" CheckConnection ConfigCheck = "connection" CheckHTTP ConfigCheck = "http" CheckHTTPBody ConfigCheck = "http_body" )
ConfigCheck constants reflect the node health status checking method for a NodeBalancer Config
type ConfigCipher ¶
type ConfigCipher string
ConfigCipher constants start with Cipher and include Linode API NodeBalancer Config Cipher values
const ( CipherRecommended ConfigCipher = "recommended" CipherLegacy ConfigCipher = "legacy" )
ConfigCipher constants reflect the preferred cipher set for a NodeBalancer Config
type ConfigProtocol ¶
type ConfigProtocol string
ConfigProtocol constants start with Protocol and include Linode API Nodebalancer Config protocols
const ( ProtocolHTTP ConfigProtocol = "http" ProtocolHTTPS ConfigProtocol = "https" ProtocolTCP ConfigProtocol = "tcp" )
ConfigProtocol constants reflect the protocol used by a NodeBalancer Config
type ConfigStickiness ¶
type ConfigStickiness string
ConfigStickiness constants start with Stickiness and include Linode API NodeBalancer Config Stickiness
const ( StickinessNone ConfigStickiness = "none" StickinessTable ConfigStickiness = "table" StickinessHTTPCookie ConfigStickiness = "http_cookie" )
ConfigStickiness constants reflect the node stickiness method for a NodeBalancer Config
type CreditCard ¶
CreditCard information associated with the Account.
type DiskFilesystem ¶
type DiskFilesystem string
DiskFilesystem constants start with Filesystem and include Linode API Filesystems
const ( FilesystemRaw DiskFilesystem = "raw" FilesystemSwap DiskFilesystem = "swap" FilesystemExt3 DiskFilesystem = "ext3" FilesystemExt4 DiskFilesystem = "ext4" FilesystemInitrd DiskFilesystem = "initrd" )
DiskFilesystem constants represent the filesystems types an Instance Disk may use
type DiskStatus ¶
type DiskStatus string
DiskStatus constants have the prefix "Disk" and include Linode API Instance Disk Status
const ( DiskReady DiskStatus = "ready" DiskNotReady DiskStatus = "not ready" DiskDeleting DiskStatus = "deleting" )
DiskStatus constants represent the status values an Instance Disk may have
type Domain ¶
type Domain struct { // This Domain's unique ID ID int `json:"id"` // 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"` // 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 DomainType `json:"type"` // Enum:"master" "slave" // Deprecated: The group this Domain belongs to. This is for display purposes only. Group string `json:"group"` // Used to control whether this Domain is currently being rendered. Status DomainStatus `json:"status"` // Enum:"disabled" "active" "edit_mode" "has_errors" // A description for this Domain. This is for display purposes only. Description string `json:"description"` // 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"` // An array of tags applied to this object. Tags are for organizational purposes only. Tags []string `json:"tags"` // 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)
GetUpdateOptions converts a Domain to DomainUpdateOptions for use in UpdateDomain
type DomainCreateOptions ¶
type DomainCreateOptions 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"` // 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 DomainType `json:"type"` // 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 DomainStatus `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"` // An array of tags applied to this object. Tags are for organizational purposes only. Tags []string `json:"tags"` // 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"` }
DomainCreateOptions fields are those accepted by CreateDomain
type DomainRecord ¶
type DomainRecord struct { ID int `json:"id"` Type DomainRecordType `json:"type"` Name string `json:"name"` Target string `json:"target"` Priority int `json:"priority"` Weight int `json:"weight"` Port int `json:"port"` Service *string `json:"service"` Protocol *string `json:"protocol"` TTLSec int `json:"ttl_sec"` Tag *string `json:"tag"` }
DomainRecord represents a DomainRecord object
func (DomainRecord) GetUpdateOptions ¶
func (d DomainRecord) GetUpdateOptions() (du DomainRecordUpdateOptions)
GetUpdateOptions converts a DomainRecord to DomainRecordUpdateOptions for use in UpdateDomainRecord
type DomainRecordCreateOptions ¶
type DomainRecordCreateOptions struct { Type DomainRecordType `json:"type"` Name string `json:"name"` Target string `json:"target"` Priority *int `json:"priority,omitempty"` Weight *int `json:"weight,omitempty"` Port *int `json:"port,omitempty"` Service *string `json:"service,omitempty"` Protocol *string `json:"protocol,omitempty"` TTLSec int `json:"ttl_sec,omitempty"` // 0 is not accepted by Linode, so can be omitted Tag *string `json:"tag,omitempty"` }
DomainRecordCreateOptions fields are those accepted by CreateDomainRecord
type DomainRecordType ¶
type DomainRecordType string
DomainRecordType constants start with RecordType and include Linode API Domain Record Types
const ( RecordTypeA DomainRecordType = "A" RecordTypeAAAA DomainRecordType = "AAAA" RecordTypeNS DomainRecordType = "NS" RecordTypeMX DomainRecordType = "MX" RecordTypeCNAME DomainRecordType = "CNAME" RecordTypeTXT DomainRecordType = "TXT" RecordTypeSRV DomainRecordType = "SRV" RecordTypePTR DomainRecordType = "PTR" RecordTypeCAA DomainRecordType = "CAA" )
DomainRecordType contants are the DNS record types a DomainRecord can assign
type DomainRecordUpdateOptions ¶
type DomainRecordUpdateOptions struct { Type DomainRecordType `json:"type,omitempty"` Name string `json:"name,omitempty"` Target string `json:"target,omitempty"` Priority *int `json:"priority,omitempty"` // 0 is valid, so omit only nil values Weight *int `json:"weight,omitempty"` // 0 is valid, so omit only nil values Port *int `json:"port,omitempty"` // 0 is valid to spec, so omit only nil values Service *string `json:"service,omitempty"` Protocol *string `json:"protocol,omitempty"` TTLSec int `json:"ttl_sec,omitempty"` // 0 is not accepted by Linode, so can be omitted Tag *string `json:"tag,omitempty"` }
DomainRecordUpdateOptions fields are those accepted by UpdateDomainRecord
type DomainRecordsPagedResponse ¶
type DomainRecordsPagedResponse struct { *PageOptions Data []DomainRecord `json:"data"` }
DomainRecordsPagedResponse represents a paginated DomainRecord API response
type DomainStatus ¶
type DomainStatus string
DomainStatus constants start with DomainStatus and include Linode API Domain Status values
const ( DomainStatusDisabled DomainStatus = "disabled" DomainStatusActive DomainStatus = "active" DomainStatusEditMode DomainStatus = "edit_mode" DomainStatusHasErrors DomainStatus = "has_errors" )
DomainStatus constants reflect the current status of a Domain
type DomainType ¶
type DomainType string
DomainType constants start with DomainType and include Linode API Domain Type values
const ( DomainTypeMaster DomainType = "master" DomainTypeSlave DomainType = "slave" )
DomainType constants reflect the DNS zone type of a Domain
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 DomainType `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 DomainStatus `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"` // An array of tags applied to this object. Tags are for organizational purposes only. Tags []string `json:"tags"` // 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"` }
DomainUpdateOptions converts a Domain to DomainUpdateOptions for use in UpdateDomain
type DomainsPagedResponse ¶
type DomainsPagedResponse struct { *PageOptions Data []Domain `json:"data"` }
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" )
EntityType contants are the entities an Event can be related to
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 `json:"id"` // Current status of the Event, Enum: "failed" "finished" "notification" "scheduled" "started" Status EventStatus `json:"status"` // The action that caused this Event. New actions may be added in the future. Action EventAction `json:"action"` // 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 `json:"rate"` // If this Event has been read. Read bool `json:"read"` // If this Event has been seen. Seen bool `json:"seen"` // The estimated time remaining until the completion of this Event. This value is only returned for in-progress events. TimeRemainingMsg json.RawMessage `json:"time_remaining"` TimeRemaining *int `json:"-"` // The username of the User who caused the Event. Username string `json:"username"` // Detailed information about the Event's entity, including ID, type, label, and URL used to access it. Entity *EventEntity `json:"entity"` // 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" )
EventAction constants represent the actions that cause an Event. New actions may be added in the future.
type EventEntity ¶
type EventEntity struct { // ID may be a string or int, it depends on the EntityType ID interface{} `json:"id"` Label string `json:"label"` Type EntityType `json:"type"` URL string `json:"url"` }
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" )
EventStatus constants reflect the current status of an Event
type EventsPagedResponse ¶
type EventsPagedResponse struct { *PageOptions Data []Event `json:"data"` }
EventsPagedResponse represents a paginated Events API response
type IPAddressUpdateOptions ¶
type IPAddressUpdateOptions struct { // The reverse DNS assigned to this address. For public IPv4 addresses, this will be set to a default value provided by Linode if set to nil. RDNS *string `json:"rdns"` }
IPAddressUpdateOptions fields are those accepted by UpdateToken
type IPAddressesPagedResponse ¶
type IPAddressesPagedResponse struct { *PageOptions Data []InstanceIP `json:"data"` }
IPAddressesPagedResponse represents a paginated IPAddress API response
type IPv6PoolsPagedResponse ¶
type IPv6PoolsPagedResponse struct { *PageOptions Data []IPv6Range `json:"data"` }
IPv6PoolsPagedResponse represents a paginated IPv6Pool API response
type IPv6Range ¶
IPv6Range represents a range of IPv6 addresses routed to a single Linode in a given Region
type IPv6RangesPagedResponse ¶
type IPv6RangesPagedResponse struct { *PageOptions Data []IPv6Range `json:"data"` }
IPv6RangesPagedResponse represents a paginated IPv6Range API response
type Image ¶
type Image struct { CreatedStr string `json:"created"` ExpiryStr string `json:"expiry"` ID string `json:"id"` CreatedBy string `json:"created_by"` Label string `json:"label"` Description string `json:"description"` Type string `json:"type"` Vendor string `json:"vendor"` Size int `json:"size"` IsPublic bool `json:"is_public"` Deprecated bool `json:"deprecated"` Created *time.Time `json:"-"` Expiry *time.Time `json:"-"` }
Image represents a deployable Image object for use with Linode Instances
func (Image) GetUpdateOptions ¶
func (i Image) GetUpdateOptions() (iu ImageUpdateOptions)
GetUpdateOptions converts an Image to ImageUpdateOptions for use in UpdateImage
type ImageCreateOptions ¶
type ImageCreateOptions struct { DiskID int `json:"disk_id"` Label string `json:"label"` Description string `json:"description,omitempty"` }
ImageCreateOptions fields are those accepted by CreateImage
type ImageUpdateOptions ¶
type ImageUpdateOptions struct { Label string `json:"label,omitempty"` Description *string `json:"description,omitempty"` }
ImageUpdateOptions fields are those accepted by UpdateImage
type ImagesPagedResponse ¶
type ImagesPagedResponse struct { *PageOptions Data []Image `json:"data"` }
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 `json:"id"` Created *time.Time `json:"-"` Updated *time.Time `json:"-"` Region string `json:"region"` Alerts *InstanceAlert `json:"alerts"` Backups *InstanceBackup `json:"backups"` Image string `json:"image"` Group string `json:"group"` IPv4 []*net.IP `json:"ipv4"` IPv6 string `json:"ipv6"` Label string `json:"label"` Type string `json:"type"` Status InstanceStatus `json:"status"` Hypervisor string `json:"hypervisor"` Specs *InstanceSpec `json:"specs"` WatchdogEnabled bool `json:"watchdog_enabled"` Tags []string `json:"tags"` }
Instance represents a linode object
func (*Instance) GetUpdateOptions ¶
func (l *Instance) GetUpdateOptions() InstanceUpdateOptions
GetUpdateOptions converts an Instance to InstanceUpdateOptions for use in UpdateInstance
type InstanceAlert ¶
type InstanceAlert struct { CPU int `json:"cpu"` IO int `json:"io"` NetworkIn int `json:"network_in"` NetworkOut int `json:"network_out"` TransferQuota int `json:"transfer_quota"` }
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 `json:"current"` InProgress *InstanceSnapshot `json:"in_progress"` }
InstanceBackupSnapshotResponse fields are those representing Instance Backup Snapshots
type InstanceBackupsResponse ¶
type InstanceBackupsResponse struct { Automatic []*InstanceSnapshot `json:"automatic"` Snapshot *InstanceBackupSnapshotResponse `json:"snapshot"` }
InstanceBackupsResponse response struct for backup snapshot
type InstanceCloneOptions ¶
type InstanceCloneOptions struct { Region string `json:"region,omitempty"` Type string `json:"type,omitempty"` // LinodeID is an optional existing instance to use as the target of the clone LinodeID int `json:"linode_id,omitempty"` Label string `json:"label,omitempty"` Group string `json:"group,omitempty"` BackupsEnabled bool `json:"backups_enabled"` Disks []int `json:"disks,omitempty"` Configs []int `json:"configs,omitempty"` }
InstanceCloneOptions is an options struct sent when Cloning an Instance
type InstanceConfig ¶
type InstanceConfig struct { CreatedStr string `json:"created"` UpdatedStr string `json:"updated"` ID int `json:"id"` 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:"-"` }
InstanceConfig represents all of the settings that control the boot and run configuration of a Linode Instance
func (InstanceConfig) GetCreateOptions ¶
func (i InstanceConfig) GetCreateOptions() InstanceConfigCreateOptions
GetCreateOptions converts a InstanceConfig to InstanceConfigCreateOptions for use in CreateInstanceConfig
func (InstanceConfig) GetUpdateOptions ¶
func (i InstanceConfig) GetUpdateOptions() InstanceConfigUpdateOptions
GetUpdateOptions converts a InstanceConfig to InstanceConfigUpdateOptions for use in UpdateInstanceConfig
type InstanceConfigCreateOptions ¶
type InstanceConfigCreateOptions struct { Label string `json:"label,omitempty"` Comments string `json:"comments,omitempty"` Devices InstanceConfigDeviceMap `json:"devices"` Helpers *InstanceConfigHelpers `json:"helpers,omitempty"` MemoryLimit int `json:"memory_limit,omitempty"` Kernel string `json:"kernel,omitempty"` InitRD int `json:"init_rd,omitempty"` 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 InstanceConfigDevice struct { DiskID int `json:"disk_id,omitempty"` VolumeID int `json:"volume_id,omitempty"` }
InstanceConfigDevice contains either the DiskID or VolumeID assigned to a Config Device
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"` }
InstanceConfigDeviceMap contains SDA-SDH InstanceConfigDevice settings
type InstanceConfigHelpers ¶
type InstanceConfigHelpers struct { UpdateDBDisabled bool `json:"updatedb_disabled"` Distro bool `json:"distro"` ModulesDep bool `json:"modules_dep"` Network bool `json:"network"` DevTmpFsAutomount bool `json:"devtmpfs_automount"` }
InstanceConfigHelpers are Instance Config options that control Linux distribution specific tweaks
type InstanceConfigUpdateOptions ¶
type InstanceConfigUpdateOptions struct { Label string `json:"label,omitempty"` Comments string `json:"comments"` Devices *InstanceConfigDeviceMap `json:"devices,omitempty"` Helpers *InstanceConfigHelpers `json:"helpers,omitempty"` // MemoryLimit 0 means unlimitted, this is not omitted MemoryLimit int `json:"memory_limit"` Kernel string `json:"kernel,omitempty"` // InitRD is nullable, permit the sending of null InitRD *int `json:"init_rd"` RootDevice string `json:"root_device,omitempty"` RunLevel string `json:"run_level,omitempty"` VirtMode string `json:"virt_mode,omitempty"` }
InstanceConfigUpdateOptions are InstanceConfig settings that can be used in updates
type InstanceConfigsPagedResponse ¶
type InstanceConfigsPagedResponse struct { *PageOptions Data []InstanceConfig `json:"data"` }
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"` AuthorizedUsers []string `json:"authorized_users,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"` PrivateIP bool `json:"private_ip,omitempty"` Tags []string `json:"tags,omitempty"` // Creation fields that need to be set explicitly false, "", or 0 use pointers SwapSize *int `json:"swap_size,omitempty"` Booted *bool `json:"booted,omitempty"` }
InstanceCreateOptions require only Region and Type
type InstanceDisk ¶
type InstanceDisk struct { CreatedStr string `json:"created"` UpdatedStr string `json:"updated"` ID int `json:"id"` Label string `json:"label"` Status DiskStatus `json:"status"` Size int `json:"size"` Filesystem DiskFilesystem `json:"filesystem"` Created time.Time `json:"-"` Updated time.Time `json:"-"` }
InstanceDisk represents an Instance Disk object
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"` AuthorizedUsers []string `json:"authorized_users,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 `json:"data"` }
InstanceDisksPagedResponse represents a paginated InstanceDisk API response
type InstanceIP ¶
type InstanceIP struct { Address string `json:"address"` Gateway string `json:"gateway"` SubnetMask string `json:"subnet_mask"` Prefix int `json:"prefix"` Type string `json:"type"` Public bool `json:"public"` RDNS string `json:"rdns"` LinodeID int `json:"linode_id"` Region string `json:"region"` }
InstanceIP represents an Instance IP with additional DNS and networking details
func (InstanceIP) GetUpdateOptions ¶
func (i InstanceIP) GetUpdateOptions() (o IPAddressUpdateOptions)
GetUpdateOptions converts a IPAddress to IPAddressUpdateOptions for use in UpdateIPAddress
type InstanceIPAddressResponse ¶
type InstanceIPAddressResponse struct { IPv4 *InstanceIPv4Response `json:"ipv4"` IPv6 *InstanceIPv6Response `json:"ipv6"` }
InstanceIPAddressResponse contains the IPv4 and IPv6 details for an Instance
type InstanceIPv4Response ¶
type InstanceIPv4Response struct { Public []*InstanceIP `json:"public"` Private []*InstanceIP `json:"private"` }
InstanceIPv4Response contains the details of all IPv4 addresses associated with an Instance
type InstanceIPv6Response ¶
type InstanceIPv6Response struct { LinkLocal *InstanceIP `json:"link_local"` SLAAC *InstanceIP `json:"slaac"` Global []*IPv6Range `json:"global"` }
InstanceIPv6Response contains the IPv6 addresses and ranges for an Instance
type InstanceSnapshot ¶
type InstanceSnapshot struct { CreatedStr string `json:"created"` UpdatedStr string `json:"updated"` FinishedStr string `json:"finished"` ID int `json:"id"` Label string `json:"label"` Status InstanceSnapshotStatus `json:"status"` Type string `json:"type"` Created *time.Time `json:"-"` Updated *time.Time `json:"-"` Finished *time.Time `json:"-"` Configs []string `json:"configs"` Disks []*InstanceSnapshotDisk `json:"disks"` }
InstanceSnapshot represents a linode backup snapshot
type InstanceSnapshotDisk ¶
type InstanceSnapshotDisk struct { Label string `json:"label"` Size int `json:"size"` Filesystem string `json:"filesystem"` }
InstanceSnapshotDisk fields represent the source disk of a Snapshot
type InstanceSnapshotStatus ¶
type InstanceSnapshotStatus string
InstanceSnapshotStatus constants start with Snapshot and include Linode API Instance Backup Snapshot status values
var ( SnapshotPaused InstanceSnapshotStatus = "paused" SnapshotPending InstanceSnapshotStatus = "pending" SnapshotRunning InstanceSnapshotStatus = "running" SnapshotNeedsPostProcessing InstanceSnapshotStatus = "needsPostProcessing" SnapshotSuccessful InstanceSnapshotStatus = "successful" SnapshotFailed InstanceSnapshotStatus = "failed" SnapshotUserAborted InstanceSnapshotStatus = "userAborted" )
InstanceSnapshotStatus constants reflect the current status of an Instance Snapshot
type InstanceSpec ¶
type InstanceSpec struct { Disk int `json:"disk"` Memory int `json:"memory"` VCPUs int `json:"vcpus"` Transfer int `json:"transfer"` }
InstanceSpec represents a linode spec
type InstanceStatus ¶
type InstanceStatus string
InstanceStatus constants start with Instance and include Linode API Instance Status values
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" InstanceResizing InstanceStatus = "resizing" )
InstanceStatus constants reflect the current status of an Instance
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"` WatchdogEnabled *bool `json:"watchdog_enabled,omitempty"` Tags *[]string `json:"tags,omitempty"` }
InstanceUpdateOptions is an options struct used when Updating an Instance
type InstanceVolumesPagedResponse ¶
type InstanceVolumesPagedResponse struct { *PageOptions Data []Volume `json:"data"` }
InstanceVolumesPagedResponse represents a paginated InstanceVolume API response
type InstancesPagedResponse ¶
type InstancesPagedResponse struct { *PageOptions Data []Instance `json:"data"` }
InstancesPagedResponse represents a linode API response for listing
type Invoice ¶
type Invoice struct { DateStr string `json:"date"` ID int `json:"id"` Label string `json:"label"` Total float32 `json:"total"` 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 `json:"label"` Type string `json:"type"` UnitPrice int `json:"unitprice"` Quantity int `json:"quantity"` Amount float32 `json:"amount"` 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 `json:"data"` }
InvoiceItemsPagedResponse represents a paginated Invoice Item API response
type InvoicesPagedResponse ¶
type InvoicesPagedResponse struct { *PageOptions Data []Invoice `json:"data"` }
InvoicesPagedResponse represents a paginated Invoice API response
type LinodeAddons ¶
type LinodeAddons struct {
Backups *LinodeBackupsAddon `json:"backups"`
}
LinodeAddons represent the linode addons object
type LinodeBackupsAddon ¶
type LinodeBackupsAddon struct {
Price *LinodePrice `json:"price"`
}
LinodeBackupsAddon represents a linode backups addon object
type LinodeKernel ¶
type LinodeKernel struct { ID string `json:"id"` Label string `json:"label"` Version string `json:"version"` Architecture string `json:"architecture"` KVM bool `json:"kvm"` XEN bool `json:"xen"` PVOPS bool `json:"pvops"` }
LinodeKernel represents a Linode Instance kernel object
type LinodeKernelsPagedResponse ¶
type LinodeKernelsPagedResponse struct { *PageOptions Data []LinodeKernel `json:"data"` }
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 `json:"id"` Disk int `json:"disk"` Class LinodeTypeClass `json:"class"` // enum: nanode, standard, highmem, dedicated Price *LinodePrice `json:"price"` Label string `json:"label"` Addons *LinodeAddons `json:"addons"` NetworkOut int `json:"network_out"` Memory int `json:"memory"` Transfer int `json:"transfer"` VCPUs int `json:"vcpus"` }
LinodeType represents a linode type object
type LinodeTypeClass ¶
type LinodeTypeClass string
LinodeTypeClass constants start with Class and include Linode API Instance Type Classes
const ( ClassNanode LinodeTypeClass = "nanode" ClassStandard LinodeTypeClass = "standard" ClassHighmem LinodeTypeClass = "highmem" ClassDedicated LinodeTypeClass = "dedicated" )
LinodeTypeClass contants are the Instance Type Classes that an Instance Type can be assigned
type LinodeTypesPagedResponse ¶
type LinodeTypesPagedResponse struct { *PageOptions Data []LinodeType `json:"data"` }
LinodeTypesPagedResponse represents a linode types API response for listing
type LishAuthMethod ¶
type LishAuthMethod string
LishAuthMethod constants start with AuthMethod and include Linode API Lish Authentication Methods
const ( AuthMethodPasswordKeys LishAuthMethod = "password_keys" AuthMethodKeysOnly LishAuthMethod = "keys_only" AuthMethodDisabled LishAuthMethod = "disabled" )
LishAuthMethod constants are the methods of authentication allowed when connecting via Lish
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 `json:"id"`
}
LongviewClient represents a LongviewClient object
type LongviewClientsPagedResponse ¶
type LongviewClientsPagedResponse struct { *PageOptions Data []LongviewClient `json:"data"` }
LongviewClientsPagedResponse represents a paginated LongviewClient API response
type LongviewSubscription ¶
type LongviewSubscription struct { ID string `json:"id"` Label string `json:"label"` ClientsIncluded int `json:"clients_included"` Price *LinodePrice `json:"price"` }
LongviewSubscription represents a LongviewSubscription object
type LongviewSubscriptionsPagedResponse ¶
type LongviewSubscriptionsPagedResponse struct { *PageOptions Data []LongviewSubscription `json:"data"` }
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 `json:"id"` // This NodeBalancer's label. These must be unique on your Account. Label *string `json:"label"` // The Region where this NodeBalancer is located. NodeBalancers only support backends in the same Region. Region string `json:"region"` // This NodeBalancer's hostname, ending with .nodebalancer.linode.com Hostname *string `json:"hostname"` // This NodeBalancer's public IPv4 address. IPv4 *string `json:"ipv4"` // This NodeBalancer's public IPv6 address. IPv6 *string `json:"ipv6"` // 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 `json:"transfer"` // An array of tags applied to this object. Tags are for organizational purposes only. Tags []string `json:"tags"` Created *time.Time `json:"-"` Updated *time.Time `json:"-"` }
NodeBalancer represents a NodeBalancer object
func (NodeBalancer) GetCreateOptions ¶
func (i NodeBalancer) GetCreateOptions() NodeBalancerCreateOptions
GetCreateOptions converts a NodeBalancer to NodeBalancerCreateOptions for use in CreateNodeBalancer
func (NodeBalancer) GetUpdateOptions ¶
func (i NodeBalancer) GetUpdateOptions() NodeBalancerUpdateOptions
GetUpdateOptions converts a NodeBalancer to NodeBalancerUpdateOptions for use in UpdateNodeBalancer
type NodeBalancerConfig ¶
type NodeBalancerConfig struct { ID int `json:"id"` Port int `json:"port"` Protocol ConfigProtocol `json:"protocol"` Algorithm ConfigAlgorithm `json:"algorithm"` Stickiness ConfigStickiness `json:"stickiness"` Check ConfigCheck `json:"check"` 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"` }
NodeBalancerConfig objects allow a NodeBalancer to accept traffic on a new port
func (NodeBalancerConfig) GetCreateOptions ¶
func (i NodeBalancerConfig) GetCreateOptions() NodeBalancerConfigCreateOptions
GetCreateOptions converts a NodeBalancerConfig to NodeBalancerConfigCreateOptions for use in CreateNodeBalancerConfig
func (NodeBalancerConfig) GetRebuildOptions ¶
func (i NodeBalancerConfig) GetRebuildOptions() NodeBalancerConfigRebuildOptions
GetRebuildOptions converts a NodeBalancerConfig to NodeBalancerConfigRebuildOptions for use in RebuildNodeBalancerConfig
func (NodeBalancerConfig) GetUpdateOptions ¶
func (i NodeBalancerConfig) GetUpdateOptions() NodeBalancerConfigUpdateOptions
GetUpdateOptions converts a NodeBalancerConfig to NodeBalancerConfigUpdateOptions for use in UpdateNodeBalancerConfig
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"` Nodes []NodeBalancerNodeCreateOptions `json:"nodes,omitempty"` }
NodeBalancerConfigCreateOptions are permitted by CreateNodeBalancerConfig
type NodeBalancerConfigRebuildOptions ¶
type NodeBalancerConfigRebuildOptions 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"` Nodes []NodeBalancerNodeCreateOptions `json:"nodes"` }
NodeBalancerConfigRebuildOptions used by RebuildNodeBalancerConfig
type NodeBalancerConfigUpdateOptions ¶
type NodeBalancerConfigUpdateOptions NodeBalancerConfigCreateOptions
NodeBalancerConfigUpdateOptions are permitted by UpdateNodeBalancerConfig
type NodeBalancerConfigsPagedResponse ¶
type NodeBalancerConfigsPagedResponse struct { *PageOptions Data []NodeBalancerConfig `json:"data"` }
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"` Configs []*NodeBalancerConfigCreateOptions `json:"configs,omitempty"` Tags []string `json:"tags"` }
NodeBalancerCreateOptions are the options permitted for CreateNodeBalancer
type NodeBalancerNode ¶
type NodeBalancerNode struct { ID int `json:"id"` Address string `json:"address"` Label string `json:"label"` Status string `json:"status"` Weight int `json:"weight"` Mode NodeMode `json:"mode"` ConfigID int `json:"config_id"` NodeBalancerID int `json:"nodebalancer_id"` }
NodeBalancerNode objects represent a backend that can accept traffic for a NodeBalancer Config
func (NodeBalancerNode) GetCreateOptions ¶
func (i NodeBalancerNode) GetCreateOptions() NodeBalancerNodeCreateOptions
GetCreateOptions converts a NodeBalancerNode to NodeBalancerNodeCreateOptions for use in CreateNodeBalancerNode
func (NodeBalancerNode) GetUpdateOptions ¶
func (i NodeBalancerNode) GetUpdateOptions() NodeBalancerNodeUpdateOptions
GetUpdateOptions converts a NodeBalancerNode to NodeBalancerNodeUpdateOptions for use in UpdateNodeBalancerNode
type NodeBalancerNodeCreateOptions ¶
type NodeBalancerNodeCreateOptions struct { Address string `json:"address"` Label string `json:"label"` Weight int `json:"weight,omitempty"` Mode NodeMode `json:"mode,omitempty"` }
NodeBalancerNodeCreateOptions fields are those accepted by CreateNodeBalancerNode
type NodeBalancerNodeStatus ¶
NodeBalancerNodeStatus represents the total number of nodes whose status is Up or Down
type NodeBalancerNodeUpdateOptions ¶
type NodeBalancerNodeUpdateOptions struct { Address string `json:"address,omitempty"` Label string `json:"label,omitempty"` Weight int `json:"weight,omitempty"` Mode NodeMode `json:"mode,omitempty"` }
NodeBalancerNodeUpdateOptions fields are those accepted by UpdateNodeBalancerNode
type NodeBalancerNodesPagedResponse ¶
type NodeBalancerNodesPagedResponse struct { *PageOptions Data []NodeBalancerNode `json:"data"` }
NodeBalancerNodesPagedResponse represents a paginated NodeBalancerNode API response
type NodeBalancerTransfer ¶
type NodeBalancerTransfer struct { // The total transfer, in MB, used by this NodeBalancer this month. Total *float64 `json:"total"` // The total inbound transfer, in MB, used for this NodeBalancer this month. Out *float64 `json:"out"` // The total outbound transfer, in MB, used for this NodeBalancer this month. In *float64 `json:"in"` }
NodeBalancerTransfer contains information about the amount of transfer a NodeBalancer has had in the current month
type NodeBalancerUpdateOptions ¶
type NodeBalancerUpdateOptions struct { Label *string `json:"label,omitempty"` ClientConnThrottle *int `json:"client_conn_throttle,omitempty"` Tags *[]string `json:"tags,omitempty"` }
NodeBalancerUpdateOptions are the options permitted for UpdateNodeBalancer
type NodeBalancersPagedResponse ¶
type NodeBalancersPagedResponse struct { *PageOptions Data []NodeBalancer `json:"data"` }
NodeBalancersPagedResponse represents a paginated NodeBalancer API response
type NodeMode ¶
type NodeMode string
NodeMode is the mode a NodeBalancer should use when sending traffic to a NodeBalancer Node
var ( // ModeAccept is the NodeMode indicating a NodeBalancer Node is accepting traffic ModeAccept NodeMode = "accept" // ModeReject is the NodeMode indicating a NodeBalancer Node is not receiving traffic ModeReject NodeMode = "reject" // ModeDrain is the NodeMode indicating a NodeBalancer Node is not receiving new traffic, but may continue receiving traffic from pinned connections ModeDrain NodeMode = "drain" )
type Notification ¶
type Notification struct { UntilStr string `json:"until"` WhenStr string `json:"when"` Label string `json:"label"` Body *string `json:"body"` Message string `json:"message"` Type NotificationType `json:"type"` Severity NotificationSeverity `json:"severity"` Entity *NotificationEntity `json:"entity"` Until *time.Time `json:"-"` When *time.Time `json:"-"` }
Notification represents a notification on an Account
type NotificationEntity ¶
type NotificationEntity struct { ID int `json:"id"` Label string `json:"label"` Type string `json:"type"` URL string `json:"url"` }
NotificationEntity adds detailed information about the Notification. This could refer to the ticket that triggered the notification, for example.
type NotificationSeverity ¶
type NotificationSeverity string
NotificationSeverity constants start with Notification and include all known Linode API Notification Severities.
const ( NotificationMinor NotificationSeverity = "minor" NotificationMajor NotificationSeverity = "major" NotificationCritical NotificationSeverity = "critical" )
NotificationSeverity constants represent the actions that cause a Notification. New severities may be added in the future.
type NotificationType ¶
type NotificationType string
NotificationType constants start with Notification and include all known Linode API Notification Types.
const ( NotificationMigrationScheduled NotificationType = "migration_scheduled" NotificationMigrationImminent NotificationType = "migration_imminent" NotificationMigrationPending NotificationType = "migration_pending" NotificationRebootScheduled NotificationType = "reboot_scheduled" NotificationOutage NotificationType = "outage" NotificationPaymentDue NotificationType = "payment_due" NotificationTicketImportant NotificationType = "ticket_important" NotificationTicketAbuse NotificationType = "ticket_abuse" NotificationNotice NotificationType = "notice" NotificationMaintenance NotificationType = "maintenance" )
NotificationType constants represent the actions that cause a Notification. New types may be added in the future.
type NotificationsPagedResponse ¶
type NotificationsPagedResponse struct { *PageOptions Data []Notification `json:"data"` }
NotificationsPagedResponse represents a paginated Notifications API response
type PageOptions ¶
type PageOptions struct { Page int `url:"page,omitempty" json:"page"` Pages int `url:"pages,omitempty" json:"pages"` Results int `url:"results,omitempty" json:"results"` }
PageOptions are the pagination parameters for List endpoints
type Profile ¶
type Profile struct { UID int `json:"uid"` Username string `json:"username"` Email string `json:"email"` Timezone string `json:"timezone"` EmailNotifications bool `json:"email_notifications"` IPWhitelistEnabled bool `json:"ip_whitelist_enabled"` TwoFactorAuth bool `json:"two_factor_auth"` Restricted bool `json:"restricted"` LishAuthMethod LishAuthMethod `json:"lish_auth_method"` Referrals ProfileReferrals `json:"referrals"` AuthorizedKeys []string `json:"authorized_keys"` }
Profile represents a Profile object
func (Profile) GetUpdateOptions ¶
func (i Profile) GetUpdateOptions() (o ProfileUpdateOptions)
GetUpdateOptions converts a Profile to ProfileUpdateOptions for use in UpdateProfile
type ProfileReferrals ¶
type ProfileReferrals struct { Total int `json:"total"` Completed int `json:"completed"` Pending int `json:"pending"` Credit float64 `json:"credit"` Code string `json:"code"` URL string `json:"url"` }
ProfileReferrals represent a User's status in the Referral Program
type ProfileUpdateOptions ¶
type ProfileUpdateOptions struct { Email string `json:"email,omitempty"` Timezone string `json:"timezone,omitempty"` EmailNotifications *bool `json:"email_notifications,omitempty"` IPWhitelistEnabled *bool `json:"ip_whitelist_enabled,omitempty"` LishAuthMethod LishAuthMethod `json:"lish_auth_method,omitempty"` AuthorizedKeys *[]string `json:"authorized_keys,omitempty"` TwoFactorAuth *bool `json:"two_factor_auth,omitempty"` Restricted *bool `json:"restricted,omitempty"` }
ProfileUpdateOptions fields are those accepted by UpdateProfile
type RebuildInstanceOptions ¶
type RebuildInstanceOptions struct { Image string `json:"image"` RootPass string `json:"root_pass"` AuthorizedKeys []string `json:"authorized_keys"` AuthorizedUsers []string `json:"authorized_users"` 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 `json:"data"` }
RegionsPagedResponse represents a linode API response for listing
type RescueInstanceOptions ¶
type RescueInstanceOptions struct {
Devices InstanceConfigDeviceMap `json:"devices"`
}
RescueInstanceOptions fields are those accepted by RescueInstance
type Resource ¶
type Resource struct { R func(ctx context.Context) *resty.Request PR func(ctx context.Context) *resty.Request // contains filtered or unexported fields }
Resource represents a linode API resource
type RestoreInstanceOptions ¶
type RestoreInstanceOptions struct { LinodeID int `json:"linode_id"` Overwrite bool `json:"overwrite"` }
RestoreInstanceOptions fields are those accepted by InstanceRestore
type SSHKey ¶
type SSHKey struct { ID int `json:"id"` Label string `json:"label"` SSHKey string `json:"ssh_key"` CreatedStr string `json:"created"` Created *time.Time `json:"-"` }
SSHKey represents a SSHKey object
func (SSHKey) GetCreateOptions ¶
func (i SSHKey) GetCreateOptions() (o SSHKeyCreateOptions)
GetCreateOptions converts a SSHKey to SSHKeyCreateOptions for use in CreateSSHKey
func (SSHKey) GetUpdateOptions ¶
func (i SSHKey) GetUpdateOptions() (o SSHKeyUpdateOptions)
GetUpdateOptions converts a SSHKey to SSHKeyCreateOptions for use in UpdateSSHKey
type SSHKeyCreateOptions ¶
SSHKeyCreateOptions fields are those accepted by CreateSSHKey
type SSHKeyUpdateOptions ¶
type SSHKeyUpdateOptions struct {
Label string `json:"label"`
}
SSHKeyUpdateOptions fields are those accepted by UpdateSSHKey
type SSHKeysPagedResponse ¶
type SSHKeysPagedResponse struct { *PageOptions Data []SSHKey `json:"data"` }
SSHKeysPagedResponse represents a paginated SSHKey API response
type SortedObjects ¶
type SortedObjects struct { Instances []Instance Domains []Domain Volumes []Volume NodeBalancers []NodeBalancer }
SortedObjects currently only includes Instances
type Stackscript ¶
type Stackscript struct { CreatedStr string `json:"created"` UpdatedStr string `json:"updated"` ID int `json:"id"` Username string `json:"username"` Label string `json:"label"` Description string `json:"description"` Images []string `json:"images"` DeploymentsTotal int `json:"deployments_total"` DeploymentsActive int `json:"deployments_active"` IsPublic bool `json:"is_public"` Created *time.Time `json:"-"` Updated *time.Time `json:"-"` RevNote string `json:"rev_note"` Script string `json:"script"` UserDefinedFields *[]StackscriptUDF `json:"user_defined_fields"` UserGravatarID string `json:"user_gravatar_id"` }
Stackscript represents a Linode StackScript
func (Stackscript) GetCreateOptions ¶
func (i Stackscript) GetCreateOptions() StackscriptCreateOptions
GetCreateOptions converts a Stackscript to StackscriptCreateOptions for use in CreateStackscript
func (Stackscript) GetUpdateOptions ¶
func (i Stackscript) GetUpdateOptions() StackscriptUpdateOptions
GetUpdateOptions converts a Stackscript to StackscriptUpdateOptions for use in UpdateStackscript
type StackscriptCreateOptions ¶
type StackscriptCreateOptions struct { Label string `json:"label"` Description string `json:"description"` Images []string `json:"images"` IsPublic bool `json:"is_public"` RevNote string `json:"rev_note"` Script string `json:"script"` }
StackscriptCreateOptions fields are those accepted by CreateStackscript
type StackscriptUDF ¶
type StackscriptUDF struct { // A human-readable label for the field that will serve as the input prompt for entering the value during deployment. Label string `json:"label"` // The name of the field. Name string `json:"name"` // An example value for the field. Example string `json:"example"` // A list of acceptable single values for the field. OneOf string `json:"oneOf,omitempty"` // A list of acceptable values for the field in any quantity, combination or order. ManyOf string `json:"manyOf,omitempty"` // The default value. If not specified, this value will be used. Default string `json:"default,omitempty"` }
StackscriptUDF define a single variable that is accepted by a Stackscript
type StackscriptUpdateOptions ¶
type StackscriptUpdateOptions StackscriptCreateOptions
StackscriptUpdateOptions fields are those accepted by UpdateStackscript
type StackscriptsPagedResponse ¶
type StackscriptsPagedResponse struct { *PageOptions Data []Stackscript `json:"data"` }
StackscriptsPagedResponse represents a paginated Stackscript API response
type Tag ¶
type Tag struct {
Label string `json:"label"`
}
Tag represents a Tag object
func (Tag) GetCreateOptions ¶
func (i Tag) GetCreateOptions() (o TagCreateOptions)
GetCreateOptions converts a Tag to TagCreateOptions for use in CreateTag
type TagCreateOptions ¶
type TagCreateOptions struct { Label string `json:"label"` Linodes []int `json:"linodes,omitempty"` Domains []int `json:"domains,omitempty"` Volumes []int `json:"volumes,omitempty"` NodeBalancers []int `json:"nodebalancers,omitempty"` }
TagCreateOptions fields are those accepted by CreateTag
type TaggedObject ¶
type TaggedObject struct { Type string `json:"type"` RawData json.RawMessage `json:"data"` Data interface{} `json:"-"` }
TaggedObject represents a Tagged Object object
type TaggedObjectList ¶
type TaggedObjectList []TaggedObject
TaggedObjectList are a list of TaggedObjects, as returning by ListTaggedObjects
func (TaggedObjectList) SortedObjects ¶
func (t TaggedObjectList) SortedObjects() (SortedObjects, error)
SortedObjects converts a list of TaggedObjects into a Sorted Objects struct, for easier access
type TaggedObjectsPagedResponse ¶
type TaggedObjectsPagedResponse struct { *PageOptions Data []TaggedObject `json:"data"` }
TaggedObjectsPagedResponse represents a paginated Tag API response
type TagsPagedResponse ¶
type TagsPagedResponse struct { *PageOptions Data []Tag `json:"data"` }
TagsPagedResponse represents a paginated Tag API response
type Ticket ¶
type Ticket struct { ID int `json:"id"` Attachments []string `json:"attachments"` Closed *time.Time `json:"-"` Description string `json:"description"` Entity *TicketEntity `json:"entity"` GravatarID string `json:"gravatar_id"` Opened *time.Time `json:"-"` OpenedBy string `json:"opened_by"` Status TicketStatus `json:"status"` Summary string `json:"summary"` Updated *time.Time `json:"-"` UpdatedBy string `json:"updated_by"` }
Ticket represents a support ticket object
type TicketEntity ¶
type TicketEntity struct { ID int `json:"id"` Label string `json:"label"` Type string `json:"type"` URL string `json:"url"` }
TicketEntity refers a ticket to a specific entity
type TicketStatus ¶
type TicketStatus string
TicketStatus constants start with Ticket and include Linode API Ticket Status values
const ( TicketNew TicketStatus = "new" TicketClosed TicketStatus = "closed" TicketOpen TicketStatus = "open" )
TicketStatus constants reflect the current status of a Ticket
type TicketsPagedResponse ¶
type TicketsPagedResponse struct { *PageOptions Data []Ticket `json:"data"` }
TicketsPagedResponse represents a paginated ticket API response
type Token ¶
type Token struct { // This token's unique ID, which can be used to revoke it. ID int `json:"id"` // The scopes this token was created with. These define what parts of the Account the token can be used to access. Many command-line tools, such as the Linode CLI, require tokens with access to *. Tokens with more restrictive scopes are generally more secure. Scopes string `json:"scopes"` // This token's label. This is for display purposes only, but can be used to more easily track what you're using each token for. (1-100 Characters) Label string `json:"label"` // The token used to access the API. When the token is created, the full token is returned here. Otherwise, only the first 16 characters are returned. Token string `json:"token"` // The date and time this token was created. Created *time.Time `json:"-"` CreatedStr string `json:"created"` // When this token will expire. Personal Access Tokens cannot be renewed, so after this time the token will be completely unusable and a new token will need to be generated. Tokens may be created with "null" as their expiry and will never expire unless revoked. Expiry *time.Time `json:"-"` ExpiryStr string `json:"expiry"` }
Token represents a Token object
func (Token) GetCreateOptions ¶
func (i Token) GetCreateOptions() (o TokenCreateOptions)
GetCreateOptions converts a Token to TokenCreateOptions for use in CreateToken
func (Token) GetUpdateOptions ¶
func (i Token) GetUpdateOptions() (o TokenUpdateOptions)
GetUpdateOptions converts a Token to TokenUpdateOptions for use in UpdateToken
type TokenCreateOptions ¶
type TokenCreateOptions struct { // The scopes this token was created with. These define what parts of the Account the token can be used to access. Many command-line tools, such as the Linode CLI, require tokens with access to *. Tokens with more restrictive scopes are generally more secure. Scopes string `json:"scopes"` // This token's label. This is for display purposes only, but can be used to more easily track what you're using each token for. (1-100 Characters) Label string `json:"label"` // When this token will expire. Personal Access Tokens cannot be renewed, so after this time the token will be completely unusable and a new token will need to be generated. Tokens may be created with "null" as their expiry and will never expire unless revoked. Expiry *time.Time `json:"expiry"` }
TokenCreateOptions fields are those accepted by CreateToken
type TokenUpdateOptions ¶
type TokenUpdateOptions struct { // This token's label. This is for display purposes only, but can be used to more easily track what you're using each token for. (1-100 Characters) Label string `json:"label"` }
TokenUpdateOptions fields are those accepted by UpdateToken
type TokensPagedResponse ¶
type TokensPagedResponse struct { *PageOptions Data []Token `json:"data"` }
TokensPagedResponse represents a paginated Token API response
type User ¶
type User struct { Username string `json:"username"` Email string `json:"email"` Restricted bool `json:"restricted"` SSHKeys []string `json:"ssh_keys"` }
User represents a User object
func (User) GetCreateOptions ¶
func (i User) GetCreateOptions() (o UserCreateOptions)
GetCreateOptions converts a User to UserCreateOptions for use in CreateUser
func (User) GetUpdateOptions ¶
func (i User) GetUpdateOptions() (o UserUpdateOptions)
GetUpdateOptions converts a User to UserUpdateOptions for use in UpdateUser
type UserCreateOptions ¶
type UserCreateOptions struct { Username string `json:"username"` Email string `json:"email"` Restricted bool `json:"restricted,omitempty"` }
UserCreateOptions fields are those accepted by CreateUser
type UserUpdateOptions ¶
type UserUpdateOptions struct { Username string `json:"username,omitempty"` Email string `json:"email,omitempty"` Restricted *bool `json:"restricted,omitempty"` SSHKeys *[]string `json:"ssh_keys,omitempty"` }
UserUpdateOptions fields are those accepted by UpdateUser
type UsersPagedResponse ¶
type UsersPagedResponse struct { *PageOptions Data []User `json:"data"` }
UsersPagedResponse represents a paginated User API response
type Volume ¶
type Volume struct { CreatedStr string `json:"created"` UpdatedStr string `json:"updated"` ID int `json:"id"` Label string `json:"label"` Status VolumeStatus `json:"status"` Region string `json:"region"` Size int `json:"size"` LinodeID *int `json:"linode_id"` FilesystemPath string `json:"filesystem_path"` Tags []string `json:"tags"` Created time.Time `json:"-"` Updated time.Time `json:"-"` }
Volume represents a linode volume object
func (Volume) GetCreateOptions ¶
func (v Volume) GetCreateOptions() (createOpts VolumeCreateOptions)
GetCreateOptions converts a Volume to VolumeCreateOptions for use in CreateVolume
func (Volume) GetUpdateOptions ¶
func (v Volume) GetUpdateOptions() (updateOpts VolumeUpdateOptions)
GetUpdateOptions converts a Volume to VolumeUpdateOptions for use in UpdateVolume
type VolumeAttachOptions ¶
type VolumeAttachOptions struct { LinodeID int `json:"linode_id"` ConfigID int `json:"config_id,omitempty"` }
VolumeAttachOptions fields are those accepted by AttachVolume
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"` // An array of tags applied to this object. Tags are for organizational purposes only. Tags []string `json:"tags"` }
VolumeCreateOptions fields are those accepted by CreateVolume
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 VolumeUpdateOptions ¶
type VolumeUpdateOptions struct { Label string `json:"label,omitempty"` Tags *[]string `json:"tags,omitempty"` }
VolumeUpdateOptions fields are those accepted by UpdateVolume
type VolumesPagedResponse ¶
type VolumesPagedResponse struct { *PageOptions Data []Volume `json:"data"` }
VolumesPagedResponse represents a linode API response for listing of volumes
Source Files ¶
- account.go
- account_events.go
- account_invoices.go
- account_notifications.go
- account_users.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
- profile_sshkeys.go
- profile_tokens.go
- regions.go
- resources.go
- stackscripts.go
- support.go
- tags.go
- types.go
- util.go
- volumes.go
- waitfor.go