cli

package
v2.3.1-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2018 License: Apache-2.0, BSD-2-Clause Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Config_dir  = ".cb"
	Config_file = "config"
)
View Source
const (
	OAUTH2 = "oauth2"
	BASIC  = "basic"
)
View Source
const (
	AVAILABLE        = status("AVAILABLE")
	STOPPED          = status("STOPPED")
	DELETE_COMPLETED = status("DELETE_COMPLETED")
	SKIP             = status("")
)

Variables

View Source
var (
	FlDebugOptional = BoolFlag{
		RequiredFlag: OPTIONAL,
		BoolFlag: cli.BoolFlag{
			Name:   "debug",
			Usage:  "debug mode",
			EnvVar: "DEBUG",
		},
	}
	FlWaitOptional = BoolFlag{
		RequiredFlag: OPTIONAL,
		BoolFlag: cli.BoolFlag{
			Name:  "wait",
			Usage: "wait for the operation to finish, no argument required",
		},
	}
	FlInputJson = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "cli-input-json",
			Usage: "user provided file with json content",
		},
	}
	FlOutputOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:   "output",
			Usage:  "supported formats: json, yaml, table (default: \"json\")",
			EnvVar: "CB_OUT_FORMAT",
		},
	}
	FlProfileOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:   "profile",
			Usage:  "selects a config profile to use",
			EnvVar: "CB_PROFILE",
		},
	}
	FlAuthTypeOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:   "auth-type",
			Usage:  "authentication method to use, values: [" + OAUTH2 + ", " + BASIC + "]",
			EnvVar: "CB_AUTH_TYPE",
		},
	}
	FlForceOptional = BoolFlag{
		RequiredFlag: OPTIONAL,
		BoolFlag: cli.BoolFlag{
			Name:  "force",
			Usage: "force the operation",
		},
	}
	FlServerOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:   "server",
			Usage:  "server address",
			EnvVar: "CB_SERVER_ADDRESS",
		},
	}
	FlServerRequired = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:   "server",
			Usage:  "server address",
			EnvVar: "CB_SERVER_ADDRESS",
		},
	}
	FlUsername = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:   "username",
			Usage:  "user name (e-mail address)",
			EnvVar: "CB_USER_NAME",
		},
	}
	FlUsernameRequired = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:   "username",
			Usage:  "user name (e-mail address)",
			EnvVar: "CB_USER_NAME",
		},
	}
	FlPassword = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:   "password",
			Usage:  "password",
			EnvVar: "CB_PASSWORD",
		},
	}
	FlName = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "name",
			Usage: "name of resource",
		},
	}
	FlNameOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:  "name",
			Usage: "name of resource",
		},
	}
	FlDescriptionOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:  "description",
			Usage: "description of resource",
		},
	}
	FlPublicOptional = BoolFlag{
		RequiredFlag: OPTIONAL,
		BoolFlag: cli.BoolFlag{
			Name:  "public",
			Usage: "public in account",
		},
	}
	FlRoleARN = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "role-arn",
		},
	}
	FlAccessKey = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "access-key",
		},
	}
	FlSecretKey = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "secret-key",
		},
	}
	FlProjectId = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "project-id",
		},
	}
	FlServiceAccountId = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "service-account-id",
		},
	}
	FlServiceAccountPrivateKeyFile = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "service-account-private-key-file",
		},
	}
	FlTenantUser = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "tenant-user",
		},
	}
	FlTenantPassword = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "tenant-password",
		},
	}
	FlTenantName = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "tenant-name",
		},
	}
	FlEndpoint = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "endpoint",
		},
	}
	FlKeystoneScopeOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name: "keystone-scope",
		},
	}
	FlUserDomain = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "user-domain",
		},
	}
	FlProjectDomainNameOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name: "project-domain-name",
		},
	}
	FlDomainNameOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name: "domain-name",
		},
	}
	FlProjectNameOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name: "project-name",
		},
	}
	FlFacingOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name: "facing",
		},
	}
	FlSubscriptionId = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "subscription-id",
		},
	}
	FlTenantId = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "tenant-id",
		},
	}
	FlAppId = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "app-id",
		},
	}
	FlAppPassword = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name: "app-password",
		},
	}
	FlFile = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "file",
			Usage: "location of the Ambari blueprint JSON file",
		},
	}
	FlURL = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "url",
			Usage: "URL location of the JSON file",
		},
	}
	FlBlueprintName = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "blueprint-name",
			Usage: "name of the blueprint",
		},
	}
	FlBlueprintNameOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:  "blueprint-name",
			Usage: "name of the blueprint",
		},
	}
	FlBlueprintFileOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:  "blueprint-file",
			Usage: "location of the blueprint file",
		},
	}
	FlExecutionType = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "execution-type",
			Usage: "type of execution [pre-ambari-start, pre-termination, post-ambari-start, post-cluster-install]",
		},
	}
	FlAmbariPasswordOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:  "input-json-param-password",
			Usage: "password of the cluster and ambari",
		},
	}
	FlGroupName = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "group-name",
			Usage: "name of the group to scale",
		},
	}
	FlDesiredNodeCount = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "desired-node-count",
			Usage: "desired number of nodes",
		},
	}
	FlOldPassword = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "old-password",
			Usage: "old password of ambari",
		},
	}
	FlNewPassword = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "new-password",
			Usage: "new password of ambari",
		},
	}
	FlAmbariUser = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "ambari-user",
			Usage: "user of ambari",
		},
	}
	FlLdapServer = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "ldap-server",
			Usage: "address of the ldap server (e.g: ldap://10.0.0.1:384)",
		},
	}
	FlLdapDomain = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "ldap-domain",
			Usage: "ldap domain (e.g: ad.cb.com)",
		},
	}
	FlLdapBindDN = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "ldap-bind-dn",
			Usage: "ldap bind dn (e.g: CN=Administrator,CN=Users,DC=ad,DC=cb,DC=com)",
		},
	}
	FlLdapUserNameAttribute = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "ldap-user-name-attribute",
			Usage: "ldap user name attribute",
		},
	}
	FlLdapUserObjectClass = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "ldap-user-object-class",
			Usage: "ldap user object class",
		},
	}
	FlLdapGroupMemberAttribute = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "ldap-group-member-attribute",
			Usage: "ldap group member attribute",
		},
	}
	FlLdapGroupNameAttribute = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "ldap-group-name-attribute",
			Usage: "ldap group name attribute",
		},
	}
	FlLdapGroupObjectClass = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "ldap-group-object-class",
			Usage: "ldap group object class",
		},
	}
	FlLdapBindPassword = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "ldap-bind-password",
			Usage: "ldap bind password",
		},
	}
	FlLdapDirectoryType = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "ldap-directory-type",
			Usage: "ldap directory type (LDAP or ACTIVE_DIRECTORY)",
		},
	}
	FlLdapUserSearchBase = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "ldap-user-search-base",
			Usage: "ldap user search base (e.g: CN=Users,DC=ad,DC=cb,DC=com)",
		},
	}
	FlLdapGroupSearchBase = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "ldap-group-search-base",
			Usage: "ldap group search base (e.g: OU=scopes,DC=ad,DC=cb,DC=com)",
		},
	}
	FlLdapAdminGroup = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:  "ldap-admin-group",
			Usage: "ldap group of administrators",
		},
	}
	FlKerberosPasswordOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:  "kerberos-password",
			Usage: "kerberos password",
		},
	}
	FlKerberosPrincipalOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:  "kerberos-principal",
			Usage: "kerberos principal",
		},
	}
	FlCredential = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "credential",
			Usage: "name of the credential",
		},
	}
	FlRegion = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "region",
			Usage: "name of the region",
		},
	}
	FlAvailabilityZoneOptional = StringFlag{
		RequiredFlag: OPTIONAL,
		StringFlag: cli.StringFlag{
			Name:  "availability-zone",
			Usage: "name of the availability zone",
		},
	}
	FlImageCatalog = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "imagecatalog",
			Usage: "name of the imagecatalog",
		},
	}
	FlKey = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "key",
			Usage: "key of the tag",
		},
	}
	FlValue = StringFlag{
		RequiredFlag: REQUIRED,
		StringFlag: cli.StringFlag{
			Name:  "value",
			Usage: "value of the tag",
		},
	}
)
View Source
var (
	Version   string
	BuildTime string
)
View Source
var AppHelpTemplate = `` /* 725-byte string literal not displayed */
View Source
var CommandHelpTemplate = `` /* 478-byte string literal not displayed */
View Source
var HiddenAppHelpTemplate = `` /* 632-byte string literal not displayed */
View Source
var LdapHeader = []string{"Name", "Server", "Domain", "BindDn", "DirectoryType",
	"UserSearchBase", "UserNameAttribute", "UserObjectClass",
	"GroupMemberAttribute", "GroupNameAttribute", "GroupObjectClass", "GroupSearchBase"}
