Documentation
¶
Overview ¶
Package binarylane is the BinaryLane API client for Go.
Index ¶
- Constants
- func Bool(v bool) *bool
- func CheckResponse(r *http.Response) error
- func DoRequest(ctx context.Context, req *http.Request) (*http.Response, error)
- func DoRequestWithClient(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error)
- func Int(v int) *int
- func StreamToString(stream io.Reader) string
- func String(v string) *string
- func Stringify(message interface{}) string
- func ToURN(resourceType string, id interface{}) string
- type Account
- type AccountService
- type AccountServiceOp
- type Action
- type ActionRequest
- type ActionsService
- type ActionsServiceOp
- type Address
- type ArgError
- type BackupWindow
- type Balance
- type BalanceService
- type BalanceServiceOp
- type BillingHistory
- type BillingHistoryEntry
- type BillingHistoryService
- type BillingHistoryServiceOp
- type Client
- func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error)
- func (c *Client) GetRate() Rate
- func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error)
- func (c *Client) OnRequestCompleted(rc RequestCompletionCallback)
- type ClientOpt
- type CreateProjectRequest
- type CustomImageCreateRequest
- type Destinations
- type Domain
- type DomainCreateRequest
- type DomainRecord
- type DomainRecordEditRequest
- type DomainsService
- type DomainsServiceOp
- func (s *DomainsServiceOp) Create(ctx context.Context, createRequest *DomainCreateRequest) (*Domain, *Response, error)
- func (s *DomainsServiceOp) CreateRecord(ctx context.Context, domain string, createRequest *DomainRecordEditRequest) (*DomainRecord, *Response, error)
- func (s *DomainsServiceOp) Delete(ctx context.Context, name string) (*Response, error)
- func (s *DomainsServiceOp) DeleteRecord(ctx context.Context, domain string, id int) (*Response, error)
- func (s *DomainsServiceOp) EditRecord(ctx context.Context, domain string, id int, ...) (*DomainRecord, *Response, error)
- func (s *DomainsServiceOp) Get(ctx context.Context, name string) (*Domain, *Response, error)
- func (s DomainsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Domain, *Response, error)
- func (s *DomainsServiceOp) Record(ctx context.Context, domain string, id int) (*DomainRecord, *Response, error)
- func (s *DomainsServiceOp) Records(ctx context.Context, domain string, opt *ListOptions) ([]DomainRecord, *Response, error)
- func (s *DomainsServiceOp) RecordsByName(ctx context.Context, domain, name string, opt *ListOptions) ([]DomainRecord, *Response, error)
- func (s *DomainsServiceOp) RecordsByType(ctx context.Context, domain, ofType string, opt *ListOptions) ([]DomainRecord, *Response, error)
- func (s *DomainsServiceOp) RecordsByTypeAndName(ctx context.Context, domain, ofType, name string, opt *ListOptions) ([]DomainRecord, *Response, error)
- type ErrorResponse
- type Firewall
- type FirewallRequest
- type FirewallRulesRequest
- type FirewallsService
- type FirewallsServiceOp
- func (fw *FirewallsServiceOp) AddRules(ctx context.Context, fID string, rr *FirewallRulesRequest) (*Response, error)
- func (fw *FirewallsServiceOp) AddServers(ctx context.Context, fID string, serverIDs ...int) (*Response, error)
- func (fw *FirewallsServiceOp) AddTags(ctx context.Context, fID string, tags ...string) (*Response, error)
- func (fw *FirewallsServiceOp) Create(ctx context.Context, fr *FirewallRequest) (*Firewall, *Response, error)
- func (fw *FirewallsServiceOp) Delete(ctx context.Context, fID string) (*Response, error)
- func (fw *FirewallsServiceOp) Get(ctx context.Context, fID string) (*Firewall, *Response, error)
- func (fw *FirewallsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Firewall, *Response, error)
- func (fw *FirewallsServiceOp) ListByServer(ctx context.Context, sID int, opt *ListOptions) ([]Firewall, *Response, error)
- func (fw *FirewallsServiceOp) RemoveRules(ctx context.Context, fID string, rr *FirewallRulesRequest) (*Response, error)
- func (fw *FirewallsServiceOp) RemoveServers(ctx context.Context, fID string, serverIDs ...int) (*Response, error)
- func (fw *FirewallsServiceOp) RemoveTags(ctx context.Context, fID string, tags ...string) (*Response, error)
- func (fw *FirewallsServiceOp) Update(ctx context.Context, fID string, fr *FirewallRequest) (*Firewall, *Response, error)
- type FloatingIP
- type FloatingIPActionsService
- type FloatingIPActionsServiceOp
- func (s *FloatingIPActionsServiceOp) Assign(ctx context.Context, ip string, serverID int) (*Action, *Response, error)
- func (s *FloatingIPActionsServiceOp) Get(ctx context.Context, ip string, actionID int) (*Action, *Response, error)
- func (s *FloatingIPActionsServiceOp) List(ctx context.Context, ip string, opt *ListOptions) ([]Action, *Response, error)
- func (s *FloatingIPActionsServiceOp) Unassign(ctx context.Context, ip string) (*Action, *Response, error)
- type FloatingIPCreateRequest
- type FloatingIPsService
- type FloatingIPsServiceOp
- func (f *FloatingIPsServiceOp) Create(ctx context.Context, createRequest *FloatingIPCreateRequest) (*FloatingIP, *Response, error)
- func (f *FloatingIPsServiceOp) Delete(ctx context.Context, ip string) (*Response, error)
- func (f *FloatingIPsServiceOp) Get(ctx context.Context, ip string) (*FloatingIP, *Response, error)
- func (f *FloatingIPsServiceOp) List(ctx context.Context, opt *ListOptions) ([]FloatingIP, *Response, error)
- type ForwardingRule
- type HealthCheck
- type Image
- type ImageActionsService
- type ImageActionsServiceOp
- func (i *ImageActionsServiceOp) Convert(ctx context.Context, imageID int) (*Action, *Response, error)
- func (i *ImageActionsServiceOp) Get(ctx context.Context, imageID, actionID int) (*Action, *Response, error)
- func (i *ImageActionsServiceOp) Transfer(ctx context.Context, imageID int, transferRequest *ActionRequest) (*Action, *Response, error)
- type ImageUpdateRequest
- type ImagesService
- type ImagesServiceOp
- func (s *ImagesServiceOp) Create(ctx context.Context, createRequest *CustomImageCreateRequest) (*Image, *Response, error)
- func (s *ImagesServiceOp) Delete(ctx context.Context, imageID int) (*Response, error)
- func (s *ImagesServiceOp) GetByID(ctx context.Context, imageID int) (*Image, *Response, error)
- func (s *ImagesServiceOp) GetBySlug(ctx context.Context, slug string) (*Image, *Response, error)
- func (s *ImagesServiceOp) List(ctx context.Context, opt *ListOptions) ([]Image, *Response, error)
- func (s *ImagesServiceOp) ListApplication(ctx context.Context, opt *ListOptions) ([]Image, *Response, error)
- func (s *ImagesServiceOp) ListByTag(ctx context.Context, tag string, opt *ListOptions) ([]Image, *Response, error)
- func (s *ImagesServiceOp) ListDistribution(ctx context.Context, opt *ListOptions) ([]Image, *Response, error)
- func (s *ImagesServiceOp) ListUser(ctx context.Context, opt *ListOptions) ([]Image, *Response, error)
- func (s *ImagesServiceOp) Update(ctx context.Context, imageID int, updateRequest *ImageUpdateRequest) (*Image, *Response, error)
- type InboundRule
- type Invoice
- type InvoiceItem
- type InvoiceList
- type InvoiceListItem
- type InvoiceSummary
- type InvoiceSummaryBreakdown
- type InvoiceSummaryBreakdownItem
- type InvoicesService
- type InvoicesServiceOp
- func (s *InvoicesServiceOp) Get(ctx context.Context, invoiceUUID string, opt *ListOptions) (*Invoice, *Response, error)
- func (s *InvoicesServiceOp) GetCSV(ctx context.Context, invoiceUUID string) ([]byte, *Response, error)
- func (s *InvoicesServiceOp) GetPDF(ctx context.Context, invoiceUUID string) ([]byte, *Response, error)
- func (s *InvoicesServiceOp) GetSummary(ctx context.Context, invoiceUUID string) (*InvoiceSummary, *Response, error)
- func (s *InvoicesServiceOp) List(ctx context.Context, opt *ListOptions) (*InvoiceList, *Response, error)
- type Kernel
- type Key
- type KeyCreateRequest
- type KeyUpdateRequest
- type KeysService
- type KeysServiceOp
- func (s *KeysServiceOp) Create(ctx context.Context, createRequest *KeyCreateRequest) (*Key, *Response, error)
- func (s *KeysServiceOp) DeleteByFingerprint(ctx context.Context, fingerprint string) (*Response, error)
- func (s *KeysServiceOp) DeleteByID(ctx context.Context, keyID int) (*Response, error)
- func (s *KeysServiceOp) GetByFingerprint(ctx context.Context, fingerprint string) (*Key, *Response, error)
- func (s *KeysServiceOp) GetByID(ctx context.Context, keyID int) (*Key, *Response, error)
- func (s *KeysServiceOp) List(ctx context.Context, opt *ListOptions) ([]Key, *Response, error)
- func (s *KeysServiceOp) UpdateByFingerprint(ctx context.Context, fingerprint string, updateRequest *KeyUpdateRequest) (*Key, *Response, error)
- func (s *KeysServiceOp) UpdateByID(ctx context.Context, keyID int, updateRequest *KeyUpdateRequest) (*Key, *Response, error)
- type LinkAction
- type Links
- type ListOptions
- type LoadBalancer
- type LoadBalancerRequest
- type LoadBalancersService
- type LoadBalancersServiceOp
- func (l *LoadBalancersServiceOp) AddForwardingRules(ctx context.Context, lbID int, rules ...ForwardingRule) (*Response, error)
- func (l *LoadBalancersServiceOp) AddServers(ctx context.Context, lbID int, serverIDs ...int) (*Response, error)
- func (l *LoadBalancersServiceOp) Create(ctx context.Context, lbr *LoadBalancerRequest) (*LoadBalancer, *Response, error)
- func (l *LoadBalancersServiceOp) Delete(ctx context.Context, ldID int) (*Response, error)
- func (l *LoadBalancersServiceOp) Get(ctx context.Context, lbID int) (*LoadBalancer, *Response, error)
- func (l *LoadBalancersServiceOp) List(ctx context.Context, opt *ListOptions) ([]LoadBalancer, *Response, error)
- func (l *LoadBalancersServiceOp) RemoveForwardingRules(ctx context.Context, lbID int, rules ...ForwardingRule) (*Response, error)
- func (l *LoadBalancersServiceOp) RemoveServers(ctx context.Context, lbID int, serverIDs ...int) (*Response, error)
- func (l *LoadBalancersServiceOp) Update(ctx context.Context, lbID int, lbr *LoadBalancerRequest) (*LoadBalancer, *Response, error)
- type Meta
- type NetworkV4
- type NetworkV6
- type Networks
- type OutboundRule
- type Pages
- type PendingChange
- type Project
- type ProjectResource
- type ProjectResourceLinks
- type ProjectsService
- type ProjectsServiceOp
- func (p *ProjectsServiceOp) AssignResources(ctx context.Context, projectID string, resources ...interface{}) ([]ProjectResource, *Response, error)
- func (p *ProjectsServiceOp) Create(ctx context.Context, cr *CreateProjectRequest) (*Project, *Response, error)
- func (p *ProjectsServiceOp) Delete(ctx context.Context, projectID string) (*Response, error)
- func (p *ProjectsServiceOp) Get(ctx context.Context, projectID string) (*Project, *Response, error)
- func (p *ProjectsServiceOp) GetDefault(ctx context.Context) (*Project, *Response, error)
- func (p *ProjectsServiceOp) List(ctx context.Context, opts *ListOptions) ([]Project, *Response, error)
- func (p *ProjectsServiceOp) ListResources(ctx context.Context, projectID string, opts *ListOptions) ([]ProjectResource, *Response, error)
- func (p *ProjectsServiceOp) Update(ctx context.Context, projectID string, ur *UpdateProjectRequest) (*Project, *Response, error)
- type Rate
- type Region
- type RegionsService
- type RegionsServiceOp
- type RequestCompletionCallback
- type Resource
- type ResourceType
- type ResourceWithURN
- type Response
- type Server
- type ServerActionsService
- type ServerActionsServiceOp
- func (s *ServerActionsServiceOp) ChangeKernel(ctx context.Context, id, kernelID int) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) DisableBackups(ctx context.Context, id int) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) DisableBackupsByTag(ctx context.Context, tag string) ([]Action, *Response, error)
- func (s *ServerActionsServiceOp) EnableBackups(ctx context.Context, id int) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) EnableBackupsByTag(ctx context.Context, tag string) ([]Action, *Response, error)
- func (s *ServerActionsServiceOp) EnableIPv6(ctx context.Context, id int) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) EnableIPv6ByTag(ctx context.Context, tag string) ([]Action, *Response, error)
- func (s *ServerActionsServiceOp) EnablePrivateNetworking(ctx context.Context, id int) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) EnablePrivateNetworkingByTag(ctx context.Context, tag string) ([]Action, *Response, error)
- func (s *ServerActionsServiceOp) Get(ctx context.Context, serverID, actionID int) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) GetByURI(ctx context.Context, rawurl string) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) PasswordReset(ctx context.Context, id int) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) PowerCycle(ctx context.Context, id int) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) PowerCycleByTag(ctx context.Context, tag string) ([]Action, *Response, error)
- func (s *ServerActionsServiceOp) PowerOff(ctx context.Context, id int) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) PowerOffByTag(ctx context.Context, tag string) ([]Action, *Response, error)
- func (s *ServerActionsServiceOp) PowerOn(ctx context.Context, id int) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) PowerOnByTag(ctx context.Context, tag string) ([]Action, *Response, error)
- func (s *ServerActionsServiceOp) Reboot(ctx context.Context, id int) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) RebuildByImageID(ctx context.Context, id, imageID int) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) RebuildByImageSlug(ctx context.Context, id int, slug string) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) Rename(ctx context.Context, id int, name string) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) Resize(ctx context.Context, id int, sizeSlug string, resizeDisk bool) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) Restore(ctx context.Context, id, imageID int) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) Shutdown(ctx context.Context, id int) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) ShutdownByTag(ctx context.Context, tag string) ([]Action, *Response, error)
- func (s *ServerActionsServiceOp) Snapshot(ctx context.Context, id int, name string) (*Action, *Response, error)
- func (s *ServerActionsServiceOp) SnapshotByTag(ctx context.Context, tag string, name string) ([]Action, *Response, error)
- type ServerCreateImage
- type ServerCreateOptions
- type ServerCreateRequest
- type ServerCreateSSHKey
- type ServerCreateVolume
- type ServerMultiCreateRequest
- type ServersService
- type ServersServiceOp
- func (s *ServersServiceOp) Actions(ctx context.Context, serverID int, opt *ListOptions) ([]Action, *Response, error)
- func (s *ServersServiceOp) Backups(ctx context.Context, serverID int, opt *ListOptions) ([]Image, *Response, error)
- func (s *ServersServiceOp) Create(ctx context.Context, createRequest *ServerCreateRequest) (*Server, *Response, error)
- func (s *ServersServiceOp) CreateMultiple(ctx context.Context, createRequest *ServerMultiCreateRequest) ([]Server, *Response, error)
- func (s *ServersServiceOp) Delete(ctx context.Context, serverID int) (*Response, error)
- func (s *ServersServiceOp) DeleteByTag(ctx context.Context, tag string) (*Response, error)
- func (s *ServersServiceOp) Get(ctx context.Context, serverID int) (*Server, *Response, error)
- func (s *ServersServiceOp) Kernels(ctx context.Context, serverID int, opt *ListOptions) ([]Kernel, *Response, error)
- func (s *ServersServiceOp) List(ctx context.Context, opt *ListOptions) ([]Server, *Response, error)
- func (s *ServersServiceOp) ListByTag(ctx context.Context, tag string, opt *ListOptions) ([]Server, *Response, error)
- func (s *ServersServiceOp) Neighbors(ctx context.Context, serverID int) ([]Server, *Response, error)
- func (s *ServersServiceOp) Snapshots(ctx context.Context, serverID int, opt *ListOptions) ([]Image, *Response, error)
- type Size
- type SizesService
- type SizesServiceOp
- type Snapshot
- type SnapshotsService
- type SnapshotsServiceOp
- func (s *SnapshotsServiceOp) Delete(ctx context.Context, snapshotID string) (*Response, error)
- func (s *SnapshotsServiceOp) Get(ctx context.Context, snapshotID string) (*Snapshot, *Response, error)
- func (s *SnapshotsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Snapshot, *Response, error)
- func (s *SnapshotsServiceOp) ListServer(ctx context.Context, opt *ListOptions) ([]Snapshot, *Response, error)
- func (s *SnapshotsServiceOp) ListVolume(ctx context.Context, opt *ListOptions) ([]Snapshot, *Response, error)
- type Sources
- type StickySessions
- type Tag
- type TagCreateRequest
- type TagResourcesRequest
- type TaggedDatabasesResources
- type TaggedImagesResources
- type TaggedResources
- type TaggedResourcesData
- type TaggedServersResources
- type TaggedVolumeSnapshotsResources
- type TaggedVolumesResources
- type TagsService
- type TagsServiceOp
- func (s *TagsServiceOp) Create(ctx context.Context, createRequest *TagCreateRequest) (*Tag, *Response, error)
- func (s *TagsServiceOp) Delete(ctx context.Context, name string) (*Response, error)
- func (s *TagsServiceOp) Get(ctx context.Context, name string) (*Tag, *Response, error)
- func (s *TagsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Tag, *Response, error)
- func (s *TagsServiceOp) TagResources(ctx context.Context, name string, tagRequest *TagResourcesRequest) (*Response, error)
- func (s *TagsServiceOp) UntagResources(ctx context.Context, name string, untagRequest *UntagResourcesRequest) (*Response, error)
- type Timestamp
- type UntagResourcesRequest
- type UpdateProjectRequest
- type VPC
- type VPCCreateRequest
- type VPCSetDescription
- type VPCSetField
- type VPCSetName
- type VPCUpdateRequest
- type VPCsService
- type VPCsServiceOp
- func (v *VPCsServiceOp) Create(ctx context.Context, create *VPCCreateRequest) (*VPC, *Response, error)
- func (v *VPCsServiceOp) Delete(ctx context.Context, id int) (*Response, error)
- func (v *VPCsServiceOp) Get(ctx context.Context, id int) (*VPC, *Response, error)
- func (v *VPCsServiceOp) List(ctx context.Context, opt *ListOptions) ([]*VPC, *Response, error)
- func (v *VPCsServiceOp) Set(ctx context.Context, id int, fields ...VPCSetField) (*VPC, *Response, error)
- func (v *VPCsServiceOp) Update(ctx context.Context, id int, update *VPCUpdateRequest) (*VPC, *Response, error)
Constants ¶
const ( // ActionInProgress is an in progress action status ActionInProgress = "in-progress" //ActionCompleted is a completed action status ActionCompleted = "completed" )
const ( // DefaultProject is the ID you should use if you are working with your // default project. DefaultProject = "default" )
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored.
func DoRequestWithClient ¶
func DoRequestWithClient( ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error)
DoRequestWithClient submits an HTTP request using the specified client.
func Int ¶
Int is a helper routine that allocates a new int32 value to store v and returns a pointer to it, but unlike Int32 its argument value is an int.
func StreamToString ¶
StreamToString converts a reader to a string
func String ¶
String is a helper routine that allocates a new string value to store v and returns a pointer to it.
Types ¶
type Account ¶
type Account struct { ServerLimit int `json:"server_limit,omitempty"` FloatingIPLimit int `json:"floating_ip_limit,omitempty"` VolumeLimit int `json:"volume_limit,omitempty"` Email string `json:"email,omitempty"` UUID string `json:"uuid,omitempty"` EmailVerified bool `json:"email_verified,omitempty"` Status string `json:"status,omitempty"` StatusMessage string `json:"status_message,omitempty"` }
Account represents a BinaryLane Account
type AccountService ¶
AccountService is an interface for interfacing with the Account endpoints of the BinaryLane API See: https://api.binarylane.com.au/reference/#account
type AccountServiceOp ¶
type AccountServiceOp struct {
// contains filtered or unexported fields
}
AccountServiceOp handles communication with the Account related methods of the BinaryLane API.
type Action ¶
type Action struct { ID int `json:"id"` Status string `json:"status"` Type string `json:"type"` StartedAt *Timestamp `json:"started_at"` CompletedAt *Timestamp `json:"completed_at"` ResourceID int `json:"resource_id"` ResourceType string `json:"resource_type"` Region *Region `json:"region,omitempty"` RegionSlug string `json:"region_slug,omitempty"` }
Action represents a BinaryLane Action
type ActionRequest ¶
type ActionRequest map[string]interface{}
ActionRequest represents BinaryLane Action Request
type ActionsService ¶
type ActionsService interface { List(context.Context, *ListOptions) ([]Action, *Response, error) Get(context.Context, int) (*Action, *Response, error) }
ActionsService handles communction with action related methods of the BinaryLane API: https://api.binarylane.com.au/reference#actions
type ActionsServiceOp ¶
type ActionsServiceOp struct {
// contains filtered or unexported fields
}
ActionsServiceOp handles communition with the image action related methods of the BinaryLane API.
func (*ActionsServiceOp) List ¶
func (s *ActionsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Action, *Response, error)
List all actions
type Address ¶
type Address struct { AddressLine1 string `json:"address_line1"` AddressLine2 string `json:"address_line2"` City string `json:"city"` Region string `json:"region"` PostalCode string `json:"postal_code"` CountryISO2Code string `json:"country_iso2_code"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Address represents the billing address of a customer
type ArgError ¶
type ArgError struct {
// contains filtered or unexported fields
}
ArgError is an error that represents an error with an input. It identifies the argument and the cause (if possible).
func NewArgError ¶
NewArgError creates an InputError.
type BackupWindow ¶
type BackupWindow struct { Start *Timestamp `json:"start,omitempty"` End *Timestamp `json:"end,omitempty"` }
BackupWindow object
type Balance ¶
type Balance struct { MonthToDateBalance string `json:"month_to_date_balance"` AccountBalance string `json:"account_balance"` MonthToDateUsage string `json:"month_to_date_usage"` GeneratedAt time.Time `json:"generated_at"` }
Balance represents a BinaryLane Balance
type BalanceService ¶
BalanceService is an interface for interfacing with the Balance endpoints of the BinaryLane API See: https://api.binarylane.com.au/reference/#balance
type BalanceServiceOp ¶
type BalanceServiceOp struct {
// contains filtered or unexported fields
}
BalanceServiceOp handles communication with the Balance related methods of the BinaryLane API.
type BillingHistory ¶
type BillingHistory struct { BillingHistory []BillingHistoryEntry `json:"billing_history"` Links *Links `json:"links"` Meta *Meta `json:"meta"` }
BillingHistory represents BinaryLane Billing History
func (BillingHistory) String ¶
func (b BillingHistory) String() string
type BillingHistoryEntry ¶
type BillingHistoryEntry struct { Description string `json:"description"` Amount string `json:"amount"` InvoiceID *string `json:"invoice_id"` InvoiceUUID *string `json:"invoice_uuid"` Date time.Time `json:"date"` Type string `json:"type"` }
BillingHistoryEntry represents an entry in a customer's Billing History
type BillingHistoryService ¶
type BillingHistoryService interface {
List(context.Context, *ListOptions) (*BillingHistory, *Response, error)
}
BillingHistoryService is an interface for interfacing with the BillingHistory endpoints of the BinaryLane API See: https://api.binarylane.com.au/reference/#billing_history
type BillingHistoryServiceOp ¶
type BillingHistoryServiceOp struct {
// contains filtered or unexported fields
}
BillingHistoryServiceOp handles communication with the BillingHistory related methods of the BinaryLane API.
func (*BillingHistoryServiceOp) List ¶
func (s *BillingHistoryServiceOp) List(ctx context.Context, opt *ListOptions) (*BillingHistory, *Response, error)
List the Billing History for a customer
type Client ¶
type Client struct { // Base URL for API requests. BaseURL *url.URL // User agent for client UserAgent string // Rate contains the current rate limit for the client as determined by the most recent // API call. It is not thread-safe. Please consider using GetRate() instead. Rate Rate // Services used for communicating with the API Account AccountService Actions ActionsService Balance BalanceService BillingHistory BillingHistoryService Domains DomainsService Servers ServersService ServerActions ServerActionsService Images ImagesService ImageActions ImageActionsService Invoices InvoicesService Keys KeysService Regions RegionsService Sizes SizesService FloatingIPs FloatingIPsService FloatingIPActions FloatingIPActionsService Snapshots SnapshotsService Tags TagsService LoadBalancers LoadBalancersService Firewalls FirewallsService Projects ProjectsService VPCs VPCsService // contains filtered or unexported fields }
Client manages communication with BinaryLane API.
func NewClient ¶
NewClient returns a new BinaryLane API client, using the given http.Client to perform all requests.
Users who wish to pass their own http.Client should use this method. If you're in need of further customization, the binarylane.New method allows more options, such as setting a custom URL or a custom user agent string.
func NewFromToken ¶
NewFromToken returns a new BinaryLane API client with the given API token.
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.
func (*Client) GetRate ¶
GetRate returns the current rate limit for the client as determined by the most recent API call. It is thread-safe.
func (*Client) NewRequest ¶
func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error)
NewRequest creates an API request. A relative URL can be provided in urlStr, which will be resolved to the BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included in as the request body.
func (*Client) OnRequestCompleted ¶
func (c *Client) OnRequestCompleted(rc RequestCompletionCallback)
OnRequestCompleted sets the API request completion callback
type ClientOpt ¶
ClientOpt are options for New.
func SetBaseURL ¶
SetBaseURL is a client option for setting the base URL.
func SetUserAgent ¶
SetUserAgent is a client option for setting the user agent.
type CreateProjectRequest ¶
type CreateProjectRequest struct { Name string `json:"name"` Description string `json:"description"` Purpose string `json:"purpose"` Environment string `json:"environment"` }
CreateProjectRequest represents the request to create a new project.
type CustomImageCreateRequest ¶
type CustomImageCreateRequest struct { Name string `json:"name"` Url string `json:"url"` Region string `json:"region"` Distribution string `json:"distribution,omitempty"` Description string `json:"description,omitempty"` Tags []string `json:"tags,omitempty"` }
CustomImageCreateRequest represents a request to create a custom image.
type Destinations ¶
type Destinations struct { Addresses []string `json:"addresses,omitempty"` Tags []string `json:"tags,omitempty"` ServerIDs []int `json:"server_ids,omitempty"` LoadBalancerUIDs []string `json:"load_balancer_uids,omitempty"` }
Destinations represents Firewall OutboundRule destinations.
type Domain ¶
type Domain struct { Name string `json:"name"` TTL int `json:"ttl"` ZoneFile string `json:"zone_file"` }
Domain represents a BinaryLane domain
type DomainCreateRequest ¶
type DomainCreateRequest struct { Name string `json:"name"` IPAddress string `json:"ip_address,omitempty"` }
DomainCreateRequest respresents a request to create a domain.
type DomainRecord ¶
type DomainRecord struct { ID int `json:"id,float64,omitempty"` Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` Data string `json:"data,omitempty"` Priority int `json:"priority"` Port int `json:"port"` TTL int `json:"ttl,omitempty"` Weight int `json:"weight"` Flags int `json:"flags"` Tag string `json:"tag,omitempty"` }
DomainRecord represents individual record within a domain
func (DomainRecord) String ¶
func (d DomainRecord) String() string
Converts a DomainRecord to a string.
type DomainRecordEditRequest ¶
type DomainRecordEditRequest struct { Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` Data string `json:"data,omitempty"` Priority int `json:"priority"` Port int `json:"port"` TTL int `json:"ttl,omitempty"` Weight int `json:"weight"` Flags int `json:"flags"` Tag string `json:"tag,omitempty"` }
DomainRecordEditRequest represents a request to update a domain record.
func (DomainRecordEditRequest) String ¶
func (d DomainRecordEditRequest) String() string
Converts a DomainRecordEditRequest to a string.
type DomainsService ¶
type DomainsService interface { List(context.Context, *ListOptions) ([]Domain, *Response, error) Get(context.Context, string) (*Domain, *Response, error) Create(context.Context, *DomainCreateRequest) (*Domain, *Response, error) Delete(context.Context, string) (*Response, error) Records(context.Context, string, *ListOptions) ([]DomainRecord, *Response, error) RecordsByType(context.Context, string, string, *ListOptions) ([]DomainRecord, *Response, error) RecordsByName(context.Context, string, string, *ListOptions) ([]DomainRecord, *Response, error) RecordsByTypeAndName(context.Context, string, string, string, *ListOptions) ([]DomainRecord, *Response, error) Record(context.Context, string, int) (*DomainRecord, *Response, error) DeleteRecord(context.Context, string, int) (*Response, error) EditRecord(context.Context, string, int, *DomainRecordEditRequest) (*DomainRecord, *Response, error) CreateRecord(context.Context, string, *DomainRecordEditRequest) (*DomainRecord, *Response, error) }
DomainsService is an interface for managing DNS with the BinaryLane API. See: https://api.binarylane.com.au/reference#domains and https://api.binarylane.com.au/reference#domain-records
type DomainsServiceOp ¶
type DomainsServiceOp struct {
// contains filtered or unexported fields
}
DomainsServiceOp handles communication with the domain related methods of the BinaryLane API.
func (*DomainsServiceOp) Create ¶
func (s *DomainsServiceOp) Create(ctx context.Context, createRequest *DomainCreateRequest) (*Domain, *Response, error)
Create a new domain
func (*DomainsServiceOp) CreateRecord ¶
func (s *DomainsServiceOp) CreateRecord(ctx context.Context, domain string, createRequest *DomainRecordEditRequest) (*DomainRecord, *Response, error)
CreateRecord creates a record using a DomainRecordEditRequest
func (*DomainsServiceOp) DeleteRecord ¶
func (s *DomainsServiceOp) DeleteRecord(ctx context.Context, domain string, id int) (*Response, error)
DeleteRecord deletes a record from a domain identified by id
func (*DomainsServiceOp) EditRecord ¶
func (s *DomainsServiceOp) EditRecord(ctx context.Context, domain string, id int, editRequest *DomainRecordEditRequest, ) (*DomainRecord, *Response, error)
EditRecord edits a record using a DomainRecordEditRequest
func (DomainsServiceOp) List ¶
func (s DomainsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Domain, *Response, error)
List all domains.
func (*DomainsServiceOp) Record ¶
func (s *DomainsServiceOp) Record(ctx context.Context, domain string, id int) (*DomainRecord, *Response, error)
Record returns the record id from a domain
func (*DomainsServiceOp) Records ¶
func (s *DomainsServiceOp) Records(ctx context.Context, domain string, opt *ListOptions) ([]DomainRecord, *Response, error)
Records returns a slice of DomainRecord for a domain.
func (*DomainsServiceOp) RecordsByName ¶
func (s *DomainsServiceOp) RecordsByName(ctx context.Context, domain, name string, opt *ListOptions) ([]DomainRecord, *Response, error)
RecordsByName returns a slice of DomainRecord for a domain matched by record name.
func (*DomainsServiceOp) RecordsByType ¶
func (s *DomainsServiceOp) RecordsByType(ctx context.Context, domain, ofType string, opt *ListOptions) ([]DomainRecord, *Response, error)
RecordsByType returns a slice of DomainRecord for a domain matched by record type.
func (*DomainsServiceOp) RecordsByTypeAndName ¶
func (s *DomainsServiceOp) RecordsByTypeAndName(ctx context.Context, domain, ofType, name string, opt *ListOptions) ([]DomainRecord, *Response, error)
RecordsByTypeAndName returns a slice of DomainRecord for a domain matched by record type and name.
type ErrorResponse ¶
type ErrorResponse struct { // HTTP response that caused this error Response *http.Response // Error message Message string `json:"message"` // RequestID returned from the API, useful to contact support. RequestID string `json:"request_id"` }
An ErrorResponse reports the error caused by an API request
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type Firewall ¶
type Firewall struct { ID string `json:"id"` Name string `json:"name"` Status string `json:"status"` InboundRules []InboundRule `json:"inbound_rules"` OutboundRules []OutboundRule `json:"outbound_rules"` ServerIDs []int `json:"server_ids"` Tags []string `json:"tags"` Created string `json:"created_at"` PendingChanges []PendingChange `json:"pending_changes"` }
Firewall represents a BinaryLane Firewall configuration.
type FirewallRequest ¶
type FirewallRequest struct { Name string `json:"name"` InboundRules []InboundRule `json:"inbound_rules"` OutboundRules []OutboundRule `json:"outbound_rules"` ServerIDs []int `json:"server_ids"` Tags []string `json:"tags"` }
FirewallRequest represents the configuration to be applied to an existing or a new Firewall.
type FirewallRulesRequest ¶
type FirewallRulesRequest struct { InboundRules []InboundRule `json:"inbound_rules"` OutboundRules []OutboundRule `json:"outbound_rules"` }
FirewallRulesRequest represents rules configuration to be applied to an existing Firewall.
type FirewallsService ¶
type FirewallsService interface { Get(context.Context, string) (*Firewall, *Response, error) Create(context.Context, *FirewallRequest) (*Firewall, *Response, error) Update(context.Context, string, *FirewallRequest) (*Firewall, *Response, error) Delete(context.Context, string) (*Response, error) List(context.Context, *ListOptions) ([]Firewall, *Response, error) ListByServer(context.Context, int, *ListOptions) ([]Firewall, *Response, error) AddServers(context.Context, string, ...int) (*Response, error) RemoveServers(context.Context, string, ...int) (*Response, error) AddTags(context.Context, string, ...string) (*Response, error) RemoveTags(context.Context, string, ...string) (*Response, error) AddRules(context.Context, string, *FirewallRulesRequest) (*Response, error) RemoveRules(context.Context, string, *FirewallRulesRequest) (*Response, error) }
FirewallsService is an interface for managing Firewalls with the BinaryLane API. See: https://api.binarylane.com.au/reference/#firewalls
type FirewallsServiceOp ¶
type FirewallsServiceOp struct {
// contains filtered or unexported fields
}
FirewallsServiceOp handles communication with Firewalls methods of the BinaryLane API.
func (*FirewallsServiceOp) AddRules ¶
func (fw *FirewallsServiceOp) AddRules(ctx context.Context, fID string, rr *FirewallRulesRequest) (*Response, error)
AddRules to a Firewall.
func (*FirewallsServiceOp) AddServers ¶
func (fw *FirewallsServiceOp) AddServers(ctx context.Context, fID string, serverIDs ...int) (*Response, error)
AddServers to a Firewall.
func (*FirewallsServiceOp) AddTags ¶
func (fw *FirewallsServiceOp) AddTags(ctx context.Context, fID string, tags ...string) (*Response, error)
AddTags to a Firewall.
func (*FirewallsServiceOp) Create ¶
func (fw *FirewallsServiceOp) Create(ctx context.Context, fr *FirewallRequest) (*Firewall, *Response, error)
Create a new Firewall with a given configuration.
func (*FirewallsServiceOp) List ¶
func (fw *FirewallsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Firewall, *Response, error)
List Firewalls.
func (*FirewallsServiceOp) ListByServer ¶
func (fw *FirewallsServiceOp) ListByServer(ctx context.Context, sID int, opt *ListOptions) ([]Firewall, *Response, error)
ListByServer Firewalls.
func (*FirewallsServiceOp) RemoveRules ¶
func (fw *FirewallsServiceOp) RemoveRules(ctx context.Context, fID string, rr *FirewallRulesRequest) (*Response, error)
RemoveRules from a Firewall.
func (*FirewallsServiceOp) RemoveServers ¶
func (fw *FirewallsServiceOp) RemoveServers(ctx context.Context, fID string, serverIDs ...int) (*Response, error)
RemoveServers from a Firewall.
func (*FirewallsServiceOp) RemoveTags ¶
func (fw *FirewallsServiceOp) RemoveTags(ctx context.Context, fID string, tags ...string) (*Response, error)
RemoveTags from a Firewall.
func (*FirewallsServiceOp) Update ¶
func (fw *FirewallsServiceOp) Update(ctx context.Context, fID string, fr *FirewallRequest) (*Firewall, *Response, error)
Update an existing Firewall with new configuration.
type FloatingIP ¶
type FloatingIP struct { Region *Region `json:"region"` Server *Server `json:"server"` IP string `json:"ip"` }
FloatingIP represents a BinaryLane floating IP.
func (FloatingIP) String ¶
func (f FloatingIP) String() string
func (FloatingIP) URN ¶
func (f FloatingIP) URN() string
URN returns the floating IP in a valid BL API URN form.
type FloatingIPActionsService ¶
type FloatingIPActionsService interface { Assign(ctx context.Context, ip string, serverID int) (*Action, *Response, error) Unassign(ctx context.Context, ip string) (*Action, *Response, error) Get(ctx context.Context, ip string, actionID int) (*Action, *Response, error) List(ctx context.Context, ip string, opt *ListOptions) ([]Action, *Response, error) }
FloatingIPActionsService is an interface for interfacing with the floating IPs actions endpoints of the BinaryLane API. See: https://api.binarylane.com.au/reference#floating-ips-action
type FloatingIPActionsServiceOp ¶
type FloatingIPActionsServiceOp struct {
// contains filtered or unexported fields
}
FloatingIPActionsServiceOp handles communication with the floating IPs action related methods of the BinaryLane API.
func (*FloatingIPActionsServiceOp) Assign ¶
func (s *FloatingIPActionsServiceOp) Assign(ctx context.Context, ip string, serverID int) (*Action, *Response, error)
Assign a floating IP to a server.
func (*FloatingIPActionsServiceOp) Get ¶
func (s *FloatingIPActionsServiceOp) Get(ctx context.Context, ip string, actionID int) (*Action, *Response, error)
Get an action for a particular floating IP by id.
func (*FloatingIPActionsServiceOp) List ¶
func (s *FloatingIPActionsServiceOp) List(ctx context.Context, ip string, opt *ListOptions) ([]Action, *Response, error)
List the actions for a particular floating IP.
type FloatingIPCreateRequest ¶
type FloatingIPCreateRequest struct { Region string `json:"region"` ServerID int `json:"server_id,omitempty"` }
FloatingIPCreateRequest represents a request to create a floating IP. If ServerId is not empty, the floating IP will be assigned to the server.
type FloatingIPsService ¶
type FloatingIPsService interface { List(context.Context, *ListOptions) ([]FloatingIP, *Response, error) Get(context.Context, string) (*FloatingIP, *Response, error) Create(context.Context, *FloatingIPCreateRequest) (*FloatingIP, *Response, error) Delete(context.Context, string) (*Response, error) }
FloatingIPsService is an interface for interfacing with the floating IPs endpoints of the BinaryLane API. See: https://api.binarylane.com.au/reference#floating-ips
type FloatingIPsServiceOp ¶
type FloatingIPsServiceOp struct {
// contains filtered or unexported fields
}
FloatingIPsServiceOp handles communication with the floating IPs related methods of the BinaryLane API.
func (*FloatingIPsServiceOp) Create ¶
func (f *FloatingIPsServiceOp) Create(ctx context.Context, createRequest *FloatingIPCreateRequest) (*FloatingIP, *Response, error)
Create a floating IP. If the ServerID field of the request is not empty, the floating IP will also be assigned to the server.
func (*FloatingIPsServiceOp) Get ¶
func (f *FloatingIPsServiceOp) Get(ctx context.Context, ip string) (*FloatingIP, *Response, error)
Get an individual floating IP.
func (*FloatingIPsServiceOp) List ¶
func (f *FloatingIPsServiceOp) List(ctx context.Context, opt *ListOptions) ([]FloatingIP, *Response, error)
List all floating IPs.
type ForwardingRule ¶
type ForwardingRule struct { EntryProtocol string `json:"entry_protocol,omitempty"` EntryPort int `json:"entry_port,omitempty"` TargetProtocol string `json:"target_protocol,omitempty"` TargetPort int `json:"target_port,omitempty"` CertificateID string `json:"certificate_id,omitempty"` TlsPassthrough bool `json:"tls_passthrough,omitempty"` }
ForwardingRule represents load balancer forwarding rules.
func (ForwardingRule) String ¶
func (f ForwardingRule) String() string
String creates a human-readable description of a ForwardingRule.
type HealthCheck ¶
type HealthCheck struct { Protocol string `json:"protocol,omitempty"` Port int `json:"port,omitempty"` Path string `json:"path,omitempty"` CheckIntervalSeconds int `json:"check_interval_seconds,omitempty"` ResponseTimeoutSeconds int `json:"response_timeout_seconds,omitempty"` HealthyThreshold int `json:"healthy_threshold,omitempty"` UnhealthyThreshold int `json:"unhealthy_threshold,omitempty"` }
HealthCheck represents optional load balancer health check rules.
func (HealthCheck) String ¶
func (h HealthCheck) String() string
String creates a human-readable description of a HealthCheck.
type Image ¶
type Image struct { ID int `json:"id,float64,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Distribution string `json:"distribution,omitempty"` Slug string `json:"slug,omitempty"` Public bool `json:"public,omitempty"` Regions []string `json:"regions,omitempty"` MinDiskSize int `json:"min_disk_size,omitempty"` SizeGigaBytes float64 `json:"size_gigabytes,omitempty"` Created string `json:"created_at,omitempty"` Description string `json:"description,omitempty"` Tags []string `json:"tags,omitempty"` Status string `json:"status,omitempty"` ErrorMessage string `json:"error_message,omitempty"` }
Image represents a BinaryLane Image
type ImageActionsService ¶
type ImageActionsService interface { Get(context.Context, int, int) (*Action, *Response, error) Transfer(context.Context, int, *ActionRequest) (*Action, *Response, error) Convert(context.Context, int) (*Action, *Response, error) }
ImageActionsService is an interface for interfacing with the image actions endpoints of the BinaryLane API See: https://api.binarylane.com.au/reference#image-actions
type ImageActionsServiceOp ¶
type ImageActionsServiceOp struct {
// contains filtered or unexported fields
}
ImageActionsServiceOp handles communition with the image action related methods of the BinaryLane API.
func (*ImageActionsServiceOp) Convert ¶
func (i *ImageActionsServiceOp) Convert(ctx context.Context, imageID int) (*Action, *Response, error)
Convert an image to a snapshot
func (*ImageActionsServiceOp) Get ¶
func (i *ImageActionsServiceOp) Get(ctx context.Context, imageID, actionID int) (*Action, *Response, error)
Get an action for a particular image by id.
func (*ImageActionsServiceOp) Transfer ¶
func (i *ImageActionsServiceOp) Transfer(ctx context.Context, imageID int, transferRequest *ActionRequest) (*Action, *Response, error)
Transfer an image
type ImageUpdateRequest ¶
type ImageUpdateRequest struct {
Name string `json:"name"`
}
ImageUpdateRequest represents a request to update an image.
type ImagesService ¶
type ImagesService interface { List(context.Context, *ListOptions) ([]Image, *Response, error) ListDistribution(ctx context.Context, opt *ListOptions) ([]Image, *Response, error) ListApplication(ctx context.Context, opt *ListOptions) ([]Image, *Response, error) ListUser(ctx context.Context, opt *ListOptions) ([]Image, *Response, error) ListByTag(ctx context.Context, tag string, opt *ListOptions) ([]Image, *Response, error) GetByID(context.Context, int) (*Image, *Response, error) GetBySlug(context.Context, string) (*Image, *Response, error) Create(context.Context, *CustomImageCreateRequest) (*Image, *Response, error) Update(context.Context, int, *ImageUpdateRequest) (*Image, *Response, error) Delete(context.Context, int) (*Response, error) }
ImagesService is an interface for interfacing with the images endpoints of the BinaryLane API See: https://api.binarylane.com.au/reference#images
type ImagesServiceOp ¶
type ImagesServiceOp struct {
// contains filtered or unexported fields
}
ImagesServiceOp handles communication with the image related methods of the BinaryLane API.
func (*ImagesServiceOp) Create ¶
func (s *ImagesServiceOp) Create(ctx context.Context, createRequest *CustomImageCreateRequest) (*Image, *Response, error)
Create a new image
func (*ImagesServiceOp) List ¶
func (s *ImagesServiceOp) List(ctx context.Context, opt *ListOptions) ([]Image, *Response, error)
List lists all the images available.
func (*ImagesServiceOp) ListApplication ¶
func (s *ImagesServiceOp) ListApplication(ctx context.Context, opt *ListOptions) ([]Image, *Response, error)
ListApplication lists all the application images.
func (*ImagesServiceOp) ListByTag ¶
func (s *ImagesServiceOp) ListByTag(ctx context.Context, tag string, opt *ListOptions) ([]Image, *Response, error)
ListByTag lists all images with a specific tag applied.
func (*ImagesServiceOp) ListDistribution ¶
func (s *ImagesServiceOp) ListDistribution(ctx context.Context, opt *ListOptions) ([]Image, *Response, error)
ListDistribution lists all the distribution images.
func (*ImagesServiceOp) ListUser ¶
func (s *ImagesServiceOp) ListUser(ctx context.Context, opt *ListOptions) ([]Image, *Response, error)
ListUser lists all the user images.
func (*ImagesServiceOp) Update ¶
func (s *ImagesServiceOp) Update(ctx context.Context, imageID int, updateRequest *ImageUpdateRequest) (*Image, *Response, error)
Update an image name.
type InboundRule ¶
type InboundRule struct { Protocol string `json:"protocol,omitempty"` PortRange string `json:"ports,omitempty"` Sources *Sources `json:"sources"` }
InboundRule represents a Firewall inbound rule.
type Invoice ¶
type Invoice struct { InvoiceItems []InvoiceItem `json:"invoice_items"` Links *Links `json:"links"` Meta *Meta `json:"meta"` }
Invoice represents a BinaryLane Invoice
type InvoiceItem ¶
type InvoiceItem struct { Product string `json:"product"` ResourceID string `json:"resource_id"` ResourceUUID string `json:"resource_uuid"` GroupDescription string `json:"group_description"` Description string `json:"description"` Amount string `json:"amount"` Duration string `json:"duration"` DurationUnit string `json:"duration_unit"` StartTime time.Time `json:"start_time"` EndTime time.Time `json:"end_time"` ProjectName string `json:"project_name"` Category string `json:"category"` }
InvoiceItem represents individual line-item on an Invoice
type InvoiceList ¶
type InvoiceList struct { Invoices []InvoiceListItem `json:"invoices"` InvoicePreview InvoiceListItem `json:"invoice_preview"` Links *Links `json:"links"` Meta *Meta `json:"meta"` }
InvoiceList contains a paginated list of all of a customer's invoices. The InvoicePreview is the month-to-date usage.
type InvoiceListItem ¶
type InvoiceListItem struct { InvoiceUUID string `json:"invoice_uuid"` Amount string `json:"amount"` InvoicePeriod string `json:"invoice_period"` UpdatedAt time.Time `json:"updated_at"` }
InvoiceListItem contains a small list of information about a customer's invoice. More information can be found in the Invoice or InvoiceSummary
type InvoiceSummary ¶
type InvoiceSummary struct { InvoiceUUID string `json:"invoice_uuid"` BillingPeriod string `json:"billing_period"` Amount string `json:"amount"` UserName string `json:"user_name"` UserBillingAddress Address `json:"user_billing_address"` UserCompany string `json:"user_company"` UserEmail string `json:"user_email"` ProductCharges InvoiceSummaryBreakdown `json:"product_charges"` Overages InvoiceSummaryBreakdown `json:"overages"` Taxes InvoiceSummaryBreakdown `json:"taxes"` CreditsAndAdjustments InvoiceSummaryBreakdown `json:"credits_and_adjustments"` }
InvoiceSummary contains metadata and summarized usage for an invoice.
type InvoiceSummaryBreakdown ¶
type InvoiceSummaryBreakdown struct { Name string `json:"name"` Amount string `json:"amount"` Items []InvoiceSummaryBreakdownItem `json:"items"` }
InvoiceSummaryBreakdown is a grouped set of InvoiceItems from an invoice
type InvoiceSummaryBreakdownItem ¶
type InvoiceSummaryBreakdownItem struct { Name string `json:"name"` Amount string `json:"amount"` Count string `json:"count"` }
InvoiceSummaryBreakdownItem further breaks down the InvoiceSummary by product
type InvoicesService ¶
type InvoicesService interface { Get(context.Context, string, *ListOptions) (*Invoice, *Response, error) GetPDF(context.Context, string) ([]byte, *Response, error) GetCSV(context.Context, string) ([]byte, *Response, error) List(context.Context, *ListOptions) (*InvoiceList, *Response, error) GetSummary(context.Context, string) (*InvoiceSummary, *Response, error) }
InvoicesService is an interface for interfacing with the Invoice endpoints of the BinaryLane API See: https://api.binarylane.com.au/reference/#invoices
type InvoicesServiceOp ¶
type InvoicesServiceOp struct {
// contains filtered or unexported fields
}
InvoicesServiceOp handles communication with the Invoice related methods of the BinaryLane API.
func (*InvoicesServiceOp) Get ¶
func (s *InvoicesServiceOp) Get(ctx context.Context, invoiceUUID string, opt *ListOptions) (*Invoice, *Response, error)
Get detailed invoice items for an Invoice
func (*InvoicesServiceOp) GetCSV ¶
func (s *InvoicesServiceOp) GetCSV(ctx context.Context, invoiceUUID string) ([]byte, *Response, error)
GetCSV returns the csv for an Invoice
func (*InvoicesServiceOp) GetPDF ¶
func (s *InvoicesServiceOp) GetPDF(ctx context.Context, invoiceUUID string) ([]byte, *Response, error)
GetPDF returns the pdf for an Invoice
func (*InvoicesServiceOp) GetSummary ¶
func (s *InvoicesServiceOp) GetSummary(ctx context.Context, invoiceUUID string) (*InvoiceSummary, *Response, error)
GetSummary returns a summary of metadata and summarized usage for an Invoice
func (*InvoicesServiceOp) List ¶
func (s *InvoicesServiceOp) List(ctx context.Context, opt *ListOptions) (*InvoiceList, *Response, error)
List invoices for a customer
type Kernel ¶
type Kernel struct { ID int `json:"id,float64,omitempty"` Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` }
Kernel object
type Key ¶
type Key struct { ID int `json:"id,float64,omitempty"` Name string `json:"name,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` PublicKey string `json:"public_key,omitempty"` }
Key represents a BinaryLane Key.
type KeyCreateRequest ¶
KeyCreateRequest represents a request to create a new key.
type KeyUpdateRequest ¶
type KeyUpdateRequest struct {
Name string `json:"name"`
}
KeyUpdateRequest represents a request to update a key.
type KeysService ¶
type KeysService interface { List(context.Context, *ListOptions) ([]Key, *Response, error) GetByID(context.Context, int) (*Key, *Response, error) GetByFingerprint(context.Context, string) (*Key, *Response, error) Create(context.Context, *KeyCreateRequest) (*Key, *Response, error) UpdateByID(context.Context, int, *KeyUpdateRequest) (*Key, *Response, error) UpdateByFingerprint(context.Context, string, *KeyUpdateRequest) (*Key, *Response, error) DeleteByID(context.Context, int) (*Response, error) DeleteByFingerprint(context.Context, string) (*Response, error) }
KeysService is an interface for interfacing with the keys endpoints of the BinaryLane API See: https://api.binarylane.com.au/reference#keys
type KeysServiceOp ¶
type KeysServiceOp struct {
// contains filtered or unexported fields
}
KeysServiceOp handles communication with key related method of the BinaryLane API.
func (*KeysServiceOp) Create ¶
func (s *KeysServiceOp) Create(ctx context.Context, createRequest *KeyCreateRequest) (*Key, *Response, error)
Create a key using a KeyCreateRequest
func (*KeysServiceOp) DeleteByFingerprint ¶
func (s *KeysServiceOp) DeleteByFingerprint(ctx context.Context, fingerprint string) (*Response, error)
DeleteByFingerprint deletes a key by its fingerprint
func (*KeysServiceOp) DeleteByID ¶
DeleteByID deletes a key by its id
func (*KeysServiceOp) GetByFingerprint ¶
func (s *KeysServiceOp) GetByFingerprint(ctx context.Context, fingerprint string) (*Key, *Response, error)
GetByFingerprint gets a Key by by fingerprint
func (*KeysServiceOp) List ¶
func (s *KeysServiceOp) List(ctx context.Context, opt *ListOptions) ([]Key, *Response, error)
List all keys
func (*KeysServiceOp) UpdateByFingerprint ¶
func (s *KeysServiceOp) UpdateByFingerprint(ctx context.Context, fingerprint string, updateRequest *KeyUpdateRequest) (*Key, *Response, error)
UpdateByFingerprint updates a key name by fingerprint.
func (*KeysServiceOp) UpdateByID ¶
func (s *KeysServiceOp) UpdateByID(ctx context.Context, keyID int, updateRequest *KeyUpdateRequest) (*Key, *Response, error)
UpdateByID updates a key name by ID.
type LinkAction ¶
type LinkAction struct { ID int `json:"id,omitempty"` Rel string `json:"rel,omitempty"` HREF string `json:"href,omitempty"` }
LinkAction is a pointer to an action
type Links ¶
type Links struct { Pages *Pages `json:"pages,omitempty"` Actions []LinkAction `json:"actions,omitempty"` }
Links manages links that are returned along with a List
func (*Links) CurrentPage ¶
CurrentPage is current page of the list
func (*Links) IsLastPage ¶
IsLastPage returns true if the current page is the last
type ListOptions ¶
type ListOptions struct { // For paginated result sets, page of results to retrieve. Page int `url:"page,omitempty"` // For paginated result sets, the number of results to include per page. PerPage int `url:"per_page,omitempty"` }
ListOptions specifies the optional parameters to various List methods that support pagination.
type LoadBalancer ¶
type LoadBalancer struct { ID int `json:"id,float64,omitempty"` Name string `json:"name,omitempty"` IP string `json:"ip,omitempty"` SizeSlug string `json:"size,omitempty"` Algorithm string `json:"algorithm,omitempty"` Status string `json:"status,omitempty"` Created string `json:"created_at,omitempty"` ForwardingRules []ForwardingRule `json:"forwarding_rules,omitempty"` HealthCheck *HealthCheck `json:"health_check,omitempty"` StickySessions *StickySessions `json:"sticky_sessions,omitempty"` Region *Region `json:"region,omitempty"` ServerIDs []int `json:"server_ids,omitempty"` Tag string `json:"tag,omitempty"` Tags []string `json:"tags,omitempty"` RedirectHttpToHttps bool `json:"redirect_http_to_https,omitempty"` EnableProxyProtocol bool `json:"enable_proxy_protocol,omitempty"` EnableBackendKeepalive bool `json:"enable_backend_keepalive,omitempty"` VPCID int `json:"vpc_id,float64,omitempty"` }
LoadBalancer represents a BinaryLane load balancer configuration. Tags can only be provided upon the creation of a Load Balancer.
func (LoadBalancer) AsRequest ¶
func (l LoadBalancer) AsRequest() *LoadBalancerRequest
AsRequest creates a LoadBalancerRequest that can be submitted to Update with the current values of the LoadBalancer. Modifying the returned LoadBalancerRequest will not modify the original LoadBalancer.
func (LoadBalancer) String ¶
func (l LoadBalancer) String() string
String creates a human-readable description of a LoadBalancer.
func (LoadBalancer) URN ¶
func (l LoadBalancer) URN() string
URN returns the load balancer ID in a valid BL API URN form.
type LoadBalancerRequest ¶
type LoadBalancerRequest struct { Name string `json:"name,omitempty"` Algorithm string `json:"algorithm,omitempty"` Region string `json:"region,omitempty"` SizeSlug string `json:"size,omitempty"` ForwardingRules []ForwardingRule `json:"forwarding_rules,omitempty"` HealthCheck *HealthCheck `json:"health_check,omitempty"` StickySessions *StickySessions `json:"sticky_sessions,omitempty"` ServerIDs []int `json:"server_ids,omitempty"` Tag string `json:"tag,omitempty"` Tags []string `json:"tags,omitempty"` RedirectHttpToHttps bool `json:"redirect_http_to_https,omitempty"` EnableProxyProtocol bool `json:"enable_proxy_protocol,omitempty"` EnableBackendKeepalive bool `json:"enable_backend_keepalive,omitempty"` VPCID int `json:"vpc_id,omitempty"` }
LoadBalancerRequest represents the configuration to be applied to an existing or a new load balancer.
func (LoadBalancerRequest) String ¶
func (l LoadBalancerRequest) String() string
String creates a human-readable description of a LoadBalancerRequest.
type LoadBalancersService ¶
type LoadBalancersService interface { Get(context.Context, int) (*LoadBalancer, *Response, error) List(context.Context, *ListOptions) ([]LoadBalancer, *Response, error) Create(context.Context, *LoadBalancerRequest) (*LoadBalancer, *Response, error) Update(ctx context.Context, lbID int, lbr *LoadBalancerRequest) (*LoadBalancer, *Response, error) Delete(ctx context.Context, lbID int) (*Response, error) AddServers(ctx context.Context, lbID int, serverIDs ...int) (*Response, error) RemoveServers(ctx context.Context, lbID int, serverIDs ...int) (*Response, error) AddForwardingRules(ctx context.Context, lbID int, rules ...ForwardingRule) (*Response, error) RemoveForwardingRules(ctx context.Context, lbID int, rules ...ForwardingRule) (*Response, error) }
LoadBalancersService is an interface for managing load balancers with the BinaryLane API. See: https://api.binarylane.com.au/reference#load-balancers
type LoadBalancersServiceOp ¶
type LoadBalancersServiceOp struct {
// contains filtered or unexported fields
}
LoadBalancersServiceOp handles communication with load balancer-related methods of the BinaryLane API.
func (*LoadBalancersServiceOp) AddForwardingRules ¶
func (l *LoadBalancersServiceOp) AddForwardingRules(ctx context.Context, lbID int, rules ...ForwardingRule) (*Response, error)
AddForwardingRules adds forwarding rules to a load balancer.
func (*LoadBalancersServiceOp) AddServers ¶
func (l *LoadBalancersServiceOp) AddServers(ctx context.Context, lbID int, serverIDs ...int) (*Response, error)
AddServers adds servers to a load balancer.
func (*LoadBalancersServiceOp) Create ¶
func (l *LoadBalancersServiceOp) Create(ctx context.Context, lbr *LoadBalancerRequest) (*LoadBalancer, *Response, error)
Create a new load balancer with a given configuration.
func (*LoadBalancersServiceOp) Get ¶
func (l *LoadBalancersServiceOp) Get(ctx context.Context, lbID int) (*LoadBalancer, *Response, error)
Get an existing load balancer by its identifier.
func (*LoadBalancersServiceOp) List ¶
func (l *LoadBalancersServiceOp) List(ctx context.Context, opt *ListOptions) ([]LoadBalancer, *Response, error)
List load balancers, with optional pagination.
func (*LoadBalancersServiceOp) RemoveForwardingRules ¶
func (l *LoadBalancersServiceOp) RemoveForwardingRules(ctx context.Context, lbID int, rules ...ForwardingRule) (*Response, error)
RemoveForwardingRules removes forwarding rules from a load balancer.
func (*LoadBalancersServiceOp) RemoveServers ¶
func (l *LoadBalancersServiceOp) RemoveServers(ctx context.Context, lbID int, serverIDs ...int) (*Response, error)
RemoveServers removes servers from a load balancer.
func (*LoadBalancersServiceOp) Update ¶
func (l *LoadBalancersServiceOp) Update(ctx context.Context, lbID int, lbr *LoadBalancerRequest) (*LoadBalancer, *Response, error)
Update an existing load balancer with new configuration.
type Meta ¶
type Meta struct {
Total int `json:"total"`
}
Meta describes generic information about a response.
type NetworkV4 ¶
type NetworkV4 struct { IPAddress string `json:"ip_address,omitempty"` Netmask string `json:"netmask,omitempty"` Gateway string `json:"gateway,omitempty"` Type string `json:"type,omitempty"` }
NetworkV4 represents a BinaryLane IPv4 Network.
type NetworkV6 ¶
type NetworkV6 struct { IPAddress string `json:"ip_address,omitempty"` Netmask int `json:"netmask,omitempty"` Gateway string `json:"gateway,omitempty"` Type string `json:"type,omitempty"` }
NetworkV6 represents a BinaryLane IPv6 network.
type OutboundRule ¶
type OutboundRule struct { Protocol string `json:"protocol,omitempty"` PortRange string `json:"ports,omitempty"` Destinations *Destinations `json:"destinations"` }
OutboundRule represents a Firewall outbound rule.
type Pages ¶
type Pages struct { First string `json:"first,omitempty"` Prev string `json:"prev,omitempty"` Last string `json:"last,omitempty"` Next string `json:"next,omitempty"` }
Pages are pages specified in Links
type PendingChange ¶
type PendingChange struct { ServerID int `json:"server_id,omitempty"` Removing bool `json:"removing,omitempty"` Status string `json:"status,omitempty"` }
PendingChange represents Firewall status details.
type Project ¶
type Project struct { ID string `json:"id"` OwnerUUID string `json:"owner_uuid"` OwnerID uint64 `json:"owner_id"` Name string `json:"name"` Description string `json:"description"` Purpose string `json:"purpose"` Environment string `json:"environment"` IsDefault bool `json:"is_default"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
Project represents a BinaryLane Project configuration.
type ProjectResource ¶
type ProjectResource struct { URN string `json:"urn"` AssignedAt string `json:"assigned_at"` Links *ProjectResourceLinks `json:"links"` Status string `json:"status,omitempty"` }
ProjectResource is the projects API's representation of a resource.
type ProjectResourceLinks ¶
type ProjectResourceLinks struct {
Self string `json:"self"`
}
ProjectResourceLinks specify the link for more information about the resource.
type ProjectsService ¶
type ProjectsService interface { List(context.Context, *ListOptions) ([]Project, *Response, error) GetDefault(context.Context) (*Project, *Response, error) Get(context.Context, string) (*Project, *Response, error) Create(context.Context, *CreateProjectRequest) (*Project, *Response, error) Update(context.Context, string, *UpdateProjectRequest) (*Project, *Response, error) Delete(context.Context, string) (*Response, error) ListResources(context.Context, string, *ListOptions) ([]ProjectResource, *Response, error) AssignResources(context.Context, string, ...interface{}) ([]ProjectResource, *Response, error) }
ProjectsService is an interface for creating and managing Projects with the BinaryLane API. See: https://api.binarylane.com.au/reference/#projects
type ProjectsServiceOp ¶
type ProjectsServiceOp struct {
// contains filtered or unexported fields
}
ProjectsServiceOp handles communication with Projects methods of the BinaryLane API.
func (*ProjectsServiceOp) AssignResources ¶
func (p *ProjectsServiceOp) AssignResources(ctx context.Context, projectID string, resources ...interface{}) ([]ProjectResource, *Response, error)
AssignResources assigns one or more resources to a project. AssignResources accepts resources in two possible formats:
- The resource type, like `&Server{ID: 1}` or `&FloatingIP{IP: "1.2.3.4"}`
- A valid BL URN as a string, like "bl:server:1234"
There is no unassign. To move a resource to another project, just assign it to that other project.
func (*ProjectsServiceOp) Create ¶
func (p *ProjectsServiceOp) Create(ctx context.Context, cr *CreateProjectRequest) (*Project, *Response, error)
Create a new project.
func (*ProjectsServiceOp) Delete ¶
Delete an existing project. You cannot have any resources in a project before deleting it. See the API documentation for more details.
func (*ProjectsServiceOp) GetDefault ¶
GetDefault project.
func (*ProjectsServiceOp) List ¶
func (p *ProjectsServiceOp) List(ctx context.Context, opts *ListOptions) ([]Project, *Response, error)
List Projects.
func (*ProjectsServiceOp) ListResources ¶
func (p *ProjectsServiceOp) ListResources(ctx context.Context, projectID string, opts *ListOptions) ([]ProjectResource, *Response, error)
ListResources lists all resources in a project.
func (*ProjectsServiceOp) Update ¶
func (p *ProjectsServiceOp) Update(ctx context.Context, projectID string, ur *UpdateProjectRequest) (*Project, *Response, error)
Update an existing project.
type Rate ¶
type Rate struct { // The number of request per hour the client is currently limited to. Limit int `json:"limit"` // The number of remaining requests the client can make this hour. Remaining int `json:"remaining"` // The time at which the current rate limit will reset. Reset Timestamp `json:"reset"` }
Rate contains the rate limit for the current client.
type Region ¶
type Region struct { Slug string `json:"slug,omitempty"` Name string `json:"name,omitempty"` Sizes []string `json:"sizes,omitempty"` Available bool `json:"available,omitempty"` Features []string `json:"features,omitempty"` }
Region represents a BinaryLane Region
type RegionsService ¶
RegionsService is an interface for interfacing with the regions endpoints of the BinaryLane API See: https://api.binarylane.com.au/reference#regions
type RegionsServiceOp ¶
type RegionsServiceOp struct {
// contains filtered or unexported fields
}
RegionsServiceOp handles communication with the region related methods of the BinaryLane API.
func (*RegionsServiceOp) List ¶
func (s *RegionsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Region, *Response, error)
List all regions
type RequestCompletionCallback ¶
RequestCompletionCallback defines the type of the request callback function
type Resource ¶
type Resource struct { ID string `json:"resource_id,omitempty"` Type ResourceType `json:"resource_type,omitempty"` }
Resource represent a single resource for associating/disassociating with tags
type ResourceType ¶
type ResourceType string
ResourceType represents a class of resource, currently only server are supported
const ( // ServerResourceType holds the string representing our ResourceType of Server. ServerResourceType ResourceType = "server" // ImageResourceType holds the string representing our ResourceType of Image. ImageResourceType ResourceType = "image" // VolumeResourceType holds the string representing our ResourceType of Volume. VolumeResourceType ResourceType = "volume" // LoadBalancerResourceType holds the string representing our ResourceType of LoadBalancer. LoadBalancerResourceType ResourceType = "load_balancer" // VolumeSnapshotResourceType holds the string representing our ResourceType for storage Snapshots. VolumeSnapshotResourceType ResourceType = "volume_snapshot" // DatabaseResourceType holds the string representing our ResourceType of Database. DatabaseResourceType ResourceType = "database" )
type ResourceWithURN ¶
type ResourceWithURN interface {
URN() string
}
ResourceWithURN is an interface for interfacing with the types that implement the URN method.
type Response ¶
type Response struct { *http.Response // Links that were returned with the response. These are parsed from // request body and not the header. Links *Links // Meta describes generic information about the response. Meta *Meta // Monitoring URI Monitor string Rate }
Response is a BinaryLane response. This wraps the standard http.Response returned from the API.
type Server ¶
type Server struct { ID int `json:"id,float64,omitempty"` Name string `json:"name,omitempty"` Memory int `json:"memory,omitempty"` Vcpus int `json:"vcpus,omitempty"` Disk int `json:"disk,omitempty"` Region *Region `json:"region,omitempty"` Image *Image `json:"image,omitempty"` Size *Size `json:"size,omitempty"` SizeSlug string `json:"size_slug,omitempty"` BackupIDs []int `json:"backup_ids,omitempty"` NextBackupWindow *BackupWindow `json:"next_backup_window,omitempty"` SnapshotIDs []int `json:"snapshot_ids,omitempty"` Features []string `json:"features,omitempty"` Locked bool `json:"locked,bool,omitempty"` Status string `json:"status,omitempty"` Networks *Networks `json:"networks,omitempty"` Created string `json:"created_at,omitempty"` Kernel *Kernel `json:"kernel,omitempty"` Tags []string `json:"tags,omitempty"` VolumeIDs []string `json:"volume_ids"` VPCID int `json:"vpc_id,float64,omitempty"` }
Server represents a BinaryLane Server
func (*Server) PrivateIPv4 ¶
PrivateIPv4 returns the private IPv4 address for the Server.
func (*Server) PublicIPv4 ¶
PublicIPv4 returns the public IPv4 address for the Server.
func (*Server) PublicIPv6 ¶
PublicIPv6 returns the public IPv6 address for the Server.
type ServerActionsService ¶
type ServerActionsService interface { Shutdown(context.Context, int) (*Action, *Response, error) ShutdownByTag(context.Context, string) ([]Action, *Response, error) PowerOff(context.Context, int) (*Action, *Response, error) PowerOffByTag(context.Context, string) ([]Action, *Response, error) PowerOn(context.Context, int) (*Action, *Response, error) PowerOnByTag(context.Context, string) ([]Action, *Response, error) PowerCycle(context.Context, int) (*Action, *Response, error) PowerCycleByTag(context.Context, string) ([]Action, *Response, error) Reboot(context.Context, int) (*Action, *Response, error) Restore(context.Context, int, int) (*Action, *Response, error) Resize(context.Context, int, string, bool) (*Action, *Response, error) Rename(context.Context, int, string) (*Action, *Response, error) Snapshot(context.Context, int, string) (*Action, *Response, error) SnapshotByTag(context.Context, string, string) ([]Action, *Response, error) EnableBackups(context.Context, int) (*Action, *Response, error) EnableBackupsByTag(context.Context, string) ([]Action, *Response, error) DisableBackups(context.Context, int) (*Action, *Response, error) DisableBackupsByTag(context.Context, string) ([]Action, *Response, error) PasswordReset(context.Context, int) (*Action, *Response, error) RebuildByImageID(context.Context, int, int) (*Action, *Response, error) RebuildByImageSlug(context.Context, int, string) (*Action, *Response, error) ChangeKernel(context.Context, int, int) (*Action, *Response, error) EnableIPv6(context.Context, int) (*Action, *Response, error) EnableIPv6ByTag(context.Context, string) ([]Action, *Response, error) EnablePrivateNetworking(context.Context, int) (*Action, *Response, error) EnablePrivateNetworkingByTag(context.Context, string) ([]Action, *Response, error) Get(context.Context, int, int) (*Action, *Response, error) GetByURI(context.Context, string) (*Action, *Response, error) }
ServerActionsService is an interface for interfacing with the Server actions endpoints of the BinaryLane API See: https://api.binarylane.com.au/reference#server-actions
type ServerActionsServiceOp ¶
type ServerActionsServiceOp struct {
// contains filtered or unexported fields
}
ServerActionsServiceOp handles communication with the Server action related methods of the BinaryLane API.
func (*ServerActionsServiceOp) ChangeKernel ¶
func (s *ServerActionsServiceOp) ChangeKernel(ctx context.Context, id, kernelID int) (*Action, *Response, error)
ChangeKernel changes the kernel for a Server.
func (*ServerActionsServiceOp) DisableBackups ¶
func (s *ServerActionsServiceOp) DisableBackups(ctx context.Context, id int) (*Action, *Response, error)
DisableBackups disables backups for a Server.
func (*ServerActionsServiceOp) DisableBackupsByTag ¶
func (s *ServerActionsServiceOp) DisableBackupsByTag(ctx context.Context, tag string) ([]Action, *Response, error)
DisableBackupsByTag disables backups for Server matched by a Tag.
func (*ServerActionsServiceOp) EnableBackups ¶
func (s *ServerActionsServiceOp) EnableBackups(ctx context.Context, id int) (*Action, *Response, error)
EnableBackups enables backups for a Server.
func (*ServerActionsServiceOp) EnableBackupsByTag ¶
func (s *ServerActionsServiceOp) EnableBackupsByTag(ctx context.Context, tag string) ([]Action, *Response, error)
EnableBackupsByTag enables backups for Servers matched by a Tag.
func (*ServerActionsServiceOp) EnableIPv6 ¶
func (s *ServerActionsServiceOp) EnableIPv6(ctx context.Context, id int) (*Action, *Response, error)
EnableIPv6 enables IPv6 for a Server.
func (*ServerActionsServiceOp) EnableIPv6ByTag ¶
func (s *ServerActionsServiceOp) EnableIPv6ByTag(ctx context.Context, tag string) ([]Action, *Response, error)
EnableIPv6ByTag enables IPv6 for Servers matched by a Tag.
func (*ServerActionsServiceOp) EnablePrivateNetworking ¶
func (s *ServerActionsServiceOp) EnablePrivateNetworking(ctx context.Context, id int) (*Action, *Response, error)
EnablePrivateNetworking enables private networking for a Server.
func (*ServerActionsServiceOp) EnablePrivateNetworkingByTag ¶
func (s *ServerActionsServiceOp) EnablePrivateNetworkingByTag(ctx context.Context, tag string) ([]Action, *Response, error)
EnablePrivateNetworkingByTag enables private networking for Servers matched by a Tag.
func (*ServerActionsServiceOp) Get ¶
func (s *ServerActionsServiceOp) Get(ctx context.Context, serverID, actionID int) (*Action, *Response, error)
Get an action for a particular Server by id.
func (*ServerActionsServiceOp) GetByURI ¶
func (s *ServerActionsServiceOp) GetByURI(ctx context.Context, rawurl string) (*Action, *Response, error)
GetByURI gets an action for a particular Server by id.
func (*ServerActionsServiceOp) PasswordReset ¶
func (s *ServerActionsServiceOp) PasswordReset(ctx context.Context, id int) (*Action, *Response, error)
PasswordReset resets the password for a Server.
func (*ServerActionsServiceOp) PowerCycle ¶
func (s *ServerActionsServiceOp) PowerCycle(ctx context.Context, id int) (*Action, *Response, error)
PowerCycle a Server
func (*ServerActionsServiceOp) PowerCycleByTag ¶
func (s *ServerActionsServiceOp) PowerCycleByTag(ctx context.Context, tag string) ([]Action, *Response, error)
PowerCycleByTag power cycles Servers matched by a Tag.
func (*ServerActionsServiceOp) PowerOffByTag ¶
func (s *ServerActionsServiceOp) PowerOffByTag(ctx context.Context, tag string) ([]Action, *Response, error)
PowerOffByTag powers off Servers matched by a Tag.
func (*ServerActionsServiceOp) PowerOnByTag ¶
func (s *ServerActionsServiceOp) PowerOnByTag(ctx context.Context, tag string) ([]Action, *Response, error)
PowerOnByTag powers on Servers matched by a Tag.
func (*ServerActionsServiceOp) RebuildByImageID ¶
func (s *ServerActionsServiceOp) RebuildByImageID(ctx context.Context, id, imageID int) (*Action, *Response, error)
RebuildByImageID rebuilds a Server from an image with a given id.
func (*ServerActionsServiceOp) RebuildByImageSlug ¶
func (s *ServerActionsServiceOp) RebuildByImageSlug(ctx context.Context, id int, slug string) (*Action, *Response, error)
RebuildByImageSlug rebuilds a Server from an Image matched by a given Slug.
func (*ServerActionsServiceOp) Rename ¶
func (s *ServerActionsServiceOp) Rename(ctx context.Context, id int, name string) (*Action, *Response, error)
Rename a Server
func (*ServerActionsServiceOp) Resize ¶
func (s *ServerActionsServiceOp) Resize(ctx context.Context, id int, sizeSlug string, resizeDisk bool) (*Action, *Response, error)
Resize a Server
func (*ServerActionsServiceOp) Restore ¶
func (s *ServerActionsServiceOp) Restore(ctx context.Context, id, imageID int) (*Action, *Response, error)
Restore an image to a Server
func (*ServerActionsServiceOp) ShutdownByTag ¶
func (s *ServerActionsServiceOp) ShutdownByTag(ctx context.Context, tag string) ([]Action, *Response, error)
ShutdownByTag shuts down Servers matched by a Tag.
func (*ServerActionsServiceOp) Snapshot ¶
func (s *ServerActionsServiceOp) Snapshot(ctx context.Context, id int, name string) (*Action, *Response, error)
Snapshot a Server.
func (*ServerActionsServiceOp) SnapshotByTag ¶
func (s *ServerActionsServiceOp) SnapshotByTag(ctx context.Context, tag string, name string) ([]Action, *Response, error)
SnapshotByTag snapshots Servers matched by a Tag.
type ServerCreateImage ¶
ServerCreateImage identifies an image for the create request. It prefers slug over ID.
func (ServerCreateImage) MarshalJSON ¶
func (d ServerCreateImage) MarshalJSON() ([]byte, error)
MarshalJSON returns either the slug or id of the image. It returns the id if the slug is empty.
type ServerCreateOptions ¶
type ServerCreateOptions struct { Memory null.Int `json:"memory,omitempty"` Disk null.Int `json:"disk,omitempty"` }
ServerCreateOptions provides additional, optional configuration values for the create request.
type ServerCreateRequest ¶
type ServerCreateRequest struct { Name string `json:"name"` Region string `json:"region"` Size string `json:"size"` Image ServerCreateImage `json:"image"` SSHKeys []ServerCreateSSHKey `json:"ssh_keys"` Backups bool `json:"backups"` IPv6 bool `json:"ipv6"` PrivateNetworking bool `json:"private_networking"` Monitoring bool `json:"monitoring"` UserData string `json:"user_data,omitempty"` Volumes []ServerCreateVolume `json:"volumes,omitempty"` Tags []string `json:"tags"` VPCID int `json:"vpc_id,omitempty"` Options *ServerCreateOptions `json:"options,omitempty"` }
ServerCreateRequest represents a request to create a Server.
func (ServerCreateRequest) String ¶
func (d ServerCreateRequest) String() string
type ServerCreateSSHKey ¶
ServerCreateSSHKey identifies a SSH Key for the create request. It prefers fingerprint over ID.
func (ServerCreateSSHKey) MarshalJSON ¶
func (d ServerCreateSSHKey) MarshalJSON() ([]byte, error)
MarshalJSON returns either the fingerprint or id of the ssh key. It returns the id if the fingerprint is empty.
type ServerCreateVolume ¶
ServerCreateVolume identifies a volume to attach for the create request. It prefers Name over ID,
func (ServerCreateVolume) MarshalJSON ¶
func (d ServerCreateVolume) MarshalJSON() ([]byte, error)
MarshalJSON returns an object with either the name or id of the volume. It returns the id if the name is empty.
type ServerMultiCreateRequest ¶
type ServerMultiCreateRequest struct { Names []string `json:"names"` Region string `json:"region"` Size string `json:"size"` Image ServerCreateImage `json:"image"` SSHKeys []ServerCreateSSHKey `json:"ssh_keys"` Backups bool `json:"backups"` IPv6 bool `json:"ipv6"` PrivateNetworking bool `json:"private_networking"` Monitoring bool `json:"monitoring"` UserData string `json:"user_data,omitempty"` Tags []string `json:"tags"` VPCID int `json:"vpc_id,omitempty"` }
ServerMultiCreateRequest is a request to create multiple Servers.
func (ServerMultiCreateRequest) String ¶
func (d ServerMultiCreateRequest) String() string
type ServersService ¶
type ServersService interface { List(context.Context, *ListOptions) ([]Server, *Response, error) ListByTag(context.Context, string, *ListOptions) ([]Server, *Response, error) Get(context.Context, int) (*Server, *Response, error) Create(context.Context, *ServerCreateRequest) (*Server, *Response, error) CreateMultiple(context.Context, *ServerMultiCreateRequest) ([]Server, *Response, error) Delete(context.Context, int) (*Response, error) DeleteByTag(context.Context, string) (*Response, error) Kernels(context.Context, int, *ListOptions) ([]Kernel, *Response, error) Snapshots(context.Context, int, *ListOptions) ([]Image, *Response, error) Backups(context.Context, int, *ListOptions) ([]Image, *Response, error) Actions(context.Context, int, *ListOptions) ([]Action, *Response, error) Neighbors(context.Context, int) ([]Server, *Response, error) }
ServersService is an interface for interfacing with the Server endpoints of the BinaryLane API See: https://api.binarylane.com.au/reference#servers
type ServersServiceOp ¶
type ServersServiceOp struct {
// contains filtered or unexported fields
}
ServersServiceOp handles communication with the Server related methods of the BinaryLane API.
func (*ServersServiceOp) Actions ¶
func (s *ServersServiceOp) Actions(ctx context.Context, serverID int, opt *ListOptions) ([]Action, *Response, error)
Actions lists the actions for a Server.
func (*ServersServiceOp) Backups ¶
func (s *ServersServiceOp) Backups(ctx context.Context, serverID int, opt *ListOptions) ([]Image, *Response, error)
Backups lists the backups for a Server.
func (*ServersServiceOp) Create ¶
func (s *ServersServiceOp) Create(ctx context.Context, createRequest *ServerCreateRequest) (*Server, *Response, error)
Create Server
func (*ServersServiceOp) CreateMultiple ¶
func (s *ServersServiceOp) CreateMultiple(ctx context.Context, createRequest *ServerMultiCreateRequest) ([]Server, *Response, error)
CreateMultiple creates multiple Servers.
func (*ServersServiceOp) DeleteByTag ¶
DeleteByTag deletes Servers matched by a Tag.
func (*ServersServiceOp) Kernels ¶
func (s *ServersServiceOp) Kernels(ctx context.Context, serverID int, opt *ListOptions) ([]Kernel, *Response, error)
Kernels lists kernels available for a Server.
func (*ServersServiceOp) List ¶
func (s *ServersServiceOp) List(ctx context.Context, opt *ListOptions) ([]Server, *Response, error)
List all Servers.
func (*ServersServiceOp) ListByTag ¶
func (s *ServersServiceOp) ListByTag(ctx context.Context, tag string, opt *ListOptions) ([]Server, *Response, error)
ListByTag lists all Servers matched by a Tag.
func (*ServersServiceOp) Neighbors ¶
func (s *ServersServiceOp) Neighbors(ctx context.Context, serverID int) ([]Server, *Response, error)
Neighbors lists the neighbors for a Server.
func (*ServersServiceOp) Snapshots ¶
func (s *ServersServiceOp) Snapshots(ctx context.Context, serverID int, opt *ListOptions) ([]Image, *Response, error)
Snapshots lists the snapshots available for a Server.
type Size ¶
type Size struct { Slug string `json:"slug,omitempty"` Memory int `json:"memory,omitempty"` Vcpus int `json:"vcpus,omitempty"` Disk int `json:"disk,omitempty"` PriceMonthly float64 `json:"price_monthly,omitempty"` PriceHourly float64 `json:"price_hourly,omitempty"` Regions []string `json:"regions,omitempty"` Available bool `json:"available,omitempty"` Transfer float64 `json:"transfer,omitempty"` }
Size represents a BinaryLane Size
type SizesService ¶
SizesService is an interface for interfacing with the size endpoints of the BinaryLane API See: https://api.binarylane.com.au/reference#sizes
type SizesServiceOp ¶
type SizesServiceOp struct {
// contains filtered or unexported fields
}
SizesServiceOp handles communication with the size related methods of the BinaryLane API.
func (*SizesServiceOp) List ¶
func (s *SizesServiceOp) List(ctx context.Context, opt *ListOptions) ([]Size, *Response, error)
List all images
type Snapshot ¶
type Snapshot struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` ResourceID string `json:"resource_id,omitempty"` ResourceType string `json:"resource_type,omitempty"` Regions []string `json:"regions,omitempty"` MinDiskSize int `json:"min_disk_size,omitempty"` SizeGigaBytes float64 `json:"size_gigabytes,omitempty"` Created string `json:"created_at,omitempty"` Tags []string `json:"tags,omitempty"` }
Snapshot represents a BinaryLane Snapshot
type SnapshotsService ¶
type SnapshotsService interface { List(context.Context, *ListOptions) ([]Snapshot, *Response, error) ListVolume(context.Context, *ListOptions) ([]Snapshot, *Response, error) ListServer(context.Context, *ListOptions) ([]Snapshot, *Response, error) Get(context.Context, string) (*Snapshot, *Response, error) Delete(context.Context, string) (*Response, error) }
SnapshotsService is an interface for interfacing with the snapshots endpoints of the BinaryLane API See: https://api.binarylane.com.au/reference#snapshots
type SnapshotsServiceOp ¶
type SnapshotsServiceOp struct {
// contains filtered or unexported fields
}
SnapshotsServiceOp handles communication with the snapshot related methods of the BinaryLane API.
func (*SnapshotsServiceOp) Get ¶
func (s *SnapshotsServiceOp) Get(ctx context.Context, snapshotID string) (*Snapshot, *Response, error)
Get retrieves an snapshot by id.
func (*SnapshotsServiceOp) List ¶
func (s *SnapshotsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Snapshot, *Response, error)
List lists all the snapshots available.
func (*SnapshotsServiceOp) ListServer ¶
func (s *SnapshotsServiceOp) ListServer(ctx context.Context, opt *ListOptions) ([]Snapshot, *Response, error)
ListServer lists all the Server snapshots.
func (*SnapshotsServiceOp) ListVolume ¶
func (s *SnapshotsServiceOp) ListVolume(ctx context.Context, opt *ListOptions) ([]Snapshot, *Response, error)
ListVolume lists all the volume snapshots.
type Sources ¶
type Sources struct { Addresses []string `json:"addresses,omitempty"` Tags []string `json:"tags,omitempty"` ServerIDs []int `json:"server_ids,omitempty"` LoadBalancerUIDs []string `json:"load_balancer_uids,omitempty"` }
Sources represents Firewall InboundRule sources.
type StickySessions ¶
type StickySessions struct { Type string `json:"type,omitempty"` CookieName string `json:"cookie_name,omitempty"` CookieTtlSeconds int `json:"cookie_ttl_seconds,omitempty"` }
StickySessions represents optional load balancer session affinity rules.
func (StickySessions) String ¶
func (s StickySessions) String() string
String creates a human-readable description of a StickySessions instance.
type Tag ¶
type Tag struct { Name string `json:"name,omitempty"` Resources *TaggedResources `json:"resources,omitempty"` }
Tag represent BinaryLane tag
type TagCreateRequest ¶
type TagCreateRequest struct {
Name string `json:"name"`
}
TagCreateRequest represents the JSON structure of a request of that type.
type TagResourcesRequest ¶
type TagResourcesRequest struct {
Resources []Resource `json:"resources"`
}
TagResourcesRequest represents the JSON structure of a request of that type.
type TaggedDatabasesResources ¶
type TaggedDatabasesResources TaggedResourcesData
TaggedDatabasesResources represent the database resources a tag is attached to
type TaggedImagesResources ¶
type TaggedImagesResources TaggedResourcesData
TaggedImagesResources represent the image resources a tag is attached to
type TaggedResources ¶
type TaggedResources struct { Count int `json:"count"` LastTaggedURI string `json:"last_tagged_uri,omitempty"` Servers *TaggedServersResources `json:"servers,omitempty"` Images *TaggedImagesResources `json:"images"` Volumes *TaggedVolumesResources `json:"volumes"` VolumeSnapshots *TaggedVolumeSnapshotsResources `json:"volume_snapshots"` Databases *TaggedDatabasesResources `json:"databases"` }
TaggedResources represent the set of resources a tag is attached to
type TaggedResourcesData ¶
type TaggedResourcesData struct { Count int `json:"count,float64,omitempty"` LastTaggedURI string `json:"last_tagged_uri,omitempty"` }
TaggedResourcesData represent the generic resources a tag is attached to
type TaggedServersResources ¶
type TaggedServersResources struct { Count int `json:"count,float64,omitempty"` LastTagged *Server `json:"last_tagged,omitempty"` LastTaggedURI string `json:"last_tagged_uri,omitempty"` }
TaggedServersResources represent the server resources a tag is attached to
type TaggedVolumeSnapshotsResources ¶
type TaggedVolumeSnapshotsResources TaggedResourcesData
TaggedVolumeSnapshotsResources represent the volume snapshot resources a tag is attached to
type TaggedVolumesResources ¶
type TaggedVolumesResources TaggedResourcesData
TaggedVolumesResources represent the volume resources a tag is attached to
type TagsService ¶
type TagsService interface { List(context.Context, *ListOptions) ([]Tag, *Response, error) Get(context.Context, string) (*Tag, *Response, error) Create(context.Context, *TagCreateRequest) (*Tag, *Response, error) Delete(context.Context, string) (*Response, error) TagResources(context.Context, string, *TagResourcesRequest) (*Response, error) UntagResources(context.Context, string, *UntagResourcesRequest) (*Response, error) }
TagsService is an interface for interfacing with the tags endpoints of the BinaryLane API See: https://api.binarylane.com.au/reference#tags
type TagsServiceOp ¶
type TagsServiceOp struct {
// contains filtered or unexported fields
}
TagsServiceOp handles communication with tag related method of the BinaryLane API.
func (*TagsServiceOp) Create ¶
func (s *TagsServiceOp) Create(ctx context.Context, createRequest *TagCreateRequest) (*Tag, *Response, error)
Create a new tag
func (*TagsServiceOp) List ¶
func (s *TagsServiceOp) List(ctx context.Context, opt *ListOptions) ([]Tag, *Response, error)
List all tags
func (*TagsServiceOp) TagResources ¶
func (s *TagsServiceOp) TagResources(ctx context.Context, name string, tagRequest *TagResourcesRequest) (*Response, error)
TagResources associates resources with a given Tag.
func (*TagsServiceOp) UntagResources ¶
func (s *TagsServiceOp) UntagResources(ctx context.Context, name string, untagRequest *UntagResourcesRequest) (*Response, error)
UntagResources dissociates resources with a given Tag.
type Timestamp ¶
Timestamp represents a time that can be unmarshalled from a JSON string formatted as either an RFC3339 or Unix timestamp. All exported methods of time.Time can be called on Timestamp.
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. Time is expected in RFC3339 or Unix format.
type UntagResourcesRequest ¶
type UntagResourcesRequest struct {
Resources []Resource `json:"resources"`
}
UntagResourcesRequest represents the JSON structure of a request of that type.
type UpdateProjectRequest ¶
type UpdateProjectRequest struct { Name interface{} Description interface{} Purpose interface{} Environment interface{} IsDefault interface{} }
UpdateProjectRequest represents the request to update project information. This type expects certain attribute types, but is built this way to allow nil values as well. See `updateProjectRequest` for the "real" types.
func (*UpdateProjectRequest) MarshalJSON ¶
func (upr *UpdateProjectRequest) MarshalJSON() ([]byte, error)
MarshalJSON takes an UpdateRequest and converts it to the "typed" request which is sent to the projects API. This is a PATCH request, which allows partial attributes, so `null` values are OK.
type VPC ¶
type VPC struct { ID int `json:"id,,float64,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` IPRange string `json:"ip_range,omitempty"` RegionSlug string `json:"region,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` Default bool `json:"default,omitempty"` }
VPC represents a BinaryLane Virtual Private Cloud configuration.
type VPCCreateRequest ¶
type VPCCreateRequest struct { Name string `json:"name,omitempty"` RegionSlug string `json:"region,omitempty"` Description string `json:"description,omitempty"` IPRange string `json:"ip_range,omitempty"` }
VPCCreateRequest represents a request to create a Virtual Private Cloud.
type VPCSetDescription ¶
type VPCSetDescription string
VPCSetDescription is used when one want to set the `description` field of a VPC. Ex.: VPCs.Set(..., VPCSetDescription("vpc description"))
type VPCSetField ¶
type VPCSetField interface {
// contains filtered or unexported methods
}
VPCSetField allows one to set individual fields within a VPC configuration.
func VPCSetDefault ¶
func VPCSetDefault() VPCSetField
VPCSetDefault is used when one wants to enable the `default` field of a VPC, to set a VPC as the default one in the region Ex.: VPCs.Set(..., VPCSetDefault())
type VPCSetName ¶
type VPCSetName string
VPCSetName is used when one want to set the `name` field of a VPC. Ex.: VPCs.Set(..., VPCSetName("new-name"))
type VPCUpdateRequest ¶
type VPCUpdateRequest struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Default *bool `json:"default,omitempty"` }
VPCUpdateRequest represents a request to update a Virtual Private Cloud.
type VPCsService ¶
type VPCsService interface { Create(context.Context, *VPCCreateRequest) (*VPC, *Response, error) Get(context.Context, int) (*VPC, *Response, error) List(context.Context, *ListOptions) ([]*VPC, *Response, error) Update(context.Context, int, *VPCUpdateRequest) (*VPC, *Response, error) Set(context.Context, int, ...VPCSetField) (*VPC, *Response, error) Delete(context.Context, int) (*Response, error) }
VPCsService is an interface for managing Virtual Private Cloud configurations with the BinaryLane API. See: https://api.binarylane.com.au/reference#vpcs
type VPCsServiceOp ¶
type VPCsServiceOp struct {
// contains filtered or unexported fields
}
VPCsServiceOp interfaces with VPC endpoints in the BinaryLane API.
func (*VPCsServiceOp) Create ¶
func (v *VPCsServiceOp) Create(ctx context.Context, create *VPCCreateRequest) (*VPC, *Response, error)
Create creates a new Virtual Private Cloud.
func (*VPCsServiceOp) Delete ¶
Delete deletes a Virtual Private Cloud. There is no way to recover a VPC once it has been destroyed.
func (*VPCsServiceOp) List ¶
func (v *VPCsServiceOp) List(ctx context.Context, opt *ListOptions) ([]*VPC, *Response, error)
List returns a list of the caller's VPCs, with optional pagination.
func (*VPCsServiceOp) Set ¶
func (v *VPCsServiceOp) Set(ctx context.Context, id int, fields ...VPCSetField) (*VPC, *Response, error)
Set updates specific properties of a Virtual Private Cloud.
func (*VPCsServiceOp) Update ¶
func (v *VPCsServiceOp) Update(ctx context.Context, id int, update *VPCUpdateRequest) (*VPC, *Response, error)
Update updates a Virtual Private Cloud's properties.
Source Files
¶
- account.go
- action.go
- balance.go
- billing_history.go
- binarylane.go
- doc.go
- domains.go
- errors.go
- firewalls.go
- floating_ips.go
- floating_ips_actions.go
- image_actions.go
- images.go
- invoices.go
- keys.go
- links.go
- load_balancers.go
- meta.go
- projects.go
- regions.go
- server_actions.go
- servers.go
- sizes.go
- snapshots.go
- strings.go
- tags.go
- timestamp.go
- vpcs.go