cm

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2019 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RemoteCommand remote command type for running commands on the agent hosts
	RemoteCommand = "RemoteCommand"
	// LocalCommand local command type for running commands on localhost
	LocalCommand = "LocalCommand"
	// SaltCommand salt command type for running salt commands on the gateway
	SaltCommand = "SaltCommand"
	// SaltSyncCommand sync salt scripts command
	SaltSyncCommand = "SaltSyncCommand"
	// Download command type for downloading a file from an url
	Download = "Download"
	// Upload command type for uploading files to the agent hosts
	Upload = "Upload"
	// ServiceConfigUpdate command type for managing (update) service configuration
	ServiceConfigUpdate = "ServiceConfigUpdate"
	// RoleConfigUpdate command type for managing (update) role configuration
	RoleConfigUpdate = "RoleConfigUpdate"
	// ServiceCpmmand runs a CM service command (like start or stop) against services
	ServiceCpmmand = "ServiceCommand"
	// RoleCommand runs a CM role command (like start or stop) against roles
	RoleCommand = "RoleCommand"
)

Variables

This section is empty.

Functions

func ActiveCMRegistry

func ActiveCMRegistry(id string)

ActiveCMRegistry turn on active status on selected CM registry

func AddQuots added in v0.3.0

func AddQuots(slice []string) []string

AddQuots add quotation for every strings in a list

func ByteCountDecimal added in v0.2.0

func ByteCountDecimal(b int64) string

ByteCountDecimal create human readable format for bytes

func CreateCMRegistryDb

func CreateCMRegistryDb()

CreateCMRegistryDb initialize cmctl database

func DeRegisterCMEntry

func DeRegisterCMEntry(id string)

DeRegisterCMEntry remove an CM server enrty by id

func DeRegisterConnectionProfile

func DeRegisterConnectionProfile(id string)

DeRegisterConnectionProfile remove a connection profile by id

func DeactiveAllCMRegistry

func DeactiveAllCMRegistry()

DeactiveAllCMRegistry turn off active status on all CM registries

func DownloadFile

func DownloadFile(filepath string, url string) error

DownloadFile download a file from an url to the local filesystem

func DownloadFileInMemory added in v0.3.0

func DownloadFileInMemory(url string) ([]byte, error)

DownloadFileInMemory download file as bytes

func DownloadViaScp

func DownloadViaScp(sshConfig *easyssh.MakeConfig, source string, dest string, skipJump bool) error

DownloadViaScp downloads file from remote to local

func DropCMRegistryRecords

func DropCMRegistryRecords()

DropCMRegistryRecords drop all CM server entries from cmctl database

func DropConnectionProfileRecords

func DropConnectionProfileRecords()

DropConnectionProfileRecords drop all connection profile from cmctl database

func EvaluateBoolValueFromString

func EvaluateBoolValueFromString(answer string) bool

EvaluateBoolValueFromString get a string boolean answer and evaluate as a boolean value

func ExecuteDownloadFileTask added in v0.3.0

func ExecuteDownloadFileTask(task Task)

ExecuteDownloadFileTask download a file from an url to the local filesystem

func ExecuteLocalCommandTask added in v0.3.0

func ExecuteLocalCommandTask(task Task)

ExecuteLocalCommandTask executes a local shell command

func Exists added in v0.2.0

func Exists(name string) bool

Exists reports whether the named file or directory exists.

func FormatJSON added in v0.3.0

func FormatJSON(b []byte) *bytes.Buffer

FormatJSON format json file

func GetCMEntryID added in v0.3.0

func GetCMEntryID(id string) string

GetCMEntryID get CM server entry id if the id exists

func GetConnectionProfileEntryID added in v0.3.0

func GetConnectionProfileEntryID(id string) string

GetConnectionProfileEntryID get connection profile entry id if the id exists

func GetHttpClient

func GetHttpClient() *http.Client

GetHttpClient create HTTP client instance for CM Server

func GetPassword

func GetPassword(flagValue string, text string) string

