models

package
v2.0.0-snapshot...-58e3a78 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssociatedEnv

type AssociatedEnv struct {
	EnvironmentID string `json:"environmentId"`
	ServiceID     string `json:"serviceId"`
	Directory     string `json:"dir"`
	Name          string `json:"name"`
	Pod           string `json:"pod"`
	OrgID         string `json:"organizationId"`
}

AssociatedEnv holds information about an associated environment

type CPUUsage

type CPUUsage struct {
	JobID       string  `json:"job"`
	CorePercent float64 `json:"core_percent"`
	TS          int     `json:"ts"`
}

type Cert

type Cert struct {
	Name    string `json:"name"`
	PubKey  string `json:"sslCertFile"`
	PrivKey string `json:"sslPKFile"`

	Service    string `json:"service,omitempty"`
	PubKeyID   int    `json:"sslCertFileId,omitempty"`
	PrivKeyID  int    `json:"sslPKFileId,omitempty"`
	Restricted bool   `json:"restricted,omitempty"`
}

type Command

type Command struct {
	Name      string
	ShortHelp string
	LongHelp  string
	CmdFunc   func(settings *Settings) func(cmd *cli.Cmd)
}

type ConsoleCredentials

type ConsoleCredentials struct {
	URL   string `json:"url"`
	Token string `json:"token"`
}

ConsoleCredentials hold the keys necessary for connecting to a console service

type DeployKey

type DeployKey struct {
	Name string `json:"name"`
	Key  string `json:"value"`
	Type string `json:"type"`
}

DeployKey is an ssh key belonging to an environment's code service

type EncryptionStore

type EncryptionStore struct {
	Key             string `json:"key"`
	KeyLogs         string `json:"keyLogs"`
	KeyInternalLogs string `json:"keyInternalLogs"`
	IV              string `json:"iv"`
}

EncryptionStore holds the values for encryption on backup/import jobs

type Environment

type Environment struct {
	ID        string `json:"id,omitempty"`
	Name      string `json:"name"`
	Pod       string `json:"pod,omitempty"`
	Namespace string `json:"namespace,omitempty"`
	OrgID     string `json:"organizationId"`
}

Environment environment

type Error

type Error struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Code        int    `json:"code"`
}

Error is a wrapper around an array of errors from the API

type HTTPManager

type HTTPManager interface {
	GetHeaders(sessionToken, version, pod, userID string) map[string][]string
	ConvertResp(b []byte, statusCode int, s interface{}) error
	Get(body []byte, url string, headers map[string][]string) ([]byte, int, error)
	Post(body []byte, url string, headers map[string][]string) ([]byte, int, error)
	PostFile(filepath string, url string, headers map[string][]string) ([]byte, int, error)
	PutFile(filepath string, url string, headers map[string][]string) ([]byte, int, error)
	Put(body []byte, url string, headers map[string][]string) ([]byte, int, error)
	Delete(body []byte, url string, headers map[string][]string) ([]byte, int, error)
}

type Hits

type Hits struct {
	Total    int64      `json:"total"`
	MaxScore float64    `json:"max_score"`
	Hits     *[]LogHits `json:"hits"`
}

Hits contain arrays of log data

type Invite

type Invite struct {
	ID       string `json:"id"`
	OrgID    string `json:"orgID"`
	SenderID string `json:"senderID"`
	RoleID   int    `json:"roleID"`
	Email    string `json:"email"`
	Consumed bool   `json:"consumed"`
	Revoked  bool   `json:"revoked"`
}

Invite represents an invitation to an organization

type Job

type Job struct {
	ID               string           `json:"id"`
	Type             string           `json:"type"`
	Status           string           `json:"status,omitempty"`
	Backup           *EncryptionStore `json:"backup,omitempty"`
	Restore          *EncryptionStore `json:"restore,omitempty"`
	CreatedAt        string           `json:"created_at"`
	MetricsData      *[]MetricsData   `json:"metrics"`
	Spec             *Spec            `json:"spec"`
	Target           string           `json:"target,omitempty"`
	IsSnapshotBackup *bool            `json:"isSnapshotBackup,omitempty"`
}

Job job

type LogHits

type LogHits struct {
	Index  string              `json:"_index"`
	Type   string              `json:"_type"`
	ID     string              `json:"_id"`
	Score  float64             `json:"_score"`
	Fields map[string][]string `json:"fields"`
}

LogHits contain ordering data for logs

type Login

type Login struct {
	Identifier string `json:"identifier"`
	Password   string `json:"password"`
}

Login is used for making an authentication request

type Logs

type Logs struct {
	Hits *Hits `json:"hits"`
}

Logs hold the log values from a successful LogQuery

type Maintenance

type Maintenance struct {
	UpstreamID string `json:"upstream"`
	CreatedAt  string `json:"createdAt"`
}

type MemoryUsage

type MemoryUsage struct {
	JobID string  `json:"job"`
	Total float64 `json:"total"`
	AVG   float64 `json:"ave"`
	Max   float64 `json:"max"`
	Min   float64 `json:"min"`
	TS    int     `json:"ts"`
}

type Metrics

type Metrics struct {
	ServiceName  string       `json:"serviceName"`
	ServiceType  string       `json:"serviceType"`
	ServiceID    string       `json:"serviceId"`
	ServiceLabel string       `json:"serviceLabel"`
	Size         ServiceSize  `json:"size"`
	Data         *MetricsData `json:"metrics"`
}

Metrics holds all metrics data for an entire environment or a single service

type MetricsData

type MetricsData struct {
	CPUUsage     *[]CPUUsage     `json:"cpu.usage"`
	MemoryUsage  *[]MemoryUsage  `json:"memory.usage"`
	NetworkUsage *[]NetworkUsage `json:"network.usage"`
}

MetricsData is a container for each type of metrics: network, memory, etc.

type NetworkUsage

type NetworkUsage struct {
	JobID     string  `json:"job"`
	RXDropped float64 `json:"rx_dropped"`
	RXErrors  float64 `json:"rx_errors"`
	RXKB      float64 `json:"rx_kb"`
	RXPackets float64 `json:"rx_packets"`
	TXDropped float64 `json:"tx_dropped"`
	TXErrors  float64 `json:"tx_errors"`
	TXKB      float64 `json:"tx_kb"`
	TXPackets float64 `json:"tx_packets"`
	TS        int     `json:"ts"`
}

type Org

type Org struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type OrgUser

type OrgUser struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Email  string `json:"email"`
	RoleID int    `json:"roleID"`
}

OrgUser users who have access to an org

type Payload

type Payload struct {
	Environment map[string]string `json:"environment"`
}

Payload is the payload of a job

type Pod

type Pod struct {
	Name                 string `json:"name"`
	PHISafe              bool   `json:"phiSafe"`
	ImportRequiresLength bool   `json:"importRequiresLength"`
}

Pod is a pod returned from the pod router

type PodWrapper

type PodWrapper struct {
	Pods *[]Pod `json:"pods"`
}

PodWrapper pod wrapper

type PostInvite

type PostInvite struct {
	Email        string `json:"email"`
	Role         int    `json:"role"`
	LinkTemplate string `json:"linkTemplate"`
}

type Release

type Release struct {
	Name      string `json:"release,omitempty"`
	CreatedAt string `json:"created_at,omitempty"`
	Notes     string `json:"metadata,omitempty"`
}

type ReportedError

type ReportedError struct {
	Code    int    `json:"id"`
	Message string `json:"message"`
}

ReportedError is the standard error model sent back from the API

type Role

type Role struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type Service

type Service struct {
	ID             string            `json:"id,omitempty"`
	Identifier     string            `json:"identifier,omitempty"`
	DNS            string            `json:"internal_domain,omitempty"`
	Type           string            `json:"type,omitempty"`
	Label          string            `json:"label"`
	Size           ServiceSize       `json:"size"`
	Name           string            `json:"name"`
	EnvVars        map[string]string `json:"environmentVariables,omitempty"`
	Source         string            `json:"source,omitempty"`
	LBIP           string            `json:"load_balancer_ip,omitempty"`
	Scale          int               `json:"scale,omitempty"`
	WorkerScale    int               `json:"worker_scale,omitempty"`
	ReleaseVersion string            `json:"release_version,omitempty"`
	Redeployable   bool              `json:"redeployable,omitempty"`
}

Service service

type ServiceFile

type ServiceFile struct {
	ID             int    `json:"id"`
	Contents       string `json:"contents"`
	GID            int    `json:"gid"`
	Mode           string `json:"mode"`
	Name           string `json:"name"`
	UID            int    `json:"uid"`
	EnableDownload bool   `json:"enable_download"`
}

ServiceFile is a file associated with a service

type ServiceSize

type ServiceSize struct {
	RAM      int    `json:"ram"`
	Storage  int    `json:"storage"`
	Behavior string `json:"behavior,omitempty"`
	Type     string `json:"type,omitempty"`
	CPU      int    `json:"cpu"`
}

ServiceSize holds size information for a service

type Settings

type Settings struct {
	AccountsHost    string      `json:"-"`
	AuthHost        string      `json:"-"`
	PaasHost        string      `json:"-"`
	AuthHostVersion string      `json:"-"`
	PaasHostVersion string      `json:"-"`
	Version         string      `json:"-"`
	HTTPManager     HTTPManager `json:"-"`

	Username        string                   `json:"-"`
	Password        string                   `json:"-"`
	EnvironmentID   string                   `json:"-"` // the id of the environment used for the current command
	ServiceID       string                   `json:"-"` // the id of the service used for the current command
	Pod             string                   `json:"-"` // the pod used for the current command
	EnvironmentName string                   `json:"-"` // the name of the environment used for the current command
	OrgID           string                   `json:"-"` // the org ID the chosen environment for this commands belongs to
	PrivateKeyPath  string                   `json:"private_key_path"`
	SessionToken    string                   `json:"token"`
	UsersID         string                   `json:"user_id"`
	Environments    map[string]AssociatedEnv `json:"environments"`
	Default         string                   `json:"default"`
	Pods            *[]Pod                   `json:"pods"`
	PodCheck        int64                    `json:"pod_check"`
}

Settings holds various settings for the current context. All items with `json:"-"` are never persisted to disk but used in memory for the current command.

type Site

type Site struct {
	ID              int                    `json:"id,omitempty"`
	Name            string                 `json:"name"`
	Cert            string                 `json:"cert"`
	SiteFileID      int                    `json:"siteFileId,omitempty"`
	UpstreamService string                 `json:"upstreamService"`
	Restricted      bool                   `json:"restricted,omitempty"`
	SiteValues      map[string]interface{} `json:"site_values"`
}

type Spec

type Spec struct {
	Payload *Payload `json:"payload"`
}

Spec is a job specification

type TempURL

type TempURL struct {
	URL string `json:"url"`
}

TempURL holds a URL for uploading or downloading files from a temporary URL

type User

type User struct {
	Username     string `json:"name"`
	Email        string `json:"email"`
	SessionToken string `json:"sessionToken"`
	UsersID      string `json:"id"`
}

User is an authenticated User

type UserKey

type UserKey struct {
	Name string `json:"name"`
	Key  string `json:"key"`
}

UserKey is a public key belonging to a user

type Workers

type Workers struct {
	Limit   int            `json:"worker_limit,omitempty"`
	Workers map[string]int `json:"workers"`
}

Jump to

Keyboard shortcuts

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