apiversions

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 1 Imported by: 6

Documentation

Overview

Package apiversions provides information about the versions supported by a specific Ironic API.

Example to list versions

	allVersions, err := apiversions.List(baremetalClient).Extract()
	if err != nil {
		panic("unable to get API versions: " + err.Error())
	}

	for _, version := range allVersions.Versions {
		fmt.Printf("%+v\n", version)
	}

Example to get a specific version

	actual, err := apiversions.Get(baremetalClient).Extract()
	if err != nil {
		panic("unable to get API version: " + err.Error())
	}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIVersion

type APIVersion struct {
	// ID is the unique identifier of the API version.
	ID string `json:"id"`

	// MinVersion is the minimum microversion supported.
	MinVersion string `json:"min_version"`

	// Status is the API versions status.
	Status string `json:"status"`

	// Version is the maximum microversion supported.
	Version string `json:"version"`
}

APIVersion represents an API version for Ironic

type APIVersions

type APIVersions struct {
	DefaultVersion APIVersion   `json:"default_version"`
	Versions       []APIVersion `json:"versions"`
}

APIVersions represents the result from getting a list of all versions available

type GetResult

type GetResult struct {
	gophercloud.Result
}

GetResult represents the result of a get operation.

func Get

func Get(client *gophercloud.ServiceClient, v string) (r GetResult)

Get will get a specific API version, specified by major ID.

func (GetResult) Extract

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

Extract is a function that accepts a get result and extracts an API version resource.

type ListResult

type ListResult struct {
	gophercloud.Result
}

ListResult represents the result of a list operation.

func List

func List(client *gophercloud.ServiceClient) (r ListResult)

List lists all the API versions available to end users.

func (ListResult) Extract

func (r ListResult) Extract() (*APIVersions, error)

Extract is a function that accepts a list result and extracts an APIVersions resource

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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