View Source
var LoggedTransportConfig = httplogger.NewLoggedTransport(TransportConfig, newLogger())
View Source
var OPTIONAL = RequiredFlag{false}
View Source
var PREFIX_TRIM = []string{"http://", "https://"}
View Source
var REQUIRED = RequiredFlag{true}
View Source
var StackTemplateDescription = `` /* 720-byte string literal not displayed */
View Source
var SubCommandHelpTemplate = `` /* 592-byte string literal not displayed */
View Source
var TransportConfig = &http.Transport{
	Proxy:           http.ProxyFromEnvironment,
	TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
	Dial: (&net.Dialer{
		Timeout:   30 * time.Second,
		KeepAlive: 30 * time.Second,
	}).Dial,
	TLSHandshakeTimeout:   10 * time.Second,
	ExpectContinueTimeout: 1 * time.Second,
}

This is nearly identical with http.DefaultTransport

Functions

func AddAccountTag

func AddAccountTag(c *cli.Context)

func ChangeAmbariPassword

func ChangeAmbariPassword(c *cli.Context)

func Configure

func Configure(c *cli.Context)

func CreateAwsCredential

func CreateAwsCredential(c *cli.Context)

func CreateAzureCredential

func CreateAzureCredential(c *cli.Context)

func CreateBlueprintFromFile