GetPassword trying to read a password flag value, if it does not exists ask an input from the user

func GetStringFlag

func GetStringFlag(flagValue string, defaultValue string, text string) string

GetStringFlag trying to read a flag value, if it does not exists ask an input from the user

func ProcessAsMap

func ProcessAsMap(request *http.Request) map[string]interface{}

ProcessAsMap get map format response

func ProcessAsMapFromBytes

func ProcessAsMapFromBytes(bodyBytes []byte) map[string]interface{}

ProcessAsMapFromBytes get JSON map from bytes

func ProcessAsMapFromSSHResponse

func ProcessAsMapFromSSHResponse(sshResponse RemoteResponse) map[string]interface{}

ProcessAsMapFromSSHResponse get JSON map from CM gateway SSH response

func ProcessRequest

func ProcessRequest(request *http.Request) []byte

ProcessRequest get a simple response from a REST call

func RegisterNewCMEntry

func RegisterNewCMEntry(id string, hostname string, port int, protocol string, username string, password string, useGateway bool, apiVersion int)

RegisterNewCMEntry create new CM server registry entry in cmctl database

func RegisterNewConnectionProfile

func RegisterNewConnectionProfile(id string, keyPath string, port int, username string)

RegisterNewConnectionProfile create new connection profile entry in cmctl database

func RunLocalCommand

func RunLocalCommand(command string, arg ...string) (string, string, error)

RunLocalCommand run local system command

func SetProfileIDForCMEntry added in v0.3.0

func SetProfileIDForCMEntry(cmEntryID string, profileId string)

SetProfileIDForCMEntry attach a connection profile to a specific CM server entry

func SliceContains added in v0.2.0

func SliceContains(a string, list []string) bool

SliceContains check that a string slice contains an element or not

func UpdateCMEntry

func UpdateCMEntry(id string, hostname string, port int, protocol string, username string, password string, useGateway bool, apiVersion int, connectionProfile string)

UpdateCMEntry update CM server registry entry in cmctl database

func UpperAllInSlice added in v0.3.0

func UpperAllInSlice(slice []string) []string

UpperAllInSlice uppercase all string in a list

func WriteCMServerEntries

func WriteCMServerEntries(cmServers []CMServer)

WriteCMServerEntries write CM server entries to the CM server registry json file

func WriteConnectionProfileEntries

func WriteConnectionProfileEntries(connectionProfiles []ConnectionProfile)

WriteConnectionProfileEntries write connection profile entries to the connection profile registry json file

Types

type CMServer

type CMServer struct {
	Name              string `json:"name"`
	Hostname          string `json:"hostname"`
	Port              int    `json:"port"`
	Username          string `json:"username"`
	Password          string `json:"password"`
	Protocol          string `json:"protocol"`
	Active            bool   `json:"active"`
	ConnectionProfile string `json:"profile"`
	UseGateway        bool   `json:"gateway"`
	APIVersion        int    `json:"version"`
}

CMServer represents registered CM server entry details

func GetActiveCM

func GetActiveCM() CMServer

GetActiveCM get the active CM server registry from cmctl database (should be only one)

func GetCMByID added in v0.3.0

func GetCMByID(searchID string) CMServer

GetCMByID get the CM server registry from cmctl database by id

func ListCMRegistryEntries

func ListCMRegistryEntries() []CMServer

ListCMRegistryEntries get all CM server registries from cmctl database

func (CMServer) CopyToCMGateway added in v0.1.1

func (c CMServer) CopyToCMGateway(source string, dest string)

CopyToCMGateway copy local file to gateway host

func (CMServer) CopyToRemote added in v0.3.0

func (c CMServer) CopyToRemote(source string, dest string, filteredHosts map[string]bool, gateway string, inventory *Inventory)

CopyToRemote copy local file to remote host(s)

func (CMServer) CreateGatewayCurlGetCommand

func (c CMServer) CreateGatewayCurlGetCommand(uri string) string

CreateGatewayCurlGetCommand generate a curl GET command for gateway usage

