objects

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ApplyCmSettings = "apply_cm-settings"

ApplyCmSettings - lookup names

Variables

View Source
var CommandVersions = map[string]string{
	"apply_cm-settings":        "0.1.6",
	"apply_database-cr":        "0.0.14",
	"apply_default-cr":         "0.0.14",
	"apply_image-tag":          "0.0.16",
	"apply_system-settings":    "0.0.14",
	"apply_vault-key":          "0.0.14",
	"create_database":          "0.1.7",
	"delete":                   "0.1.7",
	"get_accounts":             "0.1.7",
	"get_cm-settings":          "0.1.6",
	"get_database-cr":          "0.0.14",
	"get_database-status":      "0.1.6",
	"get_default-cr":           "0.0.14",
	"get_image-tag":            "0.0.16",
	"get_system-settings":      "0.0.14",
	"get_vault-key":            "0.0.14",
	"list_database":            "0.0.14",
	"pause":                    "0.1.7",
	"restart_database":         "0.1.6",
	"resume":                   "0.1.7",
	"rollback_cm-settings":     "0.1.6",
	"rollback_database-cr":     "0.0.15",
	"rollback_default-cr":      "0.0.15",
	"rollback_system-settings": "0.0.15",
	"rollback_vault-key":       "0.0.15",
	"versions_cm-settings":     "0.1.6",
	"versions_database-cr":     "0.0.15",
	"versions_default-cr":      "0.0.15",
	"versions_system-settings": "0.0.15",
	"versions_vault-key":       "0.0.15",
}

CommandVersions - map used to determine compatibility of API server

Functions

func WriteToFile

func WriteToFile(filename string, data string) error

WriteToFile will print any string of text to a file safely by checking for errors and syncing at the end.

Types

type AccountList added in v0.1.1

type AccountList struct {
	Accounts []CMUserAccount
}

AccountList - Data to read from CM Postgres

func (*AccountList) ToGRON added in v0.1.1

func (accountList *AccountList) ToGRON() error

ToGRON - Write the output as GRON

func (*AccountList) ToJSON added in v0.1.1

func (accountList *AccountList) ToJSON() error

ToJSON - Write the output as JSON

func (*AccountList) ToTEXT added in v0.1.1

func (accountList *AccountList) ToTEXT(noHeaders bool) error

ToTEXT - Write the output as TEXT

func (*AccountList) ToYAML added in v0.1.1

func (accountList *AccountList) ToYAML() error

ToYAML - Write the output as YAML

type ActionStatus

type ActionStatus struct {
	Process  string `json:"Process"`
	Success  bool   `json:"Success"`
	Database string `json:"database"`
	Error    string `json:"error"`
}

ActionStatus - Status of various actions

func (*ActionStatus) ToGRON

func (as *ActionStatus) ToGRON() error

ToGRON - Write the output as GRON

func (*ActionStatus) ToJSON

func (as *ActionStatus) ToJSON() error

ToJSON - Write the output as JSON

func (*ActionStatus) ToTEXT

func (as *ActionStatus) ToTEXT(noHeaders bool) error

ToTEXT - Write the output as TEXT

func (*ActionStatus) ToYAML

func (as *ActionStatus) ToYAML() error

ToYAML - Write the output as YAML

type BaseVersion

type BaseVersion struct {
	SemVer    string `json:"SemVer"`
	GitCommit string `json:"GitCommit"`
	BuildDate string `json:"BuildDate"`
}

BaseVersion - structure returned by the server

type CMAccount

type CMAccount struct {
	CreatedAt   string `json:"createdAt"`
	UpdatedAt   string `json:"updatedAt"`
	AccountName string `json:"accountName"`
	AccountId   string `json:"accountId"`
}

CMAccount - Account Info

type CMClusterConfiguration

type CMClusterConfiguration struct {
	CreatedAt          string `json:"createdAt"`
	UpdatedAt          string `json:"updatedAt"`
	EffectiveStartDate string `json:"effectiveStartDt"`
	EffectiveEndDate   string `json:"effectiveEndDt"`
	FreeTier           bool   `json:"freeTier"`
}

CMClusterConfiguration - CM Cluster Config Info

type CMClusterInfo

type CMClusterInfo struct {
	CreatedAt             string                   `json:"createdAt"`
	UpdatedAt             string                   `json:"updatedAt"`
	DeletedAt             string                   `json:"deletedAt"`
	ClusterId             string                   `json:"clusterId"`
	DcosAppId             string                   `json:"dcosAppId"`
	Name                  string                   `json:"name"`
	Namespace             string                   `json:"namespace"`
	Status                string                   `json:"status"`
	ClusterConfigurations []CMClusterConfiguration `json:"clusterConfigurations"`
	Account               CMAccount                `json:"account"`
	User                  CMUser                   `json:"user"`
}

CMClusterInfo - Cluster Info

func (CMClusterInfo) Active added in v0.1.2

func (cmci CMClusterInfo) Active() bool

Active - returns whether the cluster described is active or not

type CMSettings

type CMSettings struct {
	Data map[string]string `json:"data"`
}

