firewall

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package firewall represents our SiteHost `/server/firewall` API endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a Service to work with API Jobs.

func New

func New(c *api.Client) *Client

New is used to instantiate the Client struct.

func (*Client) Get

func (s *Client) Get(ctx context.Context, request GetRequest) (response GetResponse, err error)

Get retrieves the server firewall configuration.

func (*Client) Update

func (s *Client) Update(ctx context.Context, request UpdateRequest) (response UpdateResponse, err error)

Update function updates the server firewall.

type GetRequest

type GetRequest struct {
	ClientID   string `json:"client_id"`
	ServerName string `json:"server"`
}

GetRequest represents a request to get a server's firewall configuration.

type GetResponse

type GetResponse struct {
	Return []struct {
		Group     string `json:"group"`
		Pos       string `json:"pos"`
		Interface string `json:"interface"`
		IsRA      bool   `json:"is_ra"`
	} `json:"return"`
	Message string `json:"msg"`
	Status  bool   `json:"status"`
}

GetResponse represents the result of a request to retrieve a server's firewall configuration.

type UpdateRequest

type UpdateRequest struct {
	ClientID       string   `json:"client_id"`
	ServerName     string   `json:"server"`
	SecurityGroups []string `json:"groups"`
}

UpdateRequest represents a request to update a server's firewall.

type UpdateResponse

type UpdateResponse struct {
	Return struct {
		models.Job `json:"job"`
	} `json:"return"`
	models.APIResponse
}

UpdateResponse represents the result of a request to update a server's firewall call.

Directories

Path Synopsis
Package securitygroups represents our SiteHost `/server/firewall/security_groups` API endpoint.
Package securitygroups represents our SiteHost `/server/firewall/security_groups` API endpoint.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL