awx

package
v1.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package awx provides a client for using the Ansible Tower / AWX REST API.

Index

Constants

View Source
const (
	JobStatusNew        = "new"
	JobStatusPending    = "pending"
	JobStatusWaiting    = "waiting"
	JobStatusRunning    = "running"
	JobStatusSuccessful = "successful"
	JobStatusFailed     = "failed"
	JobStatusError      = "error"
	JobStatusCanceled   = "canceled"
)

Enum of job statuses.

View Source
const InstanceGroupsAPIEndpoint = "/api/v2/instance_groups/"

InstanceGroupsAPIEndpoint represents the endpoint for the InstanceGroups.

Variables

This section is empty.

Functions

func CheckResponse

func CheckResponse(resp *http.Response) error

CheckResponse do http response check, and return err if not in [200, 300).

func ValidateParams

func ValidateParams(data map[string]interface{}, mandatoryFields []string) (notfound []string, status bool)

ValidateParams is to validate the input to use the services.

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 {
	ApplicationService                              *ApplicationService
	ExecutionEnvironmentsService                    *ExecutionEnvironmentsService
	PingService                                     *PingService
	InventoriesService                              *InventoriesService
	JobService                                      *JobService
	JobTemplateService                              *JobTemplateService
	JobTemplateNotificationTemplatesService         *JobTemplateNotificationTemplatesService
	ProjectService                                  *ProjectService
	ProjectUpdatesService                           *ProjectUpdatesService
	UserService                                     *UserService
	GroupService                                    *GroupService
	HostService                                     *HostService
	CredentialsService                              *CredentialsService
	CredentialTypeService                           *CredentialTypeService
	CredentialInputSourceService                    *CredentialInputSourceService
	InventorySourcesService                         *InventorySourcesService
	InventoryGroupService                           *InventoryGroupService
	InstanceGroupsService                           *InstanceGroupsService
	NotificationTemplatesService                    *NotificationTemplatesService
	OrganizationsService                            *OrganizationsService
	ScheduleService                                 *SchedulesService
	SettingService                                  *SettingService
	TeamService                                     *TeamService
	WorkflowJobTemplateScheduleService              *WorkflowJobTemplateScheduleService
	WorkflowJobTemplateService                      *WorkflowJobTemplateService
	WorkflowJobTemplateNodeService                  *WorkflowJobTemplateNodeService
	WorkflowJobTemplateNodeAlwaysService            *WorkflowJobTemplateNodeStepService
	WorkflowJobTemplateNodeFailureService           *WorkflowJobTemplateNodeStepService
	WorkflowJobTemplateNodeSuccessService           *WorkflowJobTemplateNodeStepService
	WorkflowJobTemplateNotificationTemplatesService *WorkflowJobTemplateNotificationTemplatesService
	// contains filtered or unexported fields
}

AWX represents awx api endpoints with services, and using client to communicate with awx server.

func NewAWX

func NewAWX(baseURL, userName, passwd string, client *http.Client) (*AWX, error)

NewAWX news an awx handler with basic auth support, you could customize the http transport by passing custom client.

func NewAWXToken

func NewAWXToken(baseURL, token string, client *http.Client) (*AWX, error)

NewAWXToken creates an AWX handler with token support.

type Application

type Application struct {
	Name                   string   `json:"name"`
	ID                     int      `json:"id"`
	Type                   string   `json:"type"`
	URL                    string   `json:"url"`
	Related                *Related `json:"related"`
	Description            string   `json:"description"`
	ClientID               string   `json:"client_id"`
	ClientSecret           string   `json:"client_secret"`
	ClientType             string   `json:"client_type"`
	RedirectURIs           string   `json:"redirect_uris"`
	AuthorizationGrantType string   `json:"authorization_grant_type"`
	SkipAuthorization      bool     `json:"skip_authorization"`
	OrganizationID         int      `json:"organization"`
}

Application represents the awx api application.

type ApplicationService

type ApplicationService struct {
	// contains filtered or unexported fields
}

ApplicationService implements awx application api endpoints.

func (*ApplicationService) CreateApplication

func (c *ApplicationService) CreateApplication(data map[string]interface{}, params map[string]string) (*Application, error)

CreateApplication creates an awx authentication application.

func (*ApplicationService) DeleteApplication

func (c *ApplicationService) DeleteApplication(id int) (*Application, error)

DeleteApplication delete an awx application.

func (*ApplicationService) GetApplicationByID

func (c *ApplicationService) GetApplicationByID(id int, params map[string]string) (*Application, error)

GetApplicationByID shows an of awx application by its ID.

func (*ApplicationService) ListApplication

func (c *ApplicationService) ListApplication(params map[string]string) ([]*Application, *ListApplicationResponse, error)

ListApplication shows list of awx authentication applications.

func (*ApplicationService) UpdateApplication

func (c *ApplicationService) UpdateApplication(id int, data map[string]interface{}, _ map[string]string) (*Application, error)

UpdateApplication update an awx application.

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 AssociateGroup

type AssociateGroup struct {
	ID        int  `json:"id"`
	Associate bool `json:"associate"`
}

AssociateGroup implement the awx group association request.

type Authenticator

type Authenticator interface {
	// contains filtered or unexported methods
}

Authenticator represents an authentication interface.

type BasicAuth

type BasicAuth struct {
	Username string
	Password string
}

BasicAuth represents http basic auth.

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 Client

type Client struct {
	BaseURL   string
	Requester *Requester
}

Client implement http client.

type Credential

type Credential struct {
	Description      string                 `json:"description"`
	ID               int                    `json:"id"`
	Kind             string                 `json:"kind"`
	Name             string                 `json:"name"`
	OrganizationID   int                    `json:"organization"`
	CredentialTypeID int                    `json:"credential_type"`
	Inputs           map[string]interface{} `json:"inputs"`
	SummaryFields    *Summary               `json:"summary_fields"`
}

Credential represents the awx api credential.

type CredentialInputSource

type CredentialInputSource struct {
	ID               int                    `json:"id"`
	Description      string                 `json:"description"`
	TargetCredential int                    `json:"target_credential"`
	SourceCredential int                    `json:"source_credential"`
	InputFieldName   string                 `json:"input_field_name"`
	SummaryFields    *Summary               `json:"summary_fields"`
	Metadata         map[string]interface{} `json:"metadata"`
}

CredentialInputSource represents the awx api input source.

type CredentialInputSourceService

type CredentialInputSourceService struct {
	// contains filtered or unexported fields
}

CredentialInputSourceService implements awx credential input source api endpoints.

func (*CredentialInputSourceService) CreateCredentialInputSource

func (cs *CredentialInputSourceService) CreateCredentialInputSource(data map[string]interface{}, params map[string]string) (*CredentialInputSource, error)

CreateCredentialInputSource creates an awx credential input source.

func (*CredentialInputSourceService) DeleteCredentialInputSourceByID

func (cs *CredentialInputSourceService) DeleteCredentialInputSourceByID(id int, params map[string]string) error

DeleteCredentialInputSourceByID : Deletes an input source by ID.

func (*CredentialInputSourceService) GetCredentialInputSourceByID

func (cs *CredentialInputSourceService) GetCredentialInputSourceByID(id int, params map[string]string) (*CredentialInputSource, error)

GetCredentialInputSourceByID : Gets a specific input source by ID.

func (*CredentialInputSourceService) ListCredentialInputSources

ListCredentialInputSources shows list of awx credential input sources.

func (*CredentialInputSourceService) UpdateCredentialInputSourceByID

func (cs *CredentialInputSourceService) UpdateCredentialInputSourceByID(id int, data map[string]interface{},
	params map[string]string) (*CredentialInputSource, error)

UpdateCredentialInputSourceByID : Updates an input source by ID.

type CredentialType

