agents

package
v1.1.42 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractBGPSpeakers

func ExtractBGPSpeakers(r pagination.Page) ([]speakers.BGPSpeaker, error)

ExtractBGPSpeakers inteprets the ListBGPSpeakersResult into an array of BGP speakers

func List

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

Default policy settings return only the agents owned by the project of the user submitting the request, unless the user has the administrative role.

func ListBGPSpeakers

func ListBGPSpeakers(c *gophercloud.ServiceClient, agentID string) pagination.Pager

ListBGPSpeakers list the BGP Speakers hosted by a specific dragent GET /v2.0/agents/{agent-id}/bgp-drinstances

func ListDRAgentHostingBGPSpeakers

func ListDRAgentHostingBGPSpeakers(c *gophercloud.ServiceClient, bgpSpeakerID string) pagination.Pager

ListDRAgentHostingBGPSpeakers the dragents that are hosting a specific bgp speaker GET /v2.0/bgp-speakers/{bgp-speaker-id}/bgp-dragents

Types

type Agent

type Agent struct {
	// ID is the id of the agent.
	ID string `json:"id"`

	// AdminStateUp is an administrative state of the agent.
	AdminStateUp bool `json:"admin_state_up"`

	// AgentType is a type of the agent.
	AgentType string `json:"agent_type"`

	// Alive indicates whether agent is alive or not.
	Alive bool `json:"alive"`

	// ResourcesSynced indicates whether agent is synced or not.
	// Not all agent types track resources via Placement.
	ResourcesSynced bool `json:"resources_synced"`

	// AvailabilityZone is a zone of the agent.
	AvailabilityZone string `json:"availability_zone"`

	// Binary is an executable binary of the agent.
	Binary string `json:"binary"`

	// Configurations is a configuration specific key/value pairs that are
	// determined by the agent binary and type.
	Configurations map[string]interface{} `json:"configurations"`

	// CreatedAt is a creation timestamp.
	CreatedAt time.Time `json:"-"`

	// StartedAt is a starting timestamp.
	StartedAt time.Time `json:"-"`

	// HeartbeatTimestamp is a last heartbeat timestamp.
	HeartbeatTimestamp time.Time `json:"-"`

	// Description contains agent description.
	Description string `json:"description"`

	// Host is a hostname of the agent system.
	Host string `json:"host"`

	// Topic contains name of AMQP topic.
	Topic string `json:"topic"`
}

Agent represents a Neutron agent.

func ExtractAgents

func ExtractAgents(r pagination.Page) ([]Agent, error)

ExtractAgents interprets the results of a single page from a List() API call, producing a slice of Agents structs.

func (*Agent) UnmarshalJSON

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

UnmarshalJSON helps to convert the timestamps into the time.Time type.

type AgentPage

type AgentPage struct {
	pagination.LinkedPageBase
}

AgentPage stores a single page of Agents from a List() API call.

func (AgentPage) IsEmpty

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

IsEmpty determines whether or not a AgentPage is empty.

func (AgentPage) NextPageURL

func (r AgentPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of agent has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Delete

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

Delete deletes a specific agent based on its ID.

type GetResult

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

GetResult represents the result of a get operation. Call its Extract method to interpret it as an Agent.

func Get

func Get(c *gophercloud.ServiceClient, id string) (r GetResult)

Get retrieves a specific agent based on its ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Agent, error)

Extract is a function that accepts a result and extracts an agent resource.

type ListBGPSpeakersResult

type ListBGPSpeakersResult struct {
	pagination.SinglePageBase
}

ListBGPSpeakersResult is the respone of agents/{id}/bgp-speakers

func (ListBGPSpeakersResult) IsEmpty

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

type ListDHCPNetworksResult

type ListDHCPNetworksResult struct {
	gophercloud.Result
}

ListDHCPNetworksResult is the response from a List operation. Call its Extract method to interpret it as networks.

func ListDHCPNetworks

func ListDHCPNetworks(c *gophercloud.ServiceClient, id string) (r ListDHCPNetworksResult)

ListDHCPNetworks returns a list of networks scheduled to a specific dhcp agent.

func (ListDHCPNetworksResult) Extract

func (r ListDHCPNetworksResult) Extract() ([]networks.Network, error)

Extract interprets any ListDHCPNetworksResult as an array of networks.

type ListL3RoutersResult

type ListL3RoutersResult struct {
	gophercloud.Result
}

ListL3RoutersResult is the response from a List operation. Call its Extract method to interpret it as routers.

func ListL3Routers

func ListL3Routers(c *gophercloud.ServiceClient, id string) (r ListL3RoutersResult)

ListL3Routers returns a list of routers scheduled to a specific L3 agent.

func (ListL3RoutersResult) Extract

func (r ListL3RoutersResult) Extract() ([]routers.Router, error)

Extract interprets any ListL3RoutesResult as an array of routers.

type ListOpts

type ListOpts struct {
	ID               string `q:"id"`
	AgentType        string `q:"agent_type"`
	Alive            *bool  `q:"alive"`
	AvailabilityZone string `q:"availability_zone"`
	Binary           string `q:"binary"`
	Description      string `q:"description"`
	Host             string `q:"host"`
	Topic            string `q:"topic"`
	Limit            int    `q:"limit"`
	Marker           string `q:"marker"`
	SortKey          string `q:"sort_key"`
	SortDir          string `q:"sort_dir"`
}

ListOpts allows the filtering and sorting of paginated collections through the Neutron API. Filtering is achieved by passing in struct field values that map to the agent attributes you want to see returned. SortKey allows you to sort by a particular agent attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for the pagination.

func (ListOpts) ToAgentListQuery

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

ToAgentListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

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

type RemoveBGPSpeakerResult

type RemoveBGPSpeakerResult struct {
	gophercloud.ErrResult
}

RemoveBGPSpeakerResult represents the result of removing a BGP speaker from a BGP DR Agent. ExtractErr method to determine if the request succeeded or failed.

func RemoveBGPSpeaker

func RemoveBGPSpeaker(c *gophercloud.ServiceClient, agentID string, speakerID string) (r RemoveBGPSpeakerResult)

RemoveBGPSpeaker removes a BGP speaker from a BGP agent DELETE /v2.0/agents/{agent-id}/bgp-drinstances

type RemoveDHCPNetworkResult

type RemoveDHCPNetworkResult struct {
	gophercloud.ErrResult
}

RemoveDHCPNetworkResult represents the result of a remove a network from a DHCP agent operation. ExtractErr method to determine if the request succeeded or failed.

func RemoveDHCPNetwork

func RemoveDHCPNetwork(c *gophercloud.ServiceClient, id string, networkID string) (r RemoveDHCPNetworkResult)

RemoveDHCPNetwork removes a network from a DHCP agent.

type RemoveL3RouterResult

type RemoveL3RouterResult struct {
	gophercloud.ErrResult
}

RemoveL3RouterResult represents the result of a remove a router from a L3 agent operation. ExtractErr method to determine if the request succeeded or failed.

func RemoveL3Router

func RemoveL3Router(c *gophercloud.ServiceClient, id string, routerID string) (r RemoveL3RouterResult)

RemoveL3Router removes a router from a L3 agent.

type ScheduleBGPSpeakerOpts

type ScheduleBGPSpeakerOpts struct {
	SpeakerID string `json:"bgp_speaker_id" required:"true"`
}

ScheduleBGPSpeakerOpts represents the data that would be POST to the endpoint

func (ScheduleBGPSpeakerOpts) ToAgentScheduleBGPSpeakerMap

func (opts ScheduleBGPSpeakerOpts) ToAgentScheduleBGPSpeakerMap() (map[string]interface{}, error)

ToAgentScheduleBGPSpeakerMap builds a request body from ScheduleBGPSpeakerOpts

type ScheduleBGPSpeakerOptsBuilder

