v0.0.0-...-ae37572 Latest Latest

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

Go to latest
Published: Aug 6, 2020 License: Apache-2.0 Imports: 2 Imported by: 0



Package tenantnetworks provides the ability for tenants to see information about the networks they have access to.

This is a deprecated API and will be removed from the Nova API service in a future version.

This API works in both Neutron and nova-network based OpenStack clouds.

Example to List Networks Available to a Tenant

allPages, err := tenantnetworks.List(computeClient).AllPages()
if err != nil {

allNetworks, err := tenantnetworks.ExtractNetworks(allPages)
if err != nil {

for _, network := range allNetworks {
	fmt.Printf("%+v\n", network)



This section is empty.


This section is empty.


func List

List returns a Pager that allows you to iterate over a collection of Networks.


type GetResult

type GetResult struct {

GetResult is the response from a Get operation. Call its Extract method to interpret it as a Network.

func Get

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

Get returns data about a previously created Network.

type Network

type Network struct {
	// CIDR is the IPv4 subnet.
	CIDR string `json:"cidr"`

	// ID is the UUID of the network.
	ID string `json:"id"`

	// Name is the common name that the network has.
	Name string `json:"label"`

A Network represents a network that a server communicates on.

func ExtractNetworks

func ExtractNetworks(r pagination.Page) ([]Network, error)

ExtractNetworks interprets a page of results as a slice of Network.

type NetworkPage

type NetworkPage struct {

NetworkPage stores a single page of all Networks results from a List call.

func (NetworkPage) IsEmpty

func (page NetworkPage) IsEmpty() (bool, error)

IsEmpty determines whether or not a NetworkPage is empty.

type NetworkResult

type NetworkResult struct {

func (NetworkResult) Extract

func (r NetworkResult) Extract() (*Network, error)

Extract is a method that attempts to interpret any Network resource response as a Network struct.


Path Synopsis
tenantnetworks unit tests
tenantnetworks unit tests

Jump to

Keyboard shortcuts

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