sizes

package
v1.6.0-beta Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Lists all the configured flavors available. A flavor is a combination of amount of compute capacity(CU) and disk capacity(GB).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemSize

type ItemSize struct {
	// Description
	Description string `json:"desc"`

	// List of disk IDs
	Disks []uint64 `json:"disks"`

	// ID
	ID uint64 `json:"id"`

	// Memory
	Memory uint64 `json:"memory"`

	// Name
	Name string `json:"name"`

	// VCPUs
	VCPUs uint64 `json:"vcpus"`
}

Main onformation about configured available flavors

func (ItemSize) Serialize

func (is ItemSize) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type ListRequest

type ListRequest struct {
	// ID of the cloudspace
	// Required: false
	CloudspaceID uint64 `url:"cloudspaceId,omitempty" json:"cloudspaceId,omitempty"`

	// Location code for the sizes
	// Required: false
	Location string `url:"location,omitempty" json:"location,omitempty"`

	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

Request struct for list the available flavors

type ListSizes

type ListSizes struct {
	// Data
	Data []ItemSize `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

List of configured available flavors

func (ListSizes) FilterByID

func (ls ListSizes) FilterByID(id uint64) ListSizes

FilterByID returns ListSizes with specified ID.

func (ListSizes) FilterByName

func (ls ListSizes) FilterByName(name string) ListSizes

FilterByName returns ListSizes with specified Name.

func (ListSizes) FilterFunc

func (ls ListSizes) FilterFunc(predicate func(ItemSize) bool) ListSizes

FilterFunc allows filtering ListSizes based on a user-specified predicate.

func (ListSizes) FindOne

func (ls ListSizes) FindOne() ItemSize

FindOne returns first found ItemSize If none was found, returns an empty struct.

func (ListSizes) Serialize

func (ls ListSizes) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type Sizes

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

Structure for creatig request to sizes

func New

func New(client interfaces.Caller) *Sizes

Builder for sizes endpoints

func (Sizes) List

func (s Sizes) List(ctx context.Context, req ListRequest) (*ListSizes, error)

List gets list the available flavors, filtering can be based on the user which is doing the request

Jump to

Keyboard shortcuts

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