fic_gateways

package
v1.11.0 Latest Latest
Warning

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

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

Documentation

Overview

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

Example to List FIC Gateways

listOpts := fic_gateways.ListOpts{
	Status: "ACTIVE",
}

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

allFICGateways, err := fic_gateways.ExtractFICGateways(allPages)
if err != nil {
	panic(err)
}

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

Example to Show FIC Gateway

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List makes a request against the API to list FIC Gateways accessible to you.

Types

type FICGateway

type FICGateway struct {
	Description  string `json:"description"`
	FICServiceID string `json:"fic_service_id"`
	ID           string `json:"id"`
	Name         string `json:"name"`
	QoSOptionID  string `json:"qos_option_id"`
	Status       string `json:"status"`
	TenantID     string `json:"tenant_id"`
}

FICGateway represents a FIC Gateway.

func ExtractFICGateways

func ExtractFICGateways(r pagination.Page) ([]FICGateway, error)

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

type FICGatewayPage

type FICGatewayPage struct {
	pagination.LinkedPageBase
}

func (FICGatewayPage) IsEmpty

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

IsEmpty checks whether a FICGatewayPage struct is empty.

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 FICGateway.

func Get

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

Get retrieves a specific FIC Gateway based on its unique ID.

func (GetResult) Extract

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

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

type ListOpts

type ListOpts struct {
	// Description of the FIC Gateway resource.
	Description string `q:"description"`

	// 	FIC Service instantiated by this Gateway.
	FICServiceID string `q:"fic_service_id"`

	//Unique ID of the FIC Gateway resource.
	ID string `q:"id"`

	//Name of the FIC Gateway resource.
	Name string `q:"name"`

	// Quality of Service options selected for this Gateway.
	QoSOptionID string `q:"qos_option_id"`

	// The FIC Gateway status.
	Status string `q:"status"`

	// 	Tenant ID of the owner (UUID).
	TenantID string `q:"tenant_id"`
}

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

func (ListOpts) ToFICGatewaysListQuery

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

ToFICGatewaysListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

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

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