Documentation ¶
Index ¶
- Constants
- type AddNICInput
- type AddTagsInput
- type CloudAPI
- type ComputeClient
- func (c *ComputeClient) Datacenters() *DataCentersClient
- func (c *ComputeClient) Images() *ImagesClient
- func (c *ComputeClient) Instances() *InstancesClient
- func (c *ComputeClient) Packages() *PackagesClient
- func (c *ComputeClient) Ping(ctx context.Context) (*PingOutput, error)
- func (c *ComputeClient) Services() *ServicesClient
- func (c *ComputeClient) SetHeader(header *http.Header)
- func (c *ComputeClient) Snapshots() *SnapshotsClient
- func (c *ComputeClient) Volumes() *VolumesClient
- type CreateImageFromMachineInput
- type CreateInstanceInput
- type CreateSnapshotInput
- type CreateVolumeInput
- type DataCenter
- type DataCentersClient
- type DeleteAllMetadataInput
- type DeleteImageInput
- type DeleteInstanceInput
- type DeleteMetadataInput
- type DeleteSnapshotInput
- type DeleteTagInput
- type DeleteTagsInput
- type DeleteVolumeInput
- type DisableDeletionProtectionInput
- type DisableFirewallInput
- type EnableDeletionProtectionInput
- type EnableFirewallInput
- type ExportImageInput
- type GetDataCenterInput
- type GetImageInput
- type GetInstanceInput
- type GetMetadataInput
- type GetNICInput
- type GetPackageInput
- type GetSnapshotInput
- type GetTagInput
- type GetVolumeInput
- type Image
- type ImageFile
- type ImagesClient
- func (c *ImagesClient) CreateFromMachine(ctx context.Context, input *CreateImageFromMachineInput) (*Image, error)
- func (c *ImagesClient) Delete(ctx context.Context, input *DeleteImageInput) error
- func (c *ImagesClient) Export(ctx context.Context, input *ExportImageInput) (*MantaLocation, error)
- func (c *ImagesClient) Get(ctx context.Context, input *GetImageInput) (*Image, error)
- func (c *ImagesClient) List(ctx context.Context, input *ListImagesInput) ([]*Image, error)
- func (c *ImagesClient) Update(ctx context.Context, input *UpdateImageInput) (*Image, error)
- type Instance
- type InstanceCNS
- type InstanceVolume
- type InstancesClient
- func (c *InstancesClient) AddNIC(ctx context.Context, input *AddNICInput) (*NIC, error)
- func (c *InstancesClient) AddTags(ctx context.Context, input *AddTagsInput) error
- func (c *InstancesClient) Count(ctx context.Context, input *ListInstancesInput) (int, error)
- func (c *InstancesClient) Create(ctx context.Context, input *CreateInstanceInput) (*Instance, error)
- func (c *InstancesClient) Delete(ctx context.Context, input *DeleteInstanceInput) error
- func (c *InstancesClient) DeleteAllMetadata(ctx context.Context, input *DeleteAllMetadataInput) error
- func (c *InstancesClient) DeleteMetadata(ctx context.Context, input *DeleteMetadataInput) error
- func (c *InstancesClient) DeleteTag(ctx context.Context, input *DeleteTagInput) error
- func (c *InstancesClient) DeleteTags(ctx context.Context, input *DeleteTagsInput) error
- func (c *InstancesClient) DisableDeletionProtection(ctx context.Context, input *DisableDeletionProtectionInput) error
- func (c *InstancesClient) DisableFirewall(ctx context.Context, input *DisableFirewallInput) error
- func (c *InstancesClient) EnableDeletionProtection(ctx context.Context, input *EnableDeletionProtectionInput) error
- func (c *InstancesClient) EnableFirewall(ctx context.Context, input *EnableFirewallInput) error
- func (c *InstancesClient) Get(ctx context.Context, input *GetInstanceInput) (*Instance, error)
- func (c *InstancesClient) GetMetadata(ctx context.Context, input *GetMetadataInput) (string, error)
- func (c *InstancesClient) GetNIC(ctx context.Context, input *GetNICInput) (*NIC, error)
- func (c *InstancesClient) GetTag(ctx context.Context, input *GetTagInput) (string, error)
- func (c *InstancesClient) List(ctx context.Context, input *ListInstancesInput) ([]*Instance, error)
- func (c *InstancesClient) ListMetadata(ctx context.Context, input *ListMetadataInput) (map[string]string, error)
- func (c *InstancesClient) ListNICs(ctx context.Context, input *ListNICsInput) ([]*NIC, error)
- func (c *InstancesClient) ListTags(ctx context.Context, input *ListTagsInput) (map[string]interface{}, error)
- func (c *InstancesClient) Reboot(ctx context.Context, input *RebootInstanceInput) error
- func (c *InstancesClient) RemoveNIC(ctx context.Context, input *RemoveNICInput) error
- func (c *InstancesClient) Rename(ctx context.Context, input *RenameInstanceInput) error
- func (c *InstancesClient) ReplaceTags(ctx context.Context, input *ReplaceTagsInput) error
- func (c *InstancesClient) Resize(ctx context.Context, input *ResizeInstanceInput) error
- func (c *InstancesClient) Start(ctx context.Context, input *StartInstanceInput) error
- func (c *InstancesClient) Stop(ctx context.Context, input *StopInstanceInput) error
- func (c *InstancesClient) UpdateMetadata(ctx context.Context, input *UpdateMetadataInput) (map[string]string, error)
- type ListDataCentersInput
- type ListImagesInput
- type ListInstancesInput
- type ListMetadataInput
- type ListNICsInput
- type ListPackagesInput
- type ListServicesInput
- type ListSnapshotsInput
- type ListTagsInput
- type ListVolumesInput
- type MantaLocation
- type NIC
- type NetworkObject
- type Package
- type PackagesClient
- type PingOutput
- type RebootInstanceInput
- type RemoveNICInput
- type RenameInstanceInput
- type ReplaceTagsInput
- type ResizeInstanceInput
- type Service
- type ServicesClient
- type Snapshot
- type SnapshotsClient
- func (c *SnapshotsClient) Create(ctx context.Context, input *CreateSnapshotInput) (*Snapshot, error)
- func (c *SnapshotsClient) Delete(ctx context.Context, input *DeleteSnapshotInput) error
- func (c *SnapshotsClient) Get(ctx context.Context, input *GetSnapshotInput) (*Snapshot, error)
- func (c *SnapshotsClient) List(ctx context.Context, input *ListSnapshotsInput) ([]*Snapshot, error)
- func (c *SnapshotsClient) StartMachine(ctx context.Context, input *StartMachineFromSnapshotInput) error
- type StartInstanceInput
- type StartMachineFromSnapshotInput
- type StopInstanceInput
- type UpdateImageInput
- type UpdateMetadataInput
- type UpdateVolumeInput
- type Volume
- type VolumesClient
- func (c *VolumesClient) Create(ctx context.Context, input *CreateVolumeInput) (*Volume, error)
- func (c *VolumesClient) Delete(ctx context.Context, input *DeleteVolumeInput) error
- func (c *VolumesClient) Get(ctx context.Context, input *GetVolumeInput) (*Volume, error)
- func (c *VolumesClient) List(ctx context.Context, input *ListVolumesInput) ([]*Volume, error)
- func (c *VolumesClient) Update(ctx context.Context, input *UpdateVolumeInput) error
Constants ¶
const ( CNSTagDisable = "triton.cns.disable" CNSTagReversePTR = "triton.cns.reverse_ptr" CNSTagServices = "triton.cns.services" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddNICInput ¶
type AddNICInput struct { InstanceID string Network string NetworkObject NetworkObject }
type AddTagsInput ¶
type ComputeClient ¶
func NewClient ¶
func NewClient(config *triton.ClientConfig) (*ComputeClient, error)
NewClient returns a new client for working with Compute endpoints and resources within CloudAPI
func (*ComputeClient) Datacenters ¶
func (c *ComputeClient) Datacenters() *DataCentersClient
Datacenters returns a Compute client used for accessing functions pertaining to DataCenter functionality in the Triton API.
func (*ComputeClient) Images ¶
func (c *ComputeClient) Images() *ImagesClient
Images returns a Compute client used for accessing functions pertaining to Images functionality in the Triton API.
func (*ComputeClient) Instances ¶
func (c *ComputeClient) Instances() *InstancesClient
Machine returns a Compute client used for accessing functions pertaining to machine functionality in the Triton API.
func (*ComputeClient) Packages ¶
func (c *ComputeClient) Packages() *PackagesClient
Packages returns a Compute client used for accessing functions pertaining to Packages functionality in the Triton API.
func (*ComputeClient) Ping ¶
func (c *ComputeClient) Ping(ctx context.Context) (*PingOutput, error)
Ping sends a request to the '/--ping' endpoint and returns a `pong` as well as a list of API version numbers your instance of CloudAPI is presenting.
func (*ComputeClient) Services ¶
func (c *ComputeClient) Services() *ServicesClient
Services returns a Compute client used for accessing functions pertaining to Services functionality in the Triton API.
func (*ComputeClient) SetHeader ¶
func (c *ComputeClient) SetHeader(header *http.Header)
SetHeaders allows a consumer of the current client to set custom headers for the next backend HTTP request sent to CloudAPI
func (*ComputeClient) Snapshots ¶
func (c *ComputeClient) Snapshots() *SnapshotsClient
Snapshots returns a Compute client used for accessing functions pertaining to Snapshots functionality in the Triton API.
func (*ComputeClient) Volumes ¶
func (c *ComputeClient) Volumes() *VolumesClient
Snapshots returns a Compute client used for accessing functions pertaining to Snapshots functionality in the Triton API.
type CreateImageFromMachineInput ¶
type CreateImageFromMachineInput struct { MachineID string `json:"machine"` Name string `json:"name"` Version string `json:"version,omitempty"` Description string `json:"description,omitempty"` HomePage string `json:"homepage,omitempty"` EULA string `json:"eula,omitempty"` ACL []string `json:"acl,omitempty"` Tags map[string]string `json:"tags,omitempty"` }
type CreateInstanceInput ¶
type CreateInstanceInput struct { Name string NamePrefix string Package string Image string Networks []string NetworkObjects []NetworkObject Affinity []string LocalityStrict bool LocalityNear []string LocalityFar []string Metadata map[string]string Tags map[string]string // FirewallEnabled bool // CNS InstanceCNS Volumes []InstanceVolume }
type CreateSnapshotInput ¶
type CreateVolumeInput ¶
type DataCenter ¶
type DataCentersClient ¶
type DataCentersClient struct {
// contains filtered or unexported fields
}
func (*DataCentersClient) Get ¶
func (c *DataCentersClient) Get(ctx context.Context, input *GetDataCenterInput) (*DataCenter, error)
func (*DataCentersClient) List ¶
func (c *DataCentersClient) List(ctx context.Context, _ *ListDataCentersInput) ([]*DataCenter, error)
type DeleteAllMetadataInput ¶
type DeleteAllMetadataInput struct {
ID string
}
type DeleteImageInput ¶
type DeleteImageInput struct {
ImageID string
}
type DeleteInstanceInput ¶
type DeleteInstanceInput struct {
ID string
}
type DeleteMetadataInput ¶
type DeleteSnapshotInput ¶
type DeleteTagInput ¶
type DeleteTagsInput ¶
type DeleteTagsInput struct {
ID string
}
type DeleteVolumeInput ¶
type DeleteVolumeInput struct {
ID string
}
type DisableDeletionProtectionInput ¶
type DisableDeletionProtectionInput struct {
InstanceID string
}
type DisableFirewallInput ¶
type DisableFirewallInput struct {
ID string
}
type EnableDeletionProtectionInput ¶
type EnableDeletionProtectionInput struct {
InstanceID string
}
type EnableFirewallInput ¶
type EnableFirewallInput struct {
ID string
}
type ExportImageInput ¶
type GetDataCenterInput ¶
type GetDataCenterInput struct {
Name string
}
type GetImageInput ¶
type GetImageInput struct {
ImageID string
}
type GetInstanceInput ¶
type GetInstanceInput struct {
ID string
}
func (*GetInstanceInput) Validate ¶
func (gmi *GetInstanceInput) Validate() error
type GetMetadataInput ¶
type GetNICInput ¶
type GetPackageInput ¶
type GetPackageInput struct {
ID string
}
type GetSnapshotInput ¶
type GetTagInput ¶
type GetVolumeInput ¶
type GetVolumeInput struct {
ID string
}
type Image ¶
type Image struct { ID string `json:"id"` Name string `json:"name"` OS string `json:"os"` Description string `json:"description"` Version string `json:"version"` Type string `json:"type"` Requirements map[string]interface{} `json:"requirements"` Homepage string `json:"homepage"` Files []*ImageFile `json:"files"` PublishedAt time.Time `json:"published_at"` Owner string `json:"owner"` Public bool `json:"public"` State string `json:"state"` Tags map[string]string `json:"tags"` EULA string `json:"eula"` ACL []string `json:"acl"` }
type ImagesClient ¶
type ImagesClient struct {
// contains filtered or unexported fields
}
func (*ImagesClient) CreateFromMachine ¶
func (c *ImagesClient) CreateFromMachine(ctx context.Context, input *CreateImageFromMachineInput) (*Image, error)
func (*ImagesClient) Delete ¶
func (c *ImagesClient) Delete(ctx context.Context, input *DeleteImageInput) error
func (*ImagesClient) Export ¶
func (c *ImagesClient) Export(ctx context.Context, input *ExportImageInput) (*MantaLocation, error)
func (*ImagesClient) Get ¶
func (c *ImagesClient) Get(ctx context.Context, input *GetImageInput) (*Image, error)
func (*ImagesClient) List ¶
func (c *ImagesClient) List(ctx context.Context, input *ListImagesInput) ([]*Image, error)
func (*ImagesClient) Update ¶
func (c *ImagesClient) Update(ctx context.Context, input *UpdateImageInput) (*Image, error)
type Instance ¶
type Instance struct { ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` Brand string `json:"brand"` State string `json:"state"` Image string `json:"image"` Memory int `json:"memory"` Disk int `json:"disk"` Metadata map[string]string `json:"metadata"` Tags map[string]interface{} `json:"tags"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` Docker bool `json:"docker"` IPs []string `json:"ips"` Networks []string `json:"networks"` PrimaryIP string `json:"primaryIp"` FirewallEnabled bool `json:"firewall_enabled"` ComputeNode string `json:"compute_node"` Package string `json:"package"` DomainNames []string `json:"dns_names"` DeletionProtection bool `json:"deletion_protection"` CNS InstanceCNS }
type InstanceCNS ¶
InstanceCNS is a container for the CNS-specific attributes. In the API these values are embedded within a Instance's Tags attribute, however they are exposed to the caller as their native types.
func TagsExtractMeta ¶
func TagsExtractMeta(tags map[string]interface{}) (InstanceCNS, map[string]interface{})
TagsExtractMeta extracts all of the misc parameters from Tags and returns a clean CNS and Tags struct.
type InstanceVolume ¶
type InstancesClient ¶
type InstancesClient struct {
// contains filtered or unexported fields
}
func (*InstancesClient) AddNIC ¶
func (c *InstancesClient) AddNIC(ctx context.Context, input *AddNICInput) (*NIC, error)
AddNIC asynchronously adds a NIC to a given instance. If a NIC for a given network already exists, a ResourceFound error will be returned. The status of the addition of a NIC can be polled by calling GetNIC()'s and testing NIC until its state is set to "running". Only one NIC per network may exist. Warning: this operation causes the instance to restart.
func (*InstancesClient) AddTags ¶
func (c *InstancesClient) AddTags(ctx context.Context, input *AddTagsInput) error
func (*InstancesClient) Count ¶
func (c *InstancesClient) Count(ctx context.Context, input *ListInstancesInput) (int, error)
func (*InstancesClient) Create ¶
func (c *InstancesClient) Create(ctx context.Context, input *CreateInstanceInput) (*Instance, error)
func (*InstancesClient) Delete ¶
func (c *InstancesClient) Delete(ctx context.Context, input *DeleteInstanceInput) error
func (*InstancesClient) DeleteAllMetadata ¶
func (c *InstancesClient) DeleteAllMetadata(ctx context.Context, input *DeleteAllMetadataInput) error
DeleteAllMetadata deletes all metadata keys from this instance
func (*InstancesClient) DeleteMetadata ¶
func (c *InstancesClient) DeleteMetadata(ctx context.Context, input *DeleteMetadataInput) error
DeleteMetadata deletes a single metadata key from an instance
func (*InstancesClient) DeleteTag ¶
func (c *InstancesClient) DeleteTag(ctx context.Context, input *DeleteTagInput) error
func (*InstancesClient) DeleteTags ¶
func (c *InstancesClient) DeleteTags(ctx context.Context, input *DeleteTagsInput) error
func (*InstancesClient) DisableDeletionProtection ¶
func (c *InstancesClient) DisableDeletionProtection(ctx context.Context, input *DisableDeletionProtectionInput) error
func (*InstancesClient) DisableFirewall ¶
func (c *InstancesClient) DisableFirewall(ctx context.Context, input *DisableFirewallInput) error
func (*InstancesClient) EnableDeletionProtection ¶
func (c *InstancesClient) EnableDeletionProtection(ctx context.Context, input *EnableDeletionProtectionInput) error
func (*InstancesClient) EnableFirewall ¶
func (c *InstancesClient) EnableFirewall(ctx context.Context, input *EnableFirewallInput) error
func (*InstancesClient) Get ¶
func (c *InstancesClient) Get(ctx context.Context, input *GetInstanceInput) (*Instance, error)
func (*InstancesClient) GetMetadata ¶
func (c *InstancesClient) GetMetadata(ctx context.Context, input *GetMetadataInput) (string, error)
GetMetadata returns a single metadata entry associated with an instance.
func (*InstancesClient) GetNIC ¶
func (c *InstancesClient) GetNIC(ctx context.Context, input *GetNICInput) (*NIC, error)
func (*InstancesClient) GetTag ¶
func (c *InstancesClient) GetTag(ctx context.Context, input *GetTagInput) (string, error)
func (*InstancesClient) List ¶
func (c *InstancesClient) List(ctx context.Context, input *ListInstancesInput) ([]*Instance, error)
func (*InstancesClient) ListMetadata ¶
func (c *InstancesClient) ListMetadata(ctx context.Context, input *ListMetadataInput) (map[string]string, error)
func (*InstancesClient) ListNICs ¶
func (c *InstancesClient) ListNICs(ctx context.Context, input *ListNICsInput) ([]*NIC, error)
func (*InstancesClient) ListTags ¶
func (c *InstancesClient) ListTags(ctx context.Context, input *ListTagsInput) (map[string]interface{}, error)
func (*InstancesClient) Reboot ¶
func (c *InstancesClient) Reboot(ctx context.Context, input *RebootInstanceInput) error
func (*InstancesClient) RemoveNIC ¶
func (c *InstancesClient) RemoveNIC(ctx context.Context, input *RemoveNICInput) error
RemoveNIC removes a given NIC from a machine asynchronously. The status of the removal can be polled via GetNIC(). When GetNIC() returns a 404, the NIC has been removed from the instance. Warning: this operation causes the machine to restart.
func (*InstancesClient) Rename ¶
func (c *InstancesClient) Rename(ctx context.Context, input *RenameInstanceInput) error
func (*InstancesClient) ReplaceTags ¶
func (c *InstancesClient) ReplaceTags(ctx context.Context, input *ReplaceTagsInput) error
func (*InstancesClient) Resize ¶
func (c *InstancesClient) Resize(ctx context.Context, input *ResizeInstanceInput) error
func (*InstancesClient) Start ¶
func (c *InstancesClient) Start(ctx context.Context, input *StartInstanceInput) error
func (*InstancesClient) Stop ¶
func (c *InstancesClient) Stop(ctx context.Context, input *StopInstanceInput) error
func (*InstancesClient) UpdateMetadata ¶
func (c *InstancesClient) UpdateMetadata(ctx context.Context, input *UpdateMetadataInput) (map[string]string, error)
type ListDataCentersInput ¶
type ListDataCentersInput struct{}
type ListImagesInput ¶
type ListInstancesInput ¶
type ListMetadataInput ¶
type ListNICsInput ¶
type ListNICsInput struct {
InstanceID string
}
type ListPackagesInput ¶
type ListServicesInput ¶
type ListServicesInput struct{}
type ListSnapshotsInput ¶
type ListSnapshotsInput struct {
MachineID string
}
type ListTagsInput ¶
type ListTagsInput struct {
ID string
}
type ListVolumesInput ¶
type MantaLocation ¶
type NetworkObject ¶
type Package ¶
type Package struct { ID string `json:"id"` Name string `json:"name"` Memory int64 `json:"memory"` Disk int64 `json:"disk"` Swap int64 `json:"swap"` LWPs int64 `json:"lwps"` VCPUs int64 `json:"vcpus"` Version string `json:"version"` Group string `json:"group"` Description string `json:"description"` Default bool `json:"default"` }
type PackagesClient ¶
type PackagesClient struct {
// contains filtered or unexported fields
}
func (*PackagesClient) Get ¶
func (c *PackagesClient) Get(ctx context.Context, input *GetPackageInput) (*Package, error)
func (*PackagesClient) List ¶
func (c *PackagesClient) List(ctx context.Context, input *ListPackagesInput) ([]*Package, error)
type PingOutput ¶
type RebootInstanceInput ¶
type RebootInstanceInput struct {
InstanceID string
}
type RemoveNICInput ¶
type RenameInstanceInput ¶
type ReplaceTagsInput ¶
type ReplaceTagsInput struct { ID string Tags map[string]string CNS InstanceCNS }
type ResizeInstanceInput ¶
type ServicesClient ¶
type ServicesClient struct {
// contains filtered or unexported fields
}
func (*ServicesClient) List ¶
func (c *ServicesClient) List(ctx context.Context, _ *ListServicesInput) ([]*Service, error)
type SnapshotsClient ¶
type SnapshotsClient struct {
// contains filtered or unexported fields
}
func (*SnapshotsClient) Create ¶
func (c *SnapshotsClient) Create(ctx context.Context, input *CreateSnapshotInput) (*Snapshot, error)
func (*SnapshotsClient) Delete ¶
func (c *SnapshotsClient) Delete(ctx context.Context, input *DeleteSnapshotInput) error
func (*SnapshotsClient) Get ¶
func (c *SnapshotsClient) Get(ctx context.Context, input *GetSnapshotInput) (*Snapshot, error)
func (*SnapshotsClient) List ¶
func (c *SnapshotsClient) List(ctx context.Context, input *ListSnapshotsInput) ([]*Snapshot, error)
func (*SnapshotsClient) StartMachine ¶
func (c *SnapshotsClient) StartMachine(ctx context.Context, input *StartMachineFromSnapshotInput) error
type StartInstanceInput ¶
type StartInstanceInput struct {
InstanceID string
}
type StopInstanceInput ¶
type StopInstanceInput struct {
InstanceID string
}
type UpdateImageInput ¶
type UpdateImageInput struct { ImageID string `json:"-"` Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` Description string `json:"description,omitempty"` HomePage string `json:"homepage,omitempty"` EULA string `json:"eula,omitempty"` ACL []string `json:"acl,omitempty"` Tags map[string]string `json:"tags,omitempty"` }
type UpdateMetadataInput ¶
type UpdateVolumeInput ¶
type Volume ¶
type Volume struct { ID string `json:"id"` Name string `json:"name"` Owner string `json:"owner_uuid"` Type string `json:"type"` FileSystemPath string `json:"filesystem_path"` Size int64 `json:"size"` State string `json:"state"` Networks []string `json:"networks"` Refs []string `json:"refs"` Tags map[string]string `json:"tags"` }
type VolumesClient ¶
type VolumesClient struct {
// contains filtered or unexported fields
}
func (*VolumesClient) Create ¶
func (c *VolumesClient) Create(ctx context.Context, input *CreateVolumeInput) (*Volume, error)
func (*VolumesClient) Delete ¶
func (c *VolumesClient) Delete(ctx context.Context, input *DeleteVolumeInput) error
func (*VolumesClient) Get ¶
func (c *VolumesClient) Get(ctx context.Context, input *GetVolumeInput) (*Volume, error)
func (*VolumesClient) List ¶
func (c *VolumesClient) List(ctx context.Context, input *ListVolumesInput) ([]*Volume, error)
func (*VolumesClient) Update ¶
func (c *VolumesClient) Update(ctx context.Context, input *UpdateVolumeInput) error