services

package
v1.1.37 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List makes a request against the API to list services.

Types

type ListOpts

type ListOpts struct {
	// The pool name for the back end.
	ProjectID string `json:"project_id,omitempty"`
	// The service host name.
	Host string `json:"host"`
	// The service binary name. Default is the base name of the executable.
	Binary string `json:"binary"`
	// The availability zone.
	Zone string `json:"zone"`
	// The current state of the service. A valid value is up or down.
	State string `json:"state"`
	// The service status, which is enabled or disabled.
	Status string `json:"status"`
}

ListOpts holds options for listing Services.

func (ListOpts) ToServiceListQuery

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

ToServiceListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

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

type Service

type Service struct {
	// The binary name of the service.
	Binary string `json:"binary"`

	// The name of the host.
	Host string `json:"host"`

	// The ID of the service.
	ID int `json:"id"`

	// The state of the service. One of up or down.
	State string `json:"state"`

	// The status of the service. One of available or unavailable.
	Status string `json:"status"`

	// The date and time stamp when the extension was last updated.
	UpdatedAt time.Time `json:"-"`

	// The availability zone name.
	Zone string `json:"zone"`
}

Service represents a Shared File System service in the OpenStack cloud.

func ExtractServices

func ExtractServices(r pagination.Page) ([]Service, error)

func (*Service) UnmarshalJSON

func (r *Service) UnmarshalJSON(b []byte) error

UnmarshalJSON to override default

type ServicePage

type ServicePage struct {
	pagination.SinglePageBase
}

ServicePage represents a single page of all Services from a List request.

func (ServicePage) IsEmpty

func (page ServicePage) IsEmpty() (bool, error)

IsEmpty determines whether or not a page of Services contains any results.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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