services

package
v0.0.0-...-cd80d89 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 6 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 DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult is the response from a Delete operation. Call its ExtractErr method to determine if the call succeeded or failed.

func Delete

func Delete(client *gophercloud.ServiceClient, id string) (r DeleteResult)

Delete nova-compute service

type ListOpts

type ListOpts struct {
	Binary string `q:"binary"`
	Host   string `q:"host"`
}

ListOpts represents options to list services.

func (ListOpts) ToServicesListQuery

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

ToServicesListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToServicesListQuery() (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"`

	// Whether or not service was forced down manually.
	ForcedDown bool `json:"forced_down"`

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

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

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

	// The status of the service. One of enabled or disabled.
	Status string `json:"status"`

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

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

Service represents a Compute 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.

type ServiceStatus

type ServiceStatus string
const (
	// ServiceEnabled is used to mark a service as being enabled.
	ServiceEnabled ServiceStatus = "enabled"

	// ServiceDisabled is used to mark a service as being disabled.
	ServiceDisabled ServiceStatus = "disabled"
)

type UpdateOpts

type UpdateOpts struct {
	// Status represents the new service status. One of enabled or disabled.
	Status ServiceStatus `json:"status,omitempty"`

	// DisabledReason represents the reason for disabling a service.
	DisabledReason string `json:"disabled_reason,omitempty"`

	// ForcedDown is a manual override to tell nova that the service in question
	// has been fenced manually by the operations team.
	ForcedDown bool `json:"forced_down,omitempty"`
}

UpdateOpts specifies the base attributes that may be updated on a service.

func (UpdateOpts) ToServiceUpdateMap

func (opts UpdateOpts) ToServiceUpdateMap() (map[string]interface{}, error)

ToServiceUpdateMap formats an UpdateOpts structure into a request body.

type UpdateResult

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

UpdateResult is the response from an Update operation. Call its Extract method to interpret it as a Server.

func Update

func Update(client *gophercloud.ServiceClient, id string, opts UpdateOpts) (r UpdateResult)

Update requests that various attributes of the indicated service be changed.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Service, error)

Extract interprets any UpdateResult as a service, if possible.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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