throttling_policy

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(client *golangsdk.ServiceClient, gatewayID, throttleID string) (err error)

func UnbindPolicy

func UnbindPolicy(client *golangsdk.ServiceClient, gatewayID, throttleBindID string) (err error)

Types

type ApiThrottle

type ApiThrottle struct {
	AuthType        string `json:"auth_type"`
	GroupName       string `json:"group_name"`
	PublishID       string `json:"publish_id"`
	ThrottleApplyID string `json:"throttle_apply_id"`
	ApplyTime       string `json:"apply_time"`
	Description     string `json:"remark"`
	RunEnvID        string `json:"run_env_id"`
	Type            int    `json:"int"`
	ThrottleName    string `json:"throttle_name"`
	ReqUri          string `json:"req_uri"`
	RunEnvName      string `json:"run_env_name"`
	GroupID         string `json:"group_id"`
	Name            string `json:"name"`
	ID              string `json:"id"`
	ReqID           string `json:"req_id"`
	ReqMethod       string `json:"req_method"`
}

func ExtractBindings

func ExtractBindings(r pagination.NewPage) ([]ApiThrottle, error)

func ListAPIBoundPolicy

func ListAPIBoundPolicy(client *golangsdk.ServiceClient, opts ListBoundOpts) ([]ApiThrottle, error)

func ListAPIUnoundPolicy

func ListAPIUnoundPolicy(client *golangsdk.ServiceClient, opts ListBoundOpts) ([]ApiThrottle, error)

type BindOpts

type BindOpts struct {
	GatewayID  string   `json:"-"`
	PolicyID   string   `json:"strategy_id" required:"true"`
	PublishIds []string `json:"publish_ids" required:"true"`
}

type BindThrottleResp

type BindThrottleResp struct {
	PublishID  string `json:"publish_id"`
	Scope      int    `json:"scope"`
	StrategyID string `json:"strategy_id"`
	ApplyTime  string `json:"apply_time"`
	ID         string `json:"id"`
}

func BindPolicy

func BindPolicy(client *golangsdk.ServiceClient, opts BindOpts) ([]BindThrottleResp, error)

type BindingPage

type BindingPage struct {
	pagination.NewSinglePageBase
}

type CreateOpts

type CreateOpts struct {
	GatewayID             string `json:"-"`
	Name                  string `json:"name" required:"true"`
	AppCallLimits         *int   `json:"app_call_limits,omitempty"`
	ApiCallLimits         *int   `json:"api_call_limits" required:"true"`
	TimeInterval          *int   `json:"time_interval" required:"true"`
	TimeUnit              string `json:"time_unit" required:"true"`
	Description           string `json:"remark,omitempty"`
	Type                  *int   `json:"type,omitempty"`
	IpCallLimits          *int   `json:"ip_call_limits,omitempty"`
	UserCallLimits        *int   `json:"user_call_limits,omitempty"`
	EnableAdaptiveControl string `json:"enable_adaptive_control,omitempty"`
}

type ListBindingOpts

type ListBindingOpts struct {
	GatewayID    string `json:"-"`
	ApiID        string `q:"api_id"`
	ThrottleID   string `q:"throttle_id"`
	ThrottleName string `q:"throttle_name"`
	EnvID        string `q:"env_id"`
}

type ListBoundOpts

type ListBoundOpts struct {
	GatewayID  string `json:"-"`
	ThrottleID string `q:"throttle_id"`
	EnvID      string `q:"env_id"`
	GroupID    string `q:"group_id"`
	ApiID      string `q:"api_id"`
	ApiName    string `q:"api_name"`
}

type ListOpts

type ListOpts struct {
	GatewayID     string `json:"-"`
	ThrottleID    string `q:"id"`
	PolicyName    string `q:"name"`
	PreciseSearch string `q:"precise_search"`
}

type ListUnoundOpts

type ListUnoundOpts struct {
	GatewayID  string `json:"-"`
	ThrottleID string `q:"throttle_id"`
	EnvID      string `q:"env_id"`
	GroupID    string `q:"group_id"`
	ApiID      string `q:"api_id"`
	ApiName    string `q:"api_name"`
}

type ThrottlingBindResp

type ThrottlingBindResp struct {
	AppCallLimits          int    `json:"app_call_limits"`
	Name                   string `json:"name"`
	TimeUnit               string `json:"time_unit"`
	Description            string `json:"remark"`
	ApiCallLimits          int    `json:"api_call_limits"`
	Type                   int    `json:"type"`
	EnableAdaptiveControl  string `json:"enable_adaptive_control"`
	UserCallLimits         int    `json:"user_call_limits"`
	TimeInterval           int    `json:"time_interval"`
	IpCallLimits           int    `json:"ip_call_limits"`
	ID                     string `json:"id"`
	BindNum                int    `json:"bind_num"`
	IsIncluSpecialThrottle int    `json:"is_inclu_special_throttle"`
	CreateTime             string `json:"create_time"`
	EnvName                string `json:"env_name"`
	BindID                 string `json:"bind_id"`
	BindTime               string `json:"bind_time"`
}

func ExtractPolicies

func ExtractPolicies(r pagination.NewPage) ([]ThrottlingBindResp, error)

func ListBoundPolicies

func ListBoundPolicies(client *golangsdk.ServiceClient, opts ListBindingOpts) ([]ThrottlingBindResp, error)

type ThrottlingPage

type ThrottlingPage struct {
	pagination.NewSinglePageBase
}

type ThrottlingResp

type ThrottlingResp struct {
	AppCallLimits          int    `json:"app_call_limits"`
	Name                   string `json:"name"`
	TimeUnit               string `json:"time_unit"`
	Description            string `json:"remark"`
	ApiCallLimits          int    `json:"api_call_limits"`
	Type                   int    `json:"type"`
	EnableAdaptiveControl  string `json:"enable_adaptive_control"`
	UserCallLimits         int    `json:"user_call_limits"`
	TimeInterval           int    `json:"time_interval"`
	IpCallLimits           int    `json:"ip_call_limits"`
	ID                     string `json:"id"`
	BindNum                int    `json:"bind_num"`
	IsIncluSpecialThrottle int    `json:"is_inclu_special_throttle"`
	CreateTime             string `json:"create_time"`
}

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*ThrottlingResp, error)

func ExtractTrPolicy

func ExtractTrPolicy(r pagination.NewPage) ([]ThrottlingResp, error)

func Get

func Get(client *golangsdk.ServiceClient, gatewayID, throttleID string) (*ThrottlingResp, error)

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]ThrottlingResp, error)

func Update

func Update(client *golangsdk.ServiceClient, opts UpdateOpts) (*ThrottlingResp, error)

type UpdateOpts

type UpdateOpts struct {
	GatewayID             string `json:"-"`
	ThrottleID            string `json:"-"`
	Name                  string `json:"name" required:"true"`
	AppCallLimits         *int   `json:"app_call_limits,omitempty"`
	ApiCallLimits         *int   `json:"api_call_limits" required:"true"`
	TimeInterval          *int   `json:"time_interval" required:"true"`
	TimeUnit              string `json:"time_unit" required:"true"`
	Description           string `json:"remark,omitempty"`
	Type                  *int   `json:"type,omitempty"`
	IpCallLimits          *int   `json:"ip_call_limits,omitempty"`
	UserCallLimits        *int   `json:"user_call_limits,omitempty"`
	EnableAdaptiveControl string `json:"enable_adaptive_control,omitempty"`
}

Jump to

Keyboard shortcuts

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