type CredentialType struct {
	ID          int         `json:"ID"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Kind        string      `json:"kind"`
	Inputs      interface{} `json:"inputs"`
	Injectors   interface{} `json:"injectors"`
}

CredentialType represents the awx api credential type.

type CredentialTypeService

type CredentialTypeService struct {
	// contains filtered or unexported fields
}

CredentialTypeService implements awx CredentialType apis.

func (*CredentialTypeService) CreateCredentialType

func (cs *CredentialTypeService) CreateCredentialType(data map[string]interface{}, params map[string]string) (*CredentialType, error)

CreateCredentialType : Creates a new credential type in AWX.

func (*CredentialTypeService) DeleteCredentialTypeByID

func (cs *CredentialTypeService) DeleteCredentialTypeByID(id int, params map[string]string) error

DeleteCredentialTypeByID : Deletes a credential type by ID.

func (*CredentialTypeService) GetCredentialTypeByID

func (cs *CredentialTypeService) GetCredentialTypeByID(id int, params map[string]string) (*CredentialType, error)

GetCredentialTypeByID : Fetches a credential type by ID.

func (*CredentialTypeService) GetCredentialTypeByName added in v1.1.2

func (cs *CredentialTypeService) GetCredentialTypeByName(name string, params map[string]string) (*CredentialType, error)

GetCredentialTypeByName : Fetches a credential type by Name.

func (*CredentialTypeService) ListCredentialTypes

func (cs *CredentialTypeService) ListCredentialTypes(params map[string]string) ([]*CredentialType, error)

ListCredentialTypes shows list of awx CredentialTypes.

func (*CredentialTypeService) UpdateCredentialTypeByID

func (cs *CredentialTypeService) UpdateCredentialTypeByID(id int, data map[string]interface{}, params map[string]string) (*CredentialType, error)

UpdateCredentialTypeByID : Updates a credential type by ID.

type CredentialsService

type CredentialsService struct {
	// contains filtered or unexported fields
}

CredentialsService implements awx credentials apis.

func (*CredentialsService) CreateCredentials

func (cs *CredentialsService) CreateCredentials(data map[string]interface{}, params map[string]string) (*Credential, error)

CreateCredentials : Creates a new credential in AWX.

func (*CredentialsService) DeleteCredentialsByID

func (cs *CredentialsService) DeleteCredentialsByID(id int, params map[string]string) error

DeleteCredentialsByID : Deletes a credential by ID.

func (*CredentialsService) GetCredentialsByID

func (cs *CredentialsService) GetCredentialsByID(id int, params map[string]string) (*Credential, error)

GetCredentialsByID : Fetches a credential by ID.

func (*CredentialsService) ListCredentials

func (cs *CredentialsService) ListCredentials(params map[string]string) ([]*Credential, error)

ListCredentials : List all credentials.

func (*CredentialsService) UpdateCredentialsByID

func (cs *CredentialsService) UpdateCredentialsByID(id int, data map[string]interface{},
	params map[string]string) (*Credential, error)

UpdateCredentialsByID : Updates a credential by ID.

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 ExecutionEnvironment

type ExecutionEnvironment 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"`
	Image         string    `json:"image"`
	Managed       bool      `json:"managed"`
	Credential    int       `json:"credential"`
	Pull          string    `json:"pull"`
}

ExecutionEnvironment represents the awx api execution environment summary fields.

type ExecutionEnvironmentSummary

type ExecutionEnvironmentSummary struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Image       string `json:"image"`
}

ExecutionEnvironmentSummary represents the awx api instance group summary fields.

type ExecutionEnvironmentsService

type ExecutionEnvironmentsService struct {
	// contains filtered or unexported fields
}

ExecutionEnvironmentsService implements awx execution environments apis.

func (*ExecutionEnvironmentsService) CreateExecutionEnvironment

func (p *ExecutionEnvironmentsService) CreateExecutionEnvironment(data map[string]interface{}, params map[string]string) (*ExecutionEnvironment, error)

CreateExecutionEnvironment creates an awx ExecutionEnvironment.

func (*ExecutionEnvironmentsService) DeleteExecutionEnvironment

func (p *ExecutionEnvironmentsService) DeleteExecutionEnvironment(id int) (*ExecutionEnvironment, error)

DeleteExecutionEnvironment delete an awx ExecutionEnvironment.

func (*ExecutionEnvironmentsService) GetExecutionEnvironmentByID

func (p *ExecutionEnvironmentsService) GetExecutionEnvironmentByID(id int, params map[string]string) (*ExecutionEnvironment, error)

GetExecutionEnvironmentByID shows the details of a ExecutionEnvironment.

func (*ExecutionEnvironmentsService) ListExecutionEnvironments

ListExecutionEnvironments shows list of awx execution environments.

func (*ExecutionEnvironmentsService) UpdateExecutionEnvironment

func (p *ExecutionEnvironmentsService) UpdateExecutionEnvironment(id int, data map[string]interface{}, _ map[string]string) (*ExecutionEnvironment, error)

UpdateExecutionEnvironment update an awx ExecutionEnvironment.

type Group

type Group 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"`
	Inventory                int       `json:"inventory"`
	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"`
}

Group represents a group

type GroupService

type GroupService struct {
	// contains filtered or unexported fields
}

GroupService implements awx Groups apis.

func (*GroupService) CreateGroup

func (g *GroupService) CreateGroup(data map[string]interface{}, params map[string]string) (*Group, error)

CreateGroup creates an awx Group.

func (*GroupService) DeleteGroup

func (g *GroupService) DeleteGroup(id int) (*Group, error)

DeleteGroup delete an awx Group.

func (*GroupService) GetGroupByID

func (g *GroupService) GetGroupByID(id int, params map[string]string) (*Group, error)

GetGroupByID shows the details of a awx group.

func (*GroupService) ListGroups

func (g *GroupService) ListGroups(params map[string]string) ([]*Group, *ListGroupsResponse, error)

ListGroups shows list of awx Groups.

func (*GroupService) UpdateGroup

func (g *GroupService) UpdateGroup(id int, data map[string]interface{}, _ map[string]string) (*Group, error)

UpdateGroup update an awx group.

type Groups

type Groups struct {
	Count   int      `json:"count"`
	Results []Result `json:"results"`
}

Groups represents the awx api hosts group list.

type Host

type Host 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"`
	Inventory            int         `json:"inventory"`
	Enabled              bool        `json:"enabled"`
	InstanceID           string      `json:"instance_id"`
	Variables            string      `json:"variables"`
	HasActiveFailures    bool        `json:"has_active_failures"`
	HasInventorySources  bool        `json:"has_inventory_sources"`
	LastJob              int         `json:"last_job"`
	LastJobHostSummary   int         `json:"last_job_host_summary"`
	InsightsSystemID     string      `json:"insights_system_id"`
	AnsibleFactsModified interface{} `json:"ansible_facts_modified"`
}

Host represents a host

type HostService

type HostService struct {
	// contains filtered or unexported fields
}

HostService implements awx Hosts apis.

func (*HostService) AssociateGroup

func (h *HostService) AssociateGroup(id int, data map[string]interface{}, _ map[string]string) (*Host, error)

AssociateGroup update an awx Host.

func (*HostService) CreateHost

func (h *HostService) CreateHost(data map[string]interface{}, params map[string]string) (*Host, error)

CreateHost creates an awx Host.

func (*HostService) DeleteHost

func (h *HostService) DeleteHost(id int) (*Host, error)

DeleteHost delete an awx Host.

func (*HostService) DisAssociateGroup

func (h *HostService) DisAssociateGroup(id int, data map[string]interface{}, _ map[string]string) (*Host, error)

DisAssociateGroup update an awx Host.

func (*HostService) GetHostByID

func (h *HostService) GetHostByID(id int, params map[string]string) (*Host, error)

GetHostByID shows the details of a awx inventroy sources.

func (*HostService) ListHosts

func (h *HostService) ListHosts(params map[string]string) ([]*Host, *ListHostsResponse, error)

ListHosts shows list of awx Hosts.

func (*HostService) UpdateHost

func (h *HostService) UpdateHost(id int, data map[string]interface{}, _ map[string]string) (*Host, error)

