whiteblackip_rules

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOpts

type CreateOpts struct {
	Addr  string `json:"addr" required:"true"`
	White int    `json:"white,omitempty"`
}

CreateOpts contains all the values needed to create a new whiteblackip rule.

func (CreateOpts) ToWhiteBlackIPCreateMap

func (opts CreateOpts) ToWhiteBlackIPCreateMap() (map[string]interface{}, error)

ToWhiteBlackIPCreateMap builds a create request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToWhiteBlackIPCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

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

CreateResult represents the result of a create operation. Call its Extract method to interpret it as a WhiteBlackIP rule.

func Create

func Create(c *golangsdk.ServiceClient, policyID string, opts CreateOptsBuilder) (r CreateResult)

Create will create a new whiteblackip rule based on the values in CreateOpts.

func (CreateResult) Extract

func (r CreateResult) Extract() (*WhiteBlackIP, error)

Extract is a function that accepts a result and extracts a whiteblackip rule.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Delete

func Delete(c *golangsdk.ServiceClient, policyID, ruleID string) (r DeleteResult)

Delete will permanently delete a particular whiteblackip rule based on its unique ID.

type GetResult

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

GetResult represents the result of a get operation. Call its Extract method to interpret it as a WhiteBlackIP rule.

func Get

func Get(c *golangsdk.ServiceClient, policyID, ruleID string) (r GetResult)

Get retrieves a particular whiteblackip rule based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*WhiteBlackIP, error)

Extract is a function that accepts a result and extracts a whiteblackip rule.

type UpdateOpts

type UpdateOpts struct {
	Addr  string `json:"addr" required:"true"`
	White *int   `json:"white" required:"true"`
}

UpdateOpts contains all the values needed to update a whiteblackip rule.

func (UpdateOpts) ToWhiteBlackIPUpdateMap

func (opts UpdateOpts) ToWhiteBlackIPUpdateMap() (map[string]interface{}, error)

ToWhiteBlackIPUpdateMap builds a update request body from UpdateOpts.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToWhiteBlackIPUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

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

UpdateResult represents the result of a update operation. Call its Extract method to interpret it as a WhiteBlackIP rule.

func Update

func Update(c *golangsdk.ServiceClient, policyID, ruleID string, opts UpdateOptsBuilder) (r UpdateResult)

Update accepts a UpdateOpts struct and uses the values to update a rule.The response code from api is 200

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*WhiteBlackIP, error)

Extract is a function that accepts a result and extracts a whiteblackip rule.

type WhiteBlackIP

type WhiteBlackIP struct {
	// WhiteBlackIP Rule ID
	Id string `json:"id"`
	// WhiteBlackIP Rule Addr
	Addr string `json:"addr"`
	// IP address type
	White int `json:"white"`
	// Policy ID
	PolicyID string `json:"policyid"`
}

Jump to

Keyboard shortcuts

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