func CreateBlueprintFromFile(c *cli.Context)

func CreateBlueprintFromUrl

func CreateBlueprintFromUrl(c *cli.Context)

func CreateGcpCredential

func CreateGcpCredential(c *cli.Context)

func CreateImagecatalogFromUrl

func CreateImagecatalogFromUrl(c *cli.Context)

func CreateLDAP

func CreateLDAP(c *cli.Context) error

func CreateOpenstackCredential

func CreateOpenstackCredential(c *cli.Context)

func CreateRecipeFromFile

func CreateRecipeFromFile(c *cli.Context)

func CreateRecipeFromUrl

func CreateRecipeFromUrl(c *cli.Context)

func CreateStack

func CreateStack(c *cli.Context)

func DeleteAccountTag

func DeleteAccountTag(c *cli.Context)

func DeleteBlueprint

func DeleteBlueprint(c *cli.Context)

func DeleteCredential

func DeleteCredential(c *cli.Context)

func DeleteImagecatalog

func DeleteImagecatalog(c *cli.Context)

func DeleteLdap

func DeleteLdap(c *cli.Context) error

func DeleteRecipe

func DeleteRecipe(c *cli.Context)

func DeleteStack

func DeleteStack(c *cli.Context)

func DescribeBlueprint

func DescribeBlueprint(c *cli.Context)

func DescribeCredential

func DescribeCredential(c *cli.Context)

func DescribeRecipe

func DescribeRecipe(c *cli.Context)

func DescribeStack

func DescribeStack(c *cli.Context)

func GenerateAwsStackTemplate

func GenerateAwsStackTemplate(c *cli.Context) error

func GenerateAzureStackTemplate

func GenerateAzureStackTemplate(c *cli.Context) error

func GenerateGcpStackTemplate

func GenerateGcpStackTemplate(c *cli.Context) error

func GenerateOpenstackStackTemplate

func GenerateOpenstackStackTemplate(c *cli.Context) error

func GenerateReinstallTemplate

func GenerateReinstallTemplate(c *cli.Context)

func GenerateYarnStackTemplate

func GenerateYarnStackTemplate(c *cli.Context) error

func GetHomeDirectory

func GetHomeDirectory() string

func HiddenCommands

func HiddenCommands(app cli.App) []cli.Command

func ListAccountTags

func ListAccountTags(c *cli.Context)

func ListAvailabilityZones

func ListAvailabilityZones(c *cli.Context)

func ListAwsImages

func ListAwsImages(c *cli.Context)

func ListAwsVolumeTypes