UpdateHost update an awx Host.

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 {
	ID               int    `json:"id"`
	Capacity         int    `json:"capacity"`
	CredentialID     int    `json:"credential"` //nolint:golint,stylecheck
	Name             string `json:"name"`
	IsContainerGroup bool   `json:"is_container_group"`
	PodSpecOverride  string `json:"pod_spec_override"`
}

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 InstanceGroupsService

type InstanceGroupsService struct {
	// contains filtered or unexported fields
}

InstanceGroupsService implements awx execution environments apis.

func (*InstanceGroupsService) CreateInstanceGroup

func (p *InstanceGroupsService) CreateInstanceGroup(data map[string]interface{}, params map[string]string) (*InstanceGroup, error)

CreateInstanceGroup creates an awx InstanceGroup.

func (*InstanceGroupsService) DeleteInstanceGroup

func (p *InstanceGroupsService) DeleteInstanceGroup(id int) (*InstanceGroup, error)

DeleteInstanceGroup delete an awx InstanceGroup.

func (*InstanceGroupsService) GetInstanceGroupByID

func (p *InstanceGroupsService) GetInstanceGroupByID(id int, params map[string]string) (*InstanceGroup, error)

GetInstanceGroupByID shows the details of a InstanceGroup.

func (*InstanceGroupsService) ListInstanceGroups

func (p *InstanceGroupsService) ListInstanceGroups(params map[string]string) ([]*InstanceGroup, *ListInstanceGroupsResponse, error)

ListInstanceGroups shows list of awx execution environments.

func (*InstanceGroupsService) UpdateInstanceGroup

func (p *InstanceGroupsService) UpdateInstanceGroup(id int, data map[string]interface{}, _ map[string]string) (*InstanceGroup, error)

UpdateInstanceGroup update an awx InstanceGroup.

type InventoriesService

type InventoriesService struct {
	// contains filtered or unexported fields
}

InventoriesService implements awx inventories apis.

func (*InventoriesService) AssociateInstanceGroups added in v1.1.1

func (i *InventoriesService) AssociateInstanceGroups(id int, data map[string]interface{}, _ map[string]string) (*Inventory, error)

AssociateInstanceGroups adding InstanceGroup to Inventory.

func (*InventoriesService) CreateInventory

func (i *InventoriesService) CreateInventory(data map[string]interface{}, params map[string]string) (*Inventory, error)

CreateInventory creates an awx inventory.

func (*InventoriesService) DeleteInventory

func (i *InventoriesService) DeleteInventory(id int) (*Inventory, error)

DeleteInventory delete an inventory from AWX.

func (*InventoriesService) DisAssociateInstanceGroups added in v1.1.1

func (i *InventoriesService) DisAssociateInstanceGroups(id int, data map[string]interface{}, _ map[string]string) (*Inventory, error)

DisAssociateInstanceGroups remove InstanceGroup from an awx Inventory.

func (*InventoriesService) GetInventory

func (i *InventoriesService) GetInventory(id int, _ map[string]string) (*Inventory, error)

GetInventory retrieves the inventory information from its ID or Name.

func (*InventoriesService) GetInventoryByID

func (i *InventoriesService) GetInventoryByID(id int, params map[string]string) (*Inventory, error)

GetInventoryByID shows the details of a awx inventroy sources.

func (*InventoriesService) ListInventories

func (i *InventoriesService) ListInventories(params map[string]string) ([]*Inventory, *ListInventoriesResponse, error)

ListInventories shows list of awx inventories.

func (*InventoriesService) UpdateInventory

func (i *InventoriesService) UpdateInventory(id int, data map[string]interface{}, _ map[string]string) (*Inventory, error)

UpdateInventory update an awx inventory.

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 InventoryGroupService

type InventoryGroupService struct {
	// contains filtered or unexported fields
}

InventoryGroupService implements awx inventory group apis.

func (*InventoryGroupService) ListInventoryGroups

func (i *InventoryGroupService) ListInventoryGroups(id int, params map[string]string) ([]*Group, *ListGroupsResponse, error)

ListInventoryGroups shows list of awx groups in some inventory.

type InventorySource

type InventorySource struct {
	Created               time.Time   `json:"created"`
	Credential            interface{} `json:"credential"`
	CustomVirtualenv      interface{} `json:"custom_virtualenv"`
	Description           string      `json:"description"`
	GroupBy               string      `json:"group_by"`
	ID                    int         `json:"id"`
	EnabledVar            string      `json:"enabled_var"`
	EnabledValue          string      `json:"enabled_value"`
	ExecutionEnvironment  int         `json:"execution_environment"`
	InstanceFilters       string      `json:"instance_filters"`
	HostFilter            string      `json:"host_filter"`
	Inventory             int         `json:"inventory"`
	LastJobFailed         bool        `json:"last_job_failed"`
	LastJobRun            interface{} `json:"last_job_run"`
	LastUpdateFailed      bool        `json:"last_update_failed"`
	LastUpdated           interface{} `json:"last_updated"`
	Modified              time.Time   `json:"modified"`
	Name                  string      `json:"name"`
	NextJobRun            interface{} `json:"next_job_run"`
	Overwrite             bool        `json:"overwrite"`
	OverwriteVars         bool        `json:"overwrite_vars"`
	Related               *Related    `json:"related"`
	Source                string      `json:"source"`
	SourcePath            string      `json:"source_path"`
	SourceProject         int         `json:"source_project"`
	SourceRegions         string      `json:"source_regions"`
	SourceScript          interface{} `json:"source_script"`
	SourceVars            string      `json:"source_vars"`
	Status                string      `json:"status"`
	SummaryFields         *Summary    `json:"summary_fields"`
	Timeout               int         `json:"timeout"`
	Type                  string      `json:"type"`
	UpdateCacheTimeout    int         `json:"update_cache_timeout"`
	UpdateOnLaunch        bool        `json:"update_on_launch"`
	UpdateOnProjectUpdate bool        `json:"update_on_project_update"`
	URL                   string      `json:"url"`
	Verbosity             int         `json:"verbosity"`
}

InventorySource represents the awx api inventory source.

type InventorySourcesService

type InventorySourcesService struct {
	// contains filtered or unexported fields
}

InventorySourcesService implements awx inventory sources apis.

func (*InventorySourcesService) CreateInventorySource

func (i *InventorySourcesService) CreateInventorySource(data map[string]interface{}, params map[string]string) (*InventorySource, error)

CreateInventorySource creates an awx InventorySource.

func (*InventorySourcesService) DeleteInventorySource

func (i *InventorySourcesService) DeleteInventorySource(id int) (*InventorySource, error)

DeleteInventorySource delete an InventorySource from AWX.

func (*InventorySourcesService) GetInventorySource

func (i *InventorySourcesService) GetInventorySource(id int, _ map[string]string) (*InventorySource, error)

GetInventorySource retrieves the InventorySource information from its ID or Name.

func (*InventorySourcesService) GetInventorySourceByID

func (i *InventorySourcesService) GetInventorySourceByID(id int, params map[string]string) (*InventorySource, error)

GetInventorySourceByID shows the details of a awx inventory sources.

func (*InventorySourcesService) ListInventorySources

func (i *InventorySourcesService) ListInventorySources(params map[string]string) ([]*InventorySource, *ListInventorySourcesResponse, error)

ListInventorySources shows list of awx inventories.

func (*InventorySourcesService) UpdateInventorySource

func (i *InventorySourcesService) UpdateInventorySource(id int, data map[string]interface{}, _ map[string]string) (*InventorySource, error)

UpdateInventorySource update an awx InventorySource.

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              int               `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"`

	// Host : Host description
	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                 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           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) GetJob

func (j *JobService) GetJob(id int, params map[string]string) (*Job, error)

GetJob shows the details of a job.

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"`
	JobSliceCount         int         `json:"job_slice_count"`
	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"`
	ExecutionEnvironment  int         `json:"execution_environment"`
}

JobTemplate represents the awx api job template.

type JobTemplateNotificationTemplatesService

type JobTemplateNotificationTemplatesService struct {
	// contains filtered or unexported fields
}

JobTemplateNotificationTemplatesService implements awx job template nodes apis.

func (*JobTemplateNotificationTemplatesService) AssociateJobTemplateNotificationTemplatesError

func (jt *JobTemplateNotificationTemplatesService) AssociateJobTemplateNotificationTemplatesError(jobTemplateID int, notificationTemplateID int) (*NotificationTemplate, error)

AssociateJobTemplateNotificationTemplatesError will associate an error notification_template for a job_template.

func (*JobTemplateNotificationTemplatesService) AssociateJobTemplateNotificationTemplatesStarted

func (jt *JobTemplateNotificationTemplatesService) AssociateJobTemplateNotificationTemplatesStarted(jobTemplateID int, notificationTemplateID int) (*NotificationTemplate, error)

AssociateJobTemplateNotificationTemplatesStarted will associate a started notification_template for a job_template.

func (*JobTemplateNotificationTemplatesService) AssociateJobTemplateNotificationTemplatesSuccess

func (jt *JobTemplateNotificationTemplatesService) AssociateJobTemplateNotificationTemplatesSuccess(jobTemplateID int, notificationTemplateID int) (*NotificationTemplate, error)

AssociateJobTemplateNotificationTemplatesSuccess will associate a success notification_template for a job_template.

func (*JobTemplateNotificationTemplatesService) DisassociateJobTemplateNotificationTemplatesError

func (jt *JobTemplateNotificationTemplatesService) DisassociateJobTemplateNotificationTemplatesError(jobTemplateID int, notificationTemplateID int) (*NotificationTemplate, error)

DisassociateJobTemplateNotificationTemplatesError will disassociate an error notification_template for a job_template.

func (*JobTemplateNotificationTemplatesService) DisassociateJobTemplateNotificationTemplatesStarted

func (jt *JobTemplateNotificationTemplatesService) DisassociateJobTemplateNotificationTemplatesStarted(jobTemplateID int, notificationTemplateID int) (*NotificationTemplate, error)

DisassociateJobTemplateNotificationTemplatesStarted will disassociate a started notification_template for a job_template.

func (*JobTemplateNotificationTemplatesService) DisassociateJobTemplateNotificationTemplatesSuccess

func (jt *JobTemplateNotificationTemplatesService) DisassociateJobTemplateNotificationTemplatesSuccess(jobTemplateID int, notificationTemplateID int) (*NotificationTemplate, error)

DisassociateJobTemplateNotificationTemplatesSuccess will disassociate a success notification_template for a job_template.

type JobTemplateService

type JobTemplateService struct {
	// contains filtered or unexported fields
}

JobTemplateService implements awx job template apis.

func (*JobTemplateService) AssociateCredentials

func (jt *JobTemplateService) AssociateCredentials(id int, data map[string]interface{}, _ map[string]string) (*JobTemplate, error)

AssociateCredentials adding credentials to JobTemplate.

func (*JobTemplateService) AssociateInstanceGroups added in v1.1.0

func (jt *JobTemplateService) AssociateInstanceGroups(id int, data map[string]interface{}, _ map[string]string) (*JobTemplate, error)

AssociateInstanceGroups adding instance group to JobTemplate.

func (*JobTemplateService) CreateJobTemplate

func (jt *JobTemplateService) CreateJobTemplate(data map[string]interface{}, params map[string]string) (*JobTemplate, error)

CreateJobTemplate creates a job template.

func (*JobTemplateService) DeleteJobTemplate

func (jt *JobTemplateService) DeleteJobTemplate(id int) (*JobTemplate, error)

DeleteJobTemplate deletes a job template.

func (*JobTemplateService) DisAssociateCredentials

func (jt *JobTemplateService) DisAssociateCredentials(id int, data map[string]interface{}, _ map[string]string) (*JobTemplate, error)

DisAssociateCredentials remove Credentials form an awx job template.

func (*JobTemplateService) DisAssociateInstanceGroups added in v1.1.0

func (jt *JobTemplateService) DisAssociateInstanceGroups(id int, data map[string]interface{}, _ map[string]string) (*JobTemplate, error)

DisAssociateInstanceGroups remove instance group from an awx job template.

func (*JobTemplateService) GetJobTemplateByID

func (jt *JobTemplateService) GetJobTemplateByID(id int, params map[string]string) (*JobTemplate, error)

GetJobTemplateByID shows the details of a job template.

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.

func (*JobTemplateService) UpdateJobTemplate

func (jt *JobTemplateService) UpdateJobTemplate(id int, data map[string]interface{}, params map[string]string) (*JobTemplate, error)

UpdateJobTemplate updates a job template.

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 ListApplicationResponse

type ListApplicationResponse struct {
	Pagination
	Results []*Application `json:"results"`
}

ListApplicationResponse represents `ListApplication` endpoint response.

type ListCredentialInputSourceResponse

type ListCredentialInputSourceResponse struct {
	Pagination
	Results []*CredentialInputSource `json:"results"`
}

ListCredentialInputSourceResponse represents `ListCredentialInputSource` endpoint response.

type ListCredentialTypeResponse

type ListCredentialTypeResponse struct {
	Pagination
	Results []*CredentialType `json:"results"`
}

ListCredentialTypeResponse represents `ListCredentialTypes` endpoint response.

type ListCredentialsResponse

type ListCredentialsResponse struct {
	Pagination
	Results []*Credential `json:"results"`
}

ListCredentialsResponse represents `ListCredentials` endpoint response.

type ListExecutionEnvironmentsResponse

type ListExecutionEnvironmentsResponse struct {
	Pagination
	Results []*ExecutionEnvironment `json:"results"`
}

ListExecutionEnvironmentsResponse represents `ListExecutionEnvironments` endpoint response.

type ListGroupsResponse

type ListGroupsResponse struct {
	Pagination
	Results []*Group `json:"results"`
}

ListGroupsResponse represents `ListGroups` endpoint response.

type ListHostsResponse

type ListHostsResponse struct {
	Pagination
	Results []*Host `json:"results"`
}

ListHostsResponse represents `ListHosts` endpoint response.

type ListInstanceGroupsResponse

type ListInstanceGroupsResponse struct {
	Pagination
	Results []*InstanceGroup `json:"results"`
}

ListInstanceGroupsResponse represents `ListInstanceGroups` endpoint response.

type ListInventoriesResponse

type ListInventoriesResponse struct {
	Pagination
	Results []*Inventory `json:"results"`
}

ListInventoriesResponse represents `ListInventories` endpoint response.

type ListInventorySourcesResponse

type ListInventorySourcesResponse struct {
	Pagination
	Results []*InventorySource `json:"results"`
}

ListInventorySourcesResponse represents `ListInventorySources` endpoint response.

type ListJobTemplatesResponse

type ListJobTemplatesResponse struct {
	Pagination
	Results []*JobTemplate `json:"results"`
}

ListJobTemplatesResponse represents `ListJobTemplates` endpoint response.

type ListNotificationTemplatesResponse

type ListNotificationTemplatesResponse struct {
	Pagination
	Results []*NotificationTemplate `json:"results"`
}

ListNotificationTemplatesResponse represents `List` endpoint response.

type ListOrganizationsResponse

type ListOrganizationsResponse struct {
	Pagination
	Results []*Organization `json:"results"`
}

ListOrganizationsResponse represents `ListOrganizations` endpoint response.

type ListProjectsResponse

type ListProjectsResponse struct {
	Pagination
	Results []*Project `json:"results"`
}

ListProjectsResponse represents `ListProjects` endpoint response.

type ListSchedulesResponse

type ListSchedulesResponse struct {
	Pagination
	Results []*Schedule `json:"results"`
}

ListSchedulesResponse represents `List` endpoint response.

type ListSettingsResponse

type ListSettingsResponse struct {
	Pagination
	Results []*SettingSummary `json:"results"`
}

ListSettingsResponse represents `ListSettings` endpoint response.

type ListTeamObjectRolesResponse

type ListTeamObjectRolesResponse struct {
	Pagination
	Results []*ObjectRoles `json:"results"`
}

ListTeamObjectRolesResponse represents `ListTeamRoles` endpoint response.

type ListTeamRolesResponse

