rules

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 2 Imported by: 13

Documentation

Overview

Package rules provides the ability to retrieve and manage QoS policy rules through the Neutron API.

Example of Listing BandwidthLimitRules

listOpts := rules.BandwidthLimitRulesListOpts{
    MaxKBps: 3000,
}

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"

allPages, err := rules.ListBandwidthLimitRules(networkClient, policyID, listOpts).AllPages()
if err != nil {
    panic(err)
}

allBandwidthLimitRules, err := rules.ExtractBandwidthLimitRules(allPages)
if err != nil {
    panic(err)
}

for _, bandwidthLimitRule := range allBandwidthLimitRules {
    fmt.Printf("%+v\n", bandwidthLimitRule)
}

Example of Getting a single BandwidthLimitRule

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"
ruleID   := "30a57f4a-336b-4382-8275-d708babd2241"

rule, err := rules.GetBandwidthLimitRule(networkClient, policyID, ruleID).ExtractBandwidthLimitRule()
if err != nil {
    panic(err)
}

fmt.Printf("Rule: %+v\n", rule)

Example of Creating a single BandwidthLimitRule

opts := rules.CreateBandwidthLimitRuleOpts{
    MaxKBps:      2000,
    MaxBurstKBps: 200,
}

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"

rule, err := rules.CreateBandwidthLimitRule(networkClient, policyID, opts).ExtractBandwidthLimitRule()
if err != nil {
    panic(err)
}

fmt.Printf("Rule: %+v\n", rule)

Example of Updating a single BandwidthLimitRule

maxKBps := 500
maxBurstKBps := 0

opts := rules.UpdateBandwidthLimitRuleOpts{
    MaxKBps:      &maxKBps,
    MaxBurstKBps: &maxBurstKBps,
}

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"
ruleID   := "30a57f4a-336b-4382-8275-d708babd2241"

rule, err := rules.UpdateBandwidthLimitRule(networkClient, policyID, ruleID, opts).ExtractBandwidthLimitRule()
if err != nil {
    panic(err)
}

fmt.Printf("Rule: %+v\n", rule)

Example of Deleting a single BandwidthLimitRule

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"
ruleID   := "30a57f4a-336b-4382-8275-d708babd2241"

err := rules.DeleteBandwidthLimitRule(fake.ServiceClient(), "501005fa-3b56-4061-aaca-3f24995112e1", "30a57f4a-336b-4382-8275-d708babd2241").ExtractErr()
if err != nil {
    panic(err)
}

Example of Listing DSCP marking rules

listOpts := rules.DSCPMarkingRulesListOpts{}

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"

allPages, err := rules.ListDSCPMarkingRules(networkClient, policyID, listOpts).AllPages()
if err != nil {
    panic(err)
}

allDSCPMarkingRules, err := rules.ExtractDSCPMarkingRules(allPages)
if err != nil {
    panic(err)
}

for _, dscpMarkingRule := range allDSCPMarkingRules {
    fmt.Printf("%+v\n", dscpMarkingRule)
}

Example of Getting a single DSCPMarkingRule

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"
ruleID   := "30a57f4a-336b-4382-8275-d708babd2241"

rule, err := rules.GetDSCPMarkingRule(networkClient, policyID, ruleID).ExtractDSCPMarkingRule()
if err != nil {
    panic(err)
}

fmt.Printf("Rule: %+v\n", rule)

Example of Creating a single DSCPMarkingRule

opts := rules.CreateDSCPMarkingRuleOpts{
    DSCPMark: 20,
}

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"

rule, err := rules.CreateDSCPMarkingRule(networkClient, policyID, opts).ExtractDSCPMarkingRule()
if err != nil {
    panic(err)
}

fmt.Printf("Rule: %+v\n", rule)

Example of Updating a single DSCPMarkingRule

dscpMark := 26

opts := rules.UpdateDSCPMarkingRuleOpts{
    DSCPMark: &dscpMark,
}

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"
ruleID   := "30a57f4a-336b-4382-8275-d708babd2241"

rule, err := rules.UpdateDSCPMarkingRule(networkClient, policyID, ruleID, opts).ExtractDSCPMarkingRule()
if err != nil {
    panic(err)
}

fmt.Printf("Rule: %+v\n", rule)

Example of Deleting a single DSCPMarkingRule

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"
ruleID   := "30a57f4a-336b-4382-8275-d708babd2241"

err := rules.DeleteDSCPMarkingRule(fake.ServiceClient(), "501005fa-3b56-4061-aaca-3f24995112e1", "30a57f4a-336b-4382-8275-d708babd2241").ExtractErr()
if err != nil {
    panic(err)
}