func ListAwsVolumeTypes(c *cli.Context)

func ListAzureImages

func ListAzureImages(c *cli.Context)

func ListAzureVolumeTypes

func ListAzureVolumeTypes(c *cli.Context)

func ListBlueprints

func ListBlueprints(c *cli.Context)

func ListCredentials

func ListCredentials(c *cli.Context)

func ListGcpImages

func ListGcpImages(c *cli.Context)

func ListGcpVolumeTypes

func ListGcpVolumeTypes(c *cli.Context)

func ListImagecatalogs

func ListImagecatalogs(c *cli.Context)

func ListInstanceTypes

func ListInstanceTypes(c *cli.Context)

func ListLdaps

func ListLdaps(c *cli.Context) error

func ListOpenstackImages

func ListOpenstackImages(c *cli.Context)

func ListRecipes

func ListRecipes(c *cli.Context)

func ListRegions

func ListRegions(c *cli.Context)

func ListStacks

func ListStacks(c *cli.Context)

func PrintHelp

func PrintHelp(out io.Writer, templ string, data interface{})

func ReinstallStack

func ReinstallStack(c *cli.Context)

func RepairStack

func RepairStack(c *cli.Context)

func ScaleStack

func ScaleStack(c *cli.Context)

func SetDefaultImagecatalog

func SetDefaultImagecatalog(c *cli.Context)

func ShowHiddenCommands

func ShowHiddenCommands(c *cli.Context) error

func StartStack

func StartStack(c *cli.Context)

func StopStack

func StopStack(c *cli.Context)

func SyncStack

func SyncStack(c *cli.Context)

Types

type BoolFlag

type BoolFlag struct {
	cli.BoolFlag
	RequiredFlag
}

type Cloudbreak

type Cloudbreak struct {
	Cloudbreak *apiclient.Cloudbreak
}

func NewCloudbreakHTTPClient

func NewCloudbreakHTTPClient(address, username, password, authType string) *Cloudbreak

func NewCloudbreakHTTPClientFromContext

func NewCloudbreakHTTPClientFromContext(c *cli.Context) *Cloudbreak

type Config

type Config struct {
	Username string `json:"username" yaml:"username"`
	Password string `json:"password,omitempty" yaml:"password,omitempty"`
	Server   string `json:"server" yaml:"server"`
	AuthType string `json:"authType,omitempty" yaml:"authType,omitempty"`
	Output   string `json:"output,omitempty" yaml:"output,omitempty"`
}

func ReadConfig

func ReadConfig(baseDir string, profile string) (*Config, error)

func (Config) Yaml

func (c Config) Yaml() string

type ConfigList

type ConfigList map[string]Config

func (ConfigList) Json

func (c ConfigList) Json() string

func (ConfigList) Yaml

func (c ConfigList) Yaml() string

type ErrorMessage

type ErrorMessage struct {
	Message         string            `json:"message"`
	ValidationError map[string]string `json:"validationErrors"`
}

func (*ErrorMessage) String

func (e *ErrorMessage) String() string

type FlagBuilder

type FlagBuilder struct {
	// contains filtered or unexported fields
}

func NewFlagBuilder

func NewFlagBuilder() *FlagBuilder

func (*FlagBuilder) AddAuthenticationFlags

func (fb *FlagBuilder) AddAuthenticationFlags() *FlagBuilder

func (*FlagBuilder) AddFlags

func (fb *FlagBuilder) AddFlags(flags ...cli.Flag) *FlagBuilder

func (*FlagBuilder) AddOutputFlag

func (fb *FlagBuilder) AddOutputFlag() *FlagBuilder

func (*FlagBuilder) AddResourceDefaultFlags

func (fb *FlagBuilder) AddResourceDefaultFlags() *FlagBuilder

func (*FlagBuilder) AddResourceFlagsWithOptionalName

func (fb *FlagBuilder) AddResourceFlagsWithOptionalName() *FlagBuilder

func (*FlagBuilder) Build

func (fb *FlagBuilder) Build() []cli.Flag

type RequiredFlag

type RequiredFlag struct {
	Required bool
}

type StringFlag

type StringFlag struct {
	cli.StringFlag
	RequiredFlag
}

Directories

Path Synopsis
aws
gcp

Jump to

Keyboard shortcuts

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