func (CMServer) CreateGatewayCurlPostCommand

func (c CMServer) CreateGatewayCurlPostCommand(uri string, body string) string

CreateGatewayCurlPostCommand generate a curl POST command for gateway usage

func (CMServer) CreateGatewayCurlPutCommand added in v0.3.0

func (c CMServer) CreateGatewayCurlPutCommand(uri string, body string) string

CreateGatewayCurlPutCommand generate a curl PUT command for gateway usage

func (CMServer) CreateGetRequest

func (c CMServer) CreateGetRequest(urlSuffix string) *http.Request

CreateGetRequest creates an CM Server GET request

func (CMServer) CreateInventoryFiles added in v0.2.0

func (c CMServer) CreateInventoryFiles(targetDir string, outputFile string, cluster string, serverHostname string)

CreateInventoryFiles generate ansible compatible inventory files from CM deployment descriptor

func (CMServer) CreatePostRequest

func (c CMServer) CreatePostRequest(body bytes.Buffer, urlSuffix string) *http.Request

CreatePostRequest creates an CM Server POST request with body

func (CMServer) CreatePutRequest

func (c CMServer) CreatePutRequest(body bytes.Buffer, urlSuffix string) *http.Request

CreatePutRequest creates an CM Server PUT request with body

func (CMServer) ExecuteCMCommand added in v0.3.0

func (c CMServer) ExecuteCMCommand(task Task, cluster string, filter Filter, roleCommand bool, inventories []Inventory)

ExecuteCMCommand executes an CM command against services or roles

func (CMServer) ExecuteConfigUpdate added in v0.3.0

func (c CMServer) ExecuteConfigUpdate(task Task, cluster string, filter Filter, roleConfig bool)

ExecuteConfigUpdate executes a configuration update against roles or services

func (CMServer) ExecutePlaybook added in v0.3.0

func (c CMServer) ExecutePlaybook(playbook Playbook, inventory *Inventory)

ExecutePlaybook runs tasks on CM hosts based on a playbook object

func (CMServer) ExecuteRemoteCommandTask added in v0.3.0

func (c CMServer) ExecuteRemoteCommandTask(task Task, filteredHosts map[string]bool, inventory *Inventory)

ExecuteRemoteCommandTask executes a remote command on filtered hosts

func (CMServer) ExecuteSaltCommand

func (c CMServer) ExecuteSaltCommand(task Task)

ExecuteSaltCommand execute salt command

func (CMServer) ExecuteSaltSyncCommand added in v0.3.0

func (c CMServer) ExecuteSaltSyncCommand(task Task)

ExecuteSaltSyncCommand sync salt scripts from folder

func (CMServer) ExecuteUploadFileTask added in v0.3.0

func (c CMServer) ExecuteUploadFileTask(task Task, filteredHosts map[string]bool, inventory *Inventory)

ExecuteUploadFileTask upload a file to specific (filtered) hosts

func (CMServer) ExportClusterTemplate

func (c CMServer) ExportClusterTemplate(cluster string) []byte

ExportClusterTemplate exporting template for a specific cluster

func (CMServer) GetCMUri

func (c CMServer) GetCMUri(uriSuffix string) string

GetCMUri creates the CM uri with /api/vx/ suffix (+ /api/vx/clusters/<cluster> suffix is useCluster is enabled)

func (CMServer) GetDeployment

func (c CMServer) GetDeployment() Deployment

GetDeployment get full deployement data for CM server

func (CMServer) GetExternalAccountCategories added in v0.4.0

func (c CMServer) GetExternalAccountCategories() []string

GetExternalAccountCategories returns a list of the supported external account categories

func (CMServer) GetExternalAccountTypesByCategory added in v0.4.0

func (c CMServer) GetExternalAccountTypesByCategory(category string) []string

GetExternalAccountTypesByCategory returns a list of the external accounts types by category

func (CMServer) GetExternalAccountsByType added in v0.4.0

func (c CMServer) GetExternalAccountsByType(accountType string) map[string]map[string]string

GetExternalAccountsByType gather external accounts with configs by type

func (CMServer) GetFilteredHosts

func (c CMServer) GetFilteredHosts(filter Filter, inventory *Inventory) map[string]bool

GetFilteredHosts obtain specific hosts based on different filters

func (CMServer) GetUsers

func (c CMServer) GetUsers() []User

GetUsers returns a list of the user names configured in the system.

func (CMServer) ListClusters

func (c CMServer) ListClusters() []Cluster

ListClusters get all the registered clusters

func (CMServer) ListHosts

func (c CMServer) ListHosts() []Host

ListHosts get all the registered hosts

func (CMServer) ListRoleConfigGroups added in v0.3.0

func (c CMServer) ListRoleConfigGroups(cluster string, service string, full bool) []RoleConfigGroup

ListRoleConfigGroups gather role configuration groups

func (CMServer) ListServiceConfigs added in v0.3.0

func (c CMServer) ListServiceConfigs(cluster string, service string, full bool) []ConfigItem

ListServiceConfigs gather service configurations

func (CMServer) ListServices

func (c CMServer) ListServices(cluster string) []Service

ListServices get all the registered services per cluster

func (CMServer) RunGatewayCMCommand

func (c CMServer) RunGatewayCMCommand(command string, printStdOut bool, printEmptyResponse bool) RemoteResponse

RunGatewayCMCommand run command on CM CB gateway

func (CMServer) RunRemoteHostCommand

func (c CMServer) RunRemoteHostCommand(command string, filteredHosts map[string]bool, skipJump bool, inventory *Inventory) map[string]RemoteResponse

RunRemoteHostCommand executes bash commands on CM hosts

func (CMServer) RunRolesOperation added in v0.2.0

func (c CMServer) RunRolesOperation(cluster string, service string, roleNames []string, roleNameFilter string, command string, verbose bool) []byte

RunRolesOperation run operation on a list of roles for a specific service

func (CMServer) RunSaltCommand added in v0.3.0

func (c CMServer) RunSaltCommand(command string, rawCommand string, saltBinaryPathPrefix string, saltBinary string)

RunSaltCommand execute a command on all minions

func (CMServer) RunServiceOperation added in v0.2.0

func (c CMServer) RunServiceOperation(cluster string, service string, command string, verbose bool) []byte

RunServiceOperation run a service operation (start / stop / restart)

func (CMServer) SyncSaltScripts added in v0.1.1

func (c CMServer) SyncSaltScripts(source string, target string, filter string, clear bool)

SyncSaltScripts sync salt scripts - delete/backup old scripts then upload new ones from local salt folder

func (CMServer) UpdateRoleConfigs added in v0.3.0

func (c CMServer) UpdateRoleConfigs(cluster string, service string, roleType string, roleConfigGroup string,
	keyValueMap map[string]string, clear bool, verbose bool) []byte

UpdateRoleConfigs refresh role group configuration

func (CMServer) UpdateServiceConfigs added in v0.3.0

func (c CMServer) UpdateServiceConfigs(cluster string, service string, keyValueMap map[string]string, clear bool, verbose bool) []byte

UpdateServiceConfigs refresh service configuration

type Cluster

type Cluster struct {
	UUID        string `json:"uuid,omitempty"`
	Name        string `json:"name,omitempty"`
	DisplayName string `json:"displayName,omitempty"`
	Version     string `json:"fullVersion,omitempty"`
	Type        string `json:"clusterType,omitempty"`
}

Cluster holds installed CM cluster details

type ConfigItem added in v0.3.0

type ConfigItem struct {
	Name                         string `json:"name,omitempty"`
	Value                        string `json:"value,omitempty"`
	DisplayName                  string `json:"displayName,omitempty"`
	Description                  string `json:"description,omitempty"`
	Sensitive                    bool   `json:"sensitive,omitempty"`
	Required                     bool   `json:"required,omitempty"`
	RelatedName                  string `json:"relatedName,omitempty"`
	Default                      string `json:"default,omitempty"`
	ValidationState              string `json:"validationState,omitempty"`
	ValidationWarningsSuppressed bool   `json:"validationWarningsSuppressed,omitempty"`
}

