resources

package
v0.0.0-...-f5426d5 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOpts

type CreateOpts struct {
	ID        string `json:"id" required:"true"`
	ProjectID string `json:"project_id" required:"true`
	UserID    string `json:"user_id" required:"true"`
}

func (CreateOpts) ToMetricCreateMap

func (opts CreateOpts) ToMetricCreateMap() (map[string]interface{}, error)

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToMetricCreateMap() (string, error)
}

type CreateResult

type CreateResult struct {
	gophercloud.Result
}

func Create

func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

To create a generic resource

func (CreateResult) Extract

func (r CreateResult) Extract() (*Resource, error)

Extract CreateResource data

type ListOpts

type ListOpts struct {
	//To limit response attributes, use attrs=id&attrs=started_at&attrs=user_id in the query parameter
	Attrs string `q:""`
}

ListOpts allows the filtering and sorting of collections through the API. Filtering is achieved by passing in struct field values that map to the server attributes you want to see returned.

func (ListOpts) ToResourceListQuery

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

ToResourceListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

ListOptsBuilder allows extensions to add additional parameters to the List request.

type ListResourceResult

type ListResourceResult struct {
	gophercloud.Result
}

func List

func List(client *gophercloud.ServiceClient, attrs []string) ListResourceResult

List makes a request against the API to list resource accessible to you.

func (ListResourceResult) Extract

func (r ListResourceResult) Extract() ([]Resource, error)

Extract interprets any ListResult as an array of Metrics

type ReadResourceTypeResult

type ReadResourceTypeResult struct {
	gophercloud.Result
}

func ReadResourceType

func ReadResourceType(client *gophercloud.ServiceClient, resourceType string) ReadResourceTypeResult

No attributes specific to the resource type are retrieved when using the generic endpoint.To retrieve the details, either list using the specific resource type endpoint

func (ReadResourceTypeResult) Extract

func (r ReadResourceTypeResult) Extract() ([]Resource, error)

type ReadResult

type ReadResult struct {
	gophercloud.Result
}

func Read

func Read(client *gophercloud.ServiceClient, ID string) ReadResult

func (ReadResult) Extract

func (r ReadResult) Extract() (Resource, error)

type Resource

type Resource struct {
	CreatedByProjectID string                 `mapstructure:"created_by_project_id"`
	CreatedByUserID    string                 `mapstructure:"created_by_user_id"`
	Creator            string                 `json:"creator"`
	EndedAt            string                 `mapstructure:"ended_at"`
	ID                 string                 `json:"id"`
	Metrics            map[string]interface{} `json:"metrics"`
	OriginalResourceID string                 `mapstructure:"original_resource_id"`
	ProjectID          string                 `mapstructure:"project_id"`
	RevisionEnd        string                 `mapstructure:"revision_end"`
	RevisionStart      string                 `mapstructure:"revision_start"`
	StartedAt          string                 `mapstructure:"started_at"`
	Type               string                 `json:"type"`
	UserID             string                 `mapstructure:"user_id"`
}

type SingleFilterOpts

type SingleFilterOpts struct {
	Field map[string]string `json:"like"`
}

func (SingleFilterOpts) ToMetricSingleFilterMap

func (opts SingleFilterOpts) ToMetricSingleFilterMap() (map[string]interface{}, error)

type SingleFilterOptsBuilder

type SingleFilterOptsBuilder interface {
	ToMetricSingleFilterMap() (string, error)
}

type SingleFilterResourceResult

type SingleFilterResourceResult struct {
	gophercloud.Result
}

func SingleFilter

func SingleFilter(client *gophercloud.ServiceClient, resourceType string, opts SingleFilterOpts) (r SingleFilterResourceResult)

func SingleFilterV2

func SingleFilterV2(client *gophercloud.ServiceClient, resourceType, filterName, filterValue string, opts SingleFilterOpts) (r SingleFilterResourceResult)

func (SingleFilterResourceResult) Extract

func (r SingleFilterResourceResult) Extract() ([]Resource, error)

Jump to

Keyboard shortcuts

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