CMSettings - Structure to hold data for the cm-settings calls

func (*CMSettings) ToGRON

func (settings *CMSettings) ToGRON() error

ToGRON - Write the output as GRON

func (*CMSettings) ToJSON

func (settings *CMSettings) ToJSON() error

ToJSON - Write the output as JSON

func (*CMSettings) ToTEXT

func (settings *CMSettings) ToTEXT(noHeaders bool) error

ToTEXT - Write the output as TEXT

func (*CMSettings) ToYAML

func (settings *CMSettings) ToYAML() error

ToYAML - Write the output as YAML

type CMUser

type CMUser struct {
	LastLogin string `json:"lastLogin"`
	CreatedAt string `json:"createdAt"`
	UpdatedAt string `json:"updatedAt"`
	Email     string `json:"email"`
}

CMUser - User Info

type CMUserAccount added in v0.1.1

type CMUserAccount struct {
	AccountID string `json:"accountId"`
	EMail     string `json:"email"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
}

CMUserAccount - Data fields from CM Accounts Postres Tables

type DatabaseCR

type DatabaseCR struct {
	Data map[string]interface{} `json:"data"`
}

func (*DatabaseCR) ToGRON

func (cr *DatabaseCR) ToGRON(file string) error

ToGRON - Write output in GRON format

func (*DatabaseCR) ToJSON

func (cr *DatabaseCR) ToJSON(file string) error

ToJSON - Write the output as JSON

func (*DatabaseCR) ToTEXT

func (cr *DatabaseCR) ToTEXT(noHeaders bool) error

ToTEXT - Write the output as TEXT

func (*DatabaseCR) ToYAML

func (cr *DatabaseCR) ToYAML(file string) error

ToYAML - Write the output as YAML

type DatabaseCRList

type DatabaseCRList struct {
	Data struct {
		Metadata struct {
			Name string `json:"name"`
		} `json:"metadata"`
		Spec struct {
			Condition struct {
				Haproxy struct {
					Enabled bool `json:"enabled"`
				} `json:"haproxy"`
				Hbase struct {
					Enabled bool `json:"enabled"`
				} `json:"hbase"`
				Hdfs struct {
					Enabled bool `json:"enabled"`
				} `json:"hdfs"`
				JupyterHub struct {
					Enabled bool `json:"enabled"`
				} `json:"jupyterhub"`
				JvmProfiler struct {
					Enabled bool `json:"enabled"`
				} `json:"jvmprofiler"`
				Kafka struct {
					Enabled bool `json:"enabled"`
				} `json:"kafka"`
				MlManager struct {
					Enabled bool `json:"enabled"`
				} `json:"mlmanager"`
				Rbac struct {
					Enabled bool `json:"enabled"`
				} `json:"rbac"`
				SpliceHTTP struct {
					Enabled bool `json:"enabled"`
				} `json:"splice-http"`
				Zookeeper struct {
					Enabled bool `json:"enabled"`
				} `json:"zookeeper"`
			} `json:"condition"`
			Global struct {
				Namespace     string `json:"dnsPrefix"`
				CloudProvider string `json:"cloudprovider"`
			} `json:"global"`
		} `json:"spec"`
	} `json:"data"`
}

DatabaseCRList - List of Databases

type DatabaseList

type DatabaseList struct {
	Clusters []CMClusterInfo `json:"clusters"`
}

DatabaseList - Data to read from the CM API

func (*DatabaseList) FilterByStatus added in v0.1.2

func (dbl *DatabaseList) FilterByStatus(active, paused bool) *DatabaseList

FilterByStatus - filters the list based on status of active/paused.

func (*DatabaseList) GroupBy added in v0.1.2

func (dbl *DatabaseList) GroupBy(test func(CMClusterInfo) bool) *DatabaseList

GroupBy - filters the list on a given test

func (*DatabaseList) ToGRON

func (databaseList *DatabaseList) ToGRON() error

ToGRON - Write the output as GRON

func (*DatabaseList) ToJSON

func (databaseList *DatabaseList) ToJSON() error

ToJSON - Write the output as JSON

func (*DatabaseList) ToTEXT

func (databaseList *DatabaseList) ToTEXT(noHeaders bool) error

ToTEXT - Write the output as TEXT

func (*DatabaseList) ToYAML

func (databaseList *DatabaseList) ToYAML() error

ToYAML - Write the output as YAML

type DatabaseRequest added in v0.1.1

type DatabaseRequest struct {
	AccountID                    string `json:"accountId"`
	AuthorizationCode            string `json:"authorizationCode"`
	BackupFrequency              string `json:"backupFrequency"`
	BackupInterval               int    `json:"backupInterval"`
	BackupKeepCount              int    `json:"backupKeepCount"`
	BackupStartWindow            string `json:"backupStartWindow"`
	CloudProvider                string `json:"cloudProvider"`
	ClusterPowerOlap             int    `json:"clusterPowerOlap"`
	ClusterPowerOltp             int    `json:"clusterPowerOltp"`
	DedicatedStorage             bool   `json:"dedicatedStorage"`
	ExternalDatasetSizeGb        int    `json:"externalDatasetSizeGb"`
	InternalDatasetSizeGb        int    `json:"internalDatasetSizeGb"`
	MlManager                    bool   `json:"mlManager"`
	Name                         string `json:"name"`
	NotebookActiveUsers          int    `json:"notebookActiveUsers"`
	NotebookExecutorsPerNotebook int    `json:"notebookExecutorsPerNotebook"`
	NotebookTotalUsers           int    `json:"notebookTotalUsers"`
	NotebooksPerUser             int    `json:"notebooksPerUser"`
	Password                     string `json:"password"`
}

DatabaseRequest - Cloud Manager Database Request

func (*DatabaseRequest) ToJSON added in v0.1.1

func (r *DatabaseRequest) ToJSON() error

ToJSON - Write the output as JSON

func (*DatabaseRequest) ToYAML added in v0.1.1

func (r *DatabaseRequest) ToYAML() error

ToYAML - Write the output as YAML

type ImageTag

type ImageTag struct {
	Component       string `json:"Component"`
	DatabaseCRImage string `json:"DatabaseCRImage"`
	ActiveImage     string `json:"ActiveImage"`
}

ImageTag - Structure for Version Info

type ImageTagList

type ImageTagList struct {
	ImageTags []ImageTag
}

ImageTagList - An array of image tags

func (*ImageTagList) ToGRON

func (i *ImageTagList) ToGRON() error

ToGRON - Write the output as GRON

func (*ImageTagList) ToJSON

func (i *ImageTagList) ToJSON() error

ToJSON - Write the output as JSON

func (*ImageTagList) ToTEXT

func (i *ImageTagList) ToTEXT(noHeaders bool) error

ToTEXT - Write the output as TEXT

func (*ImageTagList) ToYAML

func (i *ImageTagList) ToYAML() error

ToYAML - Write the output as YAML

type SystemSettings

type SystemSettings struct {
	Data map[string]string `json:"data"`
}

SystemSettings - Structure to hold data for the system-settings calls

func (*SystemSettings) ToGRON

func (settings *SystemSettings) ToGRON() error

ToGRON - Write the output as GRON

func (*SystemSettings) ToJSON

func (settings *SystemSettings) ToJSON() error

ToJSON - Write the output as JSON

func (*SystemSettings) ToTEXT

func (settings *SystemSettings) ToTEXT(noHeaders bool, decode bool) error

ToTEXT - Write the output as TEXT

func (*SystemSettings) ToYAML

func (settings *SystemSettings) ToYAML() error

ToYAML - Write the output as YAML

type VaultVersion

type VaultVersion struct {
	Version      int    `json:"version"`
	CreatedTime  string `json:"created_time"`
	DeletionTime string `json:"deletion_time"`
	Destroyed    bool   `json:"destroyed"`
}

VaultVersion - structure of the version output of Vault

func (*VaultVersion) ToGRON

func (vv *VaultVersion) ToGRON() error

ToGRON - Write the output as GRON

func (*VaultVersion) ToJSON

func (vv *VaultVersion) ToJSON() error

ToJSON - Write the output as JSON

func (*VaultVersion) ToTEXT

func (vv *VaultVersion) ToTEXT(noHeaders bool) error

ToTEXT - Write the output as TEXT

func (*VaultVersion) ToYAML

func (vv *VaultVersion) ToYAML() error

ToYAML - Write the output as YAML

type VaultVersionList

type VaultVersionList struct {
	Versions []VaultVersion
}

VaultVersionList - array of versions

func (*VaultVersionList) ToGRON

func (vv *VaultVersionList) ToGRON() error

ToGRON - Write the output as GRON

func (*VaultVersionList) ToJSON

func (vv *VaultVersionList) ToJSON() error

ToJSON - Write the output as JSON

func (*VaultVersionList) ToTEXT

func (vv *VaultVersionList) ToTEXT(noHeaders bool) error

ToTEXT - Write the output as TEXT

func (*VaultVersionList) ToYAML

func (vv *VaultVersionList) ToYAML() error

ToYAML - Write the output as YAML

type Version

type Version struct {
	VersionInfo struct {
		Client BaseVersion `json:"Client"`
		Server BaseVersion `json:"Server"`
	} `json:"VersionInfo"`
	Host string `json:"Host"`
}

Version - Structure for Version Info

func (*Version) RequirementMet added in v0.1.1

func (v *Version) RequirementMet(command string) (semver.Version, semver.Version)

RequirementMet - Check if the command is supported by the server version

func (*Version) ToGRON

func (v *Version) ToGRON() error

ToGRON - Write the output as GRON

func (*Version) ToJSON

func (v *Version) ToJSON() error

ToJSON - Write the output as JSON

func (*Version) ToTEXT

func (v *Version) ToTEXT(noHeaders bool) error

ToTEXT - Write the output as TEXT

func (*Version) ToYAML

func (v *Version) ToYAML() error

ToYAML - Write the output as YAML

Jump to

Keyboard shortcuts

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