types

package
v0.0.0-...-add28f9 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrQuota is returned when a resource limit is exceeded.
	ErrQuota = errors.New("Over Quota")

	// ErrTenantNotFound is returned when a tenant ID is unknown.
	ErrTenantNotFound = errors.New("Tenant not found")

	// ErrInstanceNotFound is returned when an instance is not found.
	ErrInstanceNotFound = errors.New("Instance not found")

	// ErrInstanceNotAssigned is returned when an instance is not assigned to a node.
	ErrInstanceNotAssigned = errors.New("Cannot perform operation: instance not assigned to Node")

	// ErrDuplicateSubnet is returned when a subnet already exists
	ErrDuplicateSubnet = errors.New("Cannot add overlapping subnet")

	// ErrDuplicateIP is returned when a duplicate external IP is added
	ErrDuplicateIP = errors.New("Cannot add duplicated external IP")

	// ErrInvalidIP is returned when an IP cannot be parsed
	ErrInvalidIP = errors.New("The IP Address is not valid")

	// ErrPoolNotFound is returned when an external IP pool is not found
	ErrPoolNotFound = errors.New("Pool not found")

	// ErrPoolNotEmpty is returned when a pool is still in use
	ErrPoolNotEmpty = errors.New("Pool has mapped IPs")

	// ErrAddressNotFound is returned when an address isn't found.
	ErrAddressNotFound = errors.New("Address Not Found")

	// ErrInvalidPoolAddress is returned when an address isn't part of a pool
	ErrInvalidPoolAddress = errors.New("The Address is not found in this pool")

	// ErrBadRequest is returned when we have a malformed request
	ErrBadRequest = errors.New("Invalid Request")

	// ErrPoolEmpty is returned when a pool has no free IPs
	ErrPoolEmpty = errors.New("Pool has no Free IPs")

	// ErrDuplicatePoolName is returned when a duplicate pool name is used
	ErrDuplicatePoolName = errors.New("Pool by that name already exists")

	// ErrInstanceMapped is returned when an instance cannot be deleted
	// due to having an external IP assigned to it.
	ErrInstanceMapped = errors.New("Unmap the external IP prior to deletion")

	// ErrWorkloadNotFound is returned when a workload ID cannot be found
	ErrWorkloadNotFound = errors.New("Workload not found")

	// ErrWorkloadInUse is returned by DeleteWorkload when an instance of a workload is still active.
	ErrWorkloadInUse = errors.New("Workload definition still in use")
)

Functions

This section is empty.

Types

type APILink struct {
	Rel        string `json:"rel"`
	Href       string `json:"href"`
	Version    string `json:"version"`
	MinVersion string `json:"minimum_version"`
}

APILink provides information and links about a supported resource.

type BatchFrameStat

type BatchFrameStat struct {
	NumInstances             int     `json:"num_instances"`
	TotalElapsed             float64 `json:"total_elapsed"`
	AverageElapsed           float64 `json:"average_elapsed"`
	AverageControllerElapsed float64 `json:"average_controller_elapsed"`
	AverageLauncherElapsed   float64 `json:"average_launcher_elapsed"`
	AverageSchedulerElapsed  float64 `json:"average_scheduler_elapsed"`
	VarianceController       float64 `json:"controller_variance"`
	VarianceLauncher         float64 `json:"launcher_variance"`
	VarianceScheduler        float64 `json:"scheduler_variance"`
}

BatchFrameStat contains tracing information for a group of start requests by label.

type BatchFrameSummary

type BatchFrameSummary struct {
	BatchID      string `json:"batch_id"`
	NumInstances int    `json:"num_instances"`
}

BatchFrameSummary provides summary information on tracing per label.

type BlockData

type BlockData struct {
	storage.BlockDevice
	TenantID    string     // the tenant who owns this volume
	State       BlockState // status of
	CreateTime  time.Time  // when we created the volume
	Name        string     // a human readable name for this volume
	Description string     // some text to describe this volume.
}

BlockData respresents the attributes of this block device. TBD - do we really need to store this as actual data, or can we use a set of interfaces to get the info?

type BlockState

type BlockState string

BlockState represents the state of the block device in the controller datastore. This is a subset of the openstack status type.

const (
	// Available means that the volume is ok for attaching.
	Available BlockState = BlockState(block.Available)

	// Attaching means that the volume is in the process
	// of attaching to an instance.
	Attaching BlockState = BlockState(block.Attaching)

	// InUse means that the volume has been successfully
	// attached to an instance.
	InUse BlockState = BlockState(block.InUse)

	// Detaching means that the volume is in process
	// of detaching.
	Detaching BlockState = "detaching"
)

type CNCIDetail

type CNCIDetail struct {
	IPv4 string `json:"IPv4"`
}

CNCIDetail stores the IPv4 for a CNCI Agent.

type CiaoBatchFrameStat

type CiaoBatchFrameStat struct {
	NumInstances             int     `json:"num_instances"`
	TotalElapsed             float64 `json:"total_elapsed"`
	AverageElapsed           float64 `json:"average_elapsed"`
	AverageControllerElapsed float64 `json:"average_controller_elapsed"`
	AverageLauncherElapsed   float64 `json:"average_launcher_elapsed"`
	AverageSchedulerElapsed  float64 `json:"average_scheduler_elapsed"`
	VarianceController       float64 `json:"controller_variance"`
	VarianceLauncher         float64 `json:"launcher_variance"`
	VarianceScheduler        float64 `json:"scheduler_variance"`
}

CiaoBatchFrameStat contains frame statisitics for a ciao cluster.

type CiaoCNCI

type CiaoCNCI struct {
	ID        string           `json:"id"`
	TenantID  string           `json:"tenant_id"`
	IPv4      string           `json:"IPv4"`
	Geography string           `json:"geography"`
	Subnets   []CiaoCNCISubnet `json:"subnets"`
}

CiaoCNCI contains information about an individual CNCI.

type CiaoCNCIDetail

type CiaoCNCIDetail struct {
	CiaoCNCI `json:"cnci"`
}

CiaoCNCIDetail represents the unmarshalled version of the contents of a v2.1/cncis/{cnci}/detail response. It contains information about a CNCI.

type CiaoCNCISubnet

type CiaoCNCISubnet struct {
	Subnet string `json:"subnet_cidr"`
}

CiaoCNCISubnet contains subnet information for a CNCI.

type CiaoCNCIs

type CiaoCNCIs struct {
	CNCIs []CiaoCNCI `json:"cncis"`
}

CiaoCNCIs represents the unmarshalled version of the contents of a v2.1/cncis response. It contains information about all the CNCIs in the ciao cluster.

func NewCiaoCNCIs

func NewCiaoCNCIs() (cncis CiaoCNCIs)

NewCiaoCNCIs allocates a CiaoCNCIs structure. It allocates the CNCIs slice as well so that the marshalled JSON is an empty array and not a nil pointer, as specified by the OpenStack APIs.

type CiaoClusterStatus

type CiaoClusterStatus struct {
	Status struct {
		TotalNodes            int `json:"total_nodes"`
		TotalNodesReady       int `json:"total_nodes_ready"`
		TotalNodesFull        int `json:"total_nodes_full"`
		TotalNodesOffline     int `json:"total_nodes_offline"`
		TotalNodesMaintenance int `json:"total_nodes_maintenance"`
	} `json:"cluster"`
}

CiaoClusterStatus represents the unmarshalled version of the contents of a v2.1/nodes/summary response. It contains information about the nodes that make up a ciao cluster.

type CiaoComputeNode

type CiaoComputeNode struct {
	ID                    string    `json:"id"`
	Timestamp             time.Time `json:"updated"`
	Status                string    `json:"status"`
	MemTotal              int       `json:"ram_total"`
	MemAvailable          int       `json:"ram_available"`
	DiskTotal             int       `json:"disk_total"`
	DiskAvailable         int       `json:"disk_available"`
	Load                  int       `json:"load"`
	OnlineCPUs            int       `json:"online_cpus"`
	TotalInstances        int       `json:"total_instances"`
	TotalRunningInstances int       `json:"total_running_instances"`
	TotalPendingInstances int       `json:"total_pending_instances"`
	TotalPausedInstances  int       `json:"total_paused_instances"`
}

CiaoComputeNode contains status and statistic information for an individual node.

type CiaoComputeNodes

type CiaoComputeNodes struct {
	Nodes []CiaoComputeNode `json:"nodes"`
}

CiaoComputeNodes represents the unmarshalled version of the contents of a /v2.1/nodes response. It contains status and statistics information for a set of nodes.

func NewCiaoComputeNodes

func NewCiaoComputeNodes() (nodes CiaoComputeNodes)

NewCiaoComputeNodes allocates a CiaoComputeNodes structure. It allocates the Nodes slice as well so that the marshalled JSON is an empty array and not a nil pointer, as specified by the OpenStack APIs.

type CiaoComputeTenants

type CiaoComputeTenants struct {
	Tenants []struct {
		ID   string `json:"id"`
		Name string `json:"name"`
	} `json:"tenants"`
}

CiaoComputeTenants represents the unmarshalled version of the contents of a /v2.1/tenants response. It contains information about the tenants in a ciao cluster.

func NewCiaoComputeTenants

func NewCiaoComputeTenants() (tenants CiaoComputeTenants)

NewCiaoComputeTenants allocates a CiaoComputeTenants structure. It allocates the Tenants slice as well so that the marshalled JSON is an empty array and not a nil pointer, as specified by the OpenStack APIs.

type CiaoEvent

type CiaoEvent struct {
	Timestamp time.Time `json:"time_stamp"`
	TenantID  string    `json:"tenant_id"`
	EventType string    `json:"type"`
	Message   string    `json:"message"`
}

CiaoEvent contains information about an individual event generated in a ciao cluster.

type CiaoEvents

type CiaoEvents struct {
	Events []CiaoEvent `json:"events"`
}

CiaoEvents represents the unmarshalled version of the response to a v2.1/{tenant}/event or v2.1/event request.

func NewCiaoEvents

func NewCiaoEvents() (events CiaoEvents)

NewCiaoEvents allocates a CiaoEvents structure. It allocates the Events slice as well so that the marshalled JSON is an empty array and not a nil pointer, as specified by the OpenStack APIs.

type CiaoFrameStat

type CiaoFrameStat struct {
	ID               string  `json:"node_id"`
	TotalElapsedTime float64 `json:"total_elapsed_time"`
	ControllerTime   float64 `json:"total_controller_time"`
	LauncherTime     float64 `json:"total_launcher_time"`
	SchedulerTime    float64 `json:"total_scheduler_time"`
}

CiaoFrameStat contains the elapsed time statistics for a frame.

type CiaoServerStats

type CiaoServerStats struct {
	ID        string    `json:"id"`
	NodeID    string    `json:"node_id"`
	Timestamp time.Time `json:"updated"`
	Status    string    `json:"status"`
	TenantID  string    `json:"tenant_id"`
	IPv4      string    `json:"IPv4"`
	VCPUUsage int       `json:"cpus_usage"`
	MemUsage  int       `json:"ram_usage"`
	DiskUsage int       `json:"disk_usage"`
}

CiaoServerStats contains status information about a CN or a NN.

type CiaoServersAction

type CiaoServersAction struct {
	Action    string   `json:"action"`
	ServerIDs []string `json:"servers"`
}

CiaoServersAction represents the unmarshalled version of the contents of a v2.1/servers/action request. It contains an action to be performed on one or more instances.

type CiaoServersStats

type CiaoServersStats struct {
	TotalServers int               `json:"total_servers"`
	Servers      []CiaoServerStats `json:"servers"`
}

CiaoServersStats represents the unmarshalled version of the contents of a v2.1/nodes/{node}/servers/detail response. It contains general information about a group of instances.

func NewCiaoServersStats

func NewCiaoServersStats() (servers CiaoServersStats)

NewCiaoServersStats allocates a CiaoServersStats structure. It allocates the Servers slice as well so that the marshalled JSON is an empty array and not a nil pointer, as specified by the OpenStack APIs.

type CiaoTenantResources

type CiaoTenantResources struct {
	ID            string    `json:"id"`
	Timestamp     time.Time `json:"updated"`
	InstanceLimit int       `json:"instances_limit"`
	InstanceUsage int       `json:"instances_usage"`
	VCPULimit     int       `json:"cpus_limit"`
	VCPUUsage     int       `json:"cpus_usage"`
	MemLimit      int       `json:"ram_limit"`
	MemUsage      int       `json:"ram_usage"`
	DiskLimit     int       `json:"disk_limit"`
	DiskUsage     int       `json:"disk_usage"`
}

CiaoTenantResources represents the unmarshalled version of the contents of a /v2.1/{tenant}/quotas response. It contains the current resource usage information for a tenant.

type CiaoTraceData

type CiaoTraceData struct {
	Summary    CiaoBatchFrameStat `json:"summary"`
	FramesStat []CiaoFrameStat    `json:"frames"`
}

CiaoTraceData represents the unmarshalled version of the response to a v2.1/traces/{label} request. It contains statistics computed from the trace information of SSNTP commands sent within a ciao cluster.

type CiaoTraceSummary

type CiaoTraceSummary struct {
	Label     string `json:"label"`
	Instances int    `json:"instances"`
}

CiaoTraceSummary contains information about a specific SSNTP Trace label.

type CiaoTracesSummary

type CiaoTracesSummary struct {
	Summaries []CiaoTraceSummary `json:"summaries"`
}

CiaoTracesSummary represents the unmarshalled version of the response to a v2.1/traces request. It contains a list of all trace labels and the number of instances associated with them.

type CiaoUsage

type CiaoUsage struct {
	VCPU      int       `json:"cpus_usage"`
	Memory    int       `json:"ram_usage"`
	Disk      int       `json:"disk_usage"`
	Timestamp time.Time `json:"timestamp"`
}

CiaoUsage contains a snapshot of resource consumption for a tenant.

type CiaoUsageHistory

type CiaoUsageHistory struct {
	Usages []CiaoUsage `json:"usage"`
}

CiaoUsageHistory represents the unmarshalled version of the contents of a /v2.1/{tenant}/resources response. It contains snapshots of usage information for a given tenant over a given period of time.

type ExternalIP

type ExternalIP struct {
	ID      string `json:"id"`
	Address string `json:"address"`
	Links   []Link `json:"links"`
}

ExternalIP represents an External IP individual address.

type ExternalSubnet

type ExternalSubnet struct {
	ID    string `json:"id"`
	CIDR  string `json:"subnet"`
	Links []Link `json:"links"`
}

ExternalSubnet represents a subnet for External IPs.

type FrameStat

type FrameStat struct {
	ID               string  `json:"node_id"`
	TotalElapsedTime float64 `json:"total_elapsed_time"`
	ControllerTime   float64 `json:"total_controller_time"`
	LauncherTime     float64 `json:"total_launcher_time"`
	SchedulerTime    float64 `json:"total_scheduler_time"`
}

FrameStat contains tracing information per node.

type Instance

type Instance struct {
	ID          string              `json:"instance_id"`
	TenantID    string              `json:"tenant_id"`
	State       string              `json:"instance_state"`
	WorkloadID  string              `json:"workload_id"`
	NodeID      string              `json:"node_id"`
	MACAddress  string              `json:"mac_address"`
	IPAddress   string              `json:"ip_address"`
	SSHIP       string              `json:"ssh_ip"`
	SSHPort     int                 `json:"ssh_port"`
	CNCI        bool                `json:"-"`
	Attachments []StorageAttachment `json:"-"`
	CreateTime  time.Time           `json:"-"`
}

Instance contains information about an instance of a workload.

type Link struct {
	Rel  string `json:"rel"`
	Href string `json:"href"`
}

Link provides a url and relationship for a resource.

type ListPoolsResponse

type ListPoolsResponse struct {
	Pools []PoolSummary `json:"pools"`
}

ListPoolsResponse respresents a summary list of all pools.

type LogEntry

type LogEntry struct {
	Timestamp time.Time `json:"time_stamp"`
	TenantID  string    `json:"tenant_id"`
	EventType string    `json:"type"`
	Message   string    `json:"message"`
}

LogEntry stores information about events.

type MapIPRequest

type MapIPRequest struct {
	PoolName   *string `json:"pool_name"`
	InstanceID string  `json:"instance_id"`
}

MapIPRequest is used to request that an external IP be assigned from a pool to a particular instance.

type MappedIP

type MappedIP struct {
	ID         string `json:"mapping_id"`
	ExternalIP string `json:"external_ip"`
	InternalIP string `json:"internal_ip"`
	InstanceID string `json:"instance_id"`
	TenantID   string `json:"tenant_id"`
	PoolID     string `json:"pool_id"`
	PoolName   string `json:"pool_name"`
	Links      []Link `json:"links"`
}

MappedIP represents a mapping of external IP -> instance IP.

type MappedIPShort

type MappedIPShort struct {
	ID         string `json:"mapping_id"`
	ExternalIP string `json:"external_ip"`
	InternalIP string `json:"internal_ip"`
	Links      []Link `json:"links"`
}

MappedIPShort is a summary version of a MappedIP.

type NewAddressRequest

type NewAddressRequest struct {
	Subnet *string               `json:"subnet"`
	IPs    []NewIPAddressRequest `json:"ips"`
}

NewAddressRequest is used to add a new IP or new subnet to a pool.

type NewIPAddressRequest

type NewIPAddressRequest struct {
	IP string `json:"ip"`
}

NewIPAddressRequest is used to add a new external IP to a pool.

type NewPoolRequest

type NewPoolRequest struct {
	Name   string  `json:"name"`
	Subnet *string `json:"subnet"`
	IPs    []struct {
		IP string `json:"ip"`
	} `json:"ips"`
}

NewPoolRequest is used to create a new pool.

type Node

type Node struct {
	ID       string `json:"node_id"`
	IPAddr   string `json:"ip_address"`
	Hostname string `json:"hostname"`
}

Node contains information about a physical node in the cluster.

type NodeStats

type NodeStats struct {
	NodeID          string    `json:"node_id"`
	Timestamp       time.Time `json:"time_stamp"`
	Load            int       `json:"load"`
	MemTotalMB      int       `json:"mem_total_mb"`
	MemAvailableMB  int       `json:"mem_available_mb"`
	DiskTotalMB     int       `json:"disk_total_mb"`
	DiskAvailableMB int       `json:"disk_available_mb"`
	CpusOnline      int       `json:"cpus_online"`
}

NodeStats stores statistics for individual nodes in the cluster.

type NodeSummary

type NodeSummary struct {
	NodeID                string `json:"node_id"`
	TotalInstances        int    `json:"total_instances"`
	TotalRunningInstances int    `json:"total_running_instances"`
	TotalPendingInstances int    `json:"total_pending_instances"`
	TotalPausedInstances  int    `json:"total_paused_instances"`
}

NodeSummary contains summary information for all nodes in the cluster.

type Pool

type Pool struct {
	ID       string           `json:"id"`
	Name     string           `json:"name"`
	Free     int              `json:"free"`
	TotalIPs int              `json:"total_ips"`
	Links    []Link           `json:"links"`
	Subnets  []ExternalSubnet `json:"subnets"`
	IPs      []ExternalIP     `json:"ips"`
}

Pool represents a pool of external IPs.

type PoolSummary

type PoolSummary struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Free     *int   `json:"free,omitempty"`
	TotalIPs *int   `json:"total_ips,omitempty"`
	Links    []Link `json:"links,omitempty"`
}

PoolSummary is a short form of Pool.

type QuotaDetails

type QuotaDetails struct {
	Name  string
	Value int
	Usage int
}

QuotaDetails holds information for updating and querying quotas

func (*QuotaDetails) MarshalJSON

func (qd *QuotaDetails) MarshalJSON() ([]byte, error)

MarshalJSON provides a custom marshaller for quota API

func (*QuotaDetails) UnmarshalJSON

func (qd *QuotaDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON provides a custom demarshaller for quota API

type QuotaListResponse

type QuotaListResponse struct {
	Quotas []QuotaDetails `json:"quotas"`
}

QuotaListResponse holds the layout for returning quotas in the API

type QuotaUpdateRequest

type QuotaUpdateRequest struct {
	Quotas []QuotaDetails `json:"quotas"`
}

QuotaUpdateRequest holds the layout for updating quota API

type SortedComputeNodesByID

type SortedComputeNodesByID []CiaoComputeNode

SortedComputeNodesByID implements sort.Interface for Node by ID string

func (SortedComputeNodesByID) Len

func (s SortedComputeNodesByID) Len() int

func (SortedComputeNodesByID) Less

func (s SortedComputeNodesByID) Less(i, j int) bool

func (SortedComputeNodesByID) Swap

func (s SortedComputeNodesByID) Swap(i, j int)

type SortedInstancesByID

type SortedInstancesByID []*Instance

SortedInstancesByID implements sort.Interface for Instance by ID string

func (SortedInstancesByID) Len

func (s SortedInstancesByID) Len() int

func (SortedInstancesByID) Less

func (s SortedInstancesByID) Less(i, j int) bool

func (SortedInstancesByID) Swap

func (s SortedInstancesByID) Swap(i, j int)

type SourceType

type SourceType string

SourceType contains the valid values of the storage source.

const (
	// ImageService indicates the source comes from the image service.
	ImageService SourceType = "image"

	// VolumeService indicates the source comes from the volume service.
	VolumeService SourceType = "volume"

	// Empty indicates that there is no source for the storage source
	Empty SourceType = "empty"
)

type StorageAttachment

type StorageAttachment struct {
	ID         string // a uuid
	InstanceID string // the instance this volume is attached to
	BlockID    string // the ID of the block device
	Ephemeral  bool   // whether the storage should be deleted on Cleanup
	Boot       bool   // whether this is a boot device
}

StorageAttachment represents a link between a block device and an instance.

type StorageResource

type StorageResource struct {
	// ID indicates a volumeID. If ID is blank, then it needs to be created.
	ID string `json:"id"`

	// Bootable indicates whether should the resource be used for booting
	Bootable bool `json:"bootable"`

	// Ephemeral indicates whether the storage is temporary
	// TBD: do we bother to save info about temp storage?
	//      does it count against quota?
	Ephemeral bool `json:"ephemeral"`

	// Size is the size of the storage to be created if new.
	Size int `json:"size"`

	// ImageType indicates whether we are making a new resource
	// based on an image or existing volume.
	// Needed only for new storage.
	SourceType SourceType `json:"source_type"`

	// SourceID represents the ID of either the image or the volume
	// that the storage resource is based on.
	SourceID string `json:"source_id"`

	// Tag is a piece of abitrary search/sort identifier text
	Tag string
}

StorageResource defines a storage resource for a workload. TBD: should the workload support multiple of these?

type Tenant

type Tenant struct {
	ID      string
	Name    string
	CNCIID  string
	CNCIMAC string
	CNCIIP  string
}

Tenant contains information about a tenant or project.

type TenantCNCI

type TenantCNCI struct {
	TenantID   string   `json:"tenant_id"`
	IPAddress  string   `json:"ip_address"`
	MACAddress string   `json:"mac_address"`
	InstanceID string   `json:"instance_id"`
	Subnets    []string `json:"subnets"`
}

TenantCNCI contains information about the CNCI instance for a tenant.

type Workload

type Workload struct {
	ID          string                       `json:"id"`
	TenantID    string                       `json:"-"`
	Description string                       `json:"description"`
	FWType      string                       `json:"fw_type"`
	VMType      payloads.Hypervisor          `json:"vm_type"`
	ImageID     string                       `json:"image_id"`
	ImageName   string                       `json:"image_name"`
	Config      string                       `json:"config"`
	Defaults    []payloads.RequestedResource `json:"defaults"`
	Storage     []StorageResource            `json:"storage"`
}

Workload contains resource and configuration information for a user workload.

type WorkloadRequest

type WorkloadRequest struct {
	WorkloadID string
	TenantID   string
	Instances  int
	TraceLabel string
	Volumes    []storage.BlockDevice
}

WorkloadRequest contains resource and configuration for a user workload.

type WorkloadResponse

type WorkloadResponse struct {
	Workload Workload `json:"workload"`
	Link     Link     `json:"link"`
}

WorkloadResponse will be returned from /workloads apis It provides details on the workload, and references for the client.

Jump to

Keyboard shortcuts

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