Documentation
¶
Overview ¶
Package project contains the project logic for the control plane
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ProjectCmd = &cobra.Command{ Use: "project", Short: "Manage projects within a mediator control plane", Long: `The medic project commands allow the management of projects within a mediator control plane.`, RunE: func(cmd *cobra.Command, args []string) error { return cmd.Usage() }, }
ProjectCmd is the root command for the project subcommands
View Source
var Project_createCmd = &cobra.Command{ Use: "create", Short: "Create a project within a mediator control plane", Long: `The medic project create subcommand lets you create new projects 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 := viper.GetString("org-id") isProtected := viper.GetBool("is_protected") conn, err := util.GrpcForCommand(cmd) util.ExitNicelyOnError(err, "Error getting grpc connection") defer conn.Close() client := pb.NewProjectServiceClient(conn) ctx, cancel := util.GetAppContext() defer cancel() protectedPtr := &isProtected resp, err := client.CreateProject(ctx, &pb.CreateProjectRequest{ Name: name.(string), Description: description.(string), OrganizationId: organization, IsProtected: protectedPtr, }) util.ExitNicelyOnError(err, "Error creating project") out, err := util.GetJsonFromProto(resp) util.ExitNicelyOnError(err, "Error getting json from proto") fmt.Println(out) }, }
Project_createCmd is the command for creating a project
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.