preciseprotection_rules

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 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 Action

type Action struct {
	Category string `json:"category" required:"true"`
}

type Condition

type Condition struct {
	Category string   `json:"category" required:"true"`
	Index    string   `json:"index,omitempty"`
	Logic    int      `json:"logic" required:"true"`
	Contents []string `json:"contents" required:"true"`
}

type CreateOpts

type CreateOpts struct {
	Name       string      `json:"name" required:"true"`
	Time       bool        `json:"time,omitempty"`
	Start      int64       `json:"start,omitempty"`
	End        int64       `json:"end,omitempty"`
	Conditions []Condition `json:"conditions" required:"true"`
	Action     Action      `json:"action" required:"true"`
	Priority   *int        `json:"priority,omitempty"`
}

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

func (CreateOpts) ToPreciseCreateMap

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

ToPreciseCreateMap builds a create request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToPreciseCreateMap() (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 precise protection rule.

func Create

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

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

func (CreateResult) Extract

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

Extract is a function that accepts a result and extracts a precise protection 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 precise 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 precise protection rule.

func Get

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

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

func (GetResult) Extract

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

Extract is a function that accepts a result and extracts a precise protection rule.

type Precise

type Precise struct {
	Id         string      `json:"id"`
	PolicyID   string      `json:"policyid"`
	Name       string      `json:"name"`
	Time       bool        `json:"time"`
	Start      int64       `json:"start"`
	End        int64       `json:"end"`
	Conditions []Condition `json:"conditions"`
	Action     Action      `json:"action"`
	Priority   int         `json:"priority"`
}

Jump to

Keyboard shortcuts

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