resources

package
v0.5.36 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractResourcesInto

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

func List

List resources.

func MetadataURL

func MetadataURL(c *gcorecloud.ServiceClient, stackID, resourceName string) string

func SignalURL

func SignalURL(c *gcorecloud.ServiceClient, stackID, resourceName string) string

Types

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 Heat.

func Get

func Get(c *gcorecloud.ServiceClient, stackID, resourceName string) (r GetResult)

Get retrieves a specific resource based on its unique ID.

func (GetResult) Extract

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

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

func (GetResult) ExtractInto

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

type ListOpts

type ListOpts struct {
	Type               string                    `q:"type"`
	Name               string                    `q:"name"`
	Status             types.StackResourceStatus `q:"status"`
	Action             types.StackResourceAction `q:"name"`
	LogicalResourceID  string                    `q:"id"`
	PhysicalResourceID string                    `q:"physical_resource_id"`
	NestedDepth        int                       `q:"nested_depth"`
	WithDetail         bool                      `q:"with_detail"`
}

ListOpts allows the filtering and sorting of paginated collections through the API.

func (ListOpts) ToResourceListQuery

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

ToListenerListQuery 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 MarkUnhealthyOpts

type MarkUnhealthyOpts struct {
	// A boolean indicating whether the target resource should be marked as unhealthy.
	MarkUnhealthy bool `json:"mark_unhealthy"`
	// The reason for the current stack resource state.
	ResourceStatusReason string `json:"resource_status_reason,omitempty"`
}

MarkUnhealthyOpts contains the common options struct used in this package's MarkUnhealthy operations.

func (MarkUnhealthyOpts) ToMarkUnhealthyMap

func (opts MarkUnhealthyOpts) ToMarkUnhealthyMap() (map[string]interface{}, error)

ToMarkUnhealthyMap validates that a template was supplied and calls the ToMarkUnhealthyMap private function.

type MarkUnhealthyOptsBuilder

type MarkUnhealthyOptsBuilder interface {
	ToMarkUnhealthyMap() (map[string]interface{}, error)
}

MarkUnhealthyOptsBuilder is the interface options structs have to satisfy in order to be used in the MarkUnhealthy operation in this package

type MarkUnhealthyResult

type MarkUnhealthyResult struct {
	gcorecloud.ErrResult
}

MarkUnhealthyResult represents the result of a mark unhealthy operation.

func MarkUnhealthy

func MarkUnhealthy(c *gcorecloud.ServiceClient, stackID, resourceName string, opts MarkUnhealthyOptsBuilder) (r MarkUnhealthyResult)

MarkUnhealthy marks the specified resource in the stack as unhealthy.

type MetadataResult

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

MetadataResult represents the result of a stack metadata operation.

func Metadata

func Metadata(c *gcorecloud.ServiceClient, id, resource string) (r MetadataResult)

Metadata retrieves metadata for heat resource

func (MetadataResult) Extract

func (r MetadataResult) Extract() (map[string]interface{}, error)

Extract is a function that accepts a result and extracts a heat resource metadata.

func (MetadataResult) ExtractInto

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

type Resource

type Resource struct {
	*ResourceList
	Description string                 `json:"description"`
	Attributes  map[string]interface{} `json:"attributes"`
}

type ResourceList

type ResourceList struct {
	CreationTime         time.Time         `json:"creation_time"`
	UpdatedTime          *time.Time        `json:"updated_time"`
	LogicalResourceID    string            `json:"logical_resource_id"`
	PhysicalResourceID   string            `json:"physical_resource_id"`
	Links                []gcorecloud.Link `json:"links"`
	RequiredBy           []string          `json:"required_by"`
	ResourceName         string            `json:"resource_name"`
	ResourceStatus       string            `json:"resource_status"`
	ResourceStatusReason *string           `json:"resource_status_reason"`
	ResourceType         string            `json:"resource_type"`
}

func ExtractResources

func ExtractResources(r pagination.Page) ([]ResourceList, error)

ExtractResource accepts a Page struct, specifically a ResourcePage struct, and extracts the elements into a slice of Resource structs. In other words, a generic collection is mapped into a relevant slice.

func ListAll

func ListAll(client *gcorecloud.ServiceClient, stackID string, opts ListOptsBuilder) ([]ResourceList, error)

ListAll is a convenience function that returns a all stack resources.

type ResourcePage

type ResourcePage struct {
	pagination.LinkedPageBase
}

ResourcePage is the page returned by a pager when traversing over a collection of loadbalancers.

func (ResourcePage) IsEmpty

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

IsEmpty checks whether a ResourcePage struct is empty.

func (ResourcePage) NextPageURL

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

NextPageURL is invoked when a paginated collection of loadbalancers 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 SignalResult

type SignalResult struct {
	gcorecloud.ErrResult
}

SignalResult represents the result of a stack signal operation.

func Signal

func Signal(c *gcorecloud.ServiceClient, id, resource string, body []byte) (r SignalResult)

Signal set heat resource status

Directories

Path Synopsis
resources unit tests
resources unit tests

Jump to

Keyboard shortcuts

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