cloudapi

package
v0.0.0-...-8053c4d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2016 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cloudapi interacts with the Cloud API (http://apidocs.joyent.com/cloudapi/).

Licensed under the Mozilla Public License version 2.0

Copyright (c) Joyent Inc.

Index

Constants

View Source
const (
	// DefaultAPIVersion defines the default version of the Cloud API to use
	DefaultAPIVersion = "~7.3"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Analytics

type Analytics struct {
	Modules         map[string]interface{} // Namespace to organize metrics
	Fields          map[string]interface{} // Fields represent metadata by which data points can be filtered or decomposed
	Types           map[string]interface{} // Types are used with both metrics and fields for two purposes: to hint to clients at how to best label values, and to distinguish between numeric and discrete quantities.
	Metrics         map[string]interface{} // Metrics describe quantities which can be measured by the system
	Transformations map[string]interface{} // Transformations are post-processing functions that can be applied to data when it's retrieved.
}

Analytics represents the available analytics

type AuditAction

type AuditAction struct {
	Action     string                 // Action name
	Parameters map[string]interface{} // Original set of parameters sent when the action was requested
	Time       string                 // When the action finished
	Success    string                 // Either 'yes' or 'no', depending on the action successfulness
	Caller     Caller                 // Account requesting the action
}

AuditAction represents an action/event accomplished by a machine.

type Caller

type Caller struct {
	Type  string // Authentication type for the action request. One of 'basic', 'operator', 'signature' or 'token'
	User  string // When the authentication type is 'basic', this member will be present and include user login
	IP    string // The IP addresses this from which the action was requested. Not present if type is 'operator'
	KeyId string // When authentication type is either 'signature' or 'token', SSH key identifier
}

Caller represents an account requesting an action.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides a means to access the Joyent CloudAPI

func New

func New(client client.Client) *Client

New creates a new Client.

func (*Client) AddMachineTags

func (c *Client) AddMachineTags(machineID string, tags map[string]string) (map[string]string, error)

AddMachineTags adds additional tags to the specified machine. This API lets you append new tags, not overwrite existing tags. See API docs: http://apidocs.joyent.com/cloudapi/#AddMachineTags

func (*Client) AddNIC

func (c *Client) AddNIC(machineID, networkID string) (*NIC, error)

AddNIC creates a new NIC on a machine belonging to a given account. *WARNING*: this causes the machine to reboot while adding the NIC. See API docs: https://apidocs.joyent.com/cloudapi/#AddNic

func (*Client) CountMachines

func (c *Client) CountMachines() (int, error)

CountMachines returns the number of machines on record for an account. See API docs: http://apidocs.joyent.com/cloudapi/#ListMachines

func (*Client) CreateFabricNetwork

func (c *Client) CreateFabricNetwork(vlanID int16, opts CreateFabricNetworkOpts) (*FabricNetwork, error)

CreateFabricNetwork creates a new fabric network See API docs: https://apidocs.joyent.com/cloudapi/#CreateFabricNetwork

func (*Client) CreateFabricVLAN

func (c *Client) CreateFabricVLAN(vlan FabricVLAN) (*FabricVLAN, error)

CreateFabricVLAN creates a new VLAN with the specified options See API docs: https://apidocs.joyent.com/cloudapi/#CreateFabricVLAN

func (*Client) CreateFirewallRule

func (c *Client) CreateFirewallRule(opts CreateFwRuleOpts) (*FirewallRule, error)

CreateFirewallRule creates the firewall rule with the specified options. See API docs: http://apidocs.joyent.com/cloudapi/#CreateFirewallRule

func (*Client) CreateImageFromMachine

func (c *Client) CreateImageFromMachine(opts CreateImageFromMachineOpts) (*Image, error)

CreateImageFromMachine (Beta) Create a new custom image from a machine. See API docs: http://apidocs.joyent.com/cloudapi/#ListImages

func (*Client) CreateInstrumentation

func (c *Client) CreateInstrumentation(opts CreateInstrumentationOpts) (*Instrumentation, error)

CreateInstrumentation Creates an instrumentation. You can clone an existing instrumentation by passing in the parameter clone, which should be a numeric id of an existing instrumentation. See API docs: http://apidocs.joyent.com/cloudapi/#CreateInstrumentation

func (*Client) CreateKey

func (c *Client) CreateKey(opts CreateKeyOpts) (*Key, error)

CreateKey creates a new key with the specified options. See API docs: http://apidocs.joyent.com/cloudapi/#CreateKey

func (*Client) CreateMachine

func (c *Client) CreateMachine(opts CreateMachineOpts) (*Machine, error)

CreateMachine creates a new machine with the options specified. See API docs: http://apidocs.joyent.com/cloudapi/#CreateMachine

func (*Client) CreateMachineSnapshot

func (c *Client) CreateMachineSnapshot(machineID string, opts SnapshotOpts) (*Snapshot, error)

CreateMachineSnapshot creates a new snapshot for the machine with the options specified. See API docs: http://apidocs.joyent.com/cloudapi/#CreateMachineSnapshot

func (*Client) DeleteAllMachineMetadata

func (c *Client) DeleteAllMachineMetadata(machineID string) error

DeleteAllMachineMetadata deletes all metadata keys from the specified machine. See API docs: http://apidocs.joyent.com/cloudapi/#DeleteAllMachineMetadata

func (*Client) DeleteFabricNetwork

func (c *Client) DeleteFabricNetwork(vlanID int16, networkID string) error

DeleteFabricNetwork deletes an existing fabric network See API docs: https://apidocs.joyent.com/cloudapi/#DeleteFabricNetwork

func (*Client) DeleteFabricVLAN

func (c *Client) DeleteFabricVLAN(vlanID int16) error

DeleteFabricVLAN delets a given VLAN as specified by ID See API docs: https://apidocs.joyent.com/cloudapi/#DeleteFabricVLAN

func (*Client) DeleteFirewallRule

func (c *Client) DeleteFirewallRule(fwRuleID string) error

DeleteFirewallRule removes the given firewall rule record from all the required account machines. See API docs: http://apidocs.joyent.com/cloudapi/#DeleteFirewallRule

func (*Client) DeleteImage

func (c *Client) DeleteImage(imageID string) error

DeleteImage (Beta) Delete the image specified by imageId. Must be image owner to do so. See API docs: http://apidocs.joyent.com/cloudapi/#DeleteImage

func (*Client) DeleteInstrumentation

func (c *Client) DeleteInstrumentation(instrumentationID string) error

DeleteInstrumentation destroys an instrumentation. See API docs: http://apidocs.joyent.com/cloudapi/#DeleteInstrumentation

func (*Client) DeleteKey

func (c *Client) DeleteKey(keyName string) error

DeleteKey deletes the key identified by keyName. See API docs: http://apidocs.joyent.com/cloudapi/#DeleteKey

func (*Client) DeleteMachine

func (c *Client) DeleteMachine(machineID string) error

DeleteMachine allows you to completely destroy a machine. Machine must be in the 'stopped' state. See API docs: http://apidocs.joyent.com/cloudapi/#DeleteMachine

func (*Client) DeleteMachineMetadata

func (c *Client) DeleteMachineMetadata(machineID, metadataKey string) error

DeleteMachineMetadata deletes a single metadata key from the specified machine. See API docs: http://apidocs.joyent.com/cloudapi/#DeleteMachineMetadata

func (*Client) DeleteMachineSnapshot

func (c *Client) DeleteMachineSnapshot(machineID, snapshotName string) error

DeleteMachineSnapshot deletes the specified snapshot. See API docs: http://apidocs.joyent.com/cloudapi/#DeleteMachineSnapshot

func (*Client) DeleteMachineTag

func (c *Client) DeleteMachineTag(machineID, tagKey string) error

DeleteMachineTag deletes a single tag from the specified machine. See API docs: http://apidocs.joyent.com/cloudapi/#DeleteMachineTag

func (*Client) DeleteMachineTags

func (c *Client) DeleteMachineTags(machineID string) error

DeleteMachineTags deletes all tags from the specified machine. See API docs: http://apidocs.joyent.com/cloudapi/#DeleteMachineTags

func (*Client) DescribeAnalytics

func (c *Client) DescribeAnalytics() (*Analytics, error)

DescribeAnalytics retrieves the "schema" for instrumentations that can be created. See API docs: http://apidocs.joyent.com/cloudapi/#DescribeAnalytics

func (*Client) DisableFirewallMachine

func (c *Client) DisableFirewallMachine(machineID string) error

DisableFirewallMachine disables the firewall for the specified machine. See API docs: http://apidocs.joyent.com/cloudapi/#DisableMachineFirewall

func (*Client) DisableFirewallRule

func (c *Client) DisableFirewallRule(fwRuleID string) (*FirewallRule, error)

DisableFirewallRule disables the given firewall rule record if it is enabled. See API docs: http://apidocs.joyent.com/cloudapi/#DisableFirewallRule

func (*Client) EnableFirewallMachine

func (c *Client) EnableFirewallMachine(machineID string) error

EnableFirewallMachine enables the firewall for the specified machine. See API docs: http://apidocs.joyent.com/cloudapi/#EnableMachineFirewall

func (*Client) EnableFirewallRule

func (c *Client) EnableFirewallRule(fwRuleID string) (*FirewallRule, error)

EnableFirewallRule enables the given firewall rule record if it is disabled. See API docs: http://apidocs.joyent.com/cloudapi/#EnableFirewallRule

func (*Client) ExportImage

func (c *Client) ExportImage(imageID string, opts ExportImageOpts) (*MantaLocation, error)

ExportImage (Beta) Exports an image to the specified Manta path. See API docs: http://apidocs.joyent.com/cloudapi/#ListImages

func (*Client) GetDatacenter

func (c *Client) GetDatacenter(datacenterName string) (string, error)

GetDatacenter gets an individual datacenter by name. Returns an HTTP redirect to your client, the datacenter URL is in the Location header. See API docs: http://apidocs.joyent.com/cloudapi/#GetDatacenter

func (*Client) GetFabricNetwork

func (c *Client) GetFabricNetwork(vlanID int16, networkID string) (*FabricNetwork, error)

GetFabricNetwork gets a single network by VLAN and Network IDs See API docs: https://apidocs.joyent.com/cloudapi/#GetFabricNetwork

func (*Client) GetFabricVLAN

func (c *Client) GetFabricVLAN(vlanID int16) (*FabricVLAN, error)

GetFabricLAN retrieves a single VLAN by ID See API docs: https://apidocs.joyent.com/cloudapi/#GetFabricVLAN

func (*Client) GetFirewallRule

func (c *Client) GetFirewallRule(fwRuleID string) (*FirewallRule, error)

GetFirewallRule returns the specified firewall rule. See API docs: http://apidocs.joyent.com/cloudapi/#GetFirewallRule

func (*Client) GetImage

func (c *Client) GetImage(imageID string) (*Image, error)

GetImage returns the image specified by imageId. See API docs: http://apidocs.joyent.com/cloudapi/#GetImage

func (*Client) GetInstrumentation

func (c *Client) GetInstrumentation(instrumentationID string) (*Instrumentation, error)

GetInstrumentation retrieves the configuration for the specified instrumentation. See API docs: http://apidocs.joyent.com/cloudapi/#GetInstrumentation

func (*Client) GetInstrumentationHeatmap

func (c *Client) GetInstrumentationHeatmap(instrumentationID string) (*Heatmap, error)

GetInstrumentationHeatmap retrieves the specified instrumentation's heatmap. See API docs: http://apidocs.joyent.com/cloudapi/#GetInstrumentationHeatmap

func (*Client) GetInstrumentationHeatmapDetails

func (c *Client) GetInstrumentationHeatmapDetails(instrumentationID string) (*Heatmap, error)

GetInstrumentationHeatmapDetails allows you to retrieve the bucket details for a heatmap. See API docs: http://apidocs.joyent.com/cloudapi/#GetInstrumentationHeatmapDetails

func (*Client) GetInstrumentationValue

func (c *Client) GetInstrumentationValue(instrumentationID string) (*InstrumentationValue, error)

GetInstrumentationValue retrieves the data associated to an instrumentation for a point in time. See API docs: http://apidocs.joyent.com/cloudapi/#GetInstrumentationValue

func (*Client) GetKey

func (c *Client) GetKey(keyName string) (*Key, error)

GetKey returns the key identified by keyName. See API docs: http://apidocs.joyent.com/cloudapi/#GetKey

func (*Client) GetMachine

func (c *Client) GetMachine(machineID string) (*Machine, error)

GetMachine returns the machine specified by machineId. See API docs: http://apidocs.joyent.com/cloudapi/#GetMachine

func (*Client) GetMachineMetadata

func (c *Client) GetMachineMetadata(machineID string) (map[string]interface{}, error)

GetMachineMetadata returns the complete set of metadata associated with the specified machine. See API docs: http://apidocs.joyent.com/cloudapi/#GetMachineMetadata

func (*Client) GetMachineSnapshot

func (c *Client) GetMachineSnapshot(machineID, snapshotName string) (*Snapshot, error)

GetMachineSnapshot returns the state of the specified snapshot. See API docs: http://apidocs.joyent.com/cloudapi/#GetMachineSnapshot

func (*Client) GetMachineTag

func (c *Client) GetMachineTag(machineID, tagKey string) (string, error)

GetMachineTag returns the value for a single tag on the specified machine. See API docs: http://apidocs.joyent.com/cloudapi/#GetMachineTag

func (*Client) GetNIC

func (c *Client) GetNIC(machineID, MAC string) (*NIC, error)

GetNIC gets a specific NIC on a machine belonging to a given account See API docs: https://apidocs.joyent.com/cloudapi/#GetNic

func (*Client) GetNetwork

func (c *Client) GetNetwork(networkID string) (*Network, error)

GetNetwork retrieves an individual network record. See API docs: http://apidocs.joyent.com/cloudapi/#GetNetwork

func (*Client) GetPackage

func (c *Client) GetPackage(packageName string) (*Package, error)

GetPackage returns the package specified by packageName. NOTE: packageName can specify either the package name or package ID. See API docs: http://apidocs.joyent.com/cloudapi/#GetPackage

func (*Client) ListDatacenters

func (c *Client) ListDatacenters() (map[string]interface{}, error)

ListDatacenters provides a list of all datacenters this cloud is aware of. See API docs: http://apidocs.joyent.com/cloudapi/#ListDatacenters

func (*Client) ListFabricNetworks

func (c *Client) ListFabricNetworks(vlanID int16) ([]FabricNetwork, error)

ListFabricNetworks lists the networks inside the given VLAN See API docs: https://apidocs.joyent.com/cloudapi/#ListFabricNetworks

func (*Client) ListFabricVLANs

func (c *Client) ListFabricVLANs() ([]FabricVLAN, error)

ListFabricVLANs lists VLANs See API docs: https://apidocs.joyent.com/cloudapi/#ListFabricVLANs

func (*Client) ListFirewallRuleMachines

func (c *Client) ListFirewallRuleMachines(fwRuleID string) ([]Machine, error)

ListFirewallRuleMachines return the list of machines affected by the given firewall rule. See API docs: http://apidocs.joyent.com/cloudapi/#ListFirewallRuleMachines

func (*Client) ListFirewallRules

func (c *Client) ListFirewallRules() ([]FirewallRule, error)

ListFirewallRules lists all the firewall rules on record for a specified account. See API docs: http://apidocs.joyent.com/cloudapi/#ListFirewallRules

func (*Client) ListImages

func (c *Client) ListImages(filter *Filter) ([]Image, error)

ListImages provides a list of images available in the datacenter. See API docs: http://apidocs.joyent.com/cloudapi/#ListImages

func (*Client) ListInstrumentations

func (c *Client) ListInstrumentations() ([]Instrumentation, error)

ListInstrumentations retrieves all currently created instrumentations. See API docs: http://apidocs.joyent.com/cloudapi/#ListInstrumentations

func (*Client) ListKeys

func (c *Client) ListKeys() ([]Key, error)

ListKeys returns a list of public keys registered with a specific account. See API docs: http://apidocs.joyent.com/cloudapi/#ListKeys

func (*Client) ListMachineFirewallRules

func (c *Client) ListMachineFirewallRules(machineID string) ([]FirewallRule, error)

ListMachineFirewallRules lists all the firewall rules for the specified machine. See API docs: http://apidocs.joyent.com/cloudapi/#ListMachineFirewallRules

func (*Client) ListMachineSnapshots

func (c *Client) ListMachineSnapshots(machineID string) ([]Snapshot, error)

ListMachineSnapshots lists all snapshots for the specified machine. See API docs: http://apidocs.joyent.com/cloudapi/#ListMachineSnapshots

func (*Client) ListMachineTags

func (c *Client) ListMachineTags(machineID string) (map[string]string, error)

ListMachineTags returns the complete set of tags associated with the specified machine. See API docs: http://apidocs.joyent.com/cloudapi/#ListMachineTags

func (*Client) ListMachines

func (c *Client) ListMachines(filter *Filter) ([]Machine, error)

ListMachines lists all machines on record for an account. You can paginate this API by passing in offset, and limit See API docs: http://apidocs.joyent.com/cloudapi/#ListMachines

func (*Client) ListNICs

func (c *Client) ListNICs(machineID string) ([]NIC, error)

ListNICs lists all the NICs on a machine belonging to a given account See API docs: https://apidocs.joyent.com/cloudapi/#ListNics

func (*Client) ListNetworks

func (c *Client) ListNetworks() ([]Network, error)

ListNetworks lists all the networks which can be used by the given account. See API docs: http://apidocs.joyent.com/cloudapi/#ListNetworks

func (*Client) ListPackages

func (c *Client) ListPackages(filter *Filter) ([]Package, error)

ListPackages provides a list of packages available in the datacenter. See API docs: http://apidocs.joyent.com/cloudapi/#ListPackages

func (*Client) MachineAudit

func (c *Client) MachineAudit(machineID string) ([]AuditAction, error)

MachineAudit provides a list of machine's accomplished actions, (sorted from latest to older one). See API docs: http://apidocs.joyent.com/cloudapi/#MachineAudit

func (*Client) RebootMachine

func (c *Client) RebootMachine(machineID string) error

RebootMachine reboots (stop followed by a start) a machine. See API docs: http://apidocs.joyent.com/cloudapi/#RebootMachine

func (*Client) RemoveNIC

func (c *Client) RemoveNIC(machineID, MAC string) error

RemoveNIC removes a NIC on a machine belonging to a given account. *WARNING*: this causes the machine to reboot while removing the NIC. See API docs: https://apidocs.joyent.com/cloudapi/#RemoveNic

func (*Client) RenameMachine

func (c *Client) RenameMachine(machineID, machineName string) error

RenameMachine renames an existing machine. See API docs: http://apidocs.joyent.com/cloudapi/#RenameMachine

func (*Client) ReplaceMachineTags

func (c *Client) ReplaceMachineTags(machineID string, tags map[string]string) (map[string]string, error)

ReplaceMachineTags replaces existing tags for the specified machine. This API lets you overwrite existing tags, not append to existing tags. See API docs: http://apidocs.joyent.com/cloudapi/#ReplaceMachineTags

func (*Client) ResizeMachine

func (c *Client) ResizeMachine(machineID, packageName string) error

ResizeMachine allows you to resize a SmartMachine. Virtual machines can also be resized, but only resizing virtual machines to a higher capacity package is supported. See API docs: http://apidocs.joyent.com/cloudapi/#ResizeMachine

func (*Client) StartMachine

func (c *Client) StartMachine(machineID string) error

StartMachine starts a stopped machine. See API docs: http://apidocs.joyent.com/cloudapi/#StartMachine

func (*Client) StartMachineFromSnapshot

func (c *Client) StartMachineFromSnapshot(machineID, snapshotName string) error

StartMachineFromSnapshot starts the machine from the specified snapshot. Machine must be in 'stopped' state. See API docs: http://apidocs.joyent.com/cloudapi/#StartMachineFromSnapshot

func (*Client) StopMachine

func (c *Client) StopMachine(machineID string) error

StopMachine stops a running machine. See API docs: http://apidocs.joyent.com/cloudapi/#StopMachine

func (*Client) UpdateFabricVLAN

func (c *Client) UpdateFabricVLAN(vlan FabricVLAN) (*FabricVLAN, error)

UpdateFabricVLAN updates a given VLAN with new fields See API docs: https://apidocs.joyent.com/cloudapi/#UpdateFabricVLAN

func (*Client) UpdateFirewallRule

func (c *Client) UpdateFirewallRule(fwRuleID string, opts CreateFwRuleOpts) (*FirewallRule, error)

UpdateFirewallRule updates the specified firewall rule. See API docs: http://apidocs.joyent.com/cloudapi/#UpdateFirewallRule

func (*Client) UpdateMachineMetadata

func (c *Client) UpdateMachineMetadata(machineID string, metadata map[string]string) (map[string]interface{}, error)

UpdateMachineMetadata updates the metadata for a given machine. Any metadata keys passed in here are created if they do not exist, and overwritten if they do. See API docs: http://apidocs.joyent.com/cloudapi/#UpdateMachineMetadata

type CreateFabricNetworkOpts

type CreateFabricNetworkOpts struct {
	Name             string            `json:"name"`                  // Network name
	Description      string            `json:"description,omitempty"` // Optional description of network
	Subnet           string            `json:"subnet"`                // CIDR formatted string describing network
	ProvisionStartIp string            `json:"provision_start_ip"`    // First IP on the network that can be assigned
	ProvisionEndIp   string            `json:"provision_end_ip"`      // Last assignable IP on the network
	Gateway          string            `json:"gateway,omitempty"`     // Optional Gateway IP
	Resolvers        []string          `json:"resolvers,omitempty"`   // Array of IP addresses for resolvers
	Routes           map[string]string `json:"routes,omitempty"`      // Map of CIDR block to Gateway IP Address
	InternetNAT      bool              `json:"internet_nat"`          // If a NAT zone is provisioned at Gateway IP Address
}

type CreateFwRuleOpts

type CreateFwRuleOpts struct {
	Enabled bool   `json:"enabled"` // Whether to enable the rule or not
	Rule    string `json:"rule"`    // Firewall rule in the form 'FROM <target a> TO <target b> <action> <protocol> <port>'
}

CreateFwRuleOpts represent the option that can be specified when creating a new firewall rule.

type CreateImageFromMachineOpts

type CreateImageFromMachineOpts struct {
	Machine     string            `json:"machine"`               // The machine UUID from which the image is to be created
	Name        string            `json:"name"`                  // Image name
	Version     string            `json:"version"`               // Image version
	Description string            `json:"description,omitempty"` // Image description
	Homepage    string            `json:"homepage,omitempty"`    // URL for a web page including detailed information for this image
	EULA        string            `json:"eula,omitempty"`        // URL of the End User License Agreement (EULA) for the image
	ACL         []string          `json:"acl,omitempty"`         // An array of account UUIDs given access to a private image. The field is only relevant to private images
	Tags        map[string]string `json:"tags,omitempty"`        // A map of key/value pairs that allows clients to categorize images by any given criteria
}

CreateImageFromMachineOpts represent the option that can be specified when creating a new image from an existing machine.

type CreateInstrumentationOpts

type CreateInstrumentationOpts struct {
	Clone         int    `json:"clone"`     // An existing instrumentation ID to be cloned
	Module        string `json:"module"`    // Analytics module
	Stat          string `json:"stat"`      // Analytics stat
	Predicate     string `json:"predicate"` // Instrumentation predicate, must be JSON string
	Decomposition string `json:"decomposition"`
	Granularity   int    `json:"granularity"`    // Number of seconds between data points (default is 1)
	RetentionTime int    `json:"retention-time"` // How long to keep this instrumentation data for
	PersistData   bool   `json:"persist-data"`   // Whether or not to store this for historical analysis
	IdleMax       int    `json:"idle-max"`       // Number of seconds after which if the instrumentation or its data has not been accessed via the API the service may delete the instrumentation and its data
}

CreateInstrumentationOpts represent the option that can be specified when creating a new instrumentation.

type CreateKeyOpts

type CreateKeyOpts struct {
	Name string `json:"name"` // Name for the key, optional
	Key  string `json:"key"`  // OpenSSH formatted public key
}

CreateKeyOpts represent the option that can be specified when creating a new key.

type CreateMachineOpts

type CreateMachineOpts struct {
	Name            string            `json:"name"`             // Machine friendly name, default is a randomly generated name
	Package         string            `json:"package"`          // Name of the package to use on provisioning
	Image           string            `json:"image"`            // The image UUID
	Networks        []string          `json:"networks"`         // Desired networks IDs
	Metadata        map[string]string `json:"-"`                // An arbitrary set of metadata key/value pairs can be set at provision time
	Tags            map[string]string `json:"-"`                // An arbitrary set of tags can be set at provision time
	FirewallEnabled bool              `json:"firewall_enabled"` // Completely enable or disable firewall for this machine (new in API version 7.0)
}

CreateMachineOpts represent the option that can be specified when creating a new machine.

func (CreateMachineOpts) MarshalJSON

func (opts CreateMachineOpts) MarshalJSON() ([]byte, error)

MarshalJSON turns the given CreateMachineOpts into JSON

type ExportImageOpts

type ExportImageOpts struct {
	MantaPath string `json:"manta_path"` // The Manta path prefix to use when exporting the image
}

ExportImageOpts represent the option that can be specified when exporting an image.

type FabricNetwork

type FabricNetwork struct {
	Id               string            `json:"id"`                  // Unique identifier for network
	Name             string            `json:"name"`                // Network name
	Public           bool              `json:"public"`              // Whether or not this is an RFC1918 network
	Fabric           bool              `json:"fabric"`              // Whether this network is on a fabric
	Description      string            `json:"description"`         // Optional description of network
	Subnet           string            `json:"subnet"`              // CIDR formatted string describing network
	ProvisionStartIp string            `json:"provision_start_ip"`  // First IP on the network that can be assigned
	ProvisionEndIp   string            `json:"provision_end_ip"`    // Last assignable IP on the network
	Gateway          string            `json:"gateway"`             // Optional Gateway IP
	Resolvers        []string          `json:"resolvers,omitempty"` // Array of IP addresses for resolvers
	Routes           map[string]string `json:"routes,omitempty"`    // Map of CIDR block to Gateway IP Address
	InternetNAT      bool              `json:"internet_nat"`        // If a NAT zone is provisioned at Gateway IP Address
	VLANId           int16             `json:"vlan_id"`             // VLAN network is on
}

type FabricVLAN

type FabricVLAN struct {
	Id          int16  `json:"vlan_id"`               // Number between 0-4095 indicating VLAN Id
	Name        string `json:"name"`                  // Unique name to identify VLAN
	Description string `json:"description,omitempty"` // Optional description of the VLAN
}

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

Filter represents a filter that can be applied to an API request.

func NewFilter

func NewFilter() *Filter

NewFilter creates a new Filter.

func (*Filter) Add

func (f *Filter) Add(filter, value string)

Add a value for the specified filter.

func (*Filter) Set

func (f *Filter) Set(filter, value string)

Set a value for the specified filter.

type FirewallRule

type FirewallRule struct {
	Id      string // Unique identifier for the rule
	Enabled bool   // Whether the rule is enabled or not
	Rule    string // Firewall rule in the form 'FROM <target a> TO <target b> <action> <protocol> <port>'
}

FirewallRule represent a firewall rule that can be specifed for a machine.

type Heatmap

type Heatmap struct {
	BucketTime int                    `json:"bucket_time"` // Time corresponding to the bucket (Unix seconds)
	BucketYmin int                    `json:"bucket_ymin"` // Minimum y-axis value for the bucket
	BucketYmax int                    `json:"bucket_ymax"` // Maximum y-axis value for the bucket
	Present    map[string]interface{} `json:"present"`     // If the instrumentation defines a discrete decomposition, this property's value is an object whose keys are values of that field and whose values are the number of data points in that bucket for that key
	Total      int                    `json:"total"`       // The total number of data points in the bucket
}

Heatmap represents an instrumentation's heatmap

type HeatmapOpts

type HeatmapOpts struct {
	Height       int      `json:"height"`        // Height of the image in pixels
	Width        int      `json:"width"`         // Width of the image in pixels
	Ymin         int      `json:"ymin"`          // Y-Axis value for the bottom of the image (default: 0)
	Ymax         int      `json:"ymax"`          // Y-Axis value for the top of the image (default: auto)
	Nbuckets     int      `json:"nbuckets"`      // Number of buckets in the vertical dimension
	Selected     []string `json:"selected"`      // Array of field values to highlight, isolate or exclude
	Isolate      bool     `json:"isolate"`       // If true, only draw selected values
	Exclude      bool     `json:"exclude"`       // If true, don't draw selected values at all
	Hues         []string `json:"hues"`          // Array of colors for highlighting selected field values
	DecomposeAll bool     `json:"decompose_all"` // Highlight all field values
	X            int      `json:"x"`
	Y            int      `json:"y"`
}

HeatmapOpts represent the option that can be specified when retrieving an instrumentation.'s heatmap

type Image

type Image struct {
	Id           string                 // Unique identifier for the image
	Name         string                 // Image friendly name
	OS           string                 // Underlying operating system
	Version      string                 // Image version
	Type         string                 // Image type, one of 'smartmachine' or 'virtualmachine'
	Description  string                 // Image description
	Requirements map[string]interface{} // Minimum requirements for provisioning a machine with this image, e.g. 'password' indicates that a password must be provided
	Homepage     string                 // URL for a web page including detailed information for this image (new in API version 7.0)
	PublishedAt  string                 `json:"published_at"` // Time this image has been made publicly available (new in API version 7.0)
	Public       bool                   // Indicates if the image is publicly available (new in API version 7.1)
	State        string                 // Current image state. One of 'active', 'unactivated', 'disabled', 'creating', 'failed' (new in API version 7.1)
	Tags         map[string]string      // A map of key/value pairs that allows clients to categorize images by any given criteria (new in API version 7.1)
	EULA         string                 // URL of the End User License Agreement (EULA) for the image (new in API version 7.1)
	ACL          []string               // An array of account UUIDs given access to a private image. The field is only relevant to private images (new in API version 7.1)
	Owner        string                 // The UUID of the user owning the image
}

Image represent the software packages that will be available on newly provisioned machines

type Instrumentation

type Instrumentation struct {
	Module          string   `json:"module"`
	Stat            string   `json:"stat"`
	Predicate       string   `json:"predicate"`
	Decomposition   []string `json:"decomposition"`
	ValueDimension  int      `json:"value-dimenstion"`
	ValueArity      string   `json:"value-arity"`
	RetentionTime   int      `json:"retention-time"`
	Granularity     int      `json:"granularitiy"`
	IdleMax         int      `json:"idle-max"`
	Transformations []string `json:"transformations"`
	PersistData     bool     `json:"persist-data"`
	Crtime          int      `json:"crtime"`
	ValueScope      string   `json:"value-scope"`
	Id              string   `json:"id"`
	Uris            []Uri    `json:"uris"`
}

Instrumentation specify which metric to collect, how frequently to aggregate data (e.g., every second, every hour, etc.) how much data to keep (e.g., 10 minutes' worth, 6 months' worth, etc.) and other configuration options

type InstrumentationValue

type InstrumentationValue struct {
	Value           interface{}
	Transformations map[string]interface{}
	StartTime       int
	Duration        int
}

InstrumentationValue represents the data associated to an instrumentation for a point in time

type Key

type Key struct {
	Name        string // Name for the key
	Fingerprint string // Key Fingerprint
	Key         string // OpenSSH formatted public key
}

Key represent a public key

type Machine

type Machine struct {
	Id              string            // Unique identifier for the image
	Name            string            // Machine friendly name
	Type            string            // Machine type, one of 'smartmachine' or 'virtualmachine'
	State           string            // Current state of the machine
	Dataset         string            // The dataset URN the machine was provisioned with. For new images/datasets this value will be the dataset id, i.e, same value than the image attribute
	Memory          int               // The amount of memory the machine has (in Mb)
	Disk            int               // The amount of disk the machine has (in Gb)
	IPs             []string          // The IP addresses the machine has
	Metadata        map[string]string // Map of the machine metadata, e.g. authorized-keys
	Tags            map[string]string // Map of the machine tags
	Created         string            // When the machine was created
	Updated         string            // When the machine was updated
	Package         string            // The name of the package used to create the machine
	Image           string            // The image id the machine was provisioned with
	PrimaryIP       string            // The primary (public) IP address for the machine
	Networks        []string          // The network IDs for the machine
	FirewallEnabled bool              // whether or not the firewall is enabled
}

Machine represent a provisioned virtual machines

func (Machine) Equals

func (m Machine) Equals(other Machine) bool

Equals compares two machines. Ignores state and timestamps.

type MantaLocation

type MantaLocation struct {
	MantaURL     string `json:"manta_url"`     // Manta datacenter URL
	ImagePath    string `json:"image_path"`    // Path to the image
	ManifestPath string `json:"manifest_path"` // Path to the image manifest
}

MantaLocation represent the properties that allow a user to retrieve the image file and manifest from Manta

type NIC

type NIC struct {
	IP      string   `json:"ip"`      // NIC's IPv4 Address
	MAC     string   `json:"mac"`     // NIC's MAC address
	Primary bool     `json:"primary"` // Whether this is the machine's primary NIC
	Netmask string   `json:"netmask"` // IPv4 netmask
	Gateway string   `json:"gateway"` // IPv4 gateway
	State   NICState `json:"state"`   // Describes the state of the NIC (e.g. provisioning, running, or stopped)
	Network string   `json:"network"` // Network ID this NIC is attached to
}

NIC represents a NIC on a machine

type NICState

type NICState string

NICState represents the state of a NIC

var (
	NICStateProvisioning NICState = "provisioning"
	NICStateRunning      NICState = "running"
	NICStateStopped      NICState = "stopped"
)

type Network

type Network struct {
	Id          string // Unique identifier for the network
	Name        string // Network name
	Public      bool   // Whether this a public or private (rfc1918) network
	Description string // Optional description for this network, when name is not enough
}

Network represents a network available to a given account

type Package

type Package struct {
	Name        string // Name for the package
	Memory      int    // Memory available (in Mb)
	Disk        int    // Disk space available (in Gb)
	Swap        int    // Swap memory available (in Mb)
	VCPUs       int    // Number of VCPUs for the package
	Default     bool   // Indicates whether this is the default package in the datacenter
	Id          string // Unique identifier for the package
	Version     string // Version for the package
	Group       string // Group this package belongs to
	Description string // Human friendly description for the package
}

Package represents a named collections of resources that are used to describe the 'sizes' of either a smart machine or a virtual machine.

type Snapshot

type Snapshot struct {
	Name  string // Snapshot name
	State string // Snapshot state
}

Snapshot represent a point in time state of a machine.

type SnapshotOpts

type SnapshotOpts struct {
	Name string `json:"name"` // Snapshot name
}

SnapshotOpts represent the option that can be specified when creating a new machine snapshot.

type Uri

type Uri struct {
	Uri  string // Resource identifier
	Name string // URI name
}

Uri represents a Universal Resource Identifier

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL