Documentation ¶
Index ¶
- func NewCloudID(cid string) cloudID
- func NewCloudKVs(val map[string]interface{}) cloudKVs
- type Action
- type ActionFactory
- type AgentEnv
- type AgentEnvFactory
- type AgentEnvImpl
- type AgentID
- type AgentOptions
- type BlobstoreOptions
- type BlobstoreSpec
- type CPI
- type CPIFactory
- type CPIV1
- type CPIV2Additions
- type CallContext
- type CloudPropsImpl
- type DiskCID
- type DiskCloudProps
- type DiskHint
- type DiskMeta
- type DisksSpec
- type DisksV1
- type DisksV2Additions
- type EnvSpec
- type Info
- type Network
- type NetworkCloudProps
- type NetworkImpl
- func (n *NetworkImpl) AddRoute(ip, netmask, gw string)
- func (n NetworkImpl) CloudProps() NetworkCloudProps
- func (n NetworkImpl) DNS() []string
- func (n NetworkImpl) Default() []string
- func (n NetworkImpl) Gateway() string
- func (n NetworkImpl) IP() string
- func (n NetworkImpl) IPWithSubnetMask() string
- func (n NetworkImpl) IsDefaultFor(what string) bool
- func (n NetworkImpl) IsDynamic() bool
- func (n NetworkImpl) MarshalJSON() ([]byte, error)
- func (n NetworkImpl) Netmask() string
- func (n *NetworkImpl) SetAlias(a string)
- func (n *NetworkImpl) SetDNS(nameservers []string)
- func (n *NetworkImpl) SetMAC(mac string)
- func (n *NetworkImpl) SetPreconfigured()
- func (n NetworkImpl) Type() string
- type NetworkOpts
- type NetworkSpec
- type Networks
- type NetworksSpec
- type PersistentSpec
- type Route
- type SnapshotCID
- type SnapshotsV1
- type StemcellAPIVersion
- type StemcellCID
- type StemcellCloudProps
- type StemcellsV1
- type VMCID
- type VMCloudProps
- type VMCloudPropsImpl
- type VMEnv
- type VMMeta
- type VMResources
- type VMSpec
- type VMsV1
- type VMsV2Additions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCloudID ¶
func NewCloudID(cid string) cloudID
func NewCloudKVs ¶
func NewCloudKVs(val map[string]interface{}) cloudKVs
Types ¶
type ActionFactory ¶
type ActionFactory struct {
// contains filtered or unexported fields
}
func NewActionFactory ¶
func NewActionFactory(cpiFactory CPIFactory) ActionFactory
func (ActionFactory) Create ¶
func (f ActionFactory) Create(method string, apiVersion int, context CallContext) (interface{}, error)
type AgentEnvFactory ¶
type AgentEnvFactory struct{}
func NewAgentEnvFactory ¶
func NewAgentEnvFactory() AgentEnvFactory
func (AgentEnvFactory) ForVM ¶
func (f AgentEnvFactory) ForVM( agentID AgentID, cid VMCID, networks Networks, env VMEnv, agentOptions AgentOptions) AgentEnv
type AgentEnvImpl ¶
type AgentEnvImpl struct {
// contains filtered or unexported fields
}
func (AgentEnvImpl) AsBytes ¶
func (ae AgentEnvImpl) AsBytes() ([]byte, error)
func (*AgentEnvImpl) AttachEphemeralDisk ¶
func (ae *AgentEnvImpl) AttachEphemeralDisk(hint DiskHint)
func (*AgentEnvImpl) AttachPersistentDisk ¶
func (ae *AgentEnvImpl) AttachPersistentDisk(cid DiskCID, hint DiskHint)
todo better type for hint
func (*AgentEnvImpl) AttachSystemDisk ¶
func (ae *AgentEnvImpl) AttachSystemDisk(hint DiskHint)
func (*AgentEnvImpl) DetachPersistentDisk ¶
func (ae *AgentEnvImpl) DetachPersistentDisk(cid DiskCID)
type AgentID ¶
type AgentID struct {
// contains filtered or unexported fields
}
func NewAgentID ¶
func (AgentID) MarshalJSON ¶
func (*AgentID) UnmarshalJSON ¶
type AgentOptions ¶
type AgentOptions struct { Mbus string // e.g. "https://user:password@127.0.0.1:4321/agent" NTP []string // e.g. ["0.us.pool.ntp.org"]. Ok to be empty Blobstore BlobstoreOptions }
func (AgentOptions) Validate ¶
func (o AgentOptions) Validate() error
type BlobstoreOptions ¶
func (BlobstoreOptions) Validate ¶
func (o BlobstoreOptions) Validate() error
type BlobstoreSpec ¶
type CPIFactory ¶
type CPIFactory interface {
New(CallContext) (CPI, error)
}
type CPIV1 ¶
type CPIV1 interface { StemcellsV1 VMsV1 DisksV1 SnapshotsV1 }
type CPIV2Additions ¶
type CPIV2Additions interface { VMsV2Additions DisksV2Additions }
type CallContext ¶
type CallContext interface {
As(interface{}) error
}
type CloudPropsImpl ¶
type CloudPropsImpl struct {
json.RawMessage
}
func (CloudPropsImpl) As ¶
func (c CloudPropsImpl) As(val interface{}) error
func (CloudPropsImpl) MarshalJSON ¶
func (c CloudPropsImpl) MarshalJSON() ([]byte, error)
type DiskCID ¶
type DiskCID struct {
// contains filtered or unexported fields
}
func NewDiskCID ¶
func (DiskCID) MarshalJSON ¶
func (*DiskCID) UnmarshalJSON ¶
type DiskCloudProps ¶
type DiskCloudProps interface { As(interface{}) error // contains filtered or unexported methods }
type DiskHint ¶
type DiskHint struct {
// contains filtered or unexported fields
}
func NewDiskHintFromMap ¶
func NewDiskHintFromString ¶
func (DiskHint) MarshalJSON ¶
func (*DiskHint) UnmarshalJSON ¶
type DiskMeta ¶
type DiskMeta struct {
// contains filtered or unexported fields
}
func NewDiskMeta ¶
func (DiskMeta) MarshalJSON ¶
func (*DiskMeta) UnmarshalJSON ¶
type DisksSpec ¶
type DisksSpec struct { System DiskHint `json:"system"` Ephemeral DiskHint `json:"ephemeral"` Persistent PersistentSpec `json:"persistent"` }
type DisksV2Additions ¶
type Network ¶
type Network interface { Type() string IP() string Netmask() string Gateway() string DNS() []string Default() []string SetMAC(string) SetDNS([]string) SetPreconfigured() SetAlias(a string) AddRoute(string, string, string) CloudProps() NetworkCloudProps // Misc IsDynamic() bool IsDefaultFor(string) bool IPWithSubnetMask() string // contains filtered or unexported methods }
func NewNetwork ¶
func NewNetwork(opts NetworkOpts) Network
type NetworkCloudProps ¶
type NetworkCloudProps interface {
As(interface{}) error
}
type NetworkImpl ¶
type NetworkImpl struct {
// contains filtered or unexported fields
}
func (*NetworkImpl) AddRoute ¶
func (n *NetworkImpl) AddRoute(ip, netmask, gw string)
func (NetworkImpl) CloudProps ¶
func (n NetworkImpl) CloudProps() NetworkCloudProps
func (NetworkImpl) DNS ¶
func (n NetworkImpl) DNS() []string
func (NetworkImpl) Default ¶
func (n NetworkImpl) Default() []string
func (NetworkImpl) Gateway ¶
func (n NetworkImpl) Gateway() string
func (NetworkImpl) IP ¶
func (n NetworkImpl) IP() string
func (NetworkImpl) IPWithSubnetMask ¶
func (n NetworkImpl) IPWithSubnetMask() string
func (NetworkImpl) IsDefaultFor ¶
func (n NetworkImpl) IsDefaultFor(what string) bool
func (NetworkImpl) IsDynamic ¶
func (n NetworkImpl) IsDynamic() bool
func (NetworkImpl) MarshalJSON ¶
func (n NetworkImpl) MarshalJSON() ([]byte, error)
func (NetworkImpl) Netmask ¶
func (n NetworkImpl) Netmask() string
func (*NetworkImpl) SetAlias ¶
func (n *NetworkImpl) SetAlias(a string)
func (*NetworkImpl) SetDNS ¶
func (n *NetworkImpl) SetDNS(nameservers []string)
func (*NetworkImpl) SetMAC ¶
func (n *NetworkImpl) SetMAC(mac string)
func (*NetworkImpl) SetPreconfigured ¶
func (n *NetworkImpl) SetPreconfigured()
func (NetworkImpl) Type ¶
func (n NetworkImpl) Type() string
type NetworkOpts ¶
type NetworkSpec ¶
type NetworkSpec struct { Type string `json:"type"` IP string `json:"ip"` Netmask string `json:"netmask"` Gateway string `json:"gateway"` DNS []string `json:"dns"` Default []string `json:"default"` Routes []Route `json:"routes"` Alias string `json:"alias,omitempty"` MAC string `json:"mac"` Preconfigured bool `json:"preconfigured"` }
type NetworksSpec ¶
type NetworksSpec map[string]NetworkSpec
type PersistentSpec ¶
type SnapshotCID ¶
type SnapshotCID struct {
// contains filtered or unexported fields
}
func NewSnapshotCID ¶
func NewSnapshotCID(cid string) SnapshotCID
func (SnapshotCID) MarshalJSON ¶
func (*SnapshotCID) UnmarshalJSON ¶
type SnapshotsV1 ¶
type SnapshotsV1 interface { SnapshotDisk(DiskCID, DiskMeta) (SnapshotCID, error) DeleteSnapshot(SnapshotCID) error }
type StemcellAPIVersion ¶
type StemcellAPIVersion struct {
// contains filtered or unexported fields
}
func NewStemcellAPIVersion ¶
func NewStemcellAPIVersion(ctx CallContext) StemcellAPIVersion
func (StemcellAPIVersion) Value ¶
func (s StemcellAPIVersion) Value() (int, error)
type StemcellCID ¶
type StemcellCID struct {
// contains filtered or unexported fields
}
func NewStemcellCID ¶
func NewStemcellCID(cid string) StemcellCID
func (StemcellCID) MarshalJSON ¶
func (*StemcellCID) UnmarshalJSON ¶
type StemcellCloudProps ¶
type StemcellCloudProps interface {
As(interface{}) error
}
type StemcellsV1 ¶
type StemcellsV1 interface { CreateStemcell(string, StemcellCloudProps) (StemcellCID, error) DeleteStemcell(StemcellCID) error }
type VMCID ¶
type VMCID struct {
// contains filtered or unexported fields
}
func (VMCID) MarshalJSON ¶
func (*VMCID) UnmarshalJSON ¶
type VMCloudProps ¶
type VMCloudProps interface { As(interface{}) error // contains filtered or unexported methods }
type VMCloudPropsImpl ¶
type VMCloudPropsImpl struct {
// contains filtered or unexported fields
}
func NewVMCloudPropsFromMap ¶
func NewVMCloudPropsFromMap(val map[string]interface{}) VMCloudPropsImpl
func (VMCloudPropsImpl) As ¶
func (i VMCloudPropsImpl) As(val interface{}) error
func (VMCloudPropsImpl) MarshalJSON ¶
func (i VMCloudPropsImpl) MarshalJSON() ([]byte, error)
type VMEnv ¶
type VMEnv struct {
// contains filtered or unexported fields
}
func (VMEnv) MarshalJSON ¶
func (*VMEnv) UnmarshalJSON ¶
type VMMeta ¶
type VMMeta struct {
// contains filtered or unexported fields
}
func (VMMeta) MarshalJSON ¶
func (*VMMeta) UnmarshalJSON ¶
type VMResources ¶
type VMsV1 ¶
type VMsV1 interface { CreateVM(AgentID, StemcellCID, VMCloudProps, Networks, []DiskCID, VMEnv) (VMCID, error) DeleteVM(VMCID) error CalculateVMCloudProperties(VMResources) (VMCloudProps, error) SetVMMetadata(VMCID, VMMeta) error HasVM(VMCID) (bool, error) RebootVM(VMCID) error GetDisks(VMCID) ([]DiskCID, error) }
type VMsV2Additions ¶
type VMsV2Additions interface {
CreateVMV2(AgentID, StemcellCID, VMCloudProps, Networks, []DiskCID, VMEnv) (VMCID, Networks, error)
}
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
This file was generated by counterfeiter This file was generated by counterfeiter
|
This file was generated by counterfeiter This file was generated by counterfeiter |
Click to show internal directories.
Click to hide internal directories.