limits

package
v0.0.0-...-56e5f01 Latest Latest
Warning

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

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

Documentation

Overview

Package limits provides information and interaction with limits for the Openstack Identity service.

Example to List Limits

listOpts := limits.ListOpts{
	ProjectID: "3d596369fd2043bf8aca3c8decb0189e",
}

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

allLimits, err := limits.ExtractLimits(allPages)
if err != nil {
	panic(err)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

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

List enumerates the limits.

Types

type Limit

type Limit struct {
	// ID is the unique ID of the limit.
	ID string `json:"id"`

	// RegionID is the ID of the region where the limit is applied.
	RegionID string `json:"region_id"`

	// ProjectID is the ID of the project where the limit is applied.
	ProjectID string `json:"project_id"`

	// DomainID is the ID of the domain where the limit is applied.
	DomainID string `json:"domain_id"`

	// ServiceID is the ID of the service where the limit is applied.
	ServiceID string `json:"service_id"`

	// Description of the limit.
	Description string `json:"description"`

	// ResourceName is the name of the resource that the limit is applied to.
	ResourceName string `json:"resource_name"`

	// ResourceLimit is the override limit.
	ResourceLimit int `json:"resource_limit"`

	// Links contains referencing links to the limit.
	Links map[string]interface{} `json:"links"`
}

A limit is the limit that override the registered limit for each project.

func ExtractLimits

func ExtractLimits(r pagination.Page) ([]Limit, error)

ExtractLimits returns a slice of Limits contained in a single page of results.

type LimitPage

type LimitPage struct {
	pagination.LinkedPageBase
}

LimitPage is a single page of Limit results.

func (LimitPage) IsEmpty

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

IsEmpty determines whether or not a page of Limits contains any results.

func (LimitPage) NextPageURL

func (r LimitPage) NextPageURL() (string, error)

NextPageURL extracts the "next" link from the links section of the result.

type ListOpts

type ListOpts struct {
	// Filters the response by a region ID.
	RegionID string `q:"region_id"`

	// Filters the response by a project ID.
	ProjectID string `q:"project_id"`

	// Filters the response by a domain ID.
	DomainID string `q:"domain_id"`

	// Filters the response by a service ID.
	ServiceID string `q:"service_id"`

	// Filters the response by a resource name.
	ResourceName string `q:"resource_name"`
}

ListOpts provides options to filter the List results.

func (ListOpts) ToLimitListQuery

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

ToLimitListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

ListOptsBuilder allows extensions to add additional parameters to the List request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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