ConfigItem represents a config entry

type ConnectionProfile

type ConnectionProfile struct {
	Name     string `json:"name"`
	KeyPath  string `json:"key_path"`
	Port     int    `json:"port"`
	Username string `json:"username"`
}

ConnectionProfile represents ssh/connection descriptions which is used to communicate with CM server and agents

func GetConnectionProfileByID added in v0.3.0

func GetConnectionProfileByID(searchID string) ConnectionProfile

GetConnectionProfileByID get the connection profile from cmctl database by id

func ListConnectionProfileEntries

func ListConnectionProfileEntries() []ConnectionProfile

ListConnectionProfileEntries get all CM server registries from cmctl database

type Deployment

type Deployment struct {
	Clusters              []Cluster
	Services              []Service
	Hosts                 []Host
	ClusterServiceRoleMap map[string]ServiceRolesMap
}

Deployment hold full CM server deployment data

func ConvertDeploymentResponse

func ConvertDeploymentResponse(responseMap map[string]interface{}) Deployment

ConvertDeploymentResponse convert map to Deployment response

type Filter

type Filter struct {
	Hosts    []string
	Clusters []string
	Services []string
	Roles    []string
	Server   bool
}

Filter represents filter on agent hosts (by component / service / hosts)

func CreateFilter

func CreateFilter(clusterFilter string, serviceFilter string, rolesFilter string, hostFilter string, cmServer bool) Filter

CreateFilter will make a Filter object from filter strings (hosts)

type Host

type Host struct {
	HostID             string `json:"hostId,omitempty"`
	IPAddress          string `json:"ipAddress,omitempty"`
	HostName           string `json:"hostName,omitempty"`
	CommissionState    string `json:"commissionState,omitempty"`
	RackID             string `json:"rackId,omitempty"`
	ClusterName        string `json:"clusterName,omitempty"`
	ClusterDisplayName string `json:"clusterDisplayName,omitempty"`
	TotalMemory        string `json:"totalPhysMemBytes,omitempty"`
}

Host holds host details

type HostRoleNamePair added in v0.2.0

type HostRoleNamePair struct {
	HostName string `json:"hostName,omitempty"`
	RoleName string `json:"roleName,omitempty"`
}

HostRoleNamePair holds host name and role name for inventory resource

type IniConfiguration added in v0.3.0

type IniConfiguration struct {
	Sections *map[string]Section
}

IniConfiguration holds inventory config sections by name

func CreateIniConfiguration added in v0.3.0

func CreateIniConfiguration() *IniConfiguration

CreateIniConfiguration create new ini config object

func LoadIniFile added in v0.3.0

func LoadIniFile(fileName string) (*IniConfiguration, error)

LoadIniFile load ini configuration file locally

func (*IniConfiguration) AddSection added in v0.3.0

func (cfg *IniConfiguration) AddSection(name string) *Section

AddSection create a new section

func (*IniConfiguration) GetSection added in v0.3.0

func (cfg *IniConfiguration) GetSection(name string) *Section

GetSection gather a section by name

func (*IniConfiguration) SectionExists added in v0.3.0

func (cfg *IniConfiguration) SectionExists(sectionName string) bool

SectionExists check that a section exists with a name or not

func (*IniConfiguration) WriteIniConfiguration added in v0.3.0

func (cfg *IniConfiguration) WriteIniConfiguration(filePath string, startSectionsWith []string) error

WriteIniConfiguration create a new ini file with ini configuration object content - sections are sorted but can start with specific sections

type Input added in v0.3.0

type Input struct {
	Name    string `yaml:"name"`
	Default string `yaml:"default,omitempty"`
}

Input represents a variable that needs to be provided by users (if default value is empty)

type Inventory added in v0.2.0

type Inventory struct {
	ServerAddress       string                                   `json:"server,omitempty"`
	ClusterName         string                                   `json:"cluster,omitempty"`
	Hosts               []Host                                   `json:"agents,omitempty"`
	ServiceRoleHostsMap map[string]map[string][]HostRoleNamePair `json:"serviceRoleHostsMap,omitempty"`
	ServiceHostsMap     map[string][]string                      `json:"serviceHostsMap,omitempty"`
}

Inventory holds hosts mappings for resources

func CreateInventoriesFromDeploymentsAndHosts added in v0.2.0

func CreateInventoriesFromDeploymentsAndHosts(deployment Deployment, agentHosts []Host) []Inventory

CreateInventoriesFromDeploymentsAndHosts create struct that holds hostnames by services/roles for all clusters

func CreateInventory added in v0.2.0

func CreateInventory(clusterName string, serviceRoleMap ServiceRolesMap, deployment Deployment, agentHosts []Host) Inventory

CreateInventory create struct that holds hostnames by services/roles/cluster

func ReadInventoryFromFile added in v0.3.0

func ReadInventoryFromFile(inventoryFilePath string) Inventory

ReadInventoryFromFile parse inventory file and create an inventory resource from it

func (*Inventory) EnrichInventoryWithHostsForCluster added in v0.4.0

func (i *Inventory) EnrichInventoryWithHostsForCluster(cluster string, agentHosts []Host)

EnrichInventoryWithHostsForCluster enrich inventory struct with hosts for a specific cluster

type Item

type Item map[string]interface{}

Item dynamic map - cast contents to specific types

type Items added in v0.3.0

type Items struct {
	Href  string `json:"href"`
	Items []Item `json:"items"`
}

Items global items from CM Server rest API response

func ProcessCMItems

func ProcessCMItems(request *http.Request) Items

ProcessCMItems get "items" from CM server response

func ProcessCMItemsFromBytes

func ProcessCMItemsFromBytes(bodyBytes []byte) Items

ProcessCMItemsFromBytes get "items" from bytes

func ProcessCMItemsFromSSHResponse

func ProcessCMItemsFromSSHResponse(sshResponse RemoteResponse) Items

ProcessCMItemsFromSSHResponse get "items" from CM gateway SSH response

func (Items) ConvertClustersResponse added in v0.3.0

func (c Items) ConvertClustersResponse() []Cluster

ConvertClustersResponse convert items response to Clusters response

func (Items) ConvertExternalAccounts added in v0.4.0

func (c Items) ConvertExternalAccounts() map[string]map[string]string

ConvertExternalAccounts convert items response to external accounts per type

func (Items) ConvertHostsResponse added in v0.3.0

func (c Items) ConvertHostsResponse() []Host

ConvertHostsResponse convert items response to Hosts response

func (Items) ConvertRoleConfigGroupsResponse added in v0.3.0

func (c Items) ConvertRoleConfigGroupsResponse() []RoleConfigGroup

ConvertRoleConfigGroupsResponse convert items to role configuration groups

func (Items) ConvertRolesResponse added in v0.3.0

func (c Items) ConvertRolesResponse(cluster string, service string) []Role

ConvertRolesResponse convert items response to Roles response

func (Items) ConvertServiceConfigResponse added in v0.3.0

func (c Items) ConvertServiceConfigResponse() []ConfigItem

ConvertServiceConfigResponse convert items response to config items

func (Items) ConvertServicesResponse added in v0.3.0

func (c Items) ConvertServicesResponse(cluster string) []Service

ConvertServicesResponse convert items response to Services response

func (Items) ConvertUsersResponse added in v0.3.0

func (c Items) ConvertUsersResponse() []User

ConvertUsersResponse convert items response to Users response

type Playbook added in v0.3.0

type Playbook struct {
	Name        string  `yaml:"name"`
	Description string  `yaml:"description"`
	Tasks       []Task  `yaml:"tasks"`
	Inputs      []Input `yaml:"inputs"`
}

Playbook contains an array of tasks that will be executed on CM hosts

func LoadPlaybookFile added in v0.3.0

func LoadPlaybookFile(location string, varsInput string) Playbook

LoadPlaybookFile read a playbook yaml file and transform it to a Playbook object

type RemoteResponse

type RemoteResponse struct {
	StdOut string
	StdErr string
	Done   bool
}

RemoteResponse represents an ssh command output

type Role

type Role struct {
	Name           string `json:"name,omitempty"`
	Type           string `json:"type,omitempty"`
	HostName       string `json:"hostName,omitempty"`
	ConfigGroup    string `json:"configGroup,omitempty"`
	State          string `json:"roleState,omitempty"`
	StaleConfig    string `json:"configStalenessStatus,omitempty"`
	ComissionState string `json:"commissionState,omitempty"`
	ClusterName    string `json:"clusterName,omitempty"`
	ServiceName    string `json:"serviceName,omitempty"`
}

Role holds role details

type RoleConfigGroup added in v0.3.0

type RoleConfigGroup struct {
	Name        string       `json:"name,omitempty"`
	DisplayName string       `json:"displayName,omitempty"`
	RoleType    string       `json:"roleType,omitempty"`
	ClusterName string       `json:"clusterName,omitempty"`
	ServiceName string       `json:"serviceName,omitempty"`
	Base        bool         `json:"base,omitempty"`
	ConfigItems []ConfigItem `json:"items,omitempty"`
}

RoleConfigGroup holds role configuration group

type Section added in v0.3.0

type Section struct {
	Name        string
	KeyValueMap map[string]string
	Values      *[]string
}

Section configuration sections for inventory files

func (*Section) AddSectionKeyValue added in v0.3.0

func (s *Section) AddSectionKeyValue(key string, value string) *Section

AddSectionKeyValue add new key and value for a section

func (*Section) AddSectionKeyValueStr added in v0.3.0

func (s *Section) AddSectionKeyValueStr(keyValue string) *Section

AddSectionKeyValueStr add new section option value (key=value format)

func (*Section) AddSectionValue added in v0.3.0

func (s *Section) AddSectionValue(value string) *Section

AddSectionValue add new section option

func (*Section) SectionToString added in v0.3.0

func (s *Section) SectionToString() string

SectionToString create a section string (ini like: [section_name]key=value ... with new lines)

type Service

type Service struct {
	Name        string `json:"name,omitempty"`
	DisplayName string `json:"displayName,omitempty"`
	Type        string `json:"type,omitempty"`
	State       string `json:"serviceState,omitempty"`
	ClusterName string `json:"clusterName,omitempty"`
	StaleConfig string `json:"configStalenessStatus,omitempty"`
}

Service holds service details

type ServiceRolesMap

type ServiceRolesMap struct {
	RolesMap map[string][]Role
}

ServiceRolesMap holds service - roles map

type Task added in v0.3.0

type Task struct {
	Name           string              `yaml:"name"`
	Type           string              `yaml:"type"`
	Debug          bool                `yaml:"debug"`
	Command        string              `yaml:"command"`
	CMServerFilter bool                `yaml:"server"`
	CMAgentFilter  bool                `yaml:"agent"`
	ClusterFilter  string              `yaml:"cluster"`
	HostFilter     string              `yaml:"hosts"`
	ServiceFilter  string              `yaml:"service"`
	RoleTypeFilter string              `yaml:"role"`
	RoleNames      string              `yaml:"roleName"`
	Configs        []map[string]string `yaml:"configs,omitempty"`
	Parameters     map[string]string   `yaml:"parameters,omitempty"`
}

Task represents a task that can be executed on an CM hosts

type User

type User struct {
	Name      string         `json:"name,omitempty"`
	AuthRoles []UserAuthRole `json:"authRoles,omitempty"`
}

User holds user details

type UserAuthRole

type UserAuthRole struct {
	Name string `json:"name,omitempty"`
}

UserAuthRole holds user auth role details

Jump to

Keyboard shortcuts

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