jtemplate

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
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 AccessList

func AccessList(c *gin.Context)

AccessList is Gin Handler function

func ActivityStream

func ActivityStream(c *gin.Context)

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

func AddJTemplate(c *gin.Context)

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

func GetJTemplate(c *gin.Context)

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

func GetJTemplates(c *gin.Context)

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

func Jobs(c *gin.Context)

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

func Launch(c *gin.Context)

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

func LaunchInfo(c *gin.Context)

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

func Middleware(c *gin.Context)

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

func ObjectRoles(c *gin.Context)

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

func PatchJTemplate(c *gin.Context)

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

func RemoveJTemplate(c *gin.Context)

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

func UpdateJTemplate(c *gin.Context)

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.

Jump to

Keyboard shortcuts

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