Documentation
¶
Index ¶
- Constants
- func AccessList(c *gin.Context)
- func ActivityStream(c *gin.Context)
- func AddJTemplate(c *gin.Context)
- func GetJTemplate(c *gin.Context)
- func GetJTemplates(c *gin.Context)
- func Jobs(c *gin.Context)
- func Launch(c *gin.Context)
- func LaunchInfo(c *gin.Context)
- func Middleware(c *gin.Context)
- func ObjectRoles(c *gin.Context)
- func PatchJTemplate(c *gin.Context)
- func RemoveJTemplate(c *gin.Context)
- func UpdateJTemplate(c *gin.Context)
Constants ¶
const ( CTXJobTemplate = "job_template" CTXUser = "user" CTXJobTemplateID = "job_template_id" )
Keys for credential releated items stored in the Gin Context
Variables ¶
This section is empty.
Functions ¶
func ActivityStream ¶
ActivityStream returns serialized list of Activity models associated with the Job Template Resulting data structure contains:
{
"count\": 99,
"next\": null,
"previous\": null,
"results\": [
...
]
}
The `count` field indicates the total number of activity streams found for the given query. The `next` and `previous` fields provides links to additional results if there are more than will fit on a single page. The `results` list contains zero or more activity stream records. success returns 200 status code failure reruns 500 status code
func AddJTemplate ¶
AddJTemplate is Gin handler function which creates a new Credential using request payload This accepts Job Template model. fields to create a new job template: name: Name of this job template. string, required description: Optional description of this job template. string, default="" job_type: choice
- `run: Run default
- `check: Check
- `scan: Scan
inventory: bson.ObjectId, default=nil project: bson.ObjectId, default=nil playbook: string, default="" credential: bson.ObjectId, default=nil cloud_credential: bson.ObjectId, default=nil network_credential: bson.ObjectId, default=nil forks: integer, default=0 limit: string, default="" verbosity: choice
- 0: 0 Normal default
- 1: 1 Verbose
- 2: 2 More Verbose
- 3: 3 Debug
- 4: 4 Connection Debug
- 5: 5 WinRM Debug
extra_vars: string, default="" job_tags: string, default="" force_handlers: boolean, default=False skip_tags: string, default="" start_at_task: string, default="" host_config_key: string, default="" ask_variables_on_launch: boolean, default=False ask_limit_on_launch: boolean, default=False ask_tags_on_launch: boolean, default=False ask_skip_tags_on_launch: boolean, default=False ask_job_type_on_launch: boolean, default=False ask_inventory_on_launch: boolean, default=False ask_credential_on_launch: boolean, default=False become_enabled: boolean, default=False allow_simultaneous: boolean, default=False
func GetJTemplate ¶
GetJTemplate is a Gin handler function which returns the Job Template as a JSON object A success will return 200 status code A failure will return 500 status code
func GetJTemplates ¶
GetJTemplates is a Gin handler function which returns list of Job Templates The resulting data structure contains:
{
"count\": 99,
"next\": null,
"previous\": null,
"results\": [
...
]
The `count` field indicates the total number of job templates found for the given query. The `next` and `previous` fields provides links to additional results if there are more than will fit on a single page. The `results` list contains zero or more job template records. A success returns 200 status code A failure returns 500 status code This takes lookup parameters and order parameters to filter and sort output data
func Jobs ¶
Jobs returns list of jobs associated with the Job Template Resulting data structure contains:
{
"count\": 99,
"next\": null,
"previous\": null,
"results\": [
...
]
}
The `count` field indicates the total number of jobs found for the given query. The `next` and `previous` fields provides links to additional results if there are more than will fit on a single page. The `results` list contains zero or more job records.
func Launch ¶
Launch creates a new job and adds the job into job queue. If any passwords, inventory, or extra variables (extra_vars) are required, they must be passed via POST data, with extra_vars given as a JSON string. If `credential_needed_to_start` is `true` then the `credential` field is required and if the `inventory_needed_to_start` is `True` then the `inventory` is required as well. success returns JSON serialized Job model with 201 status code if the request body is invalid returns JSON serialized Error model with 400 status code
func LaunchInfo ¶
LaunchInfo returns JSON serialized launch information to determine if the job_template can be launched and whether any passwords are required to launch the job_template.
ask_variables_on_launch: Flag indicating whether the job template is configured to prompt for variables upon launch ask_tags_on_launch: Flag indicating whether the job template is configured to prompt for tags upon launch ask_skip_tags_on_launch: Flag indicating whether the job template is configured to prompt for skip_tags upon launch ask_job_type_on_launch: Flag indicating whether the job template is configured to prompt for job_type upon launch ask_limit_on_launch: Flag indicating whether the job template is configured to prompt for limit upon launch ask_inventory_on_launch: Flag indicating whether the job template is configured to prompt for inventory upon launch ask_credential_on_launch: Flag indicating whether the job template is configured to prompt for credential upon launch can_start_without_user_input: Flag indicating if the job template can be launched without user-input variables_needed_to_start: Required variable names required to launch the job_template credential_needed_to_start: Flag indicating the presence of a credential associated with the job template. If not then one should be supplied when launching the job inventory_needed_to_start: Flag indicating the presence of an inventory associated with the job template. If not then one should be supplied when launching the job
func Middleware ¶
Middleware generates a middleware handler function that works inside of a Gin request. This function takes CTXJobTemplateID from Gin Context and retrieves job template data from the collection and store job template data under key CTXJobTemplate in Gin Context
func ObjectRoles ¶
ObjectRoles is a Gin handler function This returns available roles can be associated with a Job Template model
func PatchJTemplate ¶ added in v0.0.3
PatchJTemplate is a Gin handler function which partially updates a Job Template using request payload. patch will only update feilds which included in the POST body A success returns 200 status code A failure returns 500 status code if the request body is invalid returns serialized Error model with 400 status code
func RemoveJTemplate ¶
RemoveJTemplate is a Gin handler function which removes a Job Template object from the database A success returns 204 status code A failure returns 500 status code
func UpdateJTemplate ¶
UpdateJTemplate is a Gin handler function which updates a Job Template using request payload A success returns 200 status code A failure returns 500 status code if the request body is invalid returns serialized Error model with 400 status code
Types ¶
This section is empty.