Documentation
¶
Index ¶
- type CanCancelJob
- type Client
- type ClientOptions
- type CreateJobTemplatesSchedule
- type Error
- type ErrorResponse
- type GetAuthTokenInput
- type GetAuthTokenOutput
- type GetOption
- type GetPingOutput
- type HTTPClient
- type Inventory
- type InventoryList
- type InventoryListInput
- type Job
- type JobList
- type JobTemplate
- type JobTemplateList
- type ListGetResponse
- type ListJobTemplateInput
- type ListJobsInput
- type ListOption
- type ListSchedulesInput
- type Object
- type ObjectKey
- type ObjectList
- type Reader
- type Schedule
- type ScheduleList
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CanCancelJob ¶
type CanCancelJob struct {
CanCancel bool `json:"can_cancel"`
}
CanCancelJob represents the output of the GetCancelJob method.
type Client ¶
Client represents the client for the AWX API.
func NewClient ¶
func NewClient(options ClientOptions) (c Client, err error)
NewClient creates a new client for the AWX API.
type ClientOptions ¶
type ClientOptions struct {
Endpoint string
HTTPClient HTTPClient
InsecureSkipVerify bool
Username string
Password string
Token string
Agent string
Version string
}
ClientOptions represents the options for the client.
type CreateJobTemplatesSchedule ¶
type CreateJobTemplatesSchedule struct {
Name string `json:"name"`
RRULE string `json:"rrule"`
UnifiedJobTemplate int `json:"unified_job_template"`
ExtraData string `json:"extra_data"`
Inventory string `json:"inventory"`
Limit string `json:"limit"`
}
CreateJobTemplatesSchedule represents the input of the PostJobTemplateSchedule method.
type ErrorResponse ¶
type ErrorResponse struct {
All []string `json:"__all__"`
}
ErrorResponse represents the awx error response.
type GetAuthTokenInput ¶
type GetAuthTokenInput struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
GetAuthTokenInput represents the input of the GetAuthToken method.
type GetAuthTokenOutput ¶
type GetAuthTokenOutput struct {
Token string `json:"token,omitempty"`
Expires time.Time `json:"expires,omitempty"`
}
GetAuthTokenOutput represents the output of the GetAuthToken method.
type GetPingOutput ¶
type GetPingOutput struct {
Version string `json:"version"`
ActiveNode string `json:"active_node"`
InstallUUID string `json:"install_uuid"`
}
GetPingOutput represents the output of the Ping method.
type HTTPClient ¶
HTTPClient provides the interface for a client making HTTP requests with the API.
type Inventory ¶
type Inventory struct {
ID int `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
Type string `json:"type"`
Modified string `json:"modified"`
Created string `json:"created"`
HasActiveFailures bool `json:"has_active_failures"`
TotalHosts int `json:"total_hosts"`
PendingDeletion bool `json:"pending_deletion"`
}
Inventory represents the output of the GetInventories method.
type InventoryList ¶
type InventoryList struct {
ListGetResponse
Results []*Inventory `json:"results,omitempty"`
}
InventoryList represents the output of the ListInventories method.
type InventoryListInput ¶
type InventoryListInput struct {
Query string `schema:"-,omitempty"`
Name string `schema:"name,omitempty"`
}
InventoryListInput represents the input of the ListInventories method.
type Job ¶
type Job struct {
ID int `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
Type string `json:"type"`
Modified string `json:"modified"`
Created string `json:"created"`
UnifiedJobTemplate int `json:"unified_job_template"`
Status string `json:"status"`
Failed bool `json:"failed"`
Started time.Time `json:"started"`
Finished time.Time `json:"finished"`
}
Job represents the output of the GetJobs method.
type JobList ¶
type JobList struct {
ListGetResponse
Results []*Job `json:"results,omitempty"`
}
JobList represents the output of the ListJobs method.
type JobTemplate ¶
type JobTemplate struct {
ID int `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
Type string `json:"type"`
Modified string `json:"modified"`
Created string `json:"created"`
Status string `json:"status"`
}
JobTemplate represents the output of the GetJobTemplates method.
type JobTemplateList ¶
type JobTemplateList struct {
ListGetResponse
Results []*JobTemplate `json:"results,omitempty"`
}
JobTemplateList represents the output of the ListJobTemplates method.
type ListGetResponse ¶
type ListGetResponse struct {
Count int `json:"count,omitempty"`
Next string `json:"next,omitempty"`
Previous string `json:"previous,omitempty"`
}
ListGetResponse represents the output of the ListGet method.
type ListJobTemplateInput ¶
type ListJobTemplateInput struct {
ID string `schema:"id,omitempty"`
Name string `schema:"name,omitempty"`
Query string `schema:"-,omitempty"`
}
ListJobTemplateInput represents the input of the ListJobTemplates method.
type ListJobsInput ¶
type ListJobsInput struct {
ID string `schema:"id,omitempty"`
LaunchType string `schema:"launch_type,omitempty"`
ScheduleID int `schema:"schedule__id,omitempty"`
Query string `schema:"query,omitempty"`
}
ListJobsInput represents the input of the ListJobs method.
type ListSchedulesInput ¶
type ListSchedulesInput struct {
ID string `schema:"id,omitempty"`
Name string `schema:"name,omitempty"`
}
ListSchedulesInput represents the input of the ListSchedules method.
type Reader ¶
type Reader interface {
// Get retrieves an obj for the given object key from AWX.
// obj must be a struct pointer so that obj can be updated with the response
// returned by the Server.
Get(ctx context.Context, key ObjectKey, obj Object, httpStatus []int) error
// List retrieves list of objects for a given resource and list options. On a
// successful call, Items field in the list will be populated with the
// result returned from the server.
List(ctx context.Context, key ObjectKey, list ObjectList, opts ListOption, httpStatus []int) error
}
Reader knows how to read and list AWX objects.
type Schedule ¶
type Schedule struct {
ID int `json:"id"`
RRULE string `json:"rrule"`
Type string `json:"type"`
URL string `json:"url"`
Created string `json:"created"`
Modified string `json:"modified"`
ExtraData string `json:"extra_data"`
Name string `json:"name"`
Description string `json:"description"`
UnifiedJobTemplate int `json:"unified_job_template"`
Inventory int `json:"inventory"`
}
Schedule represents the output of the GetSchedule method.
type ScheduleList ¶
type ScheduleList struct {
ListGetResponse
Results []*Schedule `json:"results,omitempty"`
}
ScheduleList represents the output of the ListSchedule method.
type Writer ¶
type Writer interface {
// Create saves the object obj in AWX. obj must be a
// struct pointer so that obj can be updated with the content returned by the Server.
Create(ctx context.Context, key ObjectKey, obj Object, httpStatus []int) error
// Delete deletes the given obj from AWXAWX.
Delete(ctx context.Context, key ObjectKey, httpStatus []int) error
// Update updates the given obj in the AWX. obj must be a
// struct pointer so that obj can be updated with the content returned by the Server.
Update(ctx context.Context, key ObjectKey, obj Object, httpStatus []int) error
}
Writer knows how to create, delete, and update Kubernetes objects.