group

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2016 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ListTimeout = 200
)
View Source
var (
	WeekDays = []string{
		"sun",
		"mon",
		"tue",
		"wed",
		"thu",
		"fri",
		"sat",
	}
)

Functions

func GetNames

func GetNames(cn base.Connection, dataCenter string) ([]string, error)

func IDByName

func IDByName(cn base.Connection, dataCenter string, name string) (string, error)

func IsWeekDay

func IsWeekDay(day string) bool

Types

type CPU

type CPU struct {
	Value     int64
	Inherited bool
}

type CreateReq

type CreateReq struct {
	Name            string `valid:"required"`
	Description     string
	ParentGroupId   string
	ParentGroupName string `json:"-"`
	CustomFields    []customfields.Def
}

func (*CreateReq) GetNames

func (c *CreateReq) GetNames(cn base.Connection, property string) ([]string, error)

func (*CreateReq) InferID

func (c *CreateReq) InferID(cn base.Connection) error

func (*CreateReq) Validate

func (c *CreateReq) Validate() error

type Defaults

type Defaults struct {
	Cpu          CPU
	MemoryGB     Memory
	NetworkId    Network
	PrimaryDns   PrimaryDNS
	SecondaryDns SecondaryDNS
	TemplateName TemplateName
}

type DeleteReq

type DeleteReq struct {
	Group `argument:"composed" URIParam:"GroupId" json:"-"`
}

type DiskUsage

type DiskUsage struct {
	Id         string
	CapacityMB int64
}

type Entity

type Entity struct {
	Id           string
	Name         string
	Description  string
	LocationId   string
	Type         string
	Status       string
	ServersCount int64
	Groups       []Entity
	Links        []models.LinkEntity
	ChangeInfo   models.ChangeInfo
	CustomFields []customfields.FullDef
}

func Load

func Load(cn base.Connection, dataCenter string) ([]Entity, error)

type GetBillingReq

type GetBillingReq struct {
	Group `argument:"composed" URIParam:"GroupId" json:"-"`
}

type GetBillingRes

type GetBillingRes struct {
	Date   base.Time
	Groups map[string]GroupBilling
}

type GetHAPolicy

type GetHAPolicy struct {
	Group `URIParam:"GroupId" argument:"composed" json:"-"`
}

type GetReq

type GetReq struct {
	Group `URIParam:"GroupId" argument:"composed" json:"-"`
}

type GetScheduledActivities

type GetScheduledActivities struct {
	Group `URIParam:"GroupId" argument:"composed" json:"-"`
}

type GetStatsReq

type GetStatsReq struct {
	Group          `argument:"composed" URIParam:"GroupId" json:"-"`
	Start          string `URIParam:"yes"`
	End            string `URIParam:"yes"`
	SampleInterval string `URIParam:"yes"`
	Type           string `URIParam:"yes" oneOf:"latest,hourly,realtime"`
}

func (*GetStatsReq) ApplyDefaultBehaviour

func (g *GetStatsReq) ApplyDefaultBehaviour() error

func (*GetStatsReq) Validate

func (g *GetStatsReq) Validate() error

type GetStatsRes

type GetStatsRes struct {
	Name  string
	Stats []Stats
}

type Group

type Group struct {
	GroupId   string
	GroupName string
}

func (*Group) GetNames

func (g *Group) GetNames(cn base.Connection, property string) ([]string, error)

func (*Group) InferID

func (g *Group) InferID(cn base.Connection) error

func (*Group) Validate

func (g *Group) Validate() error

type GroupBilling

type GroupBilling struct {
	Name    string
	Servers map[string]ServerBilling
}

type GroupPatchOperation

type GroupPatchOperation struct {
	Op     string
	Member string
	Value  interface{}
}

type GuestDiskUsage

type GuestDiskUsage struct {
	Path       string
	CapacityMB int64
	ConsumedMB int64
}

type HAPolicy

type HAPolicy struct {
	GroupId             string
	PolicyId            string
	LocationId          string
	Name                string
	AvailableServers    int64
	TargetSize          int64
	ScaleDirection      string
	ScaleResourceReason string
	LoadBalancer        LBForHA
	Timestamp           base.Time
}

type LBForHA

type LBForHA struct {
	Id          string
	Name        string
	PublicPort  int64
	PrivatePort int64
	PublicIp    string
}

type LBForHARequest

type LBForHARequest struct {
	Id          string
	PublicPort  int64
	PrivatePort int64
}

type List

type List struct {
	DataCenter string
	All        base.NilField
}

func (*List) Validate

func (l *List) Validate() error

type Memory

type Memory struct {
	Value     int64
	Inherited bool
}

type Network

type Network struct {
	Value     string
	Inherited bool
}

type PrimaryDNS

type PrimaryDNS struct {
	Value     string
	Inherited bool
}

type RestoreReq

type RestoreReq struct {
	Group           `argument:"composed" URIParam:"GroupId" json:"-"`
	TargetGroupId   string
	TargetGroupName string `json:"-"`
}

func (*RestoreReq) GetNames

func (r *RestoreReq) GetNames(cn base.Connection, property string) ([]string, error)

func (*RestoreReq) InferID

func (r *RestoreReq) InferID(cn base.Connection) error

func (*RestoreReq) Validate

func (r *RestoreReq) Validate() error

type RestoreRes

type RestoreRes struct {
	IsQueued     bool
	Links        []models.LinkEntity
	ErrorMessage string
}

type ScheduledActivities

type ScheduledActivities struct {
	Id                    string
	LocationId            string
	ChangeInfo            models.ChangeInfo
	Status                string
	Type                  string
	BeginDateUTC          base.Time
	Repeat                string
	CustomWeeklyDays      []string
	Expire                string
	ExpireCount           int64
	ExpireDateUTC         base.Time
	TimeZoneOffset        string
	IsExpired             bool
	LastOccurrenceDateUTC base.Time
	OccurrenceCount       int64
	NextOccurrenceDateUTC base.Time
}

type SecondaryDNS

type SecondaryDNS struct {
	Value     string
	Inherited bool
}

type ServerBilling

type ServerBilling struct {
	TemplateCost    float64
	ArchiveCost     float64
	MonthlyEstimate float64
	MonthToDate     float64
	CurrentHour     float64
}

type SetDefaults

type SetDefaults struct {
	Group        `URIParam:"GroupId" argument:"composed" json:"-"`
	Cpu          int64  `json:",omitempty"`
	MemoryGb     int64  `json:",omitempty"`
	NetworkId    string `json:",omitempty"`
	PrimaryDns   string `json:",omitempty"`
	SecondaryDns string `json:",omitempty"`
	TemplateName string `json:",omitempty"`
}

func (*SetDefaults) Validate

func (s *SetDefaults) Validate() error

type SetHAPolicy

type SetHAPolicy struct {
	Group        `URIParam:"GroupId" argument:"composed" json:"-"`
	PolicyId     string         `valid:"required"`
	LoadBalancer LBForHARequest `json:"LoadBalancerPool"`
}

func (*SetHAPolicy) Validate

func (s *SetHAPolicy) Validate() error

type SetScheduledActivities

type SetScheduledActivities struct {
	Group               `URIParam:"GroupId" argument:"composed" json:"-"`
	Status              string    `oneOf:"on,off" valid:"required"`
	Type                string    `oneOf:"archive,createsnapshot,delete,deletesnapshot,pause,poweron,reboot,shutdown" valid:"required"`
	BeginDateUtc        time.Time `json:"beginDateUTC"`
	Repeat              string    `oneOf:"never,daily,weekly,monthly,customWeekly" valid:"required"`
	CustomWeeklyDays    []string
	Expire              string    `oneOf:"never,afterDate,afterCount" valid:"required"`
	ExpireCount         int64     `json:",omitempty"`
	ExpireDateUtc       time.Time `json:"-"`
	ExpireDateUTCString string    `json:"expireDateUTC,omitempty" argument:"ignore"`
	TimeZoneOffset      string    `valid:"required"`
}

func (*SetScheduledActivities) ApplyDefaultBehaviour

func (s *SetScheduledActivities) ApplyDefaultBehaviour() error

func (*SetScheduledActivities) Validate

func (s *SetScheduledActivities) Validate() error

type Stats

type Stats struct {
	Timestamp                base.Time
	Cpu                      float64
	CpuPercent               float64
	MemoryMB                 float64
	MemoryPercent            float64
	NetworkReceivedKbs       float64
	NetworkTransmittedKbs    float64
	DiskUsageTotalCapacityMB float64
	DiskUsage                []DiskUsage
	GuestDiskUsage           []GuestDiskUsage
}

type TemplateName

type TemplateName struct {
	Value     string
	Inherited bool
}

type UpdateReq

type UpdateReq struct {
	Group          `argument:"composed" URIParam:"GroupId" json:"-"`
	PatchOperation []GroupPatchOperation `argument:"ignore"`

	CustomFields    []customfields.Def
	Name            string
	Description     string
	ParentGroupId   string
	ParentGroupName string
}

func (*UpdateReq) ApplyDefaultBehaviour

func (u *UpdateReq) ApplyDefaultBehaviour() error

func (*UpdateReq) GetNames

func (u *UpdateReq) GetNames(cn base.Connection, property string) ([]string, error)

func (*UpdateReq) InferID

func (u *UpdateReq) InferID(cn base.Connection) error

func (*UpdateReq) MarshalJSON

func (u *UpdateReq) MarshalJSON() ([]byte, error)

func (*UpdateReq) Validate

func (u *UpdateReq) Validate() error

Jump to

Keyboard shortcuts

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