Documentation
¶
Overview ¶
Package group contains the group logic for the control plane
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GroupCmd = &cobra.Command{ Use: "group", Short: "Manage groups within a mediator control plane", Long: `The medic group commands allow the management of groups within a mediator control plane.`, RunE: func(cmd *cobra.Command, args []string) error { return cmd.Usage() }, }
GroupCmd is the root command for the group subcommands
View Source
var Group_createCmd = &cobra.Command{ Use: "create", Short: "Create a group within a mediator control plane", Long: `The medic group create subcommand lets you create new groups within a mediator control plane.`, PreRun: func(cmd *cobra.Command, args []string) { if err := viper.BindPFlags(cmd.Flags()); err != nil { fmt.Fprintf(os.Stderr, "Error binding flags: %s\n", err) } }, Run: func(cmd *cobra.Command, args []string) { name := util.GetConfigValue("name", "name", cmd, "") description := util.GetConfigValue("description", "description", cmd, "") organization := util.GetConfigValue("org-id", "org-id", cmd, int32(0)).(int32) isProtected := viper.GetBool("is_protected") conn, err := util.GrpcForCommand(cmd) util.ExitNicelyOnError(err, "Error getting grpc connection") defer conn.Close() client := pb.NewGroupServiceClient(conn) ctx, cancel := util.GetAppContext() defer cancel() protectedPtr := &isProtected resp, err := client.CreateGroup(ctx, &pb.CreateGroupRequest{ Name: name.(string), Description: description.(string), OrganizationId: organization, IsProtected: protectedPtr, }) util.ExitNicelyOnError(err, "Error creating group") out, err := util.GetJsonFromProto(resp) util.ExitNicelyOnError(err, "Error getting json from proto") fmt.Println(out) }, }
Group_createCmd is the command for creating a group
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.