Documentation
¶
Overview ¶
Package cmd implements the lagoon-cli command line interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ListOrganizationUsersCmd = &cobra.Command{ Use: "organization-users", Aliases: []string{"org-u"}, Short: "List users in an organization", PreRunE: func(_ *cobra.Command, _ []string) error { return validateTokenE(cmdLagoon) }, RunE: func(cmd *cobra.Command, args []string) error { debug, err := cmd.Flags().GetBool("debug") if err != nil { return err } organizationName, err := cmd.Flags().GetString("organization-name") if err != nil { return err } if err := requiredInputCheck("Organization name", organizationName); err != nil { return err } current := lagoonCLIConfig.Current token := lagoonCLIConfig.Lagoons[current].Token lc := lclient.New( lagoonCLIConfig.Lagoons[current].GraphQL, lagoonCLIVersion, lagoonCLIConfig.Lagoons[current].Version, &token, debug) users, err := lagoon.UsersByOrganizationName(context.TODO(), organizationName, lc) if err != nil { return err } data := []output.Data{} for _, user := range *users { data = append(data, []string{ returnNonEmptyString(user.ID.String()), returnNonEmptyString(user.Email), returnNonEmptyString(user.FirstName), returnNonEmptyString(user.LastName), returnNonEmptyString(user.Comment), }) } dataMain := output.Table{ Header: []string{"ID", "Email", "First Name", "LastName", "Comment"}, Data: data, } r := output.RenderOutput(dataMain, outputOptions) fmt.Fprintf(cmd.OutOrStdout(), "%s", r) return nil }, }
Functions ¶
func GetInput ¶
func GetInput() string
GetInput reads input from an input buffer and returns the result as a string.
Types ¶
type FormatType ¶
type FormatType string
FormatType .
const ( JSON FormatType = "JSON" YAML FormatType = "YAML" STDOUT FormatType = "STDOUT" )
. .
type GetFlags ¶
type GetFlags struct {
Project string `json:"project,omitempty"`
Environment string `json:"environment,omitempty"`
RemoteID string `json:"remoteid,omitempty"`
}
GetFlags .
type LagoonConfigFlags ¶
type LagoonConfigFlags struct {
Lagoon string `json:"lagoon,omitempty"`
Hostname string `json:"hostname,omitempty"`
Port string `json:"port,omitempty"`
GraphQL string `json:"graphql,omitempty"`
Token string `json:"token,omitempty"`
UI string `json:"ui,omitempty"`
Kibana string `json:"kibana,omitempty"`
SSHKey string `json:"sshkey,omitempty"`
SSHPortal bool `json:"sshportal,omitempty"`
}
LagoonConfigFlags .
type ListFlags ¶
type ListFlags struct {
Project string `json:"project,omitempty"`
Environment string `json:"environment,omitempty"`
Reveal bool `json:"reveal,omitempty"`
}
ListFlags .
type NotificationFlags ¶
type NotificationFlags struct {
Project string `json:"project,omitempty"`
NotificationName string `json:"name,omitempty"`
NotificationNewName string `json:"newname,omitempty"`
NotificationOldName string `json:"old,omitempty"`
NotificationWebhook string `json:"webhook,omitempty"`
NotificationChannel string `json:"channel,omitempty"`
}
NotificationFlags .
Source Files
¶
- add.go
- config.go
- delete.go
- deploy.go
- deploytarget.go
- deploytargetconfig.go
- environment.go
- get.go
- groups.go
- helpers.go
- import.go
- list.go
- login.go
- logs.go
- notifications.go
- notificationsemail.go
- notificationsrocketchat.go
- notificationsslack.go
- notificationsteams.go
- notificationswebhook.go
- organization.go
- project.go
- raw.go
- retrieve.go
- root.go
- run.go
- shared.go
- ssh.go
- tasks.go
- update.go
- upload.go
- users.go
- variables.go
- web.go
- whoami.go
Click to show internal directories.
Click to hide internal directories.