qos_options

package
v2.7.0 Latest Latest
Warning

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

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

Documentation

Overview

Package qos_options provides information of several service in the Enterprise Cloud Compute service

Example to List QoS Options

listOpts := qos_options.ListOpts{
	QoSType: "guarantee",
}

allPages, err := qos_options.List(client, listOpts).AllPages()
if err != nil {
	panic(err)
}

allQoSOptions, err := qos_options.ExtractQoSOptions(allPages)
if err != nil {
	panic(err)
}

for _, qosOption := range allQoSOptions {
	fmt.Printf("%+v", qosOption)
}

Example to Show QoS Option

id := "02dc9a22-129c-4b12-9936-4080f6a7ae44"
qosOption, err := qos_options.Get(client, id).Extract()
if err != nil {
	panic(err)
}
fmt.Print(qosOption)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *eclcloud.ServiceClient, opts ListOptsBuilder) pagination.Pager

List makes a request against the API to list QoS options accessible to you.

Types

type GetResult

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

GetResult is the result of Get operations. Call its Extract method to interpret it as a QoSOption.

func Get

func Get(client *eclcloud.ServiceClient, id string) (r GetResult)

Get retrieves a specific QoS option based on its unique ID.

func (GetResult) Extract

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

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

type ListOpts

type ListOpts struct {
	// Unique ID for the AWSService.
	AWSServiceID string `q:"aws_service_id"`

	// Unique ID for the AzureService.
	AzureServiceID string `q:"azure_service_id"`

	// Bandwidth assigned with this QoS Option
	Bandwidth string `q:"bandwidth"`

	// Description is the description of the QoS Policy.
	Description string `q:"description"`

	// Unique ID for the FICService.
	FICServiceID string `q:"fic_service_id"`

	// Unique ID for the GCPService.
	GCPServiceID string `q:"gcp_service_id"`

	// Unique ID for the QoS option.
	ID string `q:"id"`

	// Unique ID for the InterDCService.
	InterDCServiceID string `q:"interdc_service_id"`

	// Unique ID for the InternetService.
	InternetServiceID string `q:"internet_service_id"`

	// Name is the name of the QoS option.
	Name string `q:"name"`

	// Type of the QoS option.(guarantee or besteffort)
	QoSType string `q:"qos_type"`

	// Service type of the QoS option.(aws, azure, fic, gcp, vpn, internet, interdc)
	ServiceType string `q:"service_type"`

	// Indicates whether QoS option is currently operational.
	Status string `q:"status"`

	// Unique ID for the VPNService.
	VPNServiceID string `q:"vpn_service_id"`
}

ListOpts allows the filtering of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the QoS option attributes you want to see returned. Marker and Limit are used for pagination.

func (ListOpts) ToQosOptionsListQuery

func (opts ListOpts) ToQosOptionsListQuery() (string, error)

ToQosOptionsListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToQosOptionsListQuery() (string, error)
}

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

type QoSOption

type QoSOption struct {
	AWSServiceID      string `json:"aws_service_id"`
	AzureServiceID    string `json:"azure_service_id"`
	Bandwidth         string `json:"bandwidth"`
	Description       string `json:"description"`
	FICServiceID      string `json:"fic_service_id"`
	GCPServiceID      string `json:"gcp_service_id"`
	ID                string `json:"id"`
	InterDCServiceID  string `json:"interdc_service_id"`
	InternetServiceID string `json:"internet_service_id"`
	Name              string `json:"name"`
	QoSType           string `json:"qos_type"`
	ServiceType       string `json:"service_type"`
	Status            string `json:"status"`
	VPNServiceID      string `json:"vpn_service_id"`
}

QoSOption represents a QoS option.

func ExtractQoSOptions

func ExtractQoSOptions(r pagination.Page) ([]QoSOption, error)

ExtractQoSOptions accepts a Page struct, specifically a QoSOptionPage struct, and extracts the elements into a slice of ListOpts structs. In other words, a generic collection is mapped into a relevant slice.

type QosOptionPage

type QosOptionPage struct {
	pagination.LinkedPageBase
}

func (QosOptionPage) IsEmpty

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

IsEmpty checks whether a QosOptionPage struct is empty.

Directories

Path Synopsis
ports unit tests
ports unit tests

Jump to

Keyboard shortcuts

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