keystones

package
v0.6.28 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractKeystonesInto

func ExtractKeystonesInto(r pagination.Page, v interface{}) error

Types

type CreateOpts

type CreateOpts struct {
	URL                       gcorecloud.URL      `json:"url" required:"true" validate:"required"`
	State                     types.KeystoneState `json:"state" required:"true" validate:"required,enum"`
	KeystoneFederatedDomainID string              `json:"keystone_federated_domain_id" required:"true" validate:"required"`
	AdminPassword             string              `json:"admin_password,omitempty"`
}

CreateOpts represents options used to create a keystone.

func (CreateOpts) ToKeystoneCreateMap

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

ToKeystoneCreateMap builds a request body from CreateOpts.

func (CreateOpts) Validate

func (opts CreateOpts) Validate() error

Validate

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToKeystoneCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult represents the result of a create operation. Call its Extract method to interpret it as a Keystone.

func Create

Create accepts a CreateOpts struct and creates a new keystone using the values provided.

func (CreateResult) Extract

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

Extract is a function that accepts a result and extracts a keystone resource.

func (CreateResult) ExtractInto

func (r CreateResult) ExtractInto(v interface{}) error

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult represents the result of a get operation. Call its Extract method to interpret it as a Keystone.

func Get

func Get(c *gcorecloud.ServiceClient, id int) (r GetResult)

Get retrieves a specific keystone based on its unique ID.

func (GetResult) Extract

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

Extract is a function that accepts a result and extracts a keystone resource.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

type Keystone

type Keystone struct {
	ID                        int                       `json:"id"`
	URL                       gcorecloud.URL            `json:"url"`
	State                     types.KeystoneState       `json:"state"`
	KeystoneFederatedDomainID string                    `json:"keystone_federated_domain_id"`
	CreatedOn                 gcorecloud.JSONRFC3339NoZ `json:"created_on"`
	AdminPassword             string                    `json:"admin_password"`
}

Keystone represents a keystone structure.

func ExtractKeystones

func ExtractKeystones(r pagination.Page) ([]Keystone, error)

ExtractKeystone accepts a Page struct, specifically a KeystonePage struct, and extracts the elements into a slice of Keystone structs. In other words, a generic collection is mapped into a relevant slice.

func ListAll

func ListAll(client *gcorecloud.ServiceClient) ([]Keystone, error)

ListAll is a convenience function that returns all keystones.

type KeystonePage

type KeystonePage struct {
	pagination.LinkedPageBase
}

KeystonePage is the page returned by a pager when traversing over a collection of keystones.

func (KeystonePage) IsEmpty

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

IsEmpty checks whether a KeystonePage struct is empty.

func (KeystonePage) NextPageURL

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

NextPageURL is invoked when a paginated collection of keystones has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

type UpdateOpts

type UpdateOpts struct {
	URL                       *gcorecloud.URL     `json:"url,omitempty" validate:"required_without_all=State KeystoneFederatedDomainID AdminPassword"`
	State                     types.KeystoneState `json:"state,omitempty" validate:"required_without_all=URL KeystoneFederatedDomainID AdminPassword"`
	KeystoneFederatedDomainID string              `json:"keystone_federated_domain_id,omitempty" validate:"required_without_all=URL State AdminPassword"`
	AdminPassword             string              `json:"admin_password,omitempty" validate:"required_without_all=State KeystoneFederatedDomainID AdminPassword"`
}

UpdateOpts represents options used to update a keystone.

func (UpdateOpts) ToKeystoneUpdateMap

func (opts UpdateOpts) ToKeystoneUpdateMap() (map[string]interface{}, error)

ToKeystoneUpdateMap builds a request body from UpdateOpts.

func (UpdateOpts) Validate

func (opts UpdateOpts) Validate() error

Validate

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToKeystoneUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a Keystone.

func Update

Update accepts a UpdateOpts struct and updates an existing keystone using the values provided.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Keystone, error)

Extract is a function that accepts a result and extracts a keystone resource.

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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