Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) AddHostsToGroup(groupUUID string, hosts []string) (*Group, error)
- func (c *Client) CreateGroup(groupName string, hostIDS []string) (*Group, error)
- func (c *Client) GetBaseURL() (*url2.URL, error)
- func (c *Client) GetGroupByName(name string) (*Group, error)
- func (c *Client) GetGroupByUUID(groupUUID string) (*Group, error)
- func (c *Client) ListGroups(requestParams ListGroupsParams) (*Response, error)
- type ClientInterface
- type CreateGroup
- type Group
- type ListGroupsParams
- type Response
Constants ¶
View Source
const BasePath = "api/inventory/v1/groups"
BasePath the inventory groups base path
View Source
const DefaultPerPage = 50
DefaultPerPage the default per page limit when listing inventory groups
Variables ¶
View Source
var ErrGroupHostsAreMandatory = errors.New("inventory group hosts are mandatory")
View Source
var ErrGroupNameIsMandatory = errors.New("inventory group name is mandatory")
View Source
var ErrGroupNotFound = errors.New("inventory group not found")
View Source
var ErrGroupUUIDIsMandatory = errors.New("inventory group uuid is mandatory")
View Source
var ErrGroupsRequestResponse = errors.New("inventory groups request error response")
View Source
var ErrParsingURL = errors.New("error occurred while parsing raw url")
View Source
var IOReadAll = io.ReadAll
IOReadAll The io body reader
View Source
var NewJSONEncoder = json.NewEncoder
NewJSONEncoder create a new json encoder
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the implementation of an ClientInterface
func (*Client) AddHostsToGroup ¶
func (*Client) CreateGroup ¶
func (*Client) GetBaseURL ¶
GetBaseURL return the base url of inventory groups
func (*Client) ListGroups ¶
func (c *Client) ListGroups(requestParams ListGroupsParams) (*Response, error)
type ClientInterface ¶
type ClientInterface interface { GetBaseURL() (*url2.URL, error) GetGroupByName(name string) (*Group, error) GetGroupByUUID(groupUUID string) (*Group, error) CreateGroup(groupName string, hostIDS []string) (*Group, error) // nolint:revive AddHostsToGroup(groupUUID string, hosts []string) (*Group, error) ListGroups(requestParams ListGroupsParams) (*Response, error) }
ClientInterface is an Interface to make request to inventory Groups
func InitClient ¶
func InitClient(ctx context.Context, log log.FieldLogger) ClientInterface
InitClient initializes the client for Image Builder
type CreateGroup ¶
type Group ¶
type Group struct { ID string `json:"id"` Name string `json:"name"` OrgID string `json:"org_id"` HostCount int `json:"host_count"` }
Group the type representation returned from inventory groups endpoint
type ListGroupsParams ¶
ListGroupsParams the parameters used for list request
Directories ¶
Path | Synopsis |
---|---|
Package mock_inventorygroups is a generated GoMock package.
|
Package mock_inventorygroups is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.