Documentation
¶
Index ¶
- func Bool(v bool) *bool
- func Int(v int) *int
- func StreamToString(stream io.Reader) string
- func String(v string) *string
- func Stringify(message interface{}) string
- type Address
- type Attachment
- type Client
- type Cpus
- type Device
- type DeviceActionRequest
- type DeviceCreateRequest
- type DeviceService
- type DeviceServiceOp
- func (s *DeviceServiceOp) Create(createRequest *DeviceCreateRequest) (*Device, *Response, error)
- func (s *DeviceServiceOp) Delete(deviceID string) (*Response, error)
- func (s *DeviceServiceOp) Get(deviceID string) (*Device, *Response, error)
- func (s *DeviceServiceOp) List(projectID string) ([]Device, *Response, error)
- func (s *DeviceServiceOp) Lock(deviceID string) (*Response, error)
- func (s *DeviceServiceOp) PowerOff(deviceID string) (*Response, error)
- func (s *DeviceServiceOp) PowerOn(deviceID string) (*Response, error)
- func (s *DeviceServiceOp) Reboot(deviceID string) (*Response, error)
- func (s *DeviceServiceOp) Unlock(deviceID string) (*Response, error)
- func (s *DeviceServiceOp) Update(deviceID string, updateRequest *DeviceUpdateRequest) (*Device, *Response, error)
- type DeviceUpdateRequest
- type Drives
- type Email
- type EmailService
- type EmailServiceOp
- type ErrorResponse
- type Facility
- type FacilityService
- type FacilityServiceOp
- type Features
- type IPAddress
- type IPAddressAssignRequest
- type IPReservation
- type IPReservationRequest
- type IPReservationService
- type IPReservationServiceOp
- func (i *IPReservationServiceOp) Get(ipReservationID string) (*IPReservation, *Response, error)
- func (i *IPReservationServiceOp) List(projectID string) ([]IPReservation, *Response, error)
- func (i *IPReservationServiceOp) Remove(ipReservationID string) (*Response, error)
- func (i *IPReservationServiceOp) RequestMore(projectID string, ipReservationReq *IPReservationRequest) (*IPReservation, *Response, error)
- type IPService
- type IPServiceOp
- type ListOptions
- type Memory
- type Nics
- type OS
- type OSService
- type OSServiceOp
- type Plan
- type PlanService
- type PlanServiceOp
- type Pricing
- type Project
- type ProjectCreateRequest
- type ProjectService
- type ProjectServiceOp
- func (s *ProjectServiceOp) Create(createRequest *ProjectCreateRequest) (*Project, *Response, error)
- func (s *ProjectServiceOp) Delete(projectID string) (*Response, error)
- func (s *ProjectServiceOp) Get(projectID string) (*Project, *Response, error)
- func (s *ProjectServiceOp) List() ([]Project, *Response, error)
- func (s *ProjectServiceOp) ListIPAddresses(projectID string) ([]IPAddress, *Response, error)
- func (s *ProjectServiceOp) ListVolumes(projectID string) ([]Volume, *Response, error)
- func (s *ProjectServiceOp) Update(updateRequest *ProjectUpdateRequest) (*Project, *Response, error)
- type ProjectUpdateRequest
- type Rate
- type Response
- type SSHKey
- type SSHKeyCreateRequest
- type SSHKeyService
- type SSHKeyServiceOp
- func (s *SSHKeyServiceOp) Create(createRequest *SSHKeyCreateRequest) (*SSHKey, *Response, error)
- func (s *SSHKeyServiceOp) Delete(sshKeyID string) (*Response, error)
- func (s *SSHKeyServiceOp) Get(sshKeyID string) (*SSHKey, *Response, error)
- func (s *SSHKeyServiceOp) List() ([]SSHKey, *Response, error)
- func (s *SSHKeyServiceOp) Update(updateRequest *SSHKeyUpdateRequest) (*SSHKey, *Response, error)
- type SSHKeyUpdateRequest
- type SnapshotPolicy
- type Specs
- type Timestamp
- type User
- type UserService
- type UserServiceOp
- type Volume
- type VolumeCreateRequest
- type VolumeService
- type VolumeServiceOp
- func (v *VolumeServiceOp) Create(createRequest *VolumeCreateRequest) (*Volume, *Response, error)
- func (v *VolumeServiceOp) Delete(volumeID string) (*Response, error)
- func (v *VolumeServiceOp) Get(volumeID string) (*Volume, *Response, error)
- func (v *VolumeServiceOp) Update(updateRequest *VolumeUpdateRequest) (*Volume, *Response, error)
- type VolumeUpdateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Int ¶
Int 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
Types ¶
type Address ¶
type Address struct {
ID string `json:"id,omitempty"`
}
Address - the physical address of the facility
type Attachment ¶
Attachment used to execute actions on volume
type Client ¶
type Client struct {
BaseURL *url.URL
UserAgent string
ConsumerToken string
APIKey string
RateLimit Rate
// Packet Api Objects
Plans PlanService
Users UserService
Emails EmailService
SSHKeys SSHKeyService
Devices DeviceService
Projects ProjectService
Facilities FacilityService
OperatingSystems OSService
Ips IPService
IpReservations IPReservationService
Volumes VolumeService
// contains filtered or unexported fields
}
Client is the base API Client
func NewClient ¶
NewClient initializes and returns a Client, use this to get an API Client to operate on N.B.: Packet's API certificate requires Go 1.5+ to successfully parse. If you are using an older version of Go, pass in a custom http.Client with a custom TLS configuration that sets "InsecureSkipVerify" to "true"
func NewClientWithBaseURL ¶
type Device ¶
type Device struct {
ID string `json:"id"`
Href string `json:"href,omitempty"`
Hostname string `json:"hostname,omitempty"`
State string `json:"state,omitempty"`
Created string `json:"created_at,omitempty"`
Updated string `json:"updated_at,omitempty"`
Locked bool `json:"locked,omitempty"`
BillingCycle string `json:"billing_cycle,omitempty"`
Tags []string `json:"tags,omitempty"`
Network []*IPAddress `json:"ip_addresses"`
OS *OS `json:"operating_system,omitempty"`
Plan *Plan `json:"plan,omitempty"`
Facility *Facility `json:"facility,omitempty"`
Project *Project `json:"project,omitempty"`
ProvisionPer float32 `json:"provisioning_percentage,omitempty"`
UserData string `json:"userdata",omitempty`
IPXEScriptUrl string `json:"ipxe_script_url,omitempty"`
AlwaysPXE bool `json:"always_pxe,omitempty"`
}
Device represents a Packet device
type DeviceActionRequest ¶
type DeviceActionRequest struct {
Type string `json:"type"`
}
DeviceActionRequest type used to execute actions on devices
func (DeviceActionRequest) String ¶
func (d DeviceActionRequest) String() string
type DeviceCreateRequest ¶
type DeviceCreateRequest struct {
HostName string `json:"hostname"`
Plan string `json:"plan"`
Facility string `json:"facility"`
OS string `json:"operating_system"`
BillingCycle string `json:"billing_cycle"`
ProjectID string `json:"project_id"`
UserData string `json:"userdata"`
Tags []string `json:"tags"`
IPXEScriptUrl string `json:"ipxe_script_url,omitempty"`
PublicIPv4SubnetSize int `json:"public_ipv4_subnet_size,omitempty"`
AlwaysPXE bool `json:"always_pxe,omitempty"`
}
DeviceCreateRequest type used to create a Packet device
func (DeviceCreateRequest) String ¶
func (d DeviceCreateRequest) String() string
type DeviceService ¶
type DeviceService interface {
List(ProjectID string) ([]Device, *Response, error)
Get(string) (*Device, *Response, error)
Create(*DeviceCreateRequest) (*Device, *Response, error)
Update(string, *DeviceUpdateRequest) (*Device, *Response, error)
Delete(string) (*Response, error)
Reboot(string) (*Response, error)
PowerOff(string) (*Response, error)
PowerOn(string) (*Response, error)
Lock(string) (*Response, error)
Unlock(string) (*Response, error)
}
DeviceService interface defines available device methods
type DeviceServiceOp ¶
type DeviceServiceOp struct {
// contains filtered or unexported fields
}
DeviceServiceOp implements DeviceService
func (*DeviceServiceOp) Create ¶
func (s *DeviceServiceOp) Create(createRequest *DeviceCreateRequest) (*Device, *Response, error)
Create creates a new device
func (*DeviceServiceOp) Delete ¶
func (s *DeviceServiceOp) Delete(deviceID string) (*Response, error)
Delete deletes a device
func (*DeviceServiceOp) Get ¶
func (s *DeviceServiceOp) Get(deviceID string) (*Device, *Response, error)
Get returns a device by id
func (*DeviceServiceOp) List ¶
func (s *DeviceServiceOp) List(projectID string) ([]Device, *Response, error)
List returns devices on a project
func (*DeviceServiceOp) Lock ¶
func (s *DeviceServiceOp) Lock(deviceID string) (*Response, error)
Lock sets a device to "locked"
func (*DeviceServiceOp) PowerOff ¶
func (s *DeviceServiceOp) PowerOff(deviceID string) (*Response, error)
PowerOff powers on a device
func (*DeviceServiceOp) PowerOn ¶
func (s *DeviceServiceOp) PowerOn(deviceID string) (*Response, error)
PowerOn powers on a device
func (*DeviceServiceOp) Reboot ¶
func (s *DeviceServiceOp) Reboot(deviceID string) (*Response, error)
Reboot reboots on a device
func (*DeviceServiceOp) Unlock ¶
func (s *DeviceServiceOp) Unlock(deviceID string) (*Response, error)
Unlock sets a device to "locked"
func (*DeviceServiceOp) Update ¶
func (s *DeviceServiceOp) Update(deviceID string, updateRequest *DeviceUpdateRequest) (*Device, *Response, error)
Update updates an existing device
type DeviceUpdateRequest ¶
type DeviceUpdateRequest struct {
HostName string `json:"hostname"`
Description string `json:"description"`
UserData string `json:"userdata"`
Locked bool `json:"locked"`
Tags []string `json:"tags"`
AlwaysPXE bool `json:"always_pxe,omitempty"`
IPXEScriptUrl string `json:"ipxe_script_url,omitempty"`
}
DeviceUpdateRequest type used to update a Packet device
type Drives ¶
type Drives struct {
Count int `json:"count,omitempty"`
Size string `json:"size,omitempty"`
Type string `json:"type,omitempty"`
}
Drives - the storage config details for specs on a plan
type Email ¶
type Email struct {
ID string `json:"id"`
Address string `json:"address"`
Default bool `json:"default,omitempty"`
URL string `json:"href,omitempty"`
}
Email represents a user's email address
type EmailService ¶
EmailService interface defines available email methods
type EmailServiceOp ¶
type EmailServiceOp struct {
// contains filtered or unexported fields
}
EmailServiceOp implements EmailService
type ErrorResponse ¶
ErrorResponse is the http response used on errrors
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type Facility ¶
type Facility struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
Features []string `json:"features,omitempty"`
Address *Address `json:"address,omitempty"`
URL string `json:"href,omitempty"`
}
Facility represents a Packet facility
type FacilityService ¶
FacilityService interface defines available facility methods
type FacilityServiceOp ¶
type FacilityServiceOp struct {
// contains filtered or unexported fields
}
FacilityServiceOp implements FacilityService
type IPAddress ¶
type IPAddress struct {
ID string `json:"id"`
Address string `json:"address"`
Gateway string `json:"gateway"`
Network string `json:"network"`
AddressFamily int `json:"address_family"`
Netmask string `json:"netmask"`
Public bool `json:"public"`
Cidr int `json:"cidr"`
AssignedTo map[string]string `json:"assigned_to"`
Created string `json:"created_at,omitempty"`
Updated string `json:"updated_at,omitempty"`
Href string `json:"href"`
Facility Facility `json:"facility,omitempty"`
}
IPAddress represents a ip address
type IPAddressAssignRequest ¶
type IPAddressAssignRequest struct {
Address string `json:"address"`
}
IPAddressAssignRequest represents the body if a ip assign request
type IPReservation ¶
type IPReservation struct {
ID string `json:"id"`
Network string `json:"network"`
Address string `json:"address"`
AddressFamily int `json:"address_family"`
Netmask string `json:"netmask"`
Public bool `json:"public"`
Cidr int `json:"cidr"`
Management bool `json:"management"`
Manageable bool `json:"manageable"`
Addon bool `json:"addon"`
Bill bool `json:"bill"`
Assignments []map[string]string `json:"assignments"`
Created string `json:"created_at,omitempty"`
Updated string `json:"updated_at,omitempty"`
Href string `json:"href"`
Facility Facility `json:"facility,omitempty"`
}
IPReservation represent an IP reservation for a single project
type IPReservationRequest ¶
type IPReservationRequest struct {
Type string `json:"type"`
Quantity int `json:"quantity"`
Comments string `json:"comments"`
Facility string `json:"facility"`
}
IPReservationRequest represents the body of a reservation request
type IPReservationService ¶
type IPReservationService interface {
List(projectID string) ([]IPReservation, *Response, error)
RequestMore(projectID string, ipReservationReq *IPReservationRequest) (*IPReservation, *Response, error)
Get(ipReservationID string) (*IPReservation, *Response, error)
Remove(ipReservationID string) (*Response, error)
}
IPReservationService interface defines available IPReservation methods
type IPReservationServiceOp ¶
type IPReservationServiceOp struct {
// contains filtered or unexported fields
}
IPReservationServiceOp implements the IPReservationService interface
func (*IPReservationServiceOp) Get ¶
func (i *IPReservationServiceOp) Get(ipReservationID string) (*IPReservation, *Response, error)
Get returns a single IP reservation object
func (*IPReservationServiceOp) List ¶
func (i *IPReservationServiceOp) List(projectID string) ([]IPReservation, *Response, error)
List provides a list of IP resevations for a single project.
func (*IPReservationServiceOp) Remove ¶
func (i *IPReservationServiceOp) Remove(ipReservationID string) (*Response, error)
Remove removes an IP reservation from the project.
func (*IPReservationServiceOp) RequestMore ¶
func (i *IPReservationServiceOp) RequestMore(projectID string, ipReservationReq *IPReservationRequest) (*IPReservation, *Response, error)
RequestMore requests more IP space for a project in order to have additional IP addresses to assign to devices
type IPService ¶
type IPService interface {
Assign(deviceID string, assignRequest *IPAddressAssignRequest) (*IPAddress, *Response, error)
Unassign(ipAddressID string) (*Response, error)
Get(ipAddressID string) (*IPAddress, *Response, error)
}
IPService interface defines available IP methods
type IPServiceOp ¶
type IPServiceOp struct {
// contains filtered or unexported fields
}
IPServiceOp implements IPService
func (*IPServiceOp) Assign ¶
func (i *IPServiceOp) Assign(deviceID string, assignRequest *IPAddressAssignRequest) (*IPAddress, *Response, error)
Assign assigns an IP address to a device. The IP address must be in one of the IP ranges assigned to the device’s project.
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 return per page
PerPage int `url:"per_page,omitempty"`
// specify which resources you want to return as collections instead of references
Includes string
}
ListOptions specifies optional global API parameters
type Memory ¶
type Memory struct {
Total string `json:"total,omitempty"`
}
Memory - the RAM config details for specs on a plan
type OS ¶
type OS struct {
Name string `json:"name"`
Slug string `json:"slug"`
Distro string `json:"distro"`
Version string `json:"version"`
}
OS represents a Packet operating system
type OSServiceOp ¶
type OSServiceOp struct {
// contains filtered or unexported fields
}
OSServiceOp implements OSService
type Plan ¶
type Plan struct {
ID string `json:"id"`
Slug string `json:"slug,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Line string `json:"line,omitempty"`
Specs *Specs `json:"specs,omitempty"`
Pricing *Pricing `json:"pricing,omitempty"`
}
Plan represents a Packet service plan
type PlanService ¶
PlanService interface defines available plan methods
type PlanServiceOp ¶
type PlanServiceOp struct {
// contains filtered or unexported fields
}
PlanServiceOp implements PlanService
type Pricing ¶
type Pricing struct {
Hourly float32 `json:"hourly,omitempty"`
Monthly float32 `json:"monthly,omitempty"`
}
Pricing - the pricing options on a plan
type Project ¶
type Project struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Created string `json:"created_at,omitempty"`
Updated string `json:"updated_at,omitempty"`
Users []User `json:"members,omitempty"`
Devices []Device `json:"devices,omitempty"`
SSHKeys []SSHKey `json:"ssh_keys,omitempty"`
URL string `json:"href,omitempty"`
}
Project represents a Packet project
type ProjectCreateRequest ¶
type ProjectCreateRequest struct {
Name string `json:"name"`
PaymentMethod string `json:"payment_method,omitempty"`
}
ProjectCreateRequest type used to create a Packet project
func (ProjectCreateRequest) String ¶
func (p ProjectCreateRequest) String() string
type ProjectService ¶
type ProjectService interface {
List() ([]Project, *Response, error)
Get(string) (*Project, *Response, error)
Create(*ProjectCreateRequest) (*Project, *Response, error)
Update(*ProjectUpdateRequest) (*Project, *Response, error)
Delete(string) (*Response, error)
ListIPAddresses(string) ([]IPAddress, *Response, error)
ListVolumes(string) ([]Volume, *Response, error)
}
ProjectService interface defines available project methods
type ProjectServiceOp ¶
type ProjectServiceOp struct {
// contains filtered or unexported fields
}
ProjectServiceOp implements ProjectService
func (*ProjectServiceOp) Create ¶
func (s *ProjectServiceOp) Create(createRequest *ProjectCreateRequest) (*Project, *Response, error)
Create creates a new project
func (*ProjectServiceOp) Delete ¶
func (s *ProjectServiceOp) Delete(projectID string) (*Response, error)
Delete deletes a project
func (*ProjectServiceOp) Get ¶
func (s *ProjectServiceOp) Get(projectID string) (*Project, *Response, error)
Get returns a project by id
func (*ProjectServiceOp) List ¶
func (s *ProjectServiceOp) List() ([]Project, *Response, error)
List returns the user's projects
func (*ProjectServiceOp) ListIPAddresses ¶
func (s *ProjectServiceOp) ListIPAddresses(projectID string) ([]IPAddress, *Response, error)
func (*ProjectServiceOp) ListVolumes ¶
func (s *ProjectServiceOp) ListVolumes(projectID string) ([]Volume, *Response, error)
List returns Volumes for a project
func (*ProjectServiceOp) Update ¶
func (s *ProjectServiceOp) Update(updateRequest *ProjectUpdateRequest) (*Project, *Response, error)
Update updates a project
type ProjectUpdateRequest ¶
type ProjectUpdateRequest struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
PaymentMethod string `json:"payment_method,omitempty"`
}
ProjectUpdateRequest type used to update a Packet project
func (ProjectUpdateRequest) String ¶
func (p ProjectUpdateRequest) String() string
type Rate ¶
type Rate struct {
RequestLimit int `json:"request_limit"`
RequestsRemaining int `json:"requests_remaining"`
Reset Timestamp `json:"rate_reset"`
}
Rate provides the API request rate limit details
type SSHKey ¶
type SSHKey struct {
ID string `json:"id"`
Label string `json:"label"`
Key string `json:"key"`
FingerPrint string `json:"fingerprint"`
Created string `json:"created_at"`
Updated string `json:"updated_at"`
User User `json:"user,omitempty"`
URL string `json:"href,omitempty"`
}
SSHKey represents a user's ssh key
type SSHKeyCreateRequest ¶
type SSHKeyCreateRequest struct {
Label string `json:"label"`
Key string `json:"key"`
ProjectID string `json:"-"`
}
SSHKeyCreateRequest type used to create an ssh key
func (SSHKeyCreateRequest) String ¶
func (s SSHKeyCreateRequest) String() string
type SSHKeyService ¶
type SSHKeyService interface {
List() ([]SSHKey, *Response, error)
Get(string) (*SSHKey, *Response, error)
Create(*SSHKeyCreateRequest) (*SSHKey, *Response, error)
Update(*SSHKeyUpdateRequest) (*SSHKey, *Response, error)
Delete(string) (*Response, error)
}
SSHKeyService interface defines available device methods
type SSHKeyServiceOp ¶
type SSHKeyServiceOp struct {
// contains filtered or unexported fields
}
SSHKeyServiceOp implements SSHKeyService
func (*SSHKeyServiceOp) Create ¶
func (s *SSHKeyServiceOp) Create(createRequest *SSHKeyCreateRequest) (*SSHKey, *Response, error)
Create creates a new ssh key
func (*SSHKeyServiceOp) Delete ¶
func (s *SSHKeyServiceOp) Delete(sshKeyID string) (*Response, error)
Delete deletes an ssh key
func (*SSHKeyServiceOp) Get ¶
func (s *SSHKeyServiceOp) Get(sshKeyID string) (*SSHKey, *Response, error)
Get returns an ssh key by id
func (*SSHKeyServiceOp) List ¶
func (s *SSHKeyServiceOp) List() ([]SSHKey, *Response, error)
List returns a user's ssh keys
func (*SSHKeyServiceOp) Update ¶
func (s *SSHKeyServiceOp) Update(updateRequest *SSHKeyUpdateRequest) (*SSHKey, *Response, error)
Update updates an ssh key
type SSHKeyUpdateRequest ¶
type SSHKeyUpdateRequest struct {
ID string `json:"id"`
Label string `json:"label"`
Key string `json:"key"`
}
SSHKeyUpdateRequest type used to update an ssh key
func (SSHKeyUpdateRequest) String ¶
func (s SSHKeyUpdateRequest) String() string
type SnapshotPolicy ¶
type SnapshotPolicy struct {
ID string `json:"id"`
Href string `json:"href"`
SnapshotFrequency string `json:"snapshot_frequency,omitempty"`
SnapshotCount int `json:"snapshot_count,omitempty"`
}
SnapshotPolicy used to execute actions on volume
type Specs ¶
type Specs struct {
Cpus []*Cpus `json:"cpus,omitempty"`
Memory *Memory `json:"memory,omitempty"`
Drives []*Drives `json:"drives,omitempty"`
Nics []*Nics `json:"nics,omitempty"`
Features *Features `json:"features,omitempty"`
}
Specs - the server specs for a plan
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 User ¶
type User struct {
ID string `json:"id"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
FullName string `json:"full_name,omitempty"`
Email string `json:"email,omitempty"`
TwoFactor string `json:"two_factor_auth,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
Facebook string `json:"twitter,omitempty"`
Twitter string `json:"facebook,omitempty"`
LinkedIn string `json:"linkedin,omitempty"`
Created string `json:"created_at,omitempty"`
Updated string `json:"updated_at,omitempty"`
TimeZone string `json:"timezone,omitempty"`
Emails []Email `json:"email,omitempty"`
PhoneNumber string `json:"phone_number,omitempty"`
URL string `json:"href,omitempty"`
}
User represents a Packet user
type UserService ¶
UserService interface defines available user methods
type UserServiceOp ¶
type UserServiceOp struct {
// contains filtered or unexported fields
}
UserServiceOp implements UserService
type Volume ¶
type Volume struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Size int `json:"size,omitempty"`
State string `json:"state,omitempty"`
Locked bool `json:"locked,omitempty"`
BillingCycle string `json:"billing_cycle,omitempty"`
Created string `json:"created_at,omitempty"`
Updated string `json:"updated_at,omitempty"`
Href string `json:"href,omitempty"`
SnapshotPolicies []*SnapshotPolicy `json:"snapshot_policies,omitempty"`
Attachments []*Attachment `json:"attachments,omitempty"`
Plan *Plan `json:"plan,omitempty"`
Facility *Facility `json:"facility,omitempty"`
Project *Project `json:"project,omitempty"`
}
Volume represents a volume
type VolumeCreateRequest ¶
type VolumeCreateRequest struct {
Size int `json:"size"`
BillingCycle string `json:"billing_cycle"`
ProjectID string `json:"project_id"`
PlanID string `json:"plan_id"`
FacilityID string `json:"facility_id"`
Description string `json:"description,omitempty"`
SnapshotPolicies []*SnapshotPolicy `json:"snapshot_policies,omitempty"`
}
VolumeCreateRequest type used to create a Packet volume
func (VolumeCreateRequest) String ¶
func (v VolumeCreateRequest) String() string
type VolumeService ¶
type VolumeService interface {
Get(string) (*Volume, *Response, error)
Update(*VolumeUpdateRequest) (*Volume, *Response, error)
Delete(string) (*Response, error)
Create(*VolumeCreateRequest) (*Volume, *Response, error)
}
VolumeService interface defines available Volume methods
type VolumeServiceOp ¶
type VolumeServiceOp struct {
// contains filtered or unexported fields
}
VolumeServiceOp implements VolumeService
func (*VolumeServiceOp) Create ¶
func (v *VolumeServiceOp) Create(createRequest *VolumeCreateRequest) (*Volume, *Response, error)
Create creates a new volume for a project
func (*VolumeServiceOp) Delete ¶
func (v *VolumeServiceOp) Delete(volumeID string) (*Response, error)
Delete deletes a volume
func (*VolumeServiceOp) Get ¶
func (v *VolumeServiceOp) Get(volumeID string) (*Volume, *Response, error)
Get returns a volume by id
func (*VolumeServiceOp) Update ¶
func (v *VolumeServiceOp) Update(updateRequest *VolumeUpdateRequest) (*Volume, *Response, error)
Update updates a volume
type VolumeUpdateRequest ¶
type VolumeUpdateRequest struct {
ID string `json:"id"`
Description string `json:"description,omitempty"`
Plan string `json:"plan,omitempty"`
}
VolumeUpdateRequest type used to update a Packet volume
func (VolumeUpdateRequest) String ¶
func (v VolumeUpdateRequest) String() string