type ListTeamRolesResponse struct {
	Pagination
	Results []*ApplyRole `json:"results"`
}

ListTeamRolesResponse represents `ListTeamRoles` endpoint response.

type ListTeamUsersResponse

type ListTeamUsersResponse struct {
	Pagination
	Results []*User `json:"results"`
}

ListTeamUsersResponse represents `ListTeamUsers` endpoint response.

type ListTeamsResponse

type ListTeamsResponse struct {
	Pagination
	Results []*Team `json:"results"`
}

ListTeamsResponse represents `ListTeams` endpoint response.

type ListUsersEntitlementsResponse

type ListUsersEntitlementsResponse struct {
	Pagination
	Results []*ApplyRole `json:"results"`
}

ListUsersEntitlementsResponse represents a list of ApplyRole for a User.

type ListUsersResponse

type ListUsersResponse struct {
	Pagination
	Results []*User `json:"results"`
}

ListUsersResponse represents `ListUsers` endpoint response.

type ListWorkflowJobTemplateNodesResponse

type ListWorkflowJobTemplateNodesResponse struct {
	Pagination
	Results []*WorkflowJobTemplateNode `json:"results"`
}

ListWorkflowJobTemplateNodesResponse represents `ListWorkflowJobTemplateNodes` endpoint response.

type ListWorkflowJobTemplatesResponse

type ListWorkflowJobTemplatesResponse struct {
	Pagination
	Results []*WorkflowJobTemplate `json:"results"`
}

ListWorkflowJobTemplatesResponse represents `ListWorkflowJobTemplate` endpoint response.

type NotificationTemplate

type NotificationTemplate struct {
	ID                        int                    `json:"id"`
	Name                      string                 `json:"name"`
	Description               string                 `json:"description"`
	Organization              int                    `json:"organization"`
	NotificationType          string                 `json:"notification_type"`
	NotificationConfiguration map[string]interface{} `json:"notification_configuration"`
	Messages                  interface{}            `json:"messages"`
}

NotificationTemplate : represents the awx api notification template.

type NotificationTemplatesService

type NotificationTemplatesService struct {
	// contains filtered or unexported fields
}

NotificationTemplatesService implements awx projects apis.

func (*NotificationTemplatesService) Create

func (s *NotificationTemplatesService) Create(data map[string]interface{}, params map[string]string) (*NotificationTemplate, error)

Create creates an awx notification_template.

func (*NotificationTemplatesService) Delete

Delete delete an awx notification_template.

func (*NotificationTemplatesService) GetByID

GetByID shows the details of a notification_template.

func (*NotificationTemplatesService) List

List shows list of awx notification_templates.

func (*NotificationTemplatesService) Update

func (s *NotificationTemplatesService) Update(id int, data map[string]interface{}, _ map[string]string) (*NotificationTemplate, error)

Update update an awx notification_template.

type ObjectRoles

type ObjectRoles struct {
	AdhocRole                    *ApplyRole `json:"adhoc_role"`
	AdminRole                    *ApplyRole `json:"admin_role"`
	ApprovalRole                 *ApplyRole `json:"approval_role"`
	AuditorRole                  *ApplyRole `json:"auditor_role"`
	CredentialAdminRole          *ApplyRole `json:"credential_admin_role"`
	ExecuteRole                  *ApplyRole `json:"execute_role"`
	ExecuteEnvironmentsAdminRole *ApplyRole `json:"execution_environment_admin_role"`
	InventoryAdminRole           *ApplyRole `json:"inventory_admin_role"`
	JobTemplateAdminRole         *ApplyRole `json:"job_template_admin_role"`
	MemberRole                   *ApplyRole `json:"member_role"`
	NotificationAdminRole        *ApplyRole `json:"notification_admin_role"`
	ProjectAdminRole             *ApplyRole `json:"project_admin_role"`
	ReadRole                     *ApplyRole `json:"read_role"`
	UpdateRole                   *ApplyRole `json:"update_role"`
	UseRole                      *ApplyRole `json:"use_role"`
	WorkflowAdminRole            *ApplyRole `json:"workflow_admin_role"`
}

ObjectRoles represents the awx api object roles.

type Organization

type Organization struct {
	Created          time.Time `json:"created"`
	CustomVirtualenv string    `json:"custom_virtualenv"`
	Description      string    `json:"description"`
	ID               int       `json:"id"`
	MaxHosts         int       `json:"max_hosts"`
	Modified         time.Time `json:"modified"`
	Name             string    `json:"name"`
	Related          *Related  `json:"related"`
	SummaryFields    *Summary  `json:"summary_fields"`
	Type             string    `json:"type"`
	URL              string    `json:"url"`
}

Organization represents an organization in AWX.

type OrganizationSummary

type OrganizationSummary struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

OrganizationSummary represents the awx api organization summary fields.

type OrganizationsService

type OrganizationsService struct {
	// contains filtered or unexported fields
}

OrganizationsService implements awx organizations apis.

func (*OrganizationsService) AssociateGalaxyCredentials

func (p *OrganizationsService) AssociateGalaxyCredentials(id int, data map[string]interface{}, _ map[string]string) (*Organization, error)

AssociateGalaxyCredentials adding credentials to Organization.

func (*OrganizationsService) CreateOrganization

func (p *OrganizationsService) CreateOrganization(data map[string]interface{}, params map[string]string) (*Organization, error)

CreateOrganization creates an awx Organization.

func (*OrganizationsService) DeleteOrganization

func (p *OrganizationsService) DeleteOrganization(id int) (*Organization, error)

DeleteOrganization delete an awx Organization.

func (*OrganizationsService) DisAssociateGalaxyCredentials

func (p *OrganizationsService) DisAssociateGalaxyCredentials(id int, data map[string]interface{}, _ map[string]string) (*Organization, error)

DisAssociateGalaxyCredentials remove Credentials form an awx job template.

func (*OrganizationsService) GetOrganizationsByID

func (p *OrganizationsService) GetOrganizationsByID(id int, params map[string]string) (*Organization, error)

GetOrganizationsByID shows the details of a Organization.

func (*OrganizationsService) ListOrganizations

func (p *OrganizationsService) ListOrganizations(params map[string]string) ([]*Organization, error)

ListOrganizations shows list of awx organizations.

func (*OrganizationsService) UpdateOrganization

func (p *OrganizationsService) UpdateOrganization(id int, data map[string]interface{}, _ map[string]string) (*Organization, error)

UpdateOrganization update an awx Organization.

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 PaginationRequest

type PaginationRequest struct {
	AllPages *bool
}

PaginationRequest : Paged response from AWX.

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"`
	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"`
	LocalPath             string    `json:"local_path"`
	ScmType               string    `json:"scm_type"`
	ScmURL                string    `json:"scm_url"`
	ScmBranch             string    `json:"scm_branch"`
	ScmClean              bool      `json:"scm_clean"`
	ScmDeleteOnUpdate     bool      `json:"scm_delete_on_update"`
	Credential            int       `json:"credential"`
	Timeout               int       `json:"timeout"`
	LastJobRun            time.Time `json:"last_job_run"`
	LastJobFailed         bool      `json:"last_job_failed"`
	NextJobRun            time.Time `json:"next_job_run"`
	Status                string    `json:"status"`
	Organization          int       `json:"organization"`
	ScmDeleteOnNextUpdate bool      `json:"scm_delete_on_next_update"`
	ScmUpdateOnLaunch     bool      `json:"scm_update_on_launch"`
	ScmUpdateCacheTimeout int       `json:"scm_update_cache_timeout"`
	AllowOverride         bool      `json:"allow_override"`
	ScmRevision           string    `json:"scm_revision"`
	LastUpdateFailed      bool      `json:"last_update_failed"`
	LastUpdated           time.Time `json:"last_updated"`
}

Project represents the awx api project.

type ProjectService

type ProjectService struct {
	// contains filtered or unexported fields
}

ProjectService implements awx projects apis.

func (*ProjectService) CreateProject

func (p *ProjectService) CreateProject(data map[string]interface{}, params map[string]string) (*Project, error)

CreateProject creates an awx project.

