Documentation ¶
Overview ¶
** Copyright [2013-2017] [Megam Systems] ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=how%20to%20convert%20json%20into%20string%20objectlimitations under the License.
** Copyright [2013-2017] [Megam Systems] ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License.
** Copyright [2013-2017] [Megam Systems] ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License.
Index ¶
- Constants
- Variables
- func Register(name string, p Provisioner)
- type Box
- func (b *Box) Available() bool
- func (b *Box) CanCycleStart() bool
- func (b *Box) CanCycleStop() bool
- func (b *Box) ConGetMemory() uint64
- func (b *Box) GetCpushare() uint64
- func (b *Box) GetFullName() string
- func (b *Box) GetHDD() uint64
- func (b *Box) GetMemory() uint64
- func (b *Box) GetPublicIp() string
- func (box *Box) GetRouter() (string, error)
- func (b *Box) GetSwap() uint64
- func (b *Box) GetTosca() string
- func (b *Box) IsPolicyOk() bool
- func (box *Box) Log(message, source, unit string) error
- func (b *Box) String() string
- type BoxCompute
- type BoxDeploy
- type BoxLevel
- type BoxSSH
- type Boxlog
- type CNameManager
- type Carton
- type Error
- type ExtensibleProvisioner
- type GitDeployer
- type ImageDeployer
- type InitializableProvisioner
- type LogListener
- type MarketPlaceAccess
- type MessageProvisioner
- type Named
- type Network
- type PolicyOps
- type Provisioner
- type RawImageAccess
- type ShellOptions
- type StateChanger
Constants ¶
const ( CPU = "cpu" RAM = "ram" HDD = "hdd" // BoxSome indicates that there is atleast one box to deploy or delete. BoxSome BoxLevel = iota // BoxNone indicates that there are no boxes to deploy or delete but its parent can be. BoxNone )
Variables ¶
var ( ErrInvalidStatus = errors.New("invalid status") ErrEmptyCarton = errors.New("no boxs for this carton") ErrBoxNotFound = errors.New("box not found") ErrNoOutputsFound = errors.New("no outputs found in the box. Did you set it ? ") ErrNotImplemented = errors.New("I'am on diet.") )
var LogPubSubQueueSuffix = "_log"
Functions ¶
func Register ¶
func Register(name string, p Provisioner)
Register registers a new provisioner in the Provisioner registry.
Types ¶
type Box ¶
type Box struct { Id string AccountId string Authority string CartonsId string CartonId string OrgId string ApiArgs api.ApiArgs QuotaId string CartonName string Name string Level BoxLevel DomainName string Tosca string StorageType string ImageVersion string ImageName string Backup bool Compute BoxCompute Repo *repository.Repo Status utils.Status State utils.State PolicyOps *PolicyOps Provider string PublicIp string PublicUrl string InstanceId string Region string Vnets map[string]string SSH BoxSSH Commit string Envs []bind.EnvVar Address *url.URL }
Box represents a provision unit. Can be a machine, container or anything IP-addressable.
func (*Box) Available ¶
Available returns true if the unit is available. It will return true whenever the unit itself is available, even when the application process is not.
func (*Box) CanCycleStart ¶
func (*Box) CanCycleStop ¶
func (*Box) ConGetMemory ¶
func (*Box) GetCpushare ¶
func (*Box) GetFullName ¶
GetName returns the assemblyname.domain(assembly001YeahBoy.megambox.com) of the box.
func (*Box) IsPolicyOk ¶
type BoxCompute ¶
func (*BoxCompute) ConnumMemory ¶
func (bc *BoxCompute) ConnumMemory() uint64
func (*BoxCompute) String ¶
func (bc *BoxCompute) String() string
type BoxSSH ¶
func (*BoxSSH) AuthKeysFile ¶
authorized_keys path is same in all linux i think
type CNameManager ¶
type CNameManager interface { SetCName(b *Box, cname string) error UnsetCName(b *Box, cname string) error }
CNameManager represents a provisioner that supports cname on box.
type Carton ¶
type Carton interface { Named Bind(*Box) error Unbind(*Box) error // Log should be used to log messages in the box. Log(message, source, unit string) error Boxes() []*Box // Run executes the command in box units. Commands executed with this // method should have access to environment variables defined in the // app. Run(cmd string, w io.Writer, once bool) error Envs() map[string]bind.EnvVar GetMemory() int64 GetSwap() int64 }
Carton represents a deployment entity in vertice.
It contains boxes to provision and only relevant information for provisioning.
type ExtensibleProvisioner ¶
type ExtensibleProvisioner interface { PlatformAdd(name string, args map[string]string, w io.Writer) error PlatformUpdate(name string, args map[string]string, w io.Writer) error PlatformRemove(name string) error }
ExtensibleProvisioner is a provisioner where administrators can manage platforms (automatically adding, removing and updating platforms).
type GitDeployer ¶
GitDeployer is a provisioner that can deploy the box from a Git repository.
type ImageDeployer ¶
type ImageDeployer interface { ImageDeploy(b *Box, image string, w io.Writer) (string, error) BackupDeploy(b *Box, image string, w io.Writer) (string, error) }
ImageDeployer is a provisioner that can deploy the box from a previously generated image.
type InitializableProvisioner ¶
type InitializableProvisioner interface {
Initialize(m interface{}) error
}
InitializableProvisioner is a provisioner that provides an initialization method that should be called when the carton is started, additionally provide a map of configuration info.
type LogListener ¶
type LogListener struct { B <-chan Boxlog // contains filtered or unexported fields }
func NewLogListener ¶
func NewLogListener(a *Box) (*LogListener, error)
func (*LogListener) Close ¶
func (l *LogListener) Close() (err error)
type MarketPlaceAccess ¶
type MessageProvisioner ¶
type Named ¶
type Named interface {
GetName() string
}
Named is something that has a name, providing the GetName method.
type Provisioner ¶
type Provisioner interface { // Destroy is called when vertice is destroying the box. Destroy(*Box, io.Writer) error // SetBoxStatus changes the status of a box. SetBoxStatus(*Box, io.Writer, utils.Status) error // ExecuteCommandOnce runs a command in one box of the carton. ExecuteCommandOnce(stdout, stderr io.Writer, box *Box, cmd string, args ...string) error // Restart restarts the boxes of the carton, with an optional // string parameter represeting the name of the process to start. Restart(*Box, string, io.Writer) error // Start starts the boxes of the application, with an optional string // parameter represeting the name of the process to start. Start(*Box, string, io.Writer) error // Stop stops the boxes of the application, with an optional string // parameter represeting the name of the process to stop. Stop(*Box, string, io.Writer) error // Suspend suspends the boxes of the application, with an optional string // parameter represeting the name of the process to suspend. Suspend(*Box, string, io.Writer) error // DiskSave creates the image for current state of the running VM SaveImage(*Box, io.Writer) error // DeleteImage removes the image from storage created from running VM DeleteImage(*Box, io.Writer) error // DiskSnapCreate(SnapShot) saves current state of the running VM CreateSnapshot(*Box, io.Writer) error // DeleteImage removes the image from storage created from running VM DeleteSnapshot(*Box, io.Writer) error // Restore current VM state to Saved Snapshot state RestoreSnapshot(*Box, io.Writer) error // AttachDisk add additional disk to current state of the running VM AttachDisk(*Box, io.Writer) error // DetachDisk remove additional disk from current state of the running VM DetachDisk(*Box, io.Writer) error // Open a remote shel in one of the boxs in the carton. Shell(ShellOptions) error // Addr returns the address for an box. // // vertice will use this method to get the IP (although it might not be // an actual IP, collector calls it "IP") of the app from the // provisioner. Addr(*Box) (string, error) // Returns the metric backend collected MetricEnvs(int64, int64, string, io.Writer) ([]interface{}, error) TriggerBills(string, string, string) error }
Provisioner is the basic interface of this package.
Any vertice provisioner must implement this interface in order to provision vertice cartons.
func Get ¶
func Get(name string) (Provisioner, error)
Get gets the named provisioner from the registry.
type ShellOptions ¶
type ShellOptions struct { Box *Box Conn io.ReadWriteCloser Width int Height int Unit string Term string }
ShellOptions is the set of options that can be used when calling the method Shell in the provisioner.
Directories ¶
Path | Synopsis |
---|---|
** Copyright [2013-2017] [Megam Systems] ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License.
|
** Copyright [2013-2017] [Megam Systems] ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. |
** Copyright [2013-2017] [Megam Systems] ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License.
|
** Copyright [2013-2017] [Megam Systems] ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. |
** Copyright [2013-2017] [Megam Systems] ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License.
|
** Copyright [2013-2017] [Megam Systems] ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. |