Documentation ¶
Index ¶
- func PostRequest(client *Client, uri string) ([]byte, error)
- type Class
- type Client
- func (c *Client) Classes(pagination *Pagination) ([]Class, error)
- func (c *Client) Group(id string) (Group, error)
- func (c *Client) GroupRules(groupID string) (GroupRules, error)
- func (c *Client) Groups(pagination *Pagination) ([]Group, error)
- func (c *Client) Node(certname string) (Node, error)
- func (c *Client) SetTransport(tripper http.RoundTripper)
- func (c *Client) TranslateRules(rule string) (string, error)
- type Group
- type GroupRules
- type Node
- type Pagination
- type Rule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Class ¶ added in v1.11.0
Class represents a group returned by the classes endpoint. See https://www.puppet.com/docs/pe/2019.8/classes_endpoint#get_v1_classes
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for the Orchestrator API
func (*Client) Classes ¶ added in v1.11.0
func (c *Client) Classes(pagination *Pagination) ([]Class, error)
func (*Client) GroupRules ¶ added in v1.1.0
func (c *Client) GroupRules(groupID string) (GroupRules, error)
GroupRules will return the rules for the specified group.
func (*Client) Groups ¶
func (c *Client) Groups(pagination *Pagination) ([]Group, error)
Groups will return all groups.
func (*Client) Node ¶
Node will return the Node matching the given id. certname is the hostname of the node to query.
func (*Client) SetTransport ¶
func (c *Client) SetTransport(tripper http.RoundTripper)
SetTransport lets the caller overwrite the default transport used by the client. This is useful when injecting mock transports for testing purposes.
type Group ¶
type Group struct { ID string Name string Description string Environment string EnvironmentTrumps bool `json:"environment_trumps"` Parent string Rule interface{} Classes map[string]interface{} ConfigData map[string]interface{} `json:"config_data"` Deleted map[string]interface{} Variables map[string]interface{} LastEdited time.Time `json:"last_edited"` SerialNumber int `json:"serial_number"` }
Group represents a group returned by the groups endpoint. See https://puppet.com/docs/pe/2018.1/groups_endpoint.html#get_v1_groups__response_format
type GroupRules ¶ added in v1.1.0
type GroupRules struct { Rule interface{} RuleWithInherited interface{} `json:"rule_with_inherited"` Translated struct { NodesQueryFormat interface{} `json:"nodes_query_format"` InventoryQueryFormat interface{} `json:"inventory_query_format"` } }
GroupRules stores the response from the group rules endpoint.
type Node ¶
type Node struct { Name string `json:"name"` Environment string `json:"environment"` Groups []struct { ID string `json:"id"` Name string `json:"name"` } `json:"groups"` Classes struct{} `json:"classes"` Parameters struct{} `json:"parameters"` ConfigData struct{} `json:"config_data"` }
Node represents the response to the classifier nodes v2 endpoint.
type Pagination ¶
Pagination is a filter to be used when paginating