func (*ProjectService) DeleteProject

func (p *ProjectService) DeleteProject(id int) (*Project, error)

DeleteProject delete an awx Project.

func (*ProjectService) GetProjectByID

func (p *ProjectService) GetProjectByID(id int, params map[string]string) (*Project, error)

GetProjectByID shows the details of a project.

func (*ProjectService) ListProjects

func (p *ProjectService) ListProjects(params map[string]string) ([]*Project, *ListProjectsResponse, error)

ListProjects shows list of awx projects.

func (*ProjectService) UpdateProject

func (p *ProjectService) UpdateProject(id int, data map[string]interface{}, _ map[string]string) (*Project, error)

UpdateProject update an awx 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 ProjectUpdateCancel

type ProjectUpdateCancel struct {
	CanCancel bool `json:"can_cancel"`
}

ProjectUpdateCancel represents the awx project update cancel api response.

type ProjectUpdatesService

type ProjectUpdatesService struct {
	// contains filtered or unexported fields
}

ProjectUpdatesService implements awx projects apis.

func (*ProjectUpdatesService) ProjectUpdateCancel

func (p *ProjectUpdatesService) ProjectUpdateCancel(id int) (*ProjectUpdateCancel, error)

ProjectUpdateCancel cancel of awx projects update.

func (*ProjectUpdatesService) ProjectUpdateGet

func (p *ProjectUpdatesService) ProjectUpdateGet(id int) (*Job, error)

ProjectUpdateGet get of awx projects update.

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"`
	FactVersions                 string `json:"fact_versions"`
	SmartInventories             string `json:"smart_inventories"`
	Insights                     string `json:"insights"`
	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"`
	AdminOfOrganizations         string `json:"admin_of_organizations"`
	Organizations                string `json:"organizations"`
	Roles                        string `json:"roles"`
	Teams                        string `json:"teams"`
	Projects                     string `json:"projects"`
	PotentialChildren            string `json:"potential_children"`
	AllHosts                     string `json:"all_hosts"`
	AllGroups                    string `json:"all_groups"`
	AdHocCommandEvents           string `json:"ad_hoc_command_events"`
	Children                     string `json:"children"`
	AnsibleFacts                 string `json:"ansible_facts"`
	ExecutionEnvironment         string `json:"execution_environment"`
	ExecutionEnvironments        string `json:"execution_environments"`
}

Related represents the awx api related field.

type Requester

type Requester struct {
	Base          string
	Authenticator Authenticator
	Client        *http.Client
}

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) Delete

func (r *Requester) Delete(endpoint string, responseStruct interface{}, querystring map[string]string) (*http.Response, error)

Delete performs http Delete request.

func (*Requester) Do

func (r *Requester) Do(ar *APIRequest, responseStruct interface{}, options ...interface{}) (*http.Response, error)

Do : Performs 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) PatchJSON

func (r *Requester) PatchJSON(endpoint string, payload io.Reader, responseStruct interface{}, querystring map[string]string) (*http.Response, error)

PatchJSON perform http patch 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.

func (*Requester) PutJSON

func (r *Requester) PutJSON(endpoint string, payload io.Reader, responseStruct interface{}, querystring map[string]string) (*http.Response, error)

PutJSON perform http PUT request with json response.

func (*Requester) ReadJSONResponse

func (r *Requester) ReadJSONResponse(response *http.Response, responseStruct interface{}) (*http.Response, error)

ReadJSONResponse reads the http raw response and decodes into json.

func (*Requester) ReadRawResponse

func (r *Requester) ReadRawResponse(response *http.Response, responseStruct interface{}) (*http.Response, error)

ReadRawResponse reads the http raw response and store it into `responseStruct`.

type Result

type Result struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Result data type.

type Schedule

type Schedule struct {
	ID                 int                    `json:"id"`
	Name               string                 `json:"name"`
	Description        string                 `json:"description"`
	Rrule              string                 `json:"rrule"`
	Enabled            bool                   `json:"enabled"`
	UnifiedJobTemplate int                    `json:"unified_job_template"`
	Inventory          int                    `json:"inventory"`
	ExtraData          map[string]interface{} `json:"extra_data"`
}

Schedule : represents the awx api schedule.

type SchedulesService

type SchedulesService struct {
	// contains filtered or unexported fields
}

SchedulesService implements awx projects apis.

func (*SchedulesService) Create

func (s *SchedulesService) Create(data map[string]interface{}, params map[string]string) (*Schedule, error)

Create creates an awx schedule.

func (*SchedulesService) Delete

func (s *SchedulesService) Delete(id int) (*Schedule, error)

Delete delete an awx schedule.

func (*SchedulesService) GetByID

func (s *SchedulesService) GetByID(id int, params map[string]string) (*Schedule, error)

GetByID shows the details of a schedule.

func (*SchedulesService) List

func (s *SchedulesService) List(params map[string]string) ([]*Schedule, *ListSchedulesResponse, error)

List shows list of awx schedules.

func (*SchedulesService) Update

func (s *SchedulesService) Update(id int, data map[string]interface{}, _ map[string]string) (*Schedule, error)

Update update an awx schedule.

type Setting

type Setting map[string]json.RawMessage

Setting abstracted settings pulled from AWX.

type SettingService

type SettingService struct {
	// contains filtered or unexported fields
}

SettingService implements awx settings apis.

func (*SettingService) DeleteSettings

func (p *SettingService) DeleteSettings(slug string) (*Setting, error)

DeleteSettings delete an awx Setting.

func (*SettingService) GetSettingsBySlug

func (p *SettingService) GetSettingsBySlug(slug string, params map[string]string) (*Setting, error)

GetSettingsBySlug shows the details of a setting.

func (*SettingService) ListSettings

func (p *SettingService) ListSettings(params map[string]string) ([]*SettingSummary, *ListSettingsResponse, error)

ListSettings shows list of awx settings.

func (*SettingService) UpdateSettings

func (p *SettingService) UpdateSettings(slug string, data map[string]interface{}, _ map[string]string) (*Setting, error)

UpdateSettings update an awx Setting.

type SettingSummary

type SettingSummary struct {
	Name string `json:"name"`
	Slug string `json:"slug"`
	URL  string `json:"url"`
}

SettingSummary represents a summary of settings in AWX.

type Summary

type Summary struct {
	InstanceGroup               *InstanceGroupSummary        `json:"instance_group"`
	Organization                *OrganizationSummary         `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"`
	LastJob                     map[string]interface{}       `json:"last_job"`
	CurrentJob                  map[string]interface{}       `json:"current_job"`
	LastUpdate                  map[string]interface{}       `json:"last_update"`
	Inventory                   *Inventory                   `json:"inventory"`
	RecentJobs                  []interface{}                `json:"recent_jobs"`
	Groups                      *Groups                      `json:"groups"`
	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"`
	ExecutionEnvironmentSummary *ExecutionEnvironmentSummary `json:"execution_environment"`
}

Summary represents the awx api summary fields.

type Team

type Team struct {
	Created       time.Time `json:"created"`
	Description   string    `json:"description"`
	ID            int       `json:"id"`
	Modified      time.Time `json:"modified"`
	Name          string    `json:"name"`
	Organization  int       `json:"organization"`
	Related       *Related  `json:"related"`
	SummaryFields *Summary  `json:"summary_fields"`
	Type          string    `json:"type"`
	URL           string    `json:"url"`
}

Team represents a team in AWX.

type TeamService

type TeamService struct {
	// contains filtered or unexported fields
}

TeamService implements awx teams apis.

func (*TeamService) AddTeamUser

func (t *TeamService) AddTeamUser(id int, data map[string]interface{}) error

AddTeamUser will add the user as member in destination team.

func (*TeamService) CreateTeam

func (t *TeamService) CreateTeam(data map[string]interface{}, params map[string]string) (*Team, error)

CreateTeam creates an awx team.

func (*TeamService) DeleteTeam

func (t *TeamService) DeleteTeam(id int) (*Team, error)

DeleteTeam delete an awx Team.

func (*TeamService) GetTeamAccessList

