operations

package
v2.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb

Package operations contains functionality for working with ECL Managed Load Balancer resources.

Example to list operations

listOpts := operations.ListOpts{}

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

allOperations, err := operations.ExtractOperations(allPages)
if err != nil {
	panic(err)
}

for _, operation := range allOperations {
	fmt.Printf("%+v\n", operation)
}

Example to show a operation

id := "497f6eca-6276-4993-bfeb-53cbbbba6f08"
operation, err := operations.Show(managedLoadBalancerClient, id).Extract()
if err != nil {
	panic(err)
}

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

Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb

Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb

Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractOperationsInto

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

ExtractOperationsInto interprets the results of a single page from a List() call, producing a slice of operation entities.

func List

func List(c *eclcloud.ServiceClient, opts ListOptsBuilder) pagination.Pager

List returns a Pager which allows you to iterate over a collection of operations. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

Types

type ListOpts

type ListOpts struct {

	// - ID of the resource
	ID string `q:"id"`

	// - ID of the resource
	ResourceID string `q:"resource_id"`

	// - Type of the resource
	ResourceType string `q:"resource_type"`

	// - The unique hyphenated UUID to identify the request
	//   - The UUID which has been set by `X-MVNA-Request-Id` in request headers
	RequestID string `q:"request_id"`

	// - Type of the request
	RequestType string `q:"request_type"`

	// - Operation status of the resource
	Status string `q:"status"`

	// - ID of the owner tenant of the resource
	TenantID string `q:"tenant_id"`

	// - When `true` is specified, operations of deleted resource is not displayed
	NoDeleted bool `q:"no_deleted"`

	// - When `true` is specified, only the latest operation of each resource is displayed
	Latest bool `q:"latest"`
}

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

func (ListOpts) ToOperationListQuery

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

ToOperationListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

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

type Operation

type Operation struct {

	// - ID of the operation
	ID string `json:"id"`

	// - ID of the resource
	ResourceID string `json:"resource_id"`

	// - Type of the resource
	ResourceType string `json:"resource_type"`

	// - The unique hyphenated UUID to identify the request
	//   - The UUID which has been set by X-MVNA-Request-Id in request headers
	RequestID string `json:"request_id"`

	// - Types of the request
	RequestTypes []string `json:"request_types"`

	// - Body of the request
	RequestBody map[string]interface{} `json:"request_body,omitempty"`

	// - Operation status of the resource
	Status string `json:"status"`

	// - The time when operation has been started by API execution
	// - Format: `"%Y-%m-%d %H:%M:%S"` (UTC)
	ReceptionDatetime string `json:"reception_datetime"`

	// - The time when operation has been finished
	// - Format: `"%Y-%m-%d %H:%M:%S"` (UTC)
	CommitDatetime string `json:"commit_datetime"`

	// - The warning message of operation that has been stopped or failed
	Warning string `json:"warning"`

	// - The error message of operation that has been stopped or failed
	Error string `json:"error"`

	// - ID of the owner tenant of the resource
	TenantID string `json:"tenant_id"`
}

Operation represents a operation.

func ExtractOperations

func ExtractOperations(r pagination.Page) ([]Operation, error)

ExtractOperations accepts a Page struct, specifically a NetworkPage struct, and extracts the elements into a slice of Operation structs. In other words, a generic collection is mapped into a relevant slice.

type OperationPage

type OperationPage struct {
	pagination.LinkedPageBase
}

OperationPage is the page returned by a pager when traversing over a collection of operation.

func (OperationPage) IsEmpty

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

IsEmpty checks whether a OperationPage struct is empty.

type ShowResult

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

ShowResult represents the result of a Show operation. Call its Extract method to interpret it as a Operation.

func Show

func Show(c *eclcloud.ServiceClient, id string) (r ShowResult)

Show retrieves a specific operation based on its unique ID.

func (ShowResult) Extract

func (r ShowResult) Extract() (*Operation, error)

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

func (ShowResult) ExtractInto

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

ExtractInto interprets any commonResult as a operation, if possible.

Directories

Path Synopsis
Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb
Generated by https://github.com/tamac-io/openapi-to-eclcloud-rb

Jump to

Keyboard shortcuts

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