Documentation
¶
Index ¶
- Constants
- func CheckResponse(resp *http.Response) error
- type APIRequest
- type AWX
- type ApplyRole
- type BasicAuth
- type ByUserSummary
- type CancelJobResponse
- type Client
- type Credential
- type EventData
- type EventInvocation
- type EventModuleArgs
- type EventRes
- type HostSummariesResponse
- type HostSummary
- type HostSummaryFields
- type HostSummaryHost
- type HostSummaryJob
- type Instance
- type InstanceGroup
- type InstanceGroupSummary
- type InventoriesService
- type Inventory
- type Job
- type JobEvent
- type JobEventsResponse
- type JobLaunch
- type JobService
- func (j *JobService) CancelJob(id int, data map[string]interface{}, params map[string]string) (*CancelJobResponse, error)
- func (j *JobService) GetHostSummaries(id int, params map[string]string) ([]HostSummary, *HostSummariesResponse, error)
- func (j *JobService) GetJob(id int, params map[string]string) (*Job, error)
- func (j *JobService) GetJobEvents(id int, params map[string]string) ([]JobEvent, *JobEventsResponse, error)
- func (j *JobService) RelaunchJob(id int, data map[string]interface{}, params map[string]string) (*JobLaunch, error)
- type JobTemplate
- type JobTemplateService
- type JobTemplateSummary
- type Labels
- type ListInventoriesResponse
- type ListJobTemplatesResponse
- type ObjectRoles
- type OrgnizationSummary
- type Pagination
- type Ping
- type PingService
- type Project
- type ProjectUpdate
- type Related
- type Requester
- func (r *Requester) Do(ar *APIRequest, responseStruct interface{}, options ...interface{}) (*http.Response, error)
- func (r *Requester) Get(endpoint string, responseStruct interface{}, querystring map[string]string) (*http.Response, error)
- func (r *Requester) GetJSON(endpoint string, responseStruct interface{}, query map[string]string) (*http.Response, error)
- func (r *Requester) Post(endpoint string, payload io.Reader, responseStruct interface{}, ...) (*http.Response, error)
- func (r *Requester) PostJSON(endpoint string, payload io.Reader, responseStruct interface{}, ...) (*http.Response, error)
- func (r *Requester) ReadJSONResponse(response *http.Response, responseStruct interface{}) (*http.Response, error)
- func (r *Requester) ReadRawResponse(response *http.Response, responseStruct interface{}) (*http.Response, error)
- type Summary
- type UnifiedJobTemplate
- type UserCapabilities
Constants ¶
const ( JobStatusNew = "new" JobStatusPending = "pending" JobStatusWaiting = "waiting" JobStatusRunning = "running" JobStatusSuccessful = "successful" JobStatusFailed = "failed" JobStatusError = "error" JobStatusCanceled = "canceled" )
Enum of job statuses.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
CheckResponse do http response check, and return err if not in [200, 300).
Types ¶
type APIRequest ¶
type APIRequest struct {
Method string
Endpoint string
Payload io.Reader
Headers http.Header
Suffix string
}
APIRequest represents the http api communication way.
func NewAPIRequest ¶
func NewAPIRequest(method string, endpoint string, payload io.Reader) *APIRequest
NewAPIRequest news an APIRequest object.
func (*APIRequest) SetHeader ¶
func (ar *APIRequest) SetHeader(key string, value string) *APIRequest
SetHeader sets http header by passing k,v.
type AWX ¶
type AWX struct {
PingService *PingService
InventoriesService *InventoriesService
JobService *JobService
JobTemplateService *JobTemplateService
// contains filtered or unexported fields
}
AWX represents awx api endpoints with services, and using client to communicate with awx server.
type ApplyRole ¶
type ApplyRole struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
}
ApplyRole represents the awx api apply role.
type ByUserSummary ¶
type ByUserSummary struct {
ID int `json:"id"`
Username string `json:"username"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
}
ByUserSummary represents the awx api user summary fields.
type CancelJobResponse ¶
type CancelJobResponse struct {
Detail string `json:"detail"`
}
CancelJobResponse represents `CancelJob` endpoint response.
type Credential ¶
type Credential struct {
Description string `json:"description"`
CredentialTypeID int `json:"credential_type_id"`
ID int `json:"id"`
Kind string `json:"kind"`
Name string `json:"name"`
}
Credential represents the awx api credential.
type EventData ¶
type EventData struct {
PlayPattern string `json:"play_pattern"`
Play string `json:"play"`
EventLoop interface{} `json:"event_loop"`
TaskArgs string `json:"task_args"`
RemoteAddr string `json:"remote_addr"`
Res *EventRes `json:"res"`
Pid int `json:"pid"`
PlayUUID string `json:"play_uuid"`
TaskUUID string `json:"task_uuid"`
Task string `json:"task"`
PlaybookUUID string `json:"playbook_uuid"`
Playbook string `json:"playbook"`
TaskAction string `json:"task_action"`
Host string `json:"host"`
Role string `json:"role"`
TaskPath string `json:"task_path"`
}
EventData represents the awx api event data.
type EventInvocation ¶
type EventInvocation struct {
ModuleArgs *EventModuleArgs `json:"module_args"`
}
EventInvocation represents the awx api event invocation.
type EventModuleArgs ¶
type EventModuleArgs struct {
Creates interface{} `json:"creates"`
Executable interface{} `json:"executable"`
UsesShell bool `json:"_uses_shell"`
RawParams string `json:"_raw_params"`
Removes interface{} `json:"removes"`
Warn bool `json:"warn"`
Chdir string `json:"chdir"`
Stdin interface{} `json:"stdin"`
}
EventModuleArgs represents the awx api event module args.
type EventRes ¶
type EventRes struct {
AnsibleParsed bool `json:"_ansible_parsed"`
StderrLines []string `json:"stderr_lines"`
Changed bool `json:"changed"`
End string `json:"end"`
AnsibleNoLog bool `json:"_ansible_no_log"`
Stdout string `json:"stdout"`
Cmd string `json:"cmd"`
Start string `json:"start"`
Delta string `json:"delta"`
Stderr string `json:"stderr"`
Rc int `json:"rc"`
Invocation *EventInvocation `json:"invocation"`
StdoutLines []string `json:"stdout_lines"`
Warnings []string `json:"warnings"`
}
EventRes represents the awx api event response.
type HostSummariesResponse ¶
type HostSummariesResponse struct {
Pagination
Results []HostSummary `json:"results"`
}
HostSummariesResponse represents `JobHostSummaries` endpoint response.
type HostSummary ¶
type HostSummary struct {
ID int `json:"id"`
Type string `json:"type"`
URL string `json:"url"`
Related *Related `json:"related"`
SummaryFields *HostSummaryFields `json:"summary_fields"`
Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
Job int `json:"job"`
Host int `json:"host"`
HostName string `json:"host_name"`
Changed int `json:"changed"`
Dark int `json:"dark"`
Failures int `json:"failures"`
Ok int `json:"ok"`
Processed int `json:"processed"`
Skipped int `json:"skipped"`
Failed bool `json:"failed"`
}
HostSummary represents the awx api host summary.
type HostSummaryFields ¶
type HostSummaryFields struct {
Role map[string]string `json:"role"`
Host *HostSummaryHost `json:"host"`
Job *HostSummaryJob `json:"job"`
}
HostSummaryFields represents the awx api host summary fields.
type HostSummaryHost ¶
type HostSummaryHost struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
HasActiveFailures bool `json:"has_active_failures"`
HasInventorySources bool `json:"has_inventory_sources"`
}
HostSummaryHost represents the awx api host summary host fields.
type HostSummaryJob ¶
type HostSummaryJob struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
Failed bool `json:"failed"`
Elapsed float64 `json:"elapsed"`
JobTemplateID int `json:"job_template_id"`
JobTemplateName string `json:"job_template_name"`
}
HostSummaryJob represents the awx api host summary job fields.
type Instance ¶
type Instance struct {
Node string `json:"node"`
Heartbeat time.Time `json:"heartbeat"`
Version string `json:"version"`
Capacity int `json:"capacity"`
}
Instance represents the awx api instance.
type InstanceGroup ¶
type InstanceGroup struct {
Instances []string `json:"instances"`
Capacity int `json:"capacity"`
Name string `json:"name"`
}
InstanceGroup represents the awx api instance group.
type InstanceGroupSummary ¶
type InstanceGroupSummary struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
}
InstanceGroupSummary represents the awx api instance group summary fields.
type InventoriesService ¶
type InventoriesService struct {
// contains filtered or unexported fields
}
InventoriesService implements awx inventories apis.
func (*InventoriesService) CreateInventory ¶ added in v0.0.2
func (i *InventoriesService) CreateInventory(data map[string]interface{}, params map[string]string) (*Inventory, error)
CreateInventory creates an awx inventory.
func (*InventoriesService) ListInventories ¶
func (i *InventoriesService) ListInventories(params map[string]string) ([]*Inventory, *ListInventoriesResponse, error)
ListInventories shows list of awx inventories.
type Inventory ¶
type Inventory struct {
ID int `json:"id"`
Type string `json:"type"`
URL string `json:"url"`
Related *Related `json:"related"`
SummaryFields *Summary `json:"summary_fields"`
Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
Name string `json:"name"`
Description string `json:"description"`
Organization int `json:"organization"`
OrganizationID int `json:"organization_id"`
Kind string `json:"kind"`
HostFilter interface{} `json:"host_filter"`
Variables string `json:"variables"`
HasActiveFailures bool `json:"has_active_failures"`
TotalHosts int `json:"total_hosts"`
HostsWithActiveFailures int `json:"hosts_with_active_failures"`
TotalGroups int `json:"total_groups"`
GroupsWithActiveFailures int `json:"groups_with_active_failures"`
HasInventorySources bool `json:"has_inventory_sources"`
TotalInventorySources int `json:"total_inventory_sources"`
InventorySourcesWithFailures int `json:"inventory_sources_with_failures"`
InsightsCredential interface{} `json:"insights_credential"`
PendingDeletion bool `json:"pending_deletion"`
}
Inventory represents the awx api inventory.
type Job ¶
type Job struct {
ID int `json:"id"`
Type string `json:"type"`
URL string `json:"url"`
Related *Related `json:"related"`
SummaryFields *Summary `json:"summary_fields"`
Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
Name string `json:"name"`
Description string `json:"description"`
JobType string `json:"job_type"`
Inventory int `json:"inventory"`
Project int `json:"project"`
Playbook string `json:"playbook"`
Forks int `json:"forks"`
Limit string `json:"limit"`
Verbosity int `json:"verbosity"`
ExtraVars string `json:"extra_vars"`
JobTags string `json:"job_tags"`
ForceHandlers bool `json:"force_handlers"`
SkipTags string `json:"skip_tags"`
StartAtTask string `json:"start_at_task"`
Timeout int `json:"timeout"`
UseFactCache bool `json:"use_fact_cache"`
UnifiedJobTemplate int `json:"unified_job_template"`
LaunchType string `json:"launch_type"`
Status string `json:"status"`
Failed bool `json:"failed"`
Started time.Time `json:"started"`
Finished time.Time `json:"finished"`
Elapsed float64 `json:"elapsed"`
JobArgs string `json:"job_args"`
JobCwd string `json:"job_cwd"`
JobEnv map[string]string `json:"job_env"`
JobExplanation string `json:"job_explanation"`
ExecutionNode string `json:"execution_node"`
ResultTraceback string `json:"result_traceback"`
EventProcessingFinished bool `json:"event_processing_finished"`
JobTemplate int `json:"job_template"`
PasswordsNeededToStart []interface{} `json:"passwords_needed_to_start"`
AskDiffModeOnLaunch bool `json:"ask_diff_mode_on_launch"`
AskVariablesOnLaunch bool `json:"ask_variables_on_launch"`
AskLimitOnLaunch bool `json:"ask_limit_on_launch"`
AskTagsOnLaunch bool `json:"ask_tags_on_launch"`
AskSkipTagsOnLaunch bool `json:"ask_skip_tags_on_launch"`
AskJobTypeOnLaunch bool `json:"ask_job_type_on_launch"`
AskVerbosityOnLaunch bool `json:"ask_verbosity_on_launch"`
AskInventoryOnLaunch bool `json:"ask_inventory_on_launch"`
AskCredentialOnLaunch bool `json:"ask_credential_on_launch"`
AllowSimultaneous bool `json:"allow_simultaneous"`
Artifacts map[string]string `json:"artifacts"`
ScmRevision string `json:"scm_revision"`
InstanceGroup int `json:"instance_group"`
DiffMode bool `json:"diff_mode"`
Credential *Credential `json:"credential"`
VaultCredential interface{} `json:"vault_credential"`
}
Job represents the awx api job.
type JobEvent ¶
type JobEvent struct {
ID int `json:"id"`
Type string `json:"type"`
URL string `json:"url"`
Related *Related `json:"related"`
SummaryFields *HostSummaryFields `json:"summary_fields"`
Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
Job int `json:"job"`
Event string `json:"event"`
Counter int `json:"counter"`
EventDisplay string `json:"event_display"`
EventData *EventData `json:"event_data"`
EventLevel int `json:"event_level"`
Failed bool `json:"failed"`
Changed bool `json:"changed"`
UUID string `json:"uuid"`
ParentUUID string `json:"parent_uuid"`
// FIXME: inconsistent value type from tower API, int, null
Host interface{} `json:"host"`
HostName string `json:"host_name"`
Parent interface{} `json:"parent"`
Playbook string `json:"playbook"`
Play string `json:"play"`
Task string `json:"task"`
Role string `json:"role"`
Stdout string `json:"stdout"`
StartLine int `json:"start_line"`
EndLine int `json:"end_line"`
Verbosity int `json:"verbosity"`
}
JobEvent represents the awx api job event.
type JobEventsResponse ¶
type JobEventsResponse struct {
Pagination
Results []JobEvent `json:"results"`
}
JobEventsResponse represents `JobEvents` endpoint response.
type JobLaunch ¶
type JobLaunch struct {
Job int `json:"job"`
IgnoredFields map[string]string `json:"ignored_fields"`
ID int `json:"id"`
Type string `json:"type"`
URL string `json:"url"`
Related *Related `json:"related"`
SummaryFields *Summary `json:"summary_fields"`
Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
Name string `json:"name"`
Description string `json:"description"`
JobType string `json:"job_type"`
Inventory int `json:"inventory"`
Project int `json:"project"`
Playbook string `json:"playbook"`
Forks int `json:"forks"`
Limit string `json:"limit"`
Verbosity int `json:"verbosity"`
ExtraVars string `json:"extra_vars"`
JobTags string `json:"job_tags"`
ForceHandlers bool `json:"force_handlers"`
SkipTags string `json:"skip_tags"`
StartAtTask string `json:"start_at_task"`
Timeout int `json:"timeout"`
UseFactCache bool `json:"use_fact_cache"`
UnifiedJobTemplate int `json:"unified_job_template"`
LaunchType string `json:"launch_type"`
Status string `json:"status"`
Failed bool `json:"failed"`
Started interface{} `json:"started"`
Finished interface{} `json:"finished"`
Elapsed int `json:"elapsed"`
JobArgs string `json:"job_args"`
JobCwd string `json:"job_cwd"`
JobEnv map[string]string `json:"job_env"`
JobExplanation string `json:"job_explanation"`
ExecutionNode string `json:"execution_node"`
ResultTraceback string `json:"result_traceback"`
EventProcessingFinished bool `json:"event_processing_finished"`
JobTemplate int `json:"job_template"`
PasswordsNeededToStart []interface{} `json:"passwords_needed_to_start"`
AskDiffModeOnLaunch bool `json:"ask_diff_mode_on_launch"`
AskVariablesOnLaunch bool `json:"ask_variables_on_launch"`
AskLimitOnLaunch bool `json:"ask_limit_on_launch"`
AskTagsOnLaunch bool `json:"ask_tags_on_launch"`
AskSkipTagsOnLaunch bool `json:"ask_skip_tags_on_launch"`
AskJobTypeOnLaunch bool `json:"ask_job_type_on_launch"`
AskVerbosityOnLaunch bool `json:"ask_verbosity_on_launch"`
AskInventoryOnLaunch bool `json:"ask_inventory_on_launch"`
AskCredentialOnLaunch bool `json:"ask_credential_on_launch"`
AllowSimultaneous bool `json:"allow_simultaneous"`
Artifacts map[string]string `json:"artifacts"`
ScmRevision string `json:"scm_revision"`
InstanceGroup interface{} `json:"instance_group"`
DiffMode bool `json:"diff_mode"`
Credential int `json:"credential"`
VaultCredential interface{} `json:"vault_credential"`
}
JobLaunch represents the awx api job launch.
type JobService ¶
type JobService struct {
// contains filtered or unexported fields
}
JobService implements awx job apis.
func (*JobService) CancelJob ¶
func (j *JobService) CancelJob(id int, data map[string]interface{}, params map[string]string) (*CancelJobResponse, error)
CancelJob cancels a job.
func (*JobService) GetHostSummaries ¶
func (j *JobService) GetHostSummaries(id int, params map[string]string) ([]HostSummary, *HostSummariesResponse, error)
GetHostSummaries get a job hosts summaries.
func (*JobService) GetJobEvents ¶
func (j *JobService) GetJobEvents(id int, params map[string]string) ([]JobEvent, *JobEventsResponse, error)
GetJobEvents get a list of job events.
func (*JobService) RelaunchJob ¶
func (j *JobService) RelaunchJob(id int, data map[string]interface{}, params map[string]string) (*JobLaunch, error)
RelaunchJob relaunch a job.
type JobTemplate ¶
type JobTemplate struct {
ID int `json:"id"`
Type string `json:"type"`
URL string `json:"url"`
Related *Related `json:"related"`
SummaryFields *Summary `json:"summary_fields"`
Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
Name string `json:"name"`
Description string `json:"description"`
JobType string `json:"job_type"`
Inventory int `json:"inventory"`
Project int `json:"project"`
Playbook string `json:"playbook"`
Forks int `json:"forks"`
Limit string `json:"limit"`
Verbosity int `json:"verbosity"`
ExtraVars string `json:"extra_vars"`
JobTags string `json:"job_tags"`
ForceHandlers bool `json:"force_handlers"`
SkipTags string `json:"skip_tags"`
StartAtTask string `json:"start_at_task"`
Timeout int `json:"timeout"`
UseFactCache bool `json:"use_fact_cache"`
LastJobRun interface{} `json:"last_job_run"`
LastJobFailed bool `json:"last_job_failed"`
NextJobRun interface{} `json:"next_job_run"`
Status string `json:"status"`
HostConfigKey string `json:"host_config_key"`
AskDiffModeOnLaunch bool `json:"ask_diff_mode_on_launch"`
AskVariablesOnLaunch bool `json:"ask_variables_on_launch"`
AskLimitOnLaunch bool `json:"ask_limit_on_launch"`
AskTagsOnLaunch bool `json:"ask_tags_on_launch"`
AskSkipTagsOnLaunch bool `json:"ask_skip_tags_on_launch"`
AskJobTypeOnLaunch bool `json:"ask_job_type_on_launch"`
AskVerbosityOnLaunch bool `json:"ask_verbosity_on_launch"`
AskInventoryOnLaunch bool `json:"ask_inventory_on_launch"`
AskCredentialOnLaunch bool `json:"ask_credential_on_launch"`
SurveyEnabled bool `json:"survey_enabled"`
BecomeEnabled bool `json:"become_enabled"`
DiffMode bool `json:"diff_mode"`
AllowSimultaneous bool `json:"allow_simultaneous"`
CustomVirtualenv interface{} `json:"custom_virtualenv"`
Credential int `json:"credential"`
VaultCredential interface{} `json:"vault_credential"`
}
JobTemplate represents the awx api job template.
type JobTemplateService ¶
type JobTemplateService struct {
// contains filtered or unexported fields
}
JobTemplateService implements awx job template apis.
func (*JobTemplateService) Launch ¶
func (jt *JobTemplateService) Launch(id int, data map[string]interface{}, params map[string]string) (*JobLaunch, error)
Launch lauchs a job with the job template.
func (*JobTemplateService) ListJobTemplates ¶
func (jt *JobTemplateService) ListJobTemplates(params map[string]string) ([]*JobTemplate, *ListJobTemplatesResponse, error)
ListJobTemplates shows a list of job templates.
type JobTemplateSummary ¶
type JobTemplateSummary struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
}
JobTemplateSummary represents the awx api job template summary fields.
type Labels ¶
type Labels struct {
Count int `json:"count"`
Results []interface{} `json:"results"`
}
Labels represents the awx api labels.
type ListInventoriesResponse ¶
type ListInventoriesResponse struct {
Pagination
Results []*Inventory `json:"results"`
}
ListInventoriesResponse represents `ListInventories` endpoint response.
type ListJobTemplatesResponse ¶
type ListJobTemplatesResponse struct {
Pagination
Results []*JobTemplate `json:"results"`
}
ListJobTemplatesResponse represents `ListJobTemplates` endpoint response.
type ObjectRoles ¶
type ObjectRoles struct {
UseRole *ApplyRole `json:"use_role"`
AdminRole *ApplyRole `json:"admin_role"`
AdhocRole *ApplyRole `json:"adhoc_role"`
UpdateRole *ApplyRole `json:"update_role"`
ReadRole *ApplyRole `json:"read_role"`
ExecuteRole *ApplyRole `json:"execute_role"`
}
ObjectRoles represents the awx api object roles.
type OrgnizationSummary ¶
type OrgnizationSummary struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
}
OrgnizationSummary represents the awx api orgnization summary fields.
type Pagination ¶
type Pagination struct {
Count int `json:"count"`
Next interface{} `json:"next"`
Previous interface{} `json:"previous"`
}
Pagination represents the awx api pagination params.
type Ping ¶
type Ping struct {
Instances []Instance `json:"instances"`
InstanceGroups []InstanceGroup `json:"instance_groups"`
Ha bool `json:"ha"`
Version string `json:"version"`
ActiveNode string `json:"active_node"`
}
Ping represents the awx api ping.
type PingService ¶
type PingService struct {
// contains filtered or unexported fields
}
PingService implements awx ping apis.
func (*PingService) Ping ¶
func (p *PingService) Ping() (*Ping, error)
Ping do ping with awx servers.
type Project ¶
type Project struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
ScmType string `json:"scm_type"`
}
Project represents the awx api project.
type ProjectUpdate ¶
type ProjectUpdate struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
Failed bool `json:"failed"`
}
ProjectUpdate represents the awx api project update.
type Related ¶
type Related struct {
NamedURL string `json:"named_url"`
CreatedBy string `json:"created_by"`
ModifiedBy string `json:"modified_by"`
JobTemplates string `json:"job_templates"`
VariableData string `json:"variable_data"`
RootGroups string `json:"root_groups"`
ObjectRoles string `json:"object_roles"`
AdHocCommands string `json:"ad_hoc_commands"`
Script string `json:"script"`
Tree string `json:"tree"`
AccessList string `json:"access_list"`
ActivityStream string `json:"activity_stream"`
InstanceGroups string `json:"instance_groups"`
Hosts string `json:"hosts"`
Job string `json:"job"`
Host string `json:"host"`
Groups string `json:"groups"`
Copy string `json:"copy"`
UpdateInventorySources string `json:"update_inventory_sources"`
InventorySources string `json:"inventory_sources"`
Organization string `json:"organization"`
Labels string `json:"labels"`
Inventory string `json:"inventory"`
Project string `json:"project"`
Credential string `json:"credential"`
ExtraCredentials string `json:"extra_credentials"`
Credentials string `json:"credentials"`
NotificationTemplatesError string `json:"notification_templates_error"`
NotificationTemplatesSuccess string `json:"notification_templates_success"`
Jobs string `json:"jobs"`
NotificationTemplatesAny string `json:"notification_templates_any"`
Launch string `json:"launch"`
Schedules string `json:"schedules"`
SurveySpec string `json:"survey_spec"`
UnifiedJobTemplate string `json:"unified_job_template"`
Stdout string `json:"stdout"`
Notifications string `json:"notifications"`
JobHostSummaries string `json:"job_host_summaries"`
JobEvents string `json:"job_events"`
JobTemplate string `json:"job_template"`
Cancel string `json:"cancel"`
ProjectUpdate string `json:"project_update"`
CreateSchedule string `json:"create_schedule"`
Relaunch string `json:"relaunch"`
}
Related represents the awx api related field.
type Requester ¶
Requester implemented a base http client. It supports do POST/GET via an human-readable way, in other word, all data is in `application/json` format. It also originally supports basic auth. For production usage, It would be better to wrapper an another rest client on this requester.
func (*Requester) Do ¶
func (r *Requester) Do(ar *APIRequest, responseStruct interface{}, options ...interface{}) (*http.Response, error)
Do do the actual http request.
func (*Requester) Get ¶
func (r *Requester) Get(endpoint string, responseStruct interface{}, querystring map[string]string) (*http.Response, error)
Get performs http get request.
func (*Requester) GetJSON ¶
func (r *Requester) GetJSON(endpoint string, responseStruct interface{}, query map[string]string) (*http.Response, error)
GetJSON performs http get request with json response.
func (*Requester) Post ¶
func (r *Requester) Post(endpoint string, payload io.Reader, responseStruct interface{}, querystring map[string]string) (*http.Response, error)
Post performs http post request.
func (*Requester) PostJSON ¶
func (r *Requester) PostJSON(endpoint string, payload io.Reader, responseStruct interface{}, querystring map[string]string) (*http.Response, error)
PostJSON performs http post request with json response.
type Summary ¶
type Summary struct {
InstanceGroup *InstanceGroupSummary `json:"instance_group"`
Organization *OrgnizationSummary `json:"organization"`
CreatedBy *ByUserSummary `json:"created_by"`
ModifiedBy *ByUserSummary `json:"modified_by"`
ObjectRoles *ObjectRoles `json:"object_roles"`
UserCapabilities *UserCapabilities `json:"user_capabilities"`
Project *Project `json:"project"`
Inventory *Inventory `json:"inventory"`
RecentJobs []interface{} `json:"recent_jobs"`
Credentials []Credential `json:"credentials"`
Credential *Credential `json:"credential"`
Labels *Labels `json:"labels"`
JobTemplate *JobTemplateSummary `json:"job_template"`
UnifiedJobTemplate *UnifiedJobTemplate `json:"unified_job_template"`
ExtraCredentials []interface{} `json:"extra_credentials"`
ProjectUpdate *ProjectUpdate `json:"project_update"`
}
Summary represents the awx api summary fields.