adapter

package
v0.0.0-...-58ea193 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StemcellAlias           = "mongodb-stemcell"
	MongodInstanceGroupName = "mongod_node"
	MongodJobName           = "mongod_node"
	AliasesJobName          = "mongodb-dns-aliases"
	SyslogJobName           = "syslog_forwarder"
	BoshDNSEnableJobName    = "bosh-dns-enable"
	ConfigAgentJobName      = "mongodb_config_agent"
	CleanupErrandJobName    = "cleanup_service"
	PostSetupErrandJobName  = "post_setup"
	LifecycleErrandType     = "errand"
)
View Source
const (
	PlanStandalone               = "standalone"
	PlanReplicaSet               = "replica_set"
	PlanShardedCluster           = "sharded_cluster"
	MonitoringAgentConfiguration = "monitoring_agent_config"
	BackupAgentConfiguration     = "backup_agent_config"
)

Variables

This section is empty.

Functions

func GenerateString

func GenerateString(l int) (string, error)

GenerateString generates a random string or panics if something goes wrong.

func GetWithCredentials

func GetWithCredentials(addrs []string, adminPassword string, ssl bool) (*mgo.Session, error)

Types

type Automation

type Automation struct {
	MongoDbVersions []MongoDbVersionsType
}

type Binder

type Binder struct {
	Logger *log.Logger
}

func (Binder) CreateBinding

func (Binder) DeleteBinding

func (Binder) DeleteBinding(params serviceadapter.DeleteBindingParams) error

type Cluster

type Cluster struct {
	Routers       []string
	ConfigServers []string
	Shards        [][]string
}

func NodesToCluster

func NodesToCluster(nodes []string, routers, configServers, replicas int) (*Cluster, error)

TODO: validate input NodesToCluster transforms a nodes list into cluster configuration object.

type Config

type Config struct {
	URL           string `json:"url"`
	Username      string `json:"username"`
	APIKey        string `json:"api_key"`
	AuthKey       string `json:"auth_key"`
	GroupID       string `json:"group"`
	NodeAddresses string `json:"nodes"`
	OrgID         string `json:"org"`
}

func LoadConfig

func LoadConfig(configFile string) (config *Config, err error)

func (Config) Validate

func (c Config) Validate() error

type DashboardURLGenerator

type DashboardURLGenerator struct{}

func (*DashboardURLGenerator) DashboardUrl

type DocContext

type DocContext struct {
	ID                      string
	Key                     string
	AdminPassword           string
	Version                 string
	AutomationAgentPassword string
	CompatibilityVersion    string
	Nodes                   []string
	Cluster                 *Cluster
	Password                string
	RequireSSL              bool
	KeyfileWindows          string
}

type Group

type Group struct {
	ID                string         `json:"id"`
	Name              string         `json:"name"`
	AgentAPIKey       string         `json:"agentApiKey"`
	HostCounts        map[string]int `json:"hostCounts"`
	AuthAgentPassword string         `json:"autoPwd"`
}

type GroupCreateRequest

type GroupCreateRequest struct {
	Name  string   `json:"name"`
	OrgId string   `json:"orgId,omitempty"`
	Tags  []string `json:"tags"`
}

type GroupHosts

type GroupHosts struct {
	TotalCount int `json:"totalCount"`
}

type GroupUpdateRequest

type GroupUpdateRequest struct {
	Tags []string `json:"tags"`
}

type ManifestGenerator

type ManifestGenerator struct {
	Logger *log.Logger
}

type MongoDbVersionsType

type MongoDbVersionsType struct {
	Name string
}

type OMClient

type OMClient struct {
	Url      string
	Username string
	ApiKey   string
}

func (*OMClient) ConfigureBackupAgent

func (oc *OMClient) ConfigureBackupAgent(configurationDoc string, groupID string) error

func (*OMClient) ConfigureGroup

func (oc *OMClient) ConfigureGroup(configurationDoc string, groupID string) error

func (*OMClient) ConfigureMonitoringAgent

func (oc *OMClient) ConfigureMonitoringAgent(configurationDoc string, groupID string) error

func (*OMClient) CreateGroup

func (oc *OMClient) CreateGroup(id string, request GroupCreateRequest) (Group, error)

func (*OMClient) CreateGroupAPIKey

func (oc *OMClient) CreateGroupAPIKey(groupID string) (string, error)

func (*OMClient) DeleteGroup

func (oc *OMClient) DeleteGroup(groupID string) error

func (*OMClient) GetAvailableVersions

func (oc *OMClient) GetAvailableVersions(groupID string) (Automation, error)

func (*OMClient) GetGroup

func (oc *OMClient) GetGroup(groupID string) (Group, error)

func (*OMClient) GetGroupAuthAgentPassword

func (oc *OMClient) GetGroupAuthAgentPassword(groupID string) (string, error)

func (*OMClient) GetGroupByName

func (oc *OMClient) GetGroupByName(name string) (Group, error)

GetGroupByName returns group if found.

func (*OMClient) GetGroupHostnames

func (oc *OMClient) GetGroupHostnames(groupID string, planID string) ([]string, error)

func (*OMClient) GetGroupHosts

func (oc *OMClient) GetGroupHosts(groupID string) (GroupHosts, error)

func (*OMClient) GetKeyfileWindows

func (oc *OMClient) GetKeyfileWindows(groupID string) (string, error)

TODO: refactor the client to avoid this call

func (*OMClient) GetLatestVersion

func (oc *OMClient) GetLatestVersion(groupID string) (string, error)

func (*OMClient) LoadDoc

func (oc *OMClient) LoadDoc(p string, ctx *DocContext) (string, error)

func (*OMClient) UpdateGroup

func (oc *OMClient) UpdateGroup(id string, request GroupUpdateRequest) (Group, error)

func (*OMClient) ValidateVersion

func (oc *OMClient) ValidateVersion(groupID string, version string) (string, error)

func (*OMClient) ValidateVersionManifest

func (oc *OMClient) ValidateVersionManifest(version string) (string, error)

Jump to

Keyboard shortcuts

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