limits

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package limits shows rate and limit information for a tenant/project.

Example to Retrieve Limits for a Tenant

getOpts := limits.GetOpts{
	TenantID: "tenant-id",
}

limits, err := limits.Get(computeClient, getOpts).Extract()
if err != nil {
	panic(err)
}

fmt.Printf("%+v\n", limits)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Absolute

type Absolute struct {
	// MaxTotalCores is the number of cores available to a tenant.
	MaxTotalCores int `json:"maxTotalCores"`

	// MaxImageMeta is the amount of image metadata available to a tenant.
	MaxImageMeta int `json:"maxImageMeta"`

	// MaxServerMeta is the amount of server metadata available to a tenant.
	MaxServerMeta int `json:"maxServerMeta"`

	// MaxPersonality is the amount of personality/files available to a tenant.
	MaxPersonality int `json:"maxPersonality"`

	// MaxPersonalitySize is the personality file size available to a tenant.
	MaxPersonalitySize int `json:"maxPersonalitySize"`

	// MaxTotalKeypairs is the total keypairs available to a tenant.
	MaxTotalKeypairs int `json:"maxTotalKeypairs"`

	// MaxSecurityGroups is the number of security groups available to a tenant.
	MaxSecurityGroups int `json:"maxSecurityGroups"`

	// MaxSecurityGroupRules is the number of security group rules available to
	// a tenant.
	MaxSecurityGroupRules int `json:"maxSecurityGroupRules"`

	// MaxServerGroups is the number of server groups available to a tenant.
	MaxServerGroups int `json:"maxServerGroups"`

	// MaxServerGroupMembers is the number of server group members available
	// to a tenant.
	MaxServerGroupMembers int `json:"maxServerGroupMembers"`

	// MaxTotalFloatingIps is the number of floating IPs available to a tenant.
	MaxTotalFloatingIps int `json:"maxTotalFloatingIps"`

	// MaxTotalInstances is the number of instances/servers available to a tenant.
	MaxTotalInstances int `json:"maxTotalInstances"`

	// MaxTotalRAMSize is the total amount of RAM available to a tenant measured
	// in megabytes (MB).
	MaxTotalRAMSize int `json:"maxTotalRAMSize"`

	// TotalCoresUsed is the number of cores currently in use.
	TotalCoresUsed int `json:"totalCoresUsed"`

	// TotalInstancesUsed is the number of instances/servers in use.
	TotalInstancesUsed int `json:"totalInstancesUsed"`

	// TotalFloatingIpsUsed is the number of floating IPs in use.
	TotalFloatingIpsUsed int `json:"totalFloatingIpsUsed"`

	// TotalRAMUsed is the total RAM/memory in use measured in megabytes (MB).
	TotalRAMUsed int `json:"totalRAMUsed"`

	// TotalSecurityGroupsUsed is the total number of security groups in use.
	TotalSecurityGroupsUsed int `json:"totalSecurityGroupsUsed"`

	// TotalServerGroupsUsed is the total number of server groups in use.
	TotalServerGroupsUsed int `json:"totalServerGroupsUsed"`
}

Usage is a struct that contains the current resource usage and limits of a tenant.

type GetOpts

type GetOpts struct {
	// The tenant ID to retrieve limits for.
	TenantID string `q:"tenant_id"`
}

GetOpts enables retrieving limits by a specific tenant.

func (GetOpts) ToLimitsQuery

func (opts GetOpts) ToLimitsQuery() (string, error)

ToLimitsQuery formats a GetOpts into a query string.

type GetOptsBuilder

type GetOptsBuilder interface {
	ToLimitsQuery() (string, error)
}

GetOptsBuilder allows extensions to add additional parameters to the Get request.

type GetResult

type GetResult struct {
	gophercloud.Result
}

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

func Get

func Get(client *gophercloud.ServiceClient, opts GetOptsBuilder) (r GetResult)

Get returns the limits about the currently scoped tenant.

func (GetResult) Extract

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

Extract interprets a limits result as a Limits.

type Limits

type Limits struct {
	// Absolute contains the limits and usage information.
	Absolute Absolute `json:"absolute"`
}

Limits is a struct that contains the response of a limit query.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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