Documentation ¶
Index ¶
- func ExtractBGPSpeakers(r pagination.Page) ([]speakers.BGPSpeaker, error)
- func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- func ListBGPSpeakers(c *gophercloud.ServiceClient, agentID string) pagination.Pager
- type Agent
- type AgentPage
- type DeleteResult
- type GetResult
- type ListBGPSpeakersResult
- type ListDHCPNetworksResult
- type ListOpts
- type ListOptsBuilder
- type RemoveDHCPNetworkResult
- type ScheduleDHCPNetworkOpts
- type ScheduleDHCPNetworkOptsBuilder
- type ScheduleDHCPNetworkResult
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractBGPSpeakers ¶ added in v0.23.0
func ExtractBGPSpeakers(r pagination.Page) ([]speakers.BGPSpeaker, error)
ExtractBGPSpeakers inteprets the ListBGPSpeakersResult into an array of BGP speakers
func List ¶
func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
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 ¶ added in v0.23.0
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
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 ¶
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) NextPageURL ¶
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 ¶ added in v0.11.0
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 ¶ added in v0.11.0
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.
type ListBGPSpeakersResult ¶ added in v0.23.0
type ListBGPSpeakersResult struct {
pagination.SinglePageBase
}
ListBGPSpeakersResult is the respone of agents/{id}/bgp-speakers
func (ListBGPSpeakersResult) IsEmpty ¶ added in v0.23.0
func (r ListBGPSpeakersResult) IsEmpty() (bool, error)
type ListDHCPNetworksResult ¶ added in v0.4.0
type ListDHCPNetworksResult struct {
gophercloud.Result
}
ListDHCPNetworksResult is the response from a List operation. Call its Extract method to interpret it as networks.
func ListDHCPNetworks ¶ added in v0.4.0
func ListDHCPNetworks(c *gophercloud.ServiceClient, id string) (r ListDHCPNetworksResult)
ListDHCPNetworks returns a list of networks scheduled to a specific dhcp agent.
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 ¶
ToAgentListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.
type RemoveDHCPNetworkResult ¶ added in v0.11.0
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 ¶ added in v0.11.0
func RemoveDHCPNetwork(c *gophercloud.ServiceClient, id string, networkID string) (r RemoveDHCPNetworkResult)
RemoveDHCPNetwork removes a network from a DHCP agent.
type ScheduleDHCPNetworkOpts ¶ added in v0.11.0
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 ¶ added in v0.11.0
func (opts ScheduleDHCPNetworkOpts) ToAgentScheduleDHCPNetworkMap() (map[string]interface{}, error)
ToAgentScheduleDHCPNetworkMap builds a request body from ScheduleDHCPNetworkOpts.
type ScheduleDHCPNetworkOptsBuilder ¶ added in v0.11.0
type ScheduleDHCPNetworkOptsBuilder interface {
ToAgentScheduleDHCPNetworkMap() (map[string]interface{}, error)
}
ScheduleDHCPNetworkOptsBuilder allows extensions to add additional parameters to the ScheduleDHCPNetwork request.
type ScheduleDHCPNetworkResult ¶ added in v0.11.0
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 ¶ added in v0.11.0
func ScheduleDHCPNetwork(c *gophercloud.ServiceClient, id string, opts ScheduleDHCPNetworkOptsBuilder) (r ScheduleDHCPNetworkResult)
ScheduleDHCPNetwork schedule a network to a DHCP agent.
type UpdateOpts ¶ added in v0.11.0
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 ¶ added in v0.11.0
func (opts UpdateOpts) ToAgentUpdateMap() (map[string]interface{}, error)
ToAgentUpdateMap builds a request body from UpdateOpts.
type UpdateOptsBuilder ¶ added in v0.11.0
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateResult ¶ added in v0.11.0
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 ¶ added in v0.11.0
func Update(c *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)
Update updates a specific agent based on its ID.