adapter

package
v0.0.0-...-e7e396a Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 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"
	BPMJobName                    = "bpm"
	BoshDNSEnableJobName          = "bosh-dns-enable"
	ConfigAgentJobName            = "mongodb_config_agent"
	CleanupErrandJobName          = "cleanup_service"
	ConfigureBackupsErrandJobName = "configure_backups"
	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 (b Binder) CreateBinding(bindingID string, deploymentTopology bosh.BoshVMs, manifest bosh.BoshManifest, requestParams serviceadapter.RequestParameters,
	secrets serviceadapter.ManifestSecrets, dnsAddresses serviceadapter.DNSAddresses) (serviceadapter.Binding, error)

func (Binder) DeleteBinding

func (Binder) DeleteBinding(bindingID string, deploymentTopology bosh.BoshVMs, manifest bosh.BoshManifest, requestParams serviceadapter.RequestParameters,
	secrets serviceadapter.ManifestSecrets) 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 DashboardURLGenerator

type DashboardURLGenerator struct{}

func (*DashboardURLGenerator) DashboardUrl

func (d *DashboardURLGenerator) DashboardUrl(instanceID string, plan serviceadapter.Plan, manifest bosh.BoshManifest) (serviceadapter.DashboardUrl, error)

type DocContext

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

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
}

func (ManifestGenerator) GenerateManifest

func (m ManifestGenerator) GenerateManifest(
	serviceDeployment serviceadapter.ServiceDeployment,
	plan serviceadapter.Plan,
	requestParams serviceadapter.RequestParameters,
	previousManifest *bosh.BoshManifest,
	previousPlan *serviceadapter.Plan) (serviceadapter.GenerateManifestOutput, error)

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) 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) 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