Documentation ¶
Index ¶
- func ParseChoosedComponents(zone *target.Zone, components []string, ansible bool, helm bool) (map[string]string, map[string]string, error)
- func ParseComponentsOption(componentsOptions []string) (map[string]string, error)
- func ParseHostsOptions(hostsOptions []string) (map[string][]ansible.ActionHosts, error)
- func PrintColorHeader(targetName string, zoneName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseChoosedComponents ¶
func ParseComponentsOption ¶
ParseComponentsOption parses --component options and interprets them as map of components.
eg options:
--component A # only specify componentName --component B/v0.0.1 # specify componentName/componentVersion --component C/v0.0.2,D/v0.0.3 # sepcify multiple components with comma separated --component E/v1.2.3/831212f # specify componentName/componentVersion/componentLongVersion
result:
{ "A": "", "B": "v0.0.1", "C": "v0.0.2", "D": "v0.0.3", "E": "831212f" }
func ParseHostsOptions ¶
func ParseHostsOptions(hostsOptions []string) (map[string][]ansible.ActionHosts, error)
ParseHostsOptions parses --hosts options and interprets them as a map, key is component name, value is a list of ActionHosts. The returned map can be used to update cmdb inventory.
eg options:
--hosts A,B/10.0.0.1,10.0.0.2 --hosts +C/10.0.0.3,10.0.0.4 --hosts -C,D,E/10.0.0.4
result:
{ "A": [ { "Aciton": "update", "Hosts": ["10.0.0.1", "10.0.0.2"] }, ], "B": [ { "Aciton": "update", "Hosts": ["10.0.0.1", "10.0.0.2"] }, ], "C": [ { "Aciton": "add", "Hosts": ["10.0.0.3", "10.0.0.4"] }, { "Aciton": "remove", "Hosts": ["10.0.0.4"] }, ], "D": [ { "Aciton": "remove", "Hosts": ["10.0.0.4"] }, ], "E": [ { "Aciton": "remove", "Hosts": ["10.0.0.4"] }, ], }
func PrintColorHeader ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.