Example of Listing MinimumBandwidthRules

listOpts := rules.MinimumBandwidthRulesListOpts{
    MinKBps: 3000,
}

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"

allPages, err := rules.ListMinimumBandwidthRules(networkClient, policyID, listOpts).AllPages()
if err != nil {
    panic(err)
}

allMinimumBandwidthRules, err := rules.ExtractMinimumBandwidthRules(allPages)
if err != nil {
    panic(err)
}

for _, bandwidthLimitRule := range allMinimumBandwidthRules {
    fmt.Printf("%+v\n", bandwidthLimitRule)
}

Example of Getting a single MinimumBandwidthRule

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"
ruleID   := "30a57f4a-336b-4382-8275-d708babd2241"

rule, err := rules.GetMinimumBandwidthRule(networkClient, policyID, ruleID).ExtractMinimumBandwidthRule()
if err != nil {
    panic(err)
}

fmt.Printf("Rule: %+v\n", rule)

Example of Creating a single MinimumBandwidthRule

opts := rules.CreateMinimumBandwidthRuleOpts{
    MinKBps: 2000,
}

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"

rule, err := rules.CreateMinimumBandwidthRule(networkClient, policyID, opts).ExtractMinimumBandwidthRule()
if err != nil {
    panic(err)
}

fmt.Printf("Rule: %+v\n", rule)

Example of Updating a single MinimumBandwidthRule

minKBps := 500

opts := rules.UpdateMinimumBandwidthRuleOpts{
    MinKBps: &minKBps,
}

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"
ruleID   := "30a57f4a-336b-4382-8275-d708babd2241"

rule, err := rules.UpdateMinimumBandwidthRule(networkClient, policyID, ruleID, opts).ExtractMinimumBandwidthRule()
if err != nil {
    panic(err)
}

fmt.Printf("Rule: %+v\n", rule)

Example of Deleting a single MinimumBandwidthRule

policyID := "501005fa-3b56-4061-aaca-3f24995112e1"
ruleID   := "30a57f4a-336b-4382-8275-d708babd2241"

err := rules.DeleteMinimumBandwidthRule(fake.ServiceClient(), "501005fa-3b56-4061-aaca-3f24995112e1", "30a57f4a-336b-4382-8275-d708babd2241").ExtractErr()
if err != nil {
    panic(err)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractBandwidthLimitRulesInto

func ExtractBandwidthLimitRulesInto(r pagination.Page, v interface{}) error

ExtractBandwidthLimitRulesInto extracts the elements into a slice of RBAC Policy structs.

func ExtractDSCPMarkingRulesInto

func ExtractDSCPMarkingRulesInto(r pagination.Page, v interface{}) error

ExtractDSCPMarkingRulesInto extracts the elements into a slice of RBAC Policy structs.

func ExtractMinimumBandwidthRulesInto

func ExtractMinimumBandwidthRulesInto(r pagination.Page, v interface{}) error

ExtractMinimumBandwidthRulesInto extracts the elements into a slice of RBAC Policy structs.

func ListBandwidthLimitRules

func ListBandwidthLimitRules(c *gophercloud.ServiceClient, policyID string, opts BandwidthLimitRulesListOptsBuilder) pagination.Pager

ListBandwidthLimitRules returns a Pager which allows you to iterate over a collection of BandwidthLimitRules. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

func ListDSCPMarkingRules

func ListDSCPMarkingRules(c *gophercloud.ServiceClient, policyID string, opts DSCPMarkingRulesListOptsBuilder) pagination.Pager

ListDSCPMarkingRules returns a Pager which allows you to iterate over a collection of DSCPMarkingRules. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

func ListMinimumBandwidthRules

func ListMinimumBandwidthRules(c *gophercloud.ServiceClient, policyID string, opts MinimumBandwidthRulesListOptsBuilder) pagination.Pager

ListMinimumBandwidthRules returns a Pager which allows you to iterate over a collection of MinimumBandwidthRules. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

Types

type BandwidthLimitRule

type BandwidthLimitRule struct {
	// ID is a unique ID of the policy.
	ID string `json:"id"`

	// TenantID is the ID of the Identity project.
	TenantID string `json:"tenant_id"`

	// MaxKBps is a maximum kilobits per second.
	MaxKBps int `json:"max_kbps"`

	// MaxBurstKBps is a maximum burst size in kilobits.
	MaxBurstKBps int `json:"max_burst_kbps"`

	// Direction represents the direction of traffic.
	Direction string `json:"direction"`

	// Tags optionally set via extensions/attributestags.
	Tags []string `json:"tags"`
}

BandwidthLimitRule represents a QoS policy rule to set bandwidth limits.

func ExtractBandwidthLimitRules

func ExtractBandwidthLimitRules(r pagination.Page) ([]BandwidthLimitRule, error)

ExtractBandwidthLimitRules accepts a BandwidthLimitRulePage, and extracts the elements into a slice of BandwidthLimitRules.

type BandwidthLimitRulePage

type BandwidthLimitRulePage struct {
	pagination.LinkedPageBase
}

BandwidthLimitRulePage stores a single page of BandwidthLimitRules from a List() API call.

func (BandwidthLimitRulePage) IsEmpty

func (r BandwidthLimitRulePage) IsEmpty() (bool, error)

IsEmpty checks whether a BandwidthLimitRulePage is empty.

type BandwidthLimitRulesListOpts

type BandwidthLimitRulesListOpts struct {
	ID           string `q:"id"`
	TenantID     string `q:"tenant_id"`
	MaxKBps      int    `q:"max_kbps"`
	MaxBurstKBps int    `q:"max_burst_kbps"`
	Direction    string `q:"direction"`
	Limit        int    `q:"limit"`
	Marker       string `q:"marker"`
	SortKey      string `q:"sort_key"`
	SortDir      string `q:"sort_dir"`
	Tags         string `q:"tags"`
	TagsAny      string `q:"tags-any"`
	NotTags      string `q:"not-tags"`
	NotTagsAny   string `q:"not-tags-any"`
}

ListOpts allows the filtering and sorting of paginated collections through the Neutron API. Filtering is achieved by passing in struct field values that map to the BandwidthLimitRules attributes you want to see returned. SortKey allows you to sort by a particular BandwidthLimitRule attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for the pagination.

func (BandwidthLimitRulesListOpts) ToBandwidthLimitRulesListQuery

func (opts BandwidthLimitRulesListOpts) ToBandwidthLimitRulesListQuery() (string, error)

ToBandwidthLimitRulesListQuery formats a ListOpts into a query string.

type BandwidthLimitRulesListOptsBuilder

type BandwidthLimitRulesListOptsBuilder interface {
	ToBandwidthLimitRulesListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

type CreateBandwidthLimitRuleOpts

type CreateBandwidthLimitRuleOpts struct {
	// MaxKBps is a maximum kilobits per second. It's a required parameter.
	MaxKBps int `json:"max_kbps"`

	// MaxBurstKBps is a maximum burst size in kilobits.
	MaxBurstKBps int `json:"max_burst_kbps,omitempty"`

	// Direction represents the direction of traffic.
	Direction string `json:"direction,omitempty"`
}

CreateBandwidthLimitRuleOpts specifies parameters of a new BandwidthLimitRule.

func (CreateBandwidthLimitRuleOpts) ToBandwidthLimitRuleCreateMap

func (opts CreateBandwidthLimitRuleOpts) ToBandwidthLimitRuleCreateMap() (map[string]interface{}, error)

ToBandwidthLimitRuleCreateMap constructs a request body from CreateBandwidthLimitRuleOpts.

type CreateBandwidthLimitRuleOptsBuilder

type CreateBandwidthLimitRuleOptsBuilder interface {
	ToBandwidthLimitRuleCreateMap() (map[string]interface{}, error)
}

CreateBandwidthLimitRuleOptsBuilder allows to add additional parameters to the CreateBandwidthLimitRule request.

type CreateBandwidthLimitRuleResult

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

CreateBandwidthLimitRuleResult represents the result of a Create operation. Call its Extract method to interpret it as a BandwidthLimitRule.

func CreateBandwidthLimitRule

func CreateBandwidthLimitRule(client *gophercloud.ServiceClient, policyID string, opts CreateBandwidthLimitRuleOptsBuilder) (r CreateBandwidthLimitRuleResult)

CreateBandwidthLimitRule requests the creation of a new BandwidthLimitRule on the server.

func (CreateBandwidthLimitRuleResult) ExtractBandwidthLimitRule

func (r CreateBandwidthLimitRuleResult) ExtractBandwidthLimitRule() (*BandwidthLimitRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

func (CreateBandwidthLimitRuleResult) ExtractDSCPMarkingRule

func (r CreateBandwidthLimitRuleResult) ExtractDSCPMarkingRule() (*DSCPMarkingRule, error)

Extract is a function that accepts a result and extracts a DSCPMarkingRule.

func (CreateBandwidthLimitRuleResult) ExtractMinimumBandwidthRule

func (r CreateBandwidthLimitRuleResult) ExtractMinimumBandwidthRule() (*MinimumBandwidthRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

type CreateDSCPMarkingRuleOpts

type CreateDSCPMarkingRuleOpts struct {
	// DSCPMark contains DSCP mark value.
	DSCPMark int `json:"dscp_mark"`
}

CreateDSCPMarkingRuleOpts specifies parameters of a new DSCPMarkingRule.

func (CreateDSCPMarkingRuleOpts) ToDSCPMarkingRuleCreateMap

func (opts CreateDSCPMarkingRuleOpts) ToDSCPMarkingRuleCreateMap() (map[string]interface{}, error)

ToDSCPMarkingRuleCreateMap constructs a request body from CreateDSCPMarkingRuleOpts.

type CreateDSCPMarkingRuleOptsBuilder

type CreateDSCPMarkingRuleOptsBuilder interface {
	ToDSCPMarkingRuleCreateMap() (map[string]interface{}, error)
}

CreateDSCPMarkingRuleOptsBuilder allows to add additional parameters to the CreateDSCPMarkingRule request.

type CreateDSCPMarkingRuleResult

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

CreateDSCPMarkingRuleResult represents the result of a Create operation. Call its Extract method to interpret it as a DSCPMarkingRule.

func CreateDSCPMarkingRule

func CreateDSCPMarkingRule(client *gophercloud.ServiceClient, policyID string, opts CreateDSCPMarkingRuleOptsBuilder) (r CreateDSCPMarkingRuleResult)

CreateDSCPMarkingRule requests the creation of a new DSCPMarkingRule on the server.

func (CreateDSCPMarkingRuleResult) ExtractBandwidthLimitRule

func (r CreateDSCPMarkingRuleResult) ExtractBandwidthLimitRule() (*BandwidthLimitRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

func (CreateDSCPMarkingRuleResult) ExtractDSCPMarkingRule

func (r CreateDSCPMarkingRuleResult) ExtractDSCPMarkingRule() (*DSCPMarkingRule, error)

Extract is a function that accepts a result and extracts a DSCPMarkingRule.

func (CreateDSCPMarkingRuleResult) ExtractMinimumBandwidthRule

func (r CreateDSCPMarkingRuleResult) ExtractMinimumBandwidthRule() (*MinimumBandwidthRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

type CreateMinimumBandwidthRuleOpts

type CreateMinimumBandwidthRuleOpts struct {
	// MaxKBps is a minimum kilobits per second. It's a required parameter.
	MinKBps int `json:"min_kbps"`

	// Direction represents the direction of traffic.
	Direction string `json:"direction,omitempty"`
}

CreateMinimumBandwidthRuleOpts specifies parameters of a new MinimumBandwidthRule.

func (CreateMinimumBandwidthRuleOpts) ToMinimumBandwidthRuleCreateMap

func (opts CreateMinimumBandwidthRuleOpts) ToMinimumBandwidthRuleCreateMap() (map[string]interface{}, error)

ToMinimumBandwidthRuleCreateMap constructs a request body from CreateMinimumBandwidthRuleOpts.

type CreateMinimumBandwidthRuleOptsBuilder

type CreateMinimumBandwidthRuleOptsBuilder interface {
	ToMinimumBandwidthRuleCreateMap() (map[string]interface{}, error)
}

CreateMinimumBandwidthRuleOptsBuilder allows to add additional parameters to the CreateMinimumBandwidthRule request.

type CreateMinimumBandwidthRuleResult

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

CreateMinimumBandwidthRuleResult represents the result of a Create operation. Call its Extract method to interpret it as a MinimumBandwidthtRule.

func CreateMinimumBandwidthRule

func CreateMinimumBandwidthRule(client *gophercloud.ServiceClient, policyID string, opts CreateMinimumBandwidthRuleOptsBuilder) (r CreateMinimumBandwidthRuleResult)

CreateMinimumBandwidthRule requests the creation of a new MinimumBandwidthRule on the server.

func (CreateMinimumBandwidthRuleResult) ExtractBandwidthLimitRule

func (r CreateMinimumBandwidthRuleResult) ExtractBandwidthLimitRule() (*BandwidthLimitRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

func (CreateMinimumBandwidthRuleResult) ExtractDSCPMarkingRule

func (r CreateMinimumBandwidthRuleResult) ExtractDSCPMarkingRule() (*DSCPMarkingRule, error)

Extract is a function that accepts a result and extracts a DSCPMarkingRule.

func (CreateMinimumBandwidthRuleResult) ExtractMinimumBandwidthRule

func (r CreateMinimumBandwidthRuleResult) ExtractMinimumBandwidthRule() (*MinimumBandwidthRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

type DSCPMarkingRule

type DSCPMarkingRule struct {
	// ID is a unique ID of the policy.
	ID string `json:"id"`

	// TenantID is the ID of the Identity project.
	TenantID string `json:"tenant_id"`

	// DSCPMark contains DSCP mark value.
	DSCPMark int `json:"dscp_mark"`

	// Tags optionally set via extensions/attributestags.
	Tags []string `json:"tags"`
}

DSCPMarkingRule represents a QoS policy rule to set DSCP marking.

func ExtractDSCPMarkingRules

func ExtractDSCPMarkingRules(r pagination.Page) ([]DSCPMarkingRule, error)

ExtractDSCPMarkingRules accepts a DSCPMarkingRulePage, and extracts the elements into a slice of DSCPMarkingRules.

type DSCPMarkingRulePage

type DSCPMarkingRulePage struct {
	pagination.LinkedPageBase
}

DSCPMarkingRulePage stores a single page of DSCPMarkingRules from a List() API call.

func (DSCPMarkingRulePage) IsEmpty

func (r DSCPMarkingRulePage) IsEmpty() (bool, error)

IsEmpty checks whether a DSCPMarkingRulePage is empty.

type DSCPMarkingRulesListOpts

type DSCPMarkingRulesListOpts struct {
	ID         string `q:"id"`
	TenantID   string `q:"tenant_id"`
	DSCPMark   int    `q:"dscp_mark"`
	Limit      int    `q:"limit"`
	Marker     string `q:"marker"`
	SortKey    string `q:"sort_key"`
	SortDir    string `q:"sort_dir"`
	Tags       string `q:"tags"`
	TagsAny    string `q:"tags-any"`
	NotTags    string `q:"not-tags"`
	NotTagsAny string `q:"not-tags-any"`
}

DSCPMarkingRulesListOpts allows the filtering and sorting of paginated collections through the Neutron API. Filtering is achieved by passing in struct field values that map to the DSCPMarking attributes you want to see returned. SortKey allows you to sort by a particular DSCPMarkingRule attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for the pagination.

func (DSCPMarkingRulesListOpts) ToDSCPMarkingRulesListQuery

func (opts DSCPMarkingRulesListOpts) ToDSCPMarkingRulesListQuery() (string, error)

ToDSCPMarkingRulesListQuery formats a ListOpts into a query string.

type DSCPMarkingRulesListOptsBuilder

type DSCPMarkingRulesListOptsBuilder interface {
	ToDSCPMarkingRulesListQuery() (string, error)
}

DSCPMarkingRulesListOptsBuilder allows extensions to add additional parameters to the List request.

type DeleteBandwidthLimitRuleResult

type DeleteBandwidthLimitRuleResult struct {
	gophercloud.ErrResult
}

DeleteBandwidthLimitRuleResult represents the result of a Delete operation. Call its Extract method to interpret it as a BandwidthLimitRule.

func DeleteBandwidthLimitRule

func DeleteBandwidthLimitRule(c *gophercloud.ServiceClient, policyID, ruleID string) (r DeleteBandwidthLimitRuleResult)

Delete accepts policy and rule ID and deletes the BandwidthLimitRule associated with them.

type DeleteDSCPMarkingRuleResult

type DeleteDSCPMarkingRuleResult struct {
	gophercloud.ErrResult
}

DeleteDSCPMarkingRuleResult represents the result of a Delete operation. Call its Extract method to interpret it as a DSCPMarkingRule.

func DeleteDSCPMarkingRule

func DeleteDSCPMarkingRule(c *gophercloud.ServiceClient, policyID, ruleID string) (r DeleteDSCPMarkingRuleResult)

DeleteDSCPMarkingRule accepts policy and rule ID and deletes the DSCPMarkingRule associated with them.

type DeleteMinimumBandwidthRuleResult

type DeleteMinimumBandwidthRuleResult struct {
	gophercloud.ErrResult
}

DeleteMinimumBandwidthRuleResult represents the result of a Delete operation. Call its Extract method to interpret it as a MinimumBandwidthRule.

func DeleteMinimumBandwidthRule

func DeleteMinimumBandwidthRule(c *gophercloud.ServiceClient, policyID, ruleID string) (r DeleteMinimumBandwidthRuleResult)

DeleteMinimumBandwidthRule accepts policy and rule ID and deletes the MinimumBandwidthRule associated with them.

type GetBandwidthLimitRuleResult

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

GetBandwidthLimitRuleResult represents the result of a Get operation. Call its Extract method to interpret it as a BandwidthLimitRule.

func GetBandwidthLimitRule

func GetBandwidthLimitRule(c *gophercloud.ServiceClient, policyID, ruleID string) (r GetBandwidthLimitRuleResult)

GetBandwidthLimitRule retrieves a specific BandwidthLimitRule based on its ID.

func (GetBandwidthLimitRuleResult) ExtractBandwidthLimitRule

func (r GetBandwidthLimitRuleResult) ExtractBandwidthLimitRule() (*BandwidthLimitRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

func (GetBandwidthLimitRuleResult) ExtractDSCPMarkingRule

func (r GetBandwidthLimitRuleResult) ExtractDSCPMarkingRule() (*DSCPMarkingRule, error)

Extract is a function that accepts a result and extracts a DSCPMarkingRule.

func (GetBandwidthLimitRuleResult) ExtractMinimumBandwidthRule

func (r GetBandwidthLimitRuleResult) ExtractMinimumBandwidthRule() (*MinimumBandwidthRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

type GetDSCPMarkingRuleResult

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

GetDSCPMarkingRuleResult represents the result of a Get operation. Call its Extract method to interpret it as a DSCPMarkingRule.

func GetDSCPMarkingRule

func GetDSCPMarkingRule(c *gophercloud.ServiceClient, policyID, ruleID string) (r GetDSCPMarkingRuleResult)

GetDSCPMarkingRule retrieves a specific DSCPMarkingRule based on its ID.

func (GetDSCPMarkingRuleResult) ExtractBandwidthLimitRule

func (r GetDSCPMarkingRuleResult) ExtractBandwidthLimitRule() (*BandwidthLimitRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

func (GetDSCPMarkingRuleResult) ExtractDSCPMarkingRule

func (r GetDSCPMarkingRuleResult) ExtractDSCPMarkingRule() (*DSCPMarkingRule, error)

Extract is a function that accepts a result and extracts a DSCPMarkingRule.

func (GetDSCPMarkingRuleResult) ExtractMinimumBandwidthRule

func (r GetDSCPMarkingRuleResult) ExtractMinimumBandwidthRule() (*MinimumBandwidthRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

type GetMinimumBandwidthRuleResult

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

GetMinimumBandwidthRuleResult represents the result of a Get operation. Call its Extract method to interpret it as a MinimumBandwidthRule.

func GetMinimumBandwidthRule

func GetMinimumBandwidthRule(c *gophercloud.ServiceClient, policyID, ruleID string) (r GetMinimumBandwidthRuleResult)

GetMinimumBandwidthRule retrieves a specific MinimumBandwidthRule based on its ID.

func (GetMinimumBandwidthRuleResult) ExtractBandwidthLimitRule

func (r GetMinimumBandwidthRuleResult) ExtractBandwidthLimitRule() (*BandwidthLimitRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

func (GetMinimumBandwidthRuleResult) ExtractDSCPMarkingRule

func (r GetMinimumBandwidthRuleResult) ExtractDSCPMarkingRule() (*DSCPMarkingRule, error)

Extract is a function that accepts a result and extracts a DSCPMarkingRule.

func (GetMinimumBandwidthRuleResult) ExtractMinimumBandwidthRule

func (r GetMinimumBandwidthRuleResult) ExtractMinimumBandwidthRule() (*MinimumBandwidthRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

type MinimumBandwidthRule

type MinimumBandwidthRule struct {
	// ID is a unique ID of the rule.
	ID string `json:"id"`

	// TenantID is the ID of the Identity project.
	TenantID string `json:"tenant_id"`

	// MaxKBps is a maximum kilobits per second.
	MinKBps int `json:"min_kbps"`

	// Direction represents the direction of traffic.
	Direction string `json:"direction"`

	// Tags optionally set via extensions/attributestags.
	Tags []string `json:"tags"`
}

MinimumBandwidthRule represents a QoS policy rule to set minimum bandwidth.

func ExtractMinimumBandwidthRules

func ExtractMinimumBandwidthRules(r pagination.Page) ([]MinimumBandwidthRule, error)

ExtractMinimumBandwidthRules accepts a MinimumBandwidthRulePage, and extracts the elements into a slice of MinimumBandwidthRules.

type MinimumBandwidthRulePage

type MinimumBandwidthRulePage struct {
	pagination.LinkedPageBase
}

MinimumBandwidthRulePage stores a single page of MinimumBandwidthRules from a List() API call.

func (MinimumBandwidthRulePage) IsEmpty

func (r MinimumBandwidthRulePage) IsEmpty() (bool, error)

IsEmpty checks whether a MinimumBandwidthRulePage is empty.

type MinimumBandwidthRulesListOpts

type MinimumBandwidthRulesListOpts struct {
	ID         string `q:"id"`
	TenantID   string `q:"tenant_id"`
	MinKBps    int    `q:"min_kbps"`
	Direction  string `q:"direction"`
	Limit      int    `q:"limit"`
	Marker     string `q:"marker"`
	SortKey    string `q:"sort_key"`
	SortDir    string `q:"sort_dir"`
	Tags       string `q:"tags"`
	TagsAny    string `q:"tags-any"`
	NotTags    string `q:"not-tags"`
	NotTagsAny string `q:"not-tags-any"`
}

ListOpts allows the filtering and sorting of paginated collections through the Neutron API. Filtering is achieved by passing in struct field values that map to the MinimumBandwidthRules attributes you want to see returned. SortKey allows you to sort by a particular MinimumBandwidthRule attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for the pagination.

func (MinimumBandwidthRulesListOpts) ToMinimumBandwidthRulesListQuery

func (opts MinimumBandwidthRulesListOpts) ToMinimumBandwidthRulesListQuery() (string, error)

ToMinimumBandwidthRulesListQuery formats a ListOpts into a query string.

type MinimumBandwidthRulesListOptsBuilder

type MinimumBandwidthRulesListOptsBuilder interface {
	ToMinimumBandwidthRulesListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

type UpdateBandwidthLimitRuleOpts

type UpdateBandwidthLimitRuleOpts struct {
	// MaxKBps is a maximum kilobits per second.
	MaxKBps *int `json:"max_kbps,omitempty"`

	// MaxBurstKBps is a maximum burst size in kilobits.
	MaxBurstKBps *int `json:"max_burst_kbps,omitempty"`

	// Direction represents the direction of traffic.
	Direction string `json:"direction,omitempty"`
}

UpdateBandwidthLimitRuleOpts specifies parameters for the Update call.

func (UpdateBandwidthLimitRuleOpts) ToBandwidthLimitRuleUpdateMap

func (opts UpdateBandwidthLimitRuleOpts) ToBandwidthLimitRuleUpdateMap() (map[string]interface{}, error)

ToBandwidthLimitRuleUpdateMap constructs a request body from UpdateBandwidthLimitRuleOpts.

type UpdateBandwidthLimitRuleOptsBuilder

type UpdateBandwidthLimitRuleOptsBuilder interface {
	ToBandwidthLimitRuleUpdateMap() (map[string]interface{}, error)
}

UpdateBandwidthLimitRuleOptsBuilder allows to add additional parameters to the UpdateBandwidthLimitRule request.

type UpdateBandwidthLimitRuleResult

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

UpdateBandwidthLimitRuleResult represents the result of a Update operation. Call its Extract method to interpret it as a BandwidthLimitRule.

func UpdateBandwidthLimitRule

func UpdateBandwidthLimitRule(client *gophercloud.ServiceClient, policyID, ruleID string, opts UpdateBandwidthLimitRuleOptsBuilder) (r UpdateBandwidthLimitRuleResult)

UpdateBandwidthLimitRule requests the creation of a new BandwidthLimitRule on the server.

func (UpdateBandwidthLimitRuleResult) ExtractBandwidthLimitRule

func (r UpdateBandwidthLimitRuleResult) ExtractBandwidthLimitRule() (*BandwidthLimitRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

func (UpdateBandwidthLimitRuleResult) ExtractDSCPMarkingRule

func (r UpdateBandwidthLimitRuleResult) ExtractDSCPMarkingRule() (*DSCPMarkingRule, error)

Extract is a function that accepts a result and extracts a DSCPMarkingRule.

func (UpdateBandwidthLimitRuleResult) ExtractMinimumBandwidthRule

func (r UpdateBandwidthLimitRuleResult) ExtractMinimumBandwidthRule() (*MinimumBandwidthRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

type UpdateDSCPMarkingRuleOpts

type UpdateDSCPMarkingRuleOpts struct {
	// DSCPMark contains DSCP mark value.
	DSCPMark *int `json:"dscp_mark,omitempty"`
}

UpdateDSCPMarkingRuleOpts specifies parameters for the Update call.

func (UpdateDSCPMarkingRuleOpts) ToDSCPMarkingRuleUpdateMap

func (opts UpdateDSCPMarkingRuleOpts) ToDSCPMarkingRuleUpdateMap() (map[string]interface{}, error)

ToDSCPMarkingRuleUpdateMap constructs a request body from UpdateDSCPMarkingRuleOpts.

type UpdateDSCPMarkingRuleOptsBuilder

type UpdateDSCPMarkingRuleOptsBuilder interface {
	ToDSCPMarkingRuleUpdateMap() (map[string]interface{}, error)
}

UpdateDSCPMarkingRuleOptsBuilder allows to add additional parameters to the UpdateDSCPMarkingRule request.

type UpdateDSCPMarkingRuleResult

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

UpdateDSCPMarkingRuleResult represents the result of a Update operation. Call its Extract method to interpret it as a DSCPMarkingRule.

func UpdateDSCPMarkingRule

func UpdateDSCPMarkingRule(client *gophercloud.ServiceClient, policyID, ruleID string, opts UpdateDSCPMarkingRuleOptsBuilder) (r UpdateDSCPMarkingRuleResult)

UpdateDSCPMarkingRule requests the creation of a new DSCPMarkingRule on the server.

func (UpdateDSCPMarkingRuleResult) ExtractBandwidthLimitRule

func (r UpdateDSCPMarkingRuleResult) ExtractBandwidthLimitRule() (*BandwidthLimitRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

func (UpdateDSCPMarkingRuleResult) ExtractDSCPMarkingRule

func (r UpdateDSCPMarkingRuleResult) ExtractDSCPMarkingRule() (*DSCPMarkingRule, error)

Extract is a function that accepts a result and extracts a DSCPMarkingRule.

func (UpdateDSCPMarkingRuleResult) ExtractMinimumBandwidthRule

func (r UpdateDSCPMarkingRuleResult) ExtractMinimumBandwidthRule() (*MinimumBandwidthRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

type UpdateMinimumBandwidthRuleOpts

type UpdateMinimumBandwidthRuleOpts struct {
	// MaxKBps is a minimum kilobits per second. It's a required parameter.
	MinKBps *int `json:"min_kbps,omitempty"`

	// Direction represents the direction of traffic.
	Direction string `json:"direction,omitempty"`
}

UpdateMinimumBandwidthRuleOpts specifies parameters for the Update call.

func (UpdateMinimumBandwidthRuleOpts) ToMinimumBandwidthRuleUpdateMap

func (opts UpdateMinimumBandwidthRuleOpts) ToMinimumBandwidthRuleUpdateMap() (map[string]interface{}, error)

ToMinimumBandwidthRuleUpdateMap constructs a request body from UpdateMinimumBandwidthRuleOpts.

type UpdateMinimumBandwidthRuleOptsBuilder

type UpdateMinimumBandwidthRuleOptsBuilder interface {
	ToMinimumBandwidthRuleUpdateMap() (map[string]interface{}, error)
}

UpdateMinimumBandwidthRuleOptsBuilder allows to add additional parameters to the UpdateMinimumBandwidthRule request.

type UpdateMinimumBandwidthRuleResult

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

UpdateMinimumBandwidthRuleResult represents the result of a Update operation. Call its Extract method to interpret it as a MinimumBandwidthRule.

func UpdateMinimumBandwidthRule

func UpdateMinimumBandwidthRule(client *gophercloud.ServiceClient, policyID, ruleID string, opts UpdateMinimumBandwidthRuleOptsBuilder) (r UpdateMinimumBandwidthRuleResult)

UpdateMinimumBandwidthRule requests the creation of a new MinimumBandwidthRule on the server.

func (UpdateMinimumBandwidthRuleResult) ExtractBandwidthLimitRule

func (r UpdateMinimumBandwidthRuleResult) ExtractBandwidthLimitRule() (*BandwidthLimitRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

func (UpdateMinimumBandwidthRuleResult) ExtractDSCPMarkingRule

func (r UpdateMinimumBandwidthRuleResult) ExtractDSCPMarkingRule() (*DSCPMarkingRule, error)

Extract is a function that accepts a result and extracts a DSCPMarkingRule.

func (UpdateMinimumBandwidthRuleResult) ExtractMinimumBandwidthRule

func (r UpdateMinimumBandwidthRuleResult) ExtractMinimumBandwidthRule() (*MinimumBandwidthRule, error)

Extract is a function that accepts a result and extracts a BandwidthLimitRule.

Directories

Path Synopsis
QoS policy rules unit tests
QoS policy rules unit tests

Jump to

Keyboard shortcuts

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