{"modulePath":"github.com/hostinger/api-cli","version":"v0.1.16","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package rules\n\n## Variables\n\n```go\nvar CreateCmd = \u0026cobra.Command{\n\tUse:   \"create \u003cfirewall ID\u003e\",\n\tShort: \"Create firewall rule\",\n\tLong: `This endpoint creates new firewall rule from a specified firewall. By default, the firewall drops all incoming traffic.\n\nAny virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually.`,\n\tArgs: cobra.MatchAll(cobra.ExactArgs(1)),\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tr, err := api.Request().VPSCreateFirewallRuleV1WithResponse(context.TODO(), utils.StringToInt(args[0]), firewallRuleCreateRequest(cmd, args))\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\toutput.Format(cmd, r.Body, r.StatusCode())\n\t},\n}\n```\n\n```go\nvar DeleteCmd = \u0026cobra.Command{\n\tUse:   \"delete \u003cfirewall ID\u003e \u003crule ID\u003e\",\n\tShort: \"Delete firewall rule\",\n\tLong: `This endpoint deletes a specific firewall rule from a specified firewall.\n\nAny virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually.`,\n\tArgs: cobra.MatchAll(cobra.ExactArgs(2)),\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tr, err := api.Request().VPSDeleteFirewallRuleV1WithResponse(context.TODO(), utils.StringToInt(args[0]), utils.StringToInt(args[1]))\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\toutput.Format(cmd, r.Body, r.StatusCode())\n\t},\n}\n```\n\n```go\nvar GroupCmd = \u0026cobra.Command{\n\tUse:   \"rules\",\n\tShort: \"Firewall rule management\",\n}\n```\n\n```go\nvar UpdateCmd = \u0026cobra.Command{\n\tUse:   \"update \u003cfirewall ID\u003e \u003crule ID\u003e\",\n\tShort: \"Update firewall rule\",\n\tLong: `This endpoint updates a specific firewall rule from a specified firewall.\n\nAny virtual machine that has this firewall activated will loose sync with the firewall and will have to be synced again manually.`,\n\tArgs: cobra.MatchAll(cobra.ExactArgs(2)),\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tr, err := api.Request().VPSUpdateFirewallRuleV1WithResponse(context.TODO(), utils.StringToInt(args[0]), utils.StringToInt(args[1]), firewallRuleUpdateRequest(cmd, args))\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\toutput.Format(cmd, r.Body, r.StatusCode())\n\t},\n}\n```\n\n","path":"github.com/hostinger/api-cli/cmd/vps/firewall/rules","name":"rules","synopsis":"","isRedistributable":true}