func (t *TeamService) GetTeamAccessList(id int, params map[string]string, pagination *PaginationRequest) ([]*User, *ListTeamUsersResponse, error)

GetTeamAccessList shows a list of users for a team.

func (*TeamService) GetTeamByID

func (t *TeamService) GetTeamByID(id int, params map[string]string) (*Team, error)

GetTeamByID shows the details of a team.

func (*TeamService) GetTeamObjectRoles

func (t *TeamService) GetTeamObjectRoles(id int, params map[string]string, _ *PaginationRequest) ([]*ApplyRole, *ListTeamRolesResponse, error)

GetTeamObjectRoles shows a list of object roles for a team.

func (*TeamService) GetTeamUsers

func (t *TeamService) GetTeamUsers(id int, params map[string]string, pagination *PaginationRequest) ([]*User, *ListTeamUsersResponse, error)

GetTeamUsers shows a list of users for a team.

func (*TeamService) ListTeamRoleEntitlements

func (t *TeamService) ListTeamRoleEntitlements(id int, params map[string]string) ([]*ApplyRole, *ListTeamRolesResponse, error)

ListTeamRoleEntitlements shows list of awx team role entitlements.

func (*TeamService) ListTeams

func (t *TeamService) ListTeams(params map[string]string) ([]*Team, *ListTeamsResponse, error)

ListTeams shows list of awx teams.

func (*TeamService) RemoveTeamUser

func (t *TeamService) RemoveTeamUser(id int, data map[string]interface{}) error

RemoveTeamUser will remove the user from destination team without deleting the user.

func (*TeamService) UpdateTeam

func (t *TeamService) UpdateTeam(id int, data map[string]interface{}, _ map[string]string) (*Team, error)

UpdateTeam update an awx Team.

func (*TeamService) UpdateTeamRoleEntitlement

func (t *TeamService) UpdateTeamRoleEntitlement(id int, data map[string]interface{}, _ map[string]string) (interface{}, error)

UpdateTeamRoleEntitlement updates the role entitlements for a team.

type TokenAuth

type TokenAuth struct {
	Token string
}

TokenAuth represents token authentication.

type UnifiedJobTemplate

type UnifiedJobTemplate struct {
	ID             int    `json:"id"`
	Name           string `json:"name"`
	Description    string `json:"description"`
	UnifiedJobType string `json:"unified_job_type"`
}

UnifiedJobTemplate represents the awx api unified job template.

type User

type User 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"`
	Username        string      `json:"username"`
	FirstName       string      `json:"first_name"`
	LastName        string      `json:"last_name"`
	Email           string      `json:"email"`
	IsSuperUser     bool        `json:"is_superuser"`
	IsSystemAuditor bool        `json:"is_system_auditor"`
	Password        string      `json:"password"`
	LdapDn          string      `json:"ldap_dn"`
	ExternalAccount interface{} `json:"external_account"`
}

User represents an user.

type UserCapabilities

type UserCapabilities struct {
	Edit     bool `json:"edit"`
	Start    bool `json:"start"`
	Schedule bool `json:"schedule"`
	Copy     bool `json:"copy"`
	Adhoc    bool `json:"adhoc"`
	Delete   bool `json:"delete"`
}

UserCapabilities represents the awx api user capabilities.

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

UserService implements awx Users apis.

func (*UserService) CreateUser

func (u *UserService) CreateUser(data map[string]interface{}, params map[string]string) (*User, error)

CreateUser creates an awx User.

func (*UserService) DeleteUser

func (u *UserService) DeleteUser(id int) (*User, error)

DeleteUser delete an awx User.

func (*UserService) GetUserByID

func (u *UserService) GetUserByID(id int, params map[string]string) (*User, error)

GetUserByID read an awx User.

func (*UserService) ListUserRoleEntitlements

func (u *UserService) ListUserRoleEntitlements(id int, params map[string]string) ([]*ApplyRole, *ListUsersEntitlementsResponse, error)

ListUserRoleEntitlements shows list of awx User Role Entitlements.

func (*UserService) ListUsers

func (u *UserService) ListUsers(params map[string]string) ([]*User, *ListUsersResponse, error)

ListUsers shows list of awx Users.

func (*UserService) UpdateUser

func (u *UserService) UpdateUser(id int, data map[string]interface{}, _ map[string]string) (*User, error)

UpdateUser update an awx user.

func (*UserService) UpdateUserRoleEntitlement

func (u *UserService) UpdateUserRoleEntitlement(id int, data map[string]interface{}, _ map[string]string) (interface{}, error)

UpdateUserRoleEntitlement updates an awx user role entitlement.

type WorkflowJobTemplate

type WorkflowJobTemplate 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"`
	LastJobRun           interface{} `json:"last_job_run"`
	LastJobFailed        bool        `json:"last_job_failed"`
	NextJobRun           interface{} `json:"next_job_run"`
	Status               string      `json:"status"`
	ExtraVars            string      `json:"extra_vars"`
	Organization         int         `json:"organization"`
	SurveyEnabled        bool        `json:"survey_enabled"`
	AllowSimultaneous    bool        `json:"allow_simultaneous"`
	AskVariablesOnLaunch bool        `json:"ask_variables_on_launch"`
	Inventory            int         `json:"inventory"`
	Limit                interface{} `json:"limit"`
	ScmBranch            interface{} `json:"scm_branch"`
	AskInventoryOnLaunch bool        `json:"ask_inventory_on_launch"`
	AskScmBranchOnLaunch bool        `json:"ask_scm_branch_on_launch"`
	AskLimitOnLaunch     bool        `json:"ask_limit_on_launch"`
	WebhookService       string      `json:"webhook_service"`
	WebhookCredential    interface{} `json:"webhook_credential"`
}

WorkflowJobTemplate : represents a workflow job template in AWX.

type WorkflowJobTemplateNode

type WorkflowJobTemplateNode 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"`
	ExtraData              string    `json:"extra_data"`
	Inventory              int       `json:"inventory"`
	ScmBranch              string    `json:"scm_branch"`
	JobType                string    `json:"job_type"`
	JobTags                string    `json:"job_tags"`
	SkipTags               string    `json:"skip_tags"`
	Limit                  string    `json:"limit"`
	DiffMode               string    `json:"diff_mode"`
	Verbosity              int       `json:"verbosity"`
	WorkflowJobTemplate    int       `json:"workflow_job_template"`
	UnifiedJobTemplate     int       `json:"unified_job_template"`
	SuccessNodes           []int     `json:"success_nodes"`
	FailureNodes           []int     `json:"failure_nodes"`
	AlwaysNodes            []int     `json:"always_nodes"`
	AllParentsMustConverge bool      `json:"all_parents_must_converge"`
	Identifier             string    `json:"identifier"`
}

WorkflowJobTemplateNode represents the awx api workflow job template node.

type WorkflowJobTemplateNodeService

type WorkflowJobTemplateNodeService struct {
	// contains filtered or unexported fields
}

WorkflowJobTemplateNodeService implements awx job template node apis.

func (*WorkflowJobTemplateNodeService) CreateWorkflowJobTemplateNode

func (jt *WorkflowJobTemplateNodeService) CreateWorkflowJobTemplateNode(data map[string]interface{}, params map[string]string) (*WorkflowJobTemplateNode, error)

CreateWorkflowJobTemplateNode creates a job template node, without any pe exisiting nodes.

func (*WorkflowJobTemplateNodeService) DeleteWorkflowJobTemplateNode

func (jt *WorkflowJobTemplateNodeService) DeleteWorkflowJobTemplateNode(id int) (*WorkflowJobTemplateNode, error)

DeleteWorkflowJobTemplateNode deletes a job template node.

func (*WorkflowJobTemplateNodeService) GetWorkflowJobTemplateNodeByID

func (jt *WorkflowJobTemplateNodeService) GetWorkflowJobTemplateNodeByID(id int, params map[string]string) (*WorkflowJobTemplateNode, error)

GetWorkflowJobTemplateNodeByID shows the details of a job template node.

func (*WorkflowJobTemplateNodeService) ListWorkflowJobTemplateNodes

ListWorkflowJobTemplateNodes shows a list of job templates nodes.

func (*WorkflowJobTemplateNodeService) UpdateWorkflowJobTemplateNode

func (jt *WorkflowJobTemplateNodeService) UpdateWorkflowJobTemplateNode(id int, data map[string]interface{}, params map[string]string) (*WorkflowJobTemplateNode, error)

UpdateWorkflowJobTemplateNode updates a job template node.

type WorkflowJobTemplateNodeStepService

type WorkflowJobTemplateNodeStepService struct {
	// contains filtered or unexported fields
}

WorkflowJobTemplateNodeStepService implements awx job template nodes apis.

func (*WorkflowJobTemplateNodeStepService) CreateWorkflowJobTemplateNodeStep

func (jt *WorkflowJobTemplateNodeStepService) CreateWorkflowJobTemplateNodeStep(id int, data map[string]interface{}, params map[string]string) (*WorkflowJobTemplateNode, error)

CreateWorkflowJobTemplateNodeStep will be creating a template node for an existing node.

func (*WorkflowJobTemplateNodeStepService) ListWorkflowJobTemplateNodes

ListWorkflowJobTemplateNodes shows a list of job templates nodes.

type WorkflowJobTemplateNotificationTemplatesService

type WorkflowJobTemplateNotificationTemplatesService struct {
	// contains filtered or unexported fields
}

WorkflowJobTemplateNotificationTemplatesService implements awx job template nodes apis.

func (*WorkflowJobTemplateNotificationTemplatesService) AssociateWorkflowJobTemplateNotificationTemplatesApprovals

func (s *WorkflowJobTemplateNotificationTemplatesService) AssociateWorkflowJobTemplateNotificationTemplatesApprovals(jobTemplateID int, notificationTemplateID int) (*NotificationTemplate, error)

AssociateWorkflowJobTemplateNotificationTemplatesApprovals will associate an approval notification_template for a job_template.

func (*WorkflowJobTemplateNotificationTemplatesService) AssociateWorkflowJobTemplateNotificationTemplatesError

func (s *WorkflowJobTemplateNotificationTemplatesService) AssociateWorkflowJobTemplateNotificationTemplatesError(jobTemplateID int, notificationTemplateID int) (*NotificationTemplate, error)

AssociateWorkflowJobTemplateNotificationTemplatesError will associate an error notification_template for a job_template.

func (*WorkflowJobTemplateNotificationTemplatesService) AssociateWorkflowJobTemplateNotificationTemplatesStarted

func (s *WorkflowJobTemplateNotificationTemplatesService) AssociateWorkflowJobTemplateNotificationTemplatesStarted(jobTemplateID int, notificationTemplateID int) (*NotificationTemplate, error)

AssociateWorkflowJobTemplateNotificationTemplatesStarted will associate a started notification_template for a job_template.

func (*WorkflowJobTemplateNotificationTemplatesService) AssociateWorkflowJobTemplateNotificationTemplatesSuccess

func (s *WorkflowJobTemplateNotificationTemplatesService) AssociateWorkflowJobTemplateNotificationTemplatesSuccess(jobTemplateID int, notificationTemplateID int) (*NotificationTemplate, error)

AssociateWorkflowJobTemplateNotificationTemplatesSuccess will associate a success notification_template for a job_template.

func (*WorkflowJobTemplateNotificationTemplatesService) DisassociateWorkflowJobTemplateNotificationTemplatesApprovals

func (s *WorkflowJobTemplateNotificationTemplatesService) DisassociateWorkflowJobTemplateNotificationTemplatesApprovals(jobTemplateID int, notificationTemplateID int) (*NotificationTemplate, error)

DisassociateWorkflowJobTemplateNotificationTemplatesApprovals will disassociate an approval notification_template for a job_template.

func (*WorkflowJobTemplateNotificationTemplatesService) DisassociateWorkflowJobTemplateNotificationTemplatesError

func (s *WorkflowJobTemplateNotificationTemplatesService) DisassociateWorkflowJobTemplateNotificationTemplatesError(jobTemplateID int, notificationTemplateID int) (*NotificationTemplate, error)

DisassociateWorkflowJobTemplateNotificationTemplatesError will disassociate an error notification_template for a job_template.

func (*WorkflowJobTemplateNotificationTemplatesService) DisassociateWorkflowJobTemplateNotificationTemplatesStarted

func (s *WorkflowJobTemplateNotificationTemplatesService) DisassociateWorkflowJobTemplateNotificationTemplatesStarted(jobTemplateID int, notificationTemplateID int) (*NotificationTemplate, error)

DisassociateWorkflowJobTemplateNotificationTemplatesStarted will disassociate a started notification_template for a job_template.

func (*WorkflowJobTemplateNotificationTemplatesService) DisassociateWorkflowJobTemplateNotificationTemplatesSuccess

func (s *WorkflowJobTemplateNotificationTemplatesService) DisassociateWorkflowJobTemplateNotificationTemplatesSuccess(jobTemplateID int, notificationTemplateID int) (*NotificationTemplate, error)

DisassociateWorkflowJobTemplateNotificationTemplatesSuccess will disassociate a success notification_template for a job_template.

type WorkflowJobTemplateScheduleService

type WorkflowJobTemplateScheduleService struct {
	// contains filtered or unexported fields
}

WorkflowJobTemplateScheduleService implements awx job template nodes apis.

func (*WorkflowJobTemplateScheduleService) CreateWorkflowJobTemplateSchedule

func (jt *WorkflowJobTemplateScheduleService) CreateWorkflowJobTemplateSchedule(id int, data map[string]interface{}, params map[string]string) (*Schedule, error)

CreateWorkflowJobTemplateSchedule will create a schedule for an existing workflow_job_template.

func (*WorkflowJobTemplateScheduleService) ListWorkflowJobTemplateSchedules

func (jt *WorkflowJobTemplateScheduleService) ListWorkflowJobTemplateSchedules(id int, params map[string]string) ([]*Schedule, *ListSchedulesResponse, error)

ListWorkflowJobTemplateSchedules shows a list of schedules for a given workflow_job_template.

type WorkflowJobTemplateService

type WorkflowJobTemplateService struct {
	// contains filtered or unexported fields
}

WorkflowJobTemplateService implements awx workflow job template apis.

func (*WorkflowJobTemplateService) CreateWorkflowJobTemplate

func (jt *WorkflowJobTemplateService) CreateWorkflowJobTemplate(data map[string]interface{}, params map[string]string) (*WorkflowJobTemplate, error)

CreateWorkflowJobTemplate creates a workflow job template.

func (*WorkflowJobTemplateService) DeleteWorkflowJobTemplate

func (jt *WorkflowJobTemplateService) DeleteWorkflowJobTemplate(id int) (*WorkflowJobTemplate, error)

DeleteWorkflowJobTemplate deletes a workflow job template.

func (*WorkflowJobTemplateService) GetWorkflowJobTemplateByID

func (jt *WorkflowJobTemplateService) GetWorkflowJobTemplateByID(id int, params map[string]string) (*WorkflowJobTemplate, error)

GetWorkflowJobTemplateByID shows the details of a workflow job template.

func (*WorkflowJobTemplateService) Launch

func (jt *WorkflowJobTemplateService) Launch(id int, data map[string]interface{}, params map[string]string) (*JobLaunch, error)

Launch a job with the workflow job template.

func (*WorkflowJobTemplateService) ListWorkflowJobTemplates

func (jt *WorkflowJobTemplateService) ListWorkflowJobTemplates(params map[string]string) ([]*WorkflowJobTemplate, *ListWorkflowJobTemplatesResponse, error)

ListWorkflowJobTemplates shows a list of workflow job templates.

func (*WorkflowJobTemplateService) UpdateWorkflowJobTemplate

func (jt *WorkflowJobTemplateService) UpdateWorkflowJobTemplate(id int, data map[string]interface{}, params map[string]string) (*WorkflowJobTemplate, error)

UpdateWorkflowJobTemplate updates a workflow job template.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL