Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ContainersCmd = &cobra.Command{ Use: "containers <virtual machine ID> <project name>", Short: "Get Docker project containers", Long: `This endpoint retrieves the containers of a specified Docker Compose project on a virtual machine.`, Args: cobra.MatchAll(cobra.ExactArgs(2)), Run: func(cmd *cobra.Command, args []string) { r, err := api.Request().VPSGetProjectContainersV1WithResponse(context.TODO(), utils.StringToInt(args[0]), args[1]) if err != nil { log.Fatal(err) } output.Format(cmd, r.Body, r.StatusCode()) }, }
View Source
var CreateCmd = &cobra.Command{ Use: "create <virtual machine ID>", Short: "Create Docker project", Long: `This endpoint creates and starts a new Docker Compose project on a specified virtual machine.`, Args: cobra.MatchAll(cobra.ExactArgs(1)), Run: func(cmd *cobra.Command, args []string) { r, err := api.Request().VPSCreateNewProjectV1WithResponse(context.TODO(), utils.StringToInt(args[0]), projectCreateRequest(cmd)) if err != nil { log.Fatal(err) } output.Format(cmd, r.Body, r.StatusCode()) }, }
View Source
var DeleteCmd = &cobra.Command{ Use: "delete <virtual machine ID> <project name>", Short: "Delete Docker project", Long: `This endpoint stops and deletes a specified Docker Compose project on a virtual machine.`, Args: cobra.MatchAll(cobra.ExactArgs(2)), Run: func(cmd *cobra.Command, args []string) { r, err := api.Request().VPSDeleteProjectV1WithResponse(context.TODO(), utils.StringToInt(args[0]), args[1]) if err != nil { log.Fatal(err) } output.Format(cmd, r.Body, r.StatusCode()) }, }
View Source
var GetCmd = &cobra.Command{ Use: "get <virtual machine ID> <project name>", Short: "Get Docker project contents", Long: `This endpoint retrieves the contents of a specified Docker Compose project on a virtual machine.`, Args: cobra.MatchAll(cobra.ExactArgs(2)), Run: func(cmd *cobra.Command, args []string) { r, err := api.Request().VPSGetProjectContentsV1WithResponse(context.TODO(), utils.StringToInt(args[0]), args[1]) if err != nil { log.Fatal(err) } output.Format(cmd, r.Body, r.StatusCode()) }, }
View Source
var GroupCmd = &cobra.Command{
Use: "docker",
Short: "Docker project management",
Long: `Manage Docker Compose projects on a virtual machine. You can list projects, inspect their contents, containers and logs, and create, update, delete, start, stop or restart them.`,
}
View Source
var ListCmd = &cobra.Command{ Use: "list <virtual machine ID>", Short: "Get Docker project list", Long: `This endpoint retrieves a list of Docker Compose projects running on a specified virtual machine.`, Args: cobra.MatchAll(cobra.ExactArgs(1)), Run: func(cmd *cobra.Command, args []string) { r, err := api.Request().VPSGetProjectListV1WithResponse(context.TODO(), utils.StringToInt(args[0])) if err != nil { log.Fatal(err) } output.Format(cmd, r.Body, r.StatusCode()) }, }
View Source
var LogsCmd = &cobra.Command{ Use: "logs <virtual machine ID> <project name>", Short: "Get Docker project logs", Long: `This endpoint retrieves the logs of a specified Docker Compose project on a virtual machine.`, Args: cobra.MatchAll(cobra.ExactArgs(2)), Run: func(cmd *cobra.Command, args []string) { r, err := api.Request().VPSGetProjectLogsV1WithResponse(context.TODO(), utils.StringToInt(args[0]), args[1]) if err != nil { log.Fatal(err) } output.Format(cmd, r.Body, r.StatusCode()) }, }
View Source
var RestartCmd = &cobra.Command{ Use: "restart <virtual machine ID> <project name>", Short: "Restart Docker project", Long: `This endpoint restarts a specified Docker Compose project on a virtual machine.`, Args: cobra.MatchAll(cobra.ExactArgs(2)), Run: func(cmd *cobra.Command, args []string) { r, err := api.Request().VPSRestartProjectV1WithResponse(context.TODO(), utils.StringToInt(args[0]), args[1]) if err != nil { log.Fatal(err) } output.Format(cmd, r.Body, r.StatusCode()) }, }
View Source
var StartCmd = &cobra.Command{ Use: "start <virtual machine ID> <project name>", Short: "Start Docker project", Long: `This endpoint starts a specified Docker Compose project on a virtual machine.`, Args: cobra.MatchAll(cobra.ExactArgs(2)), Run: func(cmd *cobra.Command, args []string) { r, err := api.Request().VPSStartProjectV1WithResponse(context.TODO(), utils.StringToInt(args[0]), args[1]) if err != nil { log.Fatal(err) } output.Format(cmd, r.Body, r.StatusCode()) }, }
View Source
var StopCmd = &cobra.Command{ Use: "stop <virtual machine ID> <project name>", Short: "Stop Docker project", Long: `This endpoint stops a specified Docker Compose project on a virtual machine.`, Args: cobra.MatchAll(cobra.ExactArgs(2)), Run: func(cmd *cobra.Command, args []string) { r, err := api.Request().VPSStopProjectV1WithResponse(context.TODO(), utils.StringToInt(args[0]), args[1]) if err != nil { log.Fatal(err) } output.Format(cmd, r.Body, r.StatusCode()) }, }
View Source
var UpdateCmd = &cobra.Command{ Use: "update <virtual machine ID> <project name>", Short: "Update Docker project", Long: `This endpoint updates a specified Docker Compose project on a virtual machine, pulling the latest images and recreating the containers.`, Args: cobra.MatchAll(cobra.ExactArgs(2)), Run: func(cmd *cobra.Command, args []string) { r, err := api.Request().VPSUpdateProjectV1WithResponse(context.TODO(), utils.StringToInt(args[0]), args[1]) if err != nil { log.Fatal(err) } output.Format(cmd, r.Body, r.StatusCode()) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.