Documentation ¶
Index ¶
- func ExtractAgentsInto(r pagination.Page, v interface{}) error
- func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- type Agent
- type AgentPage
- type CreateTagsBuilder
- type DeleteResult
- type Facts
- type FactsResult
- type GetResult
- type InitHeader
- type InitJSON
- type InitOpts
- type InitOptsBuilder
- type InitResult
- type ListOpts
- type ListOptsBuilder
- type Tags
- type TagsErrResult
- type TagsResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractAgentsInto ¶
func ExtractAgentsInto(r pagination.Page, v interface{}) error
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 the returned collection for greater efficiency.
Types ¶
type Agent ¶
type Agent struct { DisplayName string `json:"display_name"` AgentID string `json:"agent_id"` Project string `json:"project"` Organization string `json:"organization"` Facts map[string]interface{} `json:"facts"` Tags map[string]string `json:"tags"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` UpdatedWith string `json:"updated_with"` UpdatedBy string `json:"updated_by"` }
Agent represents an Arc Agent.
func ExtractAgents ¶
func ExtractAgents(r pagination.Page) ([]Agent, error)
ExtractAgents accepts a Page struct, specifically an AgentPage struct, and extracts the elements into a slice of Agent structs. In other words, a generic collection is mapped into a relevant slice.
func (*Agent) UnmarshalJSON ¶
type AgentPage ¶
type AgentPage struct {
pagination.MarkerPageBase
}
AgentPage is the page returned by a pager when traversing over a collection of agents.
func (AgentPage) LastMarker ¶
LastMarker returns the next page in a ListResult.
func (AgentPage) NextPageURL ¶
NextPageURL is invoked when a paginated collection of agents 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 CreateTagsBuilder ¶
CreateTagsBuilder allows extensions to add additional parameters to the CreateTags request.
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.
type FactsResult ¶
type FactsResult struct {
gophercloud.Result
}
FactsResult is the result of a facts request. Call its Extract method to interpret it as a map[string]string.
func GetFacts ¶
func GetFacts(ctx context.Context, client *gophercloud.ServiceClient, agentID string) (r FactsResult)
GetFacts lists tags for a given agent.
func (FactsResult) Extract ¶
func (r FactsResult) Extract() (map[string]interface{}, error)
Extract interprets any FactsResult as map[string]string.
type GetResult ¶
type GetResult struct {
gophercloud.Result
}
func (GetResult) Extract ¶
Extract is a function that accepts a result and extracts an agent resource.
func (GetResult) ExtractInto ¶
type InitHeader ¶
type InitHeader struct {
ContentType string `json:"Content-Type"`
}
InitHeader represents the headers returned in the response from an Init request.
type InitJSON ¶
type InitJSON struct { Token string `json:"token"` URL string `json:"url"` EndpointURL string `json:"endpoint_url"` UpdateURL string `json:"update_url"` RenewCertURL string `json:"renew_cert_url"` }
InitJSON represents the structure returned in the response from an Init request.
type InitOpts ¶
type InitOpts struct { // Valid options: // * application/json // * text/x-shellscript // * text/x-powershellscript // * text/cloud-config Accept string `h:"Accept" required:"true"` }
InitOpts represents the attributes used when initializing a new agent.
type InitOptsBuilder ¶
InitOptsBuilder allows extensions to add additional parameters to the Init request.
type InitResult ¶
type InitResult struct { gophercloud.HeaderResult Body []byte }
InitResult represents the result of an init operation. Call its ExtractHeaders method to interpret it as an init agent response headers or ExtractContent method to interpret it as a response content.
func Init ¶
func Init(ctx context.Context, c *gophercloud.ServiceClient, opts InitOptsBuilder) (r InitResult)
Init accepts an InitOpts struct and initializes a new agent using the values provided.
func (*InitResult) ExtractContent ¶
func (r *InitResult) ExtractContent() ([]byte, error)
ExtractContent is a function that takes a InitResult's io.Reader body and reads all available data into a slice of bytes. Please be aware that due the nature of io.Reader is forward-only - meaning that it can only be read once and not rewound. You can recreate a reader from the output of this function by using bytes.NewReader(initBytes)
func (InitResult) ExtractHeaders ¶
func (r InitResult) ExtractHeaders() (*InitHeader, error)
ExtractHeaders will return a struct of headers returned from a call to Init.
type ListOpts ¶
type ListOpts struct { Page int `q:"page"` PerPage int `q:"per_page"` // E.g. '@os = "darwin" OR (landscape = "staging" AND pool = "green")' // where: // @fact - fact // tag - tag Filter string `q:"q"` }
ListOpts allows the filtering of paginated collections through the API. Filtering is achieved by passing in filter value. Page and PerPage are used for 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 TagsErrResult ¶
type TagsErrResult struct {
gophercloud.ErrResult
}
TagsDeleteResult is the response from a tags Delete operation. Call its ExtractErr to determine if the request succeeded or failed.
func CreateTags ¶
func CreateTags(ctx context.Context, client *gophercloud.ServiceClient, agentID string, opts Tags) (r TagsErrResult)
CreateTags adds/updates tags for a given agent.
type TagsResult ¶
type TagsResult struct {
gophercloud.Result
}
TagsResult is the result of a tags request. Call its Extract method to interpret it as a map[string]string.