Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CreateCmd = &cobra.Command{ Use: "create <firewall ID>", Short: "Create firewall rule", Long: `This endpoint creates new firewall rule from a specified firewall. By default, the firewall drops all incoming traffic. Any virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually.`, Args: cobra.MatchAll(cobra.ExactArgs(1)), Run: func(cmd *cobra.Command, args []string) { r, err := api.Request().VPSCreateFirewallRuleV1WithResponse(context.TODO(), utils.StringToInt(args[0]), firewallRuleCreateRequest(cmd, args)) if err != nil { log.Fatal(err) } output.Format(cmd, r.Body, r.StatusCode()) }, }
View Source
var DeleteCmd = &cobra.Command{ Use: "delete <firewall ID> <rule ID>", Short: "Delete firewall rule", Long: `This endpoint deletes a specific firewall rule from a specified firewall. Any virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually.`, Args: cobra.MatchAll(cobra.ExactArgs(2)), Run: func(cmd *cobra.Command, args []string) { r, err := api.Request().VPSDeleteFirewallRuleV1WithResponse(context.TODO(), utils.StringToInt(args[0]), utils.StringToInt(args[1])) if err != nil { log.Fatal(err) } output.Format(cmd, r.Body, r.StatusCode()) }, }
View Source
var GroupCmd = &cobra.Command{
Use: "rules",
Short: "Firewall rule management",
}
View Source
var UpdateCmd = &cobra.Command{ Use: "update <firewall ID> <rule ID>", Short: "Update firewall rule", Long: `This endpoint updates a specific firewall rule from a specified firewall. Any virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually.`, Args: cobra.MatchAll(cobra.ExactArgs(2)), Run: func(cmd *cobra.Command, args []string) { r, err := api.Request().VPSUpdateFirewallRuleV1WithResponse(context.TODO(), utils.StringToInt(args[0]), utils.StringToInt(args[1]), firewallRuleUpdateRequest(cmd, args)) 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.