Version: v1.0.20 Latest Latest

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 4 Imported by: 0




This section is empty.


This section is empty.


func List

List makes a request against the API to list services.


type ListOpts

type ListOpts struct {
	// Filter the service list result by binary name of the service.
	Binary string `q:"binary"`

	// Filter the service list result by host name of the service.
	Host string `q:"host"`

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 reason for disabling a service.
	DisabledReason string `json:"disabled_reason"`

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

	// 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"`

	// The host is frozen or not. Only in cinder-volume service.
	Frozen bool `json:"frozen"`

	// The cluster name. Only in cinder-volume service.
	Cluster string `json:"cluster"`

	// The volume service replication status. Only in cinder-volume service.
	ReplicationStatus string `json:"replication_status"`

	// The ID of active storage backend. Only in cinder-volume service.
	ActiveBackendID string `json:"active_backend_id"`

Service represents a Blockstorage 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 {

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.


Path Synopsis

Jump to

Keyboard shortcuts

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