system_updates

package
v4.0.0 Latest Latest
Warning

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

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

Documentation

Overview

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

Example to list system updates

listOpts := system_updates.ListOpts{}

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

allSystemUpdates, err := system_updates.ExtractSystemUpdates(allPages)
if err != nil {
	panic(err)
}

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

Example to show a system update

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractSystemUpdatesInto

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

ExtractSystemUpdatesInto interprets the results of a single page from a List() call, producing a slice of system update 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 system updates. 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"`

	// - Name of the resource
	// - This field accepts single-byte characters only
	Name string `q:"name"`

	// - Description of the resource
	// - This field accepts single-byte characters only
	Description string `q:"description"`

	// - URL of announcement for the system update (for example, Knowledge Center news)
	Href string `q:"href"`

	// - Current revision for the system update
	CurrentRevision int `q:"current_revision"`

	// - Next revision for the system update
	NextRevision int `q:"next_revision"`

	// - Whether the system update can be applied to the load balancer
	Applicable bool `q:"applicable"`

	// - If `true` is set, only the latest 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 system update attributes you want to see returned.

func (ListOpts) ToSystemUpdateListQuery

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

ToSystemUpdateListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

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

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

func Show

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

Show retrieves a specific system update based on its unique ID.

func (ShowResult) Extract

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

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

func (ShowResult) ExtractInto

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

ExtractInto interprets any commonResult as a system update, if possible.

type SystemUpdate

type SystemUpdate struct {

	// - ID of the system update
	ID string `json:"id"`

	// - Name of the system update
	Name string `json:"name"`

	// - Description of the system update
	Description string `json:"description"`

	// - URL of announcement for the system update (for example, Knowledge Center news)
	Href string `json:"href"`

	// - The time when the system update has been announced
	// - Format: `"%Y-%m-%d %H:%M:%S"` (UTC)
	PublishDatetime string `json:"publish_datetime"`

	// - The deadline for applying the system update to the load balancer at any time
	//   - **For load balancers that have not been applied the system update even after the deadline, the provider will automatically apply it in the maintenance window of each region**
	// - Format: `"%Y-%m-%d %H:%M:%S"` (UTC)
	LimitDatetime string `json:"limit_datetime"`

	// - Current revision for the system update
	// - The system update can be applied to the load balancers that is this revision
	CurrentRevision int `json:"current_revision"`

	// - Next revision for the system update
	// - The load balancer to which the system update is applied will be this revision
	NextRevision int `json:"next_revision"`

	// - Whether the system update can be applied to the load balancer
	Applicable bool `json:"applicable"`
}

SystemUpdate represents a system update.

func ExtractSystemUpdates

func ExtractSystemUpdates(r pagination.Page) ([]SystemUpdate, error)

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

type SystemUpdatePage

type SystemUpdatePage struct {
	pagination.LinkedPageBase
}

SystemUpdatePage is the page returned by a pager when traversing over a collection of system update.

func (SystemUpdatePage) IsEmpty

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

IsEmpty checks whether a SystemUpdatePage struct is empty.

Directories

Path Synopsis
Package testing contains system update unit tests
Package testing contains system update unit tests

Jump to

Keyboard shortcuts

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