type ScheduleBGPSpeakerOptsBuilder interface {
	ToAgentScheduleBGPSpeakerMap() (map[string]interface{}, error)
}

ScheduleBGPSpeakerOptsBuilder declare a function that build ScheduleBGPSpeakerOpts into a request body

type ScheduleBGPSpeakerResult

type ScheduleBGPSpeakerResult struct {
	gophercloud.ErrResult
}

ScheduleBGPSpeakerResult represents the result of adding a BGP speaker to a BGP DR Agent. ExtractErr method to determine if the request succeeded or failed.

func ScheduleBGPSpeaker

ScheduleBGPSpeaker schedule a BGP speaker to a BGP agent POST /v2.0/agents/{agent-id}/bgp-drinstances

type ScheduleDHCPNetworkOpts

type ScheduleDHCPNetworkOpts struct {
	NetworkID string `json:"network_id" required:"true"`
}

ScheduleDHCPNetworkOpts represents the attributes used when scheduling a network to a DHCP agent.

func (ScheduleDHCPNetworkOpts) ToAgentScheduleDHCPNetworkMap

func (opts ScheduleDHCPNetworkOpts) ToAgentScheduleDHCPNetworkMap() (map[string]interface{}, error)

ToAgentScheduleDHCPNetworkMap builds a request body from ScheduleDHCPNetworkOpts.

type ScheduleDHCPNetworkOptsBuilder

type ScheduleDHCPNetworkOptsBuilder interface {
	ToAgentScheduleDHCPNetworkMap() (map[string]interface{}, error)
}

ScheduleDHCPNetworkOptsBuilder allows extensions to add additional parameters to the ScheduleDHCPNetwork request.

type ScheduleDHCPNetworkResult

type ScheduleDHCPNetworkResult struct {
	gophercloud.ErrResult
}

ScheduleDHCPNetworkResult represents the result of a schedule a network to a DHCP agent operation. ExtractErr method to determine if the request succeeded or failed.

func ScheduleDHCPNetwork

ScheduleDHCPNetwork schedule a network to a DHCP agent.

type ScheduleL3RouterOpts

type ScheduleL3RouterOpts struct {
	RouterID string `json:"router_id" required:"true"`
}

ScheduleL3RouterOpts represents the attributes used when scheduling a router to a L3 agent.

func (ScheduleL3RouterOpts) ToAgentScheduleL3RouterMap

func (opts ScheduleL3RouterOpts) ToAgentScheduleL3RouterMap() (map[string]interface{}, error)

ToAgentScheduleL3RouterMap builds a request body from ScheduleL3RouterOpts.

type ScheduleL3RouterOptsBuilder

type ScheduleL3RouterOptsBuilder interface {
	ToAgentScheduleL3RouterMap() (map[string]interface{}, error)
}

ScheduleL3RouterOptsBuilder allows extensions to add additional parameters to the ScheduleL3Router request.

type ScheduleL3RouterResult

type ScheduleL3RouterResult struct {
	gophercloud.ErrResult
}

ScheduleL3RouterResult represents the result of a schedule a router to a L3 agent operation. ExtractErr method to determine if the request succeeded or failed.

func ScheduleL3Router

ScheduleL3Router schedule a router to a L3 agent.

type UpdateOpts

type UpdateOpts struct {
	Description  *string `json:"description,omitempty"`
	AdminStateUp *bool   `json:"admin_state_up,omitempty"`
}

UpdateOpts represents the attributes used when updating an existing agent.

func (UpdateOpts) ToAgentUpdateMap

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

ToAgentUpdateMap builds a request body from UpdateOpts.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToAgentUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

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

UpdateResult represents the result of a get operation. Call its Extract method to interpret it as an Agent.

func Update

Update updates a specific agent based on its ID.

func (UpdateResult) Extract

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

Extract is a function that accepts a result and extracts an agent resource.

Directories

Path Synopsis
agents unit tests
agents unit tests

Jump to

Keyboard shortcuts

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