models

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREDENTIAL_KIND_SSH        = "ssh"
	CREDENTIAL_KIND_NET        = "net"
	CREDENTIAL_KIND_WIN        = "win"
	CREDENTIAL_KIND_SCM        = "scm"
	CREDENTIAL_KIND_AWS        = "aws"
	CREDENTIAL_KIND_RAX        = "rax"
	CREDENTIAL_KIND_VMWARE     = "vmware"
	CREDENTIAL_KIND_SATELLITE6 = "satellite6"
	CREDENTIAL_KIND_CLOUDFORMS = "cloudforms"
	CREDENTIAL_KIND_GCE        = "gce"
	CREDENTIAL_KIND_AZURE      = "azure"
	CREDENTIAL_KIND_OPENSTACK  = "openstack"
)
View Source
const (
	JOBTYPE_ANSIBLE_JOB = "ansible_job" // A ansible job
	JOBTYPE_UPDATE_JOB  = "update_job"  // A project scm update job

	JOB_LAUNCH_TYPE_MANUAL = "manual"
	JOB_LAUNCH_TYPE_SYSTEM = "system"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessControl

type AccessControl struct {
	UserID bson.ObjectId `bson:"user_id,omitempty" json:"user_id,omitempty"`
	TeamID bson.ObjectId `bson:"team_id,omitempty" json:"team_id,omitempty"`
	Type   string        `bson:"type" json:"type"` // Team or a User
	Role   string        `bson:"role" json:"role"`
}

type AccessType

type AccessType struct {
	DirectAccess   []gin.H `json:"direct_access"`
	IndirectAccess []gin.H `json:"indirect_access"`
}

type AccessUser

type AccessUser struct {
	ID      bson.ObjectId `bson:"_id" json:"id"`
	Type    string        `bson:"-" json:"type"`
	Url     string        `bson:"-" json:"url"`
	Related gin.H         `bson:"-" json:"related"`
	Summary *AccessType   `bson:"-" json:"summary_fields"`

	Created         time.Time     `bson:"created" json:"created"`
	Username        string        `bson:"username" json:"username" binding:"required"`
	FirstName       string        `bson:"first_name" json:"first_name"`
	LastName        string        `bson:"last_name" json:"last_name"`
	Email           string        `bson:"email" json:"email" binding:"required"`
	IsSuperUser     bool          `bson:"is_superuser" json:"is_superuser"`
	IsSystemAuditor bool          `bson:"is_system_auditor" json:"is_system_auditor"`
	Password        string        `bson:"password" json:"-"`
	OrganizationID  bson.ObjectId `bson:"organization_id" json:"organization"`
}

type Activity

type Activity struct {
	ID          bson.ObjectId `bson:"_id" json:"id"`
	ObjectID    bson.ObjectId `bson:"object_id" json:"object_id"`
	ActorID     bson.ObjectId `bson:"actor_id" json:"actor_id"`
	Type        string        `bson:"type" json:"type"`
	Description string        `bson:"description" json:"description"`
	Created     time.Time     `bson:"created" json:"created"`
}

type AdHocCommand

type AdHocCommand struct {
	ID            bson.ObjectId `bson:"_id" json:"id"`
	ModuleName    string        `bson:"module_name" json:"module_name" binding:"required"`
	Limit         string        `bson:"limit" json:"limit"`
	ModuleArgs    string        `bson:"module_args" json:"module_args"`
	JobType       string        `bson:"job_type" json:"job_type"`
	Forks         uint8         `bson:"forks" json:"forks"`
	Verbosity     uint8         `bson:"verbosity" json:"verbosity"`
	BecomeEnabled bool          `bson:"become_enabled" json:"become_enabled"`
	CredentialID  bson.ObjectId `bson:"credential_id" json:"credential"`
	InventoryID   bson.ObjectId `bson:"inventory_id" json:"inventory"`
	ExtraVars     gin.H         `bson:"extra_vars" json:"extra_vars"`
	CreatedByID   bson.ObjectId `bson:"created_by_id" json:"created_by"`
	ModifiedByID  bson.ObjectId `bson:"modified_by_id" json:"modified_by"`
	Created       time.Time     `bson:"created" json:"created"`
	Modified      time.Time     `bson:"modified" json:"modified"`

	Type          string `bson:"-" json:"type"`
	Url           string `bson:"-" json:"url"`
	Related       gin.H  `bson:"-" json:"related"`
	SummaryFields gin.H  `bson:"-" json:"summary_fields"`
}

type AdHocCommandEvent

type AdHocCommandEvent struct {
	ID             bson.ObjectId `bson:"_id" json:"id"`
	HostName       string        `bson:"host_name" json:"host_name" binding:"required"`
	Event          string        `bson:"event" json:"event"`
	EventData      string        `bson:"event_data" json:"event_data"`
	Failed         bool          `bson:"failed" json:"failed"`
	Changed        bool          `bson:"changed" json:"changed"`
	Counter        uint8         `bson:"counter" json:"counter"`
	HostID         bson.ObjectId `bson:"host_id" json:"host"`
	AdHocCommandID bson.ObjectId `bson:"ad_hoc_command_id" json:"ad_hoc_command_id"`

	Type          string `bson:"-" json:"type"`
	Url           string `bson:"-" json:"url"`
	Related       gin.H  `bson:"-" json:"related"`
	SummaryFields gin.H  `bson:"-" json:"summary_fields"`
}

type Credential

type Credential struct {
	ID bson.ObjectId `bson:"_id" json:"id"`
	// required feilds
	Name string `bson:"name" json:"name" binding:"required,min=1,max=500"`
	Kind string `bson:"kind" json:"kind" binding:"required,credentialkind"`

	//optional feilds
	Cloud             bool           `bson:"cloud,omitempty" json:"cloud"`
	Description       string         `bson:"description,omitempty" json:"description"`
	Host              string         `bson:"host,omitempty" json:"host"`
	Username          string         `bson:"username,omitempty" json:"username"`
	Password          string         `bson:"password,omitempty" json:"password"`
	SecurityToken     string         `bson:"security_token,omitempty" json:"security_token"`
	Project           string         `bson:"project,omitempty" json:"project"`
	Domain            string         `bson:"domain,omitempty" json:"domain"`
	SshKeyData        string         `bson:"ssh_key_data,omitempty" json:"ssh_key_data"`
	SshKeyUnlock      string         `bson:"ssh_key_unlock,omitempty" json:"ssh_key_unlock"`
	BecomeMethod      string         `bson:"become_method,omitempty" json:"become_method" binding:"omitempty,become_method"`
	BecomeUsername    string         `bson:"become_username,omitempty" json:"become_username"`
	BecomePassword    string         `bson:"become_password,omitempty" json:"become_password"`
	VaultPassword     string         `bson:"vault_password,omitempty" json:"vault_password"`
	Subscription      string         `bson:"subscription,omitempty" json:"subscription"`
	Tenant            string         `bson:"tenant,omitempty" json:"tenant"`
	Secret            string         `bson:"secret,omitempty" json:"secret"`
	Client            string         `bson:"client,omitempty" json:"client"`
	Authorize         bool           `bson:"authorize,omitempty" json:"authorize"`
	AuthorizePassword string         `bson:"authorize_password,omitempty" json:"authorize_password"`
	OrganizationID    *bson.ObjectId `bson:"organization_id,omitempty" json:"organization"`

	Created  time.Time `bson:"created" json:"created"`
	Modified time.Time `bson:"modified" json:"modified"`

	CreatedByID  bson.ObjectId `bson:"created_by_id" json:"-"`
	ModifiedByID bson.ObjectId `bson:"modified_by_id" json:"-"`

	Type    string `bson:"-" json:"type"`
	Url     string `bson:"-" json:"url"`
	Related gin.H  `bson:"-" json:"related"`
	Summary gin.H  `bson:"-" json:"summary_fields"`

	Roles []AccessControl `bson:"roles" json:"-"`
}

Organization is the model for organization collection

type Error

type Error struct {
	Code     int         `json:"code"`
	Messages interface{} `json:"messages"`
}

type Group

type Group struct {
	ID bson.ObjectId `bson:"_id" json:"id"`

	// required feilds
	Name string `bson:"name" json:"name" binding:"required,min=1,max=500"`

	Description              string        `bson:"description" json:"description"`
	Variables                string        `bson:"variables" json:"variables"`
	TotalHosts               uint32        `bson:"total_hosts" json:"total_hosts"`
	HasActiveFailures        bool          `bson:"has_active_failures" json:"has_active_failures"`
	HostsWithActiveFailures  uint32        `bson:"hosts_with_active_failures" json:"hosts_with_active_failures"`
	TotalGroups              uint32        `bson:"total_groups" json:"total_groups"`
	GroupsWithActiveFailures uint32        `bson:"groups_with_active_failures" json:"groups_with_active_failures"`
	HasInventorySources      bool          `bson:"has_inventory_sources" json:"has_inventory_sources"`
	InventoryID              bson.ObjectId `bson:"inventory_id" json:"inventory"`
	//parent child relation
	ParentGroupID *bson.ObjectId `bson:"parent_group_id,omitempty" json:"parent_group,omitempty"`

	CreatedByID  bson.ObjectId `bson:"created_by_id" json:"-"`
	ModifiedByID bson.ObjectId `bson:"modified_by_id" json:"-"`

	Created  time.Time `bson:"created" json:"created"`
	Modified time.Time `bson:"modified" json:"modified"`

	Type               string `bson:"-" json:"type"`
	Url                string `bson:"-" json:"url"`
	Related            gin.H  `bson:"-" json:"related"`
	Summary            gin.H  `bson:"-" json:"summary_fields"`
	LastJob            gin.H  `bson:"-" json:"last_job"`
	LastJobHostSummary gin.H  `bson:"-" json:"last_job_host_summary"`
}

Organization is the model for organization collection

type Host

type Host struct {
	ID bson.ObjectId `bson:"_id" json:"id"`

	// required
	Name        string        `bson:"name" json:"name" binding:"required,iphost"`
	InventoryID bson.ObjectId `bson:"inventory_id" json:"inventory" binding:"required"`

	Description          string         `bson:"description,omitempty" json:"description,omitempty"`
	GroupID              *bson.ObjectId `bson:"group_id,omitempty" json:"group,omitempty"`
	InstanceID           string         `bson:"instance_id,omitempty" json:"instance_id,omitempty"`
	Variables            string         `bson:"variables,omitempty" json:"variables,omitempty"`
	LastJobID            *bson.ObjectId `bson:"last_job_id,omitempty" json:"last_job,omitempty"`
	LastJobHostSummaryID *bson.ObjectId `bson:"last_job_host_summary_id,omitempty" json:"last_job_host_summary,omitempty"`

	HasActiveFailures   bool `bson:"has_active_failures,omitempty" json:"has_active_failures,omitempty"`
	HasInventorySources bool `bson:"has_inventory_sources,omitempty" json:"has_inventory_sources,omitempty"`
	Enabled             bool `bson:"enabled,omitempty" json:"enabled,omitempty"`

	CreatedByID  bson.ObjectId `bson:"created_by_id" json:"-"`
	ModifiedByID bson.ObjectId `bson:"modified_by_id" json:"-"`

	Created  time.Time `bson:"created,omitempty" json:"created,omitempty"`
	Modified time.Time `bson:"modified,omitempty" json:"modified,omitempty"`

	Type          string `bson:"-" json:"type"`
	Url           string `bson:"-" json:"url"`
	Related       gin.H  `bson:"-" json:"related"`
	SummaryFields gin.H  `bson:"-" json:"summary_fields"`
}

type Inventory

type Inventory struct {
	ID bson.ObjectId `bson:"_id" json:"id"`

	Type          string `bson:"-" json:"type"`
	Url           string `bson:"-" json:"url"`
	Related       gin.H  `bson:"-" json:"related"`
	SummaryFields gin.H  `bson:"-" json:"summary_fields"`

	// required feilds
	Name           string        `bson:"name" json:"name" binding:"required,min=1,max=500"`
	OrganizationID bson.ObjectId `bson:"organization_id" json:"organization" binding:"required"`
	Description    string        `bson:"description,omitempty" json:"description"`
	Variables      string        `bson:"variables,omitempty" json:"variables"`

	// only output
	TotalHosts                   uint32 `bson:"total_hosts,omitempty" json:"total_hosts" binding:"omitempty,naproperty"`
	HostsWithActiveFailures      uint32 `bson:"hosts_with_active_failures,omitempty" json:"hosts_with_active_failures" binding:"omitempty,naproperty"`
	TotalGroups                  uint32 `bson:"total_groups,omitempty" json:"total_groups" binding:"omitempty,naproperty"`
	GroupsWithActiveFailures     uint32 `bson:"groups_with_active_failures,omitempty" json:"groups_with_active_failures" binding:"omitempty,naproperty"`
	TotalInventorySources        uint32 `bson:"total_inventory_sources,omitempty" json:"total_inventory_sources" binding:"omitempty,naproperty"`
	InventorySourcesWithFailures uint32 `bson:"inventory_sources_with_failures,omitempty" json:"inventory_sources_with_failures" binding:"omitempty,naproperty"`

	HasInventorySources bool `bson:"has_inventory_sources" json:"has_inventory_sources" binding:"omitempty,naproperty"`
	HasActiveFailures   bool `bson:"has_active_failures" json:"has_active_failures" binding:"omitempty,naproperty"`

	CreatedBy  bson.ObjectId `bson:"created_by" json:"-"`
	ModifiedBy bson.ObjectId `bson:"modified_by" json:"-"`

	Created  time.Time `bson:"created" json:"created"`
	Modified time.Time `bson:"modified" json:"modified"`

	Roles []AccessControl `bson:"roles" json:"-"`
}

Inventory is the model for Inventory collection

type InventoryScript

type InventoryScript struct {
	ID          bson.ObjectId `bson:"_id" json:"id"`
	Name        string        `bson:"name" json:"name" binding:"required"`
	Description string        `bson:"description" json:"description"`
	Script      string        `bson:"script" json:"script" binding:"required"`

	CreatedByID  bson.ObjectId `bson:"created_by_id" json:"-"`
	ModifiedByID bson.ObjectId `bson:"modified_by_id" json:"-"`

	Created  time.Time `bson:"created" json:"created"`
	Modified time.Time `bson:"modified" json:"modified"`

	Type          string `bson:"-" json:"type"`
	Url           string `bson:"-" json:"url"`
	Related       gin.H  `bson:"-" json:"related"`
	SummaryFields gin.H  `bson:"-" json:"summary_fields"`
}

CustomInventoryScript is the model for organization collection

type InventorySource

type InventorySource struct {
	ID bson.ObjectId `bson:"_id" json:"id"`

	Source             string        `bson:"source" json:"source"`
	SourcePath         string        `bson:"source_path" json:"source_path"`
	SourceVars         string        `bson:"source_vars" json:"source_regions"`
	SourceRegions      string        `bson:"source_regions" json:"has_active_failures"`
	InstanceFilters    string        `bson:"instance_filters" json:"instance_filters"`
	GroupBy            string        `bson:"group_by" json:"group_by"`
	Overwrite          bool          `bson:"overwrite" json:"overwrite"`
	OverwriteVars      bool          `bson:"overwrite_vars" json:"overwrite_vars"`
	UpdateOnLaunch     bool          `bson:"update_on_launch" json:"update_on_launch"`
	UpdateCacheTimeout uint32        `bson:"update_cache_timeout" json:"update_cache_timeout"`
	CredentialID       bson.ObjectId `bson:"credential_id" json:"credential"`
	GroupID            bson.ObjectId `bson:"group_id" json:"group"`
	InventoryID        bson.ObjectId `bson:"inventory_id" json:"inventory"`
	SourceScriptID     bson.ObjectId `bson:"source_script_id" json:"source_script"`

	Type          string `bson:"-" json:"type"`
	Url           string `bson:"-" json:"url"`
	Related       gin.H  `bson:"-" json:"related"`
	SummaryFields gin.H  `bson:"-" json:"summary_fields"`
}

Inventory is the model for Inventory collection TODO: not implemented

type Job

type Job struct {
	ID bson.ObjectId `bson:"_id" json:"id"`

	Name string `bson:"name" json:"name" binding:"required"`

	Description     string    `bson:"description,omitempty" json:"description"`
	LaunchType      string    `bson:"launch_type" json:"launch_type"`
	CancelFlag      bool      `bson:"cancel_flag" json:"cancel_flag"`
	Status          string    `bson:"status" json:"status"`
	Failed          bool      `bson:"failed" json:"failed"`
	Started         time.Time `bson:"started" json:"started"`
	Finished        time.Time `bson:"finished" json:"finished"`
	Elapsed         uint32    `bson:"elapsed" json:"elapsed"`
	ResultStdout    string    `bson:"result_stdout" json:"result_stdout"`
	ResultTraceback string    `bson:"result_traceback" json:"result_traceback"`
	JobExplanation  string    `bson:"job_explanation" json:"job_explanation"`
	JobType         string    `bson:"job_type" json:"job_type"`

	Playbook          string `bson:"playbook" json:"playbook"`
	Forks             uint8  `bson:"forks" json:"forks"`
	Limit             string `bson:"limit,omitempty" json:"limit"`
	Verbosity         uint8  `bson:"verbosity" json:"verbosity"`
	ExtraVars         gin.H  `bson:"extra_vars,omitempty" json:"extra_vars"`
	JobTags           string `bson:"job_tags,omitempty" json:"job_tags"`
	SkipTags          string `bson:"skip_tags,omitempty" json:"skip_tags"`
	ForceHandlers     bool   `bson:"force_handlers" json:"force_handlers"`
	StartAtTask       string `bson:"start_at_task,omitempty" json:"start_at_task"`
	AllowSimultaneous bool   `bson:"allow_simultaneous,omitempty" json:"allow_simultaneous"`

	MachineCredentialID bson.ObjectId  `bson:"credential_id" json:"credential"`
	InventoryID         bson.ObjectId  `bson:"inventory_id" json:"inventory"`
	JobTemplateID       bson.ObjectId  `bson:"job_template_id" json:"job_template"`
	ProjectID           bson.ObjectId  `bson:"project_id" json:"project"`
	BecomeEnabled       bool           `bson:"become_enabled" json:"become_enabled"`
	NetworkCredentialID *bson.ObjectId `bson:"network_credential_id,omitempty" json:"network_credential"`
	CloudCredentialID   *bson.ObjectId `bson:"cloud_credential_id,omitempty" json:"cloud_credential"`

	PromptLimit      bool `bson:"prompt_limit_on_launch" json:"ask_limit_on_launch"`
	PromptInventory  bool `bson:"prompt_inventory" json:"ask_inventory_on_launch"`
	PromptCredential bool `bson:"prompt_credential" json:"ask_credential_on_launch"`
	PromptJobType    bool `bson:"prompt_job_type" json:"ask_job_type_on_launch"`
	PromptTags       bool `bson:"prompt_tags" json:"ask_tags_on_launch"`
	PromptVariables  bool `bson:"prompt_variables" json:"ask_variables_on_launch"`

	// system generated items
	JobCWD  string   `bson:"job_cwd" json:"job_cwd"`
	JobARGS []string `bson:"job_args" json:"job_args"`
	JobENV  []string `bson:"job_env" json:"job_env"`

	CreatedByID  bson.ObjectId `bson:"created_by_id" json:"-"`
	ModifiedByID bson.ObjectId `bson:"modified_by_id" json:"-"`

	Created  time.Time `bson:"created" json:"created"`
	Modified time.Time `bson:"modified" json:"modified"`

	Type    string `bson:"-" json:"type"`
	Url     string `bson:"-" json:"url"`
	Related gin.H  `bson:"-" json:"related"`
	Summary gin.H  `bson:"-" json:"summary_fields"`

	Roles []AccessControl `bson:"roles" json:"-"`
}

type JobTemplate

type JobTemplate struct {
	ID bson.ObjectId `bson:"_id" json:"id"`

	// required
	Name                string        `bson:"name" json:"name" binding:"required,min=1,max=500"`
	JobType             string        `bson:"job_type" json:"job_type" binding:"required,jobtype"`
	InventoryID         bson.ObjectId `bson:"inventory_id" json:"inventory" binding:"required"`
	ProjectID           bson.ObjectId `bson:"project_id" json:"project" binding:"required"`
	Playbook            string        `bson:"playbook" json:"playbook" binding:"required"`
	MachineCredentialID bson.ObjectId `bson:"credential_id" json:"credential" binding:"required"`

	Verbosity uint8 `bson:"verbosity,omitempty" json:"verbosity" binding:"omitempty,max=5"`

	Description         string         `bson:"description,omitempty" json:"description"`
	Forks               uint8          `bson:"forks,omitempty" json:"forks"`
	Limit               string         `bson:"limit,omitempty" json:"limit" binding:"max=1024"`
	ExtraVars           gin.H          `bson:"extra_vars,omitempty" json:"extra_vars"`
	JobTags             string         `bson:"job_tags,omitempty" json:"job_tags" binding:"max=1024"`
	SkipTags            string         `bson:"skip_tags,omitempty" json:"skip_tags" binding:"max=1024"`
	StartAtTask         string         `bson:"start_at_task,omitempty" json:"start_at_task"`
	ForceHandlers       bool           `bson:"force_handlers,omitempty" json:"force_handlers"`
	PromptVariables     bool           `bson:"ask_variables_on_launch,omitempty" json:"ask_variables_on_launch"`
	BecomeEnabled       bool           `bson:"become_enabled,omitempty" json:"become_enabled"`
	CloudCredentialID   *bson.ObjectId `bson:"cloud_credential_id,omitempty" json:"cloud_credential"`
	NetworkCredentialID *bson.ObjectId `bson:"network_credential_id,omitempty" json:"network_credential"`
	PromptLimit         bool           `bson:"prompt_limit_on_launch,omitempty" json:"ask_limit_on_launch"`
	PromptInventory     bool           `bson:"prompt_inventory,omitempty" json:"ask_inventory_on_launch"`
	PromptCredential    bool           `bson:"prompt_credential,omitempty" json:"ask_credential_on_launch"`
	PromptJobType       bool           `bson:"prompt_job_type,omitempty" json:"ask_job_type_on_launch"`
	PromptTags          bool           `bson:"prompt_tags,omitempty" json:"ask_tags_on_launch"`
	PromptSkipTags      bool           `bson:"prompt_skip_tags,omitempty" json:"ask_skip_tags_on_launch"`
	AllowSimultaneous   bool           `bson:"allow_simultaneous,omitempty" json:"allow_simultaneous"`

	PolymorphicCtypeID *bson.ObjectId `bson:"polymorphic_ctype_id,omitempty" json:"polymorphic_ctype"`

	// output only
	LastJobRun     *time.Time     `bson:"last_job_run,omitempty" json:"last_job_run" binding:"omitempty,naproperty"`
	NextJobRun     *time.Time     `bson:"next_job_run,omitempty" json:"next_job_run" binding:"omitempty,naproperty"`
	Status         string         `bson:"status,omitempty" json:"status" binding:"omitempty,naproperty"`
	CurrentJobID   *bson.ObjectId `bson:"current_job_id,omitempty" json:"current_job" binding:"omitempty,naproperty"`
	LastJobID      *bson.ObjectId `bson:"last_job_id,omitempty" json:"last_job" binding:"omitempty,naproperty"`
	NextScheduleID *bson.ObjectId `bson:"next_schedule_id,omitempty" json:"next_schedule" binding:"omitempty,naproperty"`
	LastJobFailed  bool           `bson:"last_job_failed,omitempty" json:"last_job_failed" binding:"omitempty,naproperty"`
	HasSchedules   bool           `bson:"has_schedules,omitempty" json:"has_schedules" binding:"omitempty,naproperty"`

	Kind string `bson:"kind,omitempty" json:"-"`

	CreatedByID  bson.ObjectId `bson:"created_by_id" json:"-"`
	ModifiedByID bson.ObjectId `bson:"modified_by_id" json:"-"`

	Created  time.Time `bson:"created" json:"created" binding:"omitempty,naproperty"`
	Modified time.Time `bson:"modified" json:"modified" binding:"omitempty,naproperty"`

	Type    string `bson:"-" json:"type"`
	Url     string `bson:"-" json:"url"`
	Related gin.H  `bson:"-" json:"related"`
	Summary gin.H  `bson:"-" json:"summary_fields"`

	Roles []AccessControl `bson:"roles" json:"-"`
}

type Launch added in v0.0.2

type Launch struct {
	Limit               string        `bson:"limit,omitempty" json:"limit,omitempty" binding:"omitempty,max=1024"`
	ExtraVars           gin.H         `bson:"extra_vars,omitempty" json:"extra_vars,omitempty"`
	JobTags             string        `bson:"job_tags,omitempty" json:"job_tags,omitempty" binding:"omitempty,max=1024"`
	SkipTags            string        `bson:"skip_tags,omitempty" json:"skip_tags,omitempty" binding:"omitempty,max=1024"`
	JobType             string        `bson:"job_type,omitempty" json:"job_type,omitempty" binding:"omitempty,jobtype"`
	InventoryID         bson.ObjectId `bson:"inventory_id,omitempty" json:"inventory,omitempty"`
	MachineCredentialID bson.ObjectId `bson:"credential_id,omitempty" json:"credential,omitempty"`
}

type Notification

type Notification struct {
	ID bson.ObjectId `bson:"_id" json:"id"`

	Status                 string `bson:"status" json:"status"`
	Error                  string `bson:"error" json:"error"`
	NotificationsSent      uint64 `bson:"notifications_sent" json:"notifications_sent"`
	NotificationsType      string `bson:"notification_type" json:"notification_type"`
	Recipients             string `bson:"recipients" json:"recipients"`
	Subject                string `bson:"subject" json:"subject"`
	Body                   string `bson:"body" json:"body"`
	NotificationTemplateId string `bson:"notification_template_id" json:"notification_template_id"`

	CreatedByID  bson.ObjectId `bson:"created_by_id" json:"-"`
	ModifiedByID bson.ObjectId `bson:"modified_by_id" json:"-"`

	Created  time.Time `bson:"created" json:"created"`
	Modified time.Time `bson:"modified" json:"modified"`

	Type          string `bson:"-" json:"type"`
	Url           string `bson:"-" json:"url"`
	Related       gin.H  `bson:"-" json:"related"`
	SummaryFields gin.H  `bson:"-" json:"summary_fields"`

	Access []AccessControl `bson:"access" json:"-"`
}

type NotificationTemplate

type NotificationTemplate struct {
	ID bson.ObjectId `bson:"_id" json:"id"`

	Description               string `bson:"description" json:"description"`
	Name                      string `bson:"name" json:"name"`
	NotificationsType         string `bson:"notification_type" json:"notification_type"`
	NotificationConfiguration string `bson:"notification_configuration" json:"notification_configuration"`
	Subject                   string `bson:"subject" json:"subject"`

	CreatedByID  bson.ObjectId `bson:"created_by_id" json:"-"`
	ModifiedByID bson.ObjectId `bson:"modified_by_id" json:"-"`

	Created  time.Time `bson:"created" json:"created"`
	Modified time.Time `bson:"modified" json:"modified"`

	Type          string `bson:"-" json:"type"`
	Url           string `bson:"-" json:"url"`
	Related       gin.H  `bson:"-" json:"related"`
	SummaryFields gin.H  `bson:"-" json:"summary_fields"`

	Access []AccessControl `bson:"access" json:"-"`
}

type Organization

type Organization struct {
	ID            bson.ObjectId `bson:"_id" json:"id"`
	Type          string        `bson:"-" json:"type"`
	Url           string        `bson:"-" json:"url"`
	Related       gin.H         `bson:"-" json:"related"`
	SummaryFields gin.H         `bson:"-" json:"summary_fields"`

	Name        string `bson:"name" json:"name" binding:"required,min=1,max=500"`
	Description string `bson:"description" json:"description"`

	CreatedBy  bson.ObjectId `bson:"created_by" json:"-"`
	ModifiedBy bson.ObjectId `bson:"modified_by" json:"-"`

	Created  time.Time `bson:"created" json:"created"`
	Modified time.Time `bson:"modified" json:"modified"`

	Roles []AccessControl `bson:"roles" json:"-"`
}

Organization is the model for organization collection

type PatchCredential added in v0.0.3

type PatchCredential struct {
	Name              string         `bson:"name,omitempty" json:"name,omitempty" binding:"omitempty,min=1,max=500"`
	Kind              string         `bson:"kind,omitempty" json:"kind,omitempty" binding:"omitempty,credentialkind"`
	Cloud             bool           `bson:"cloud,omitempty" json:"cloud,omitempty"`
	Description       string         `bson:"description,omitempty" json:"description,omitempty"`
	Host              string         `bson:"host,omitempty" json:"host,omitempty"`
	Username          string         `bson:"username,omitempty" json:"username,omitempty"`
	Password          string         `bson:"password,omitempty" json:"password,omitempty"`
	SecurityToken     string         `bson:"security_token,omitempty" json:"security_token"`
	Project           string         `bson:"project,omitempty" json:"project,omitempty"`
	Domain            string         `bson:"domain,omitempty" json:"domain,omitempty"`
	SshKeyData        string         `bson:"ssh_key_data,omitempty" json:"ssh_key_data,omitempty"`
	SshKeyUnlock      string         `bson:"ssh_key_unlock,omitempty" json:"ssh_key_unlock,omitempty"`
	BecomeMethod      string         `bson:"become_method,omitempty" json:"become_method,omitempty" binding:"omitempty,become_method"`
	BecomeUsername    string         `bson:"become_username,omitempty" json:"become_username,omitempty"`
	BecomePassword    string         `bson:"become_password,omitempty" json:"become_password,omitempty"`
	VaultPassword     string         `bson:"vault_password,omitempty" json:"vault_password,omitempty"`
	Subscription      string         `bson:"subscription,omitempty" json:"subscription,omitempty"`
	Tenant            string         `bson:"tenant,omitempty" json:"tenant,omitempty"`
	Secret            string         `bson:"secret,omitempty" json:"secret,omitempty"`
	Client            string         `bson:"client,omitempty" json:"client,omitempty"`
	Authorize         *bool          `bson:"authorize,omitempty" json:"authorize,omitempty"`
	AuthorizePassword string         `bson:"authorize_password,omitempty" json:"authorize_password,omitempty"`
	OrganizationID    *bson.ObjectId `bson:"organization_id,omitempty" json:"organization,omitempty"`
	Modified          time.Time      `bson:"modified" json:"-"`
	ModifiedByID      bson.ObjectId  `bson:"modified_by_id" json:"-"`
}

type PatchGroup added in v0.0.3

type PatchGroup struct {
	Name          string         `bson:"name,omitempty" json:"name,omitempty" binding:"omitempty,min=1,max=500"`
	Description   string         `bson:"description,omitempty" json:"description,omitempty"`
	Variables     string         `bson:"variables,omitempty" json:"variables,omitempty"`
	InventoryID   bson.ObjectId  `bson:"inventory_id,omitempty" json:"inventory,omitempty"`
	ParentGroupID *bson.ObjectId `bson:"parent_group_id,omitempty" json:"parent_group,omitempty"`

	ModifiedByID bson.ObjectId `bson:"modified_by_id" json:"-"`
	Modified     time.Time     `bson:"modified" json:"-"`
}

type PatchHost added in v0.0.3

type PatchHost struct {
	Name        string         `bson:"name,omitempty" json:"name,omitempty" binding:"iphost"`
	InventoryID bson.ObjectId  `bson:"inventory_id,omitempty" json:"inventory,omitempty"`
	Description string         `bson:"description,omitempty" json:"description,omitempty"`
	GroupID     *bson.ObjectId `bson:"group_id,omitempty" json:"group,omitempty"`
	InstanceID  string         `bson:"instance_id,omitempty" json:"instance_id,omitempty"`
	Variables   string         `bson:"variables,omitempty" json:"variables,omitempty"`
	Enabled     *bool          `bson:"enabled,omitempty" json:"enabled,omitempty"`

	ModifiedByID bson.ObjectId `bson:"modified_by_id" json:"-"`
	Modified     time.Time     `bson:"modified,omitempty" json:"-"`
}

type PatchInventory added in v0.0.3

type PatchInventory struct {
	// required feilds
	Name           string        `bson:"name,omitempty" json:"name,omitempty" binding:"omitempty,min=1,max=500"`
	OrganizationID bson.ObjectId `bson:"organization_id,omitempty" json:"organization,omitempty"`
	Description    string        `bson:"description,omitempty" json:"description,omitempty"`
	Variables      string        `bson:"variables,omitempty" json:"variables,omitempty"`

	ModifiedBy bson.ObjectId `bson:"modified_by" json:"-"`
	Modified   time.Time     `bson:"modified" json:"-"`
}

PatchInventory is the model for patch requests

type PatchJobTemplate added in v0.0.3

type PatchJobTemplate struct {
	Name                string         `bson:"name,omitempty" json:"name,omitempty" binding:"omitempty,min=1,max=500"`
	JobType             string         `bson:"job_type,omitempty" json:"job_type,omitempty" binding:"omitempty,jobtype"`
	InventoryID         bson.ObjectId  `bson:"inventory_id,omitempty" json:"inventory,omitempty"`
	ProjectID           bson.ObjectId  `bson:"project_id,omitempty" json:"project,omitempty"`
	Playbook            string         `bson:"playbook,omitempty" json:"playbook,omitempty"`
	MachineCredentialID bson.ObjectId  `bson:"credential_id,omitempty" json:"credential,omitempty"`
	Verbosity           uint8          `bson:"verbosity,omitempty" json:"verbosity,omitempty" binding:"omitempty,min=0,max=5"`
	Description         string         `bson:"description,omitempty" json:"description,omitempty"`
	Forks               uint8          `bson:"forks,omitempty" json:"forks,omitempty"`
	Limit               string         `bson:"limit,omitempty" json:"limit,omitempty" binding:"omitempty,max=1024"`
	ExtraVars           gin.H          `bson:"extra_vars,omitempty" json:"extra_vars,omitempty"`
	JobTags             string         `bson:"job_tags,omitempty" json:"job_tags,omitempty" binding:"omitempty,max=1024"`
	SkipTags            string         `bson:"skip_tags,omitempty" json:"skip_tags,omitempty" binding:"omitempty,max=1024"`
	StartAtTask         string         `bson:"start_at_task,omitempty" json:"start_at_task,omitempty"`
	ForceHandlers       *bool          `bson:"force_handlers,omitempty" json:"force_handlers,omitempty"`
	PromptVariables     *bool          `bson:"ask_variables_on_launch,omitempty" json:"ask_variables_on_launch,omitempty"`
	BecomeEnabled       *bool          `bson:"become_enabled,omitempty" json:"become_enabled,omitempty"`
	CloudCredentialID   *bson.ObjectId `bson:"cloud_credential_id,omitempty" json:"cloud_credential,omitempty"`
	NetworkCredentialID *bson.ObjectId `bson:"network_credential_id,omitempty" json:"network_credential,omitempty"`
	PromptLimit         *bool          `bson:"prompt_limit_on_launch,omitempty" json:"ask_limit_on_launch,omitempty"`
	PromptInventory     *bool          `bson:"prompt_inventory,omitempty" json:"ask_inventory_on_launch,omitempty"`
	PromptCredential    *bool          `bson:"prompt_credential,omitempty" json:"ask_credential_on_launch,omitempty"`
	PromptJobType       *bool          `bson:"prompt_job_type,omitempty" json:"ask_job_type_on_launch,omitempty"`
	PromptTags          *bool          `bson:"prompt_tags,omitempty" json:"ask_tags_on_launch,omitempty"`
	PromptSkipTags      *bool          `bson:"prompt_skip_tags,omitempty" json:"ask_skip_tags_on_launch,omitempty"`
	AllowSimultaneous   *bool          `bson:"allow_simultaneous,omitempty" json:"allow_simultaneous,omitempty"`
	PolymorphicCtypeID  *bson.ObjectId `bson:"polymorphic_ctype_id,omitempty" json:"polymorphic_ctype,omitempty"`

	ModifiedByID bson.ObjectId `bson:"modified_by_id" json:"-"`
	Modified     time.Time     `bson:"modified" json:"-"`
}

type PatchOrganization added in v0.0.3

type PatchOrganization struct {
	Name        string `bson:"name,omitempty" json:"name,omitempty" binding:"omitempty,min=1,max=500"`
	Description string `bson:"description,omitempty" json:"description,omitempty"`

	ModifiedBy bson.ObjectId `bson:"modified_by" json:"-"`
	Modified   time.Time     `bson:"modified" json:"-"`
}

type PatchProject added in v0.0.3

type PatchProject struct {
	Name                  string         `bson:"name,omitempty" json:"name,omitempty" binding:"omitempty,min=1,max=500"`
	ScmType               string         `bson:"scm_type,omitempty" json:"scm_type,omitempty" binding:"omitempty,scmtype"`
	OrganizationID        bson.ObjectId  `bson:"organization_id,omitempty" json:"organization,omitempty"`
	Description           string         `bson:"description,omitempty" json:"description,omitempty"`
	ScmUrl                string         `bson:"scm_url,omitempty" json:"scm_url,omitempty" binding:"omitempty,url"`
	ScmBranch             string         `bson:"scm_branch,omitempty" json:"scm_branch,omitempty"`
	ScmClean              *bool          `bson:"scm_clean,omitempty" json:"scm_clean,omitempty"`
	ScmDeleteOnUpdate     *bool          `bson:"scm_delete_on_update,omitempty" json:"scm_delete_on_update,omitempty"`
	ScmCredentialID       *bson.ObjectId `bson:"credentail_id,omitempty" json:"credential,omitempty"`
	ScmDeleteOnNextUpdate *bool          `bson:"scm_delete_on_next_update,omitempty" json:"scm_delete_on_next_update,omitempty"`
	ScmUpdateOnLaunch     *bool          `bson:"scm_update_on_launch,omitempty" json:"scm_update_on_launch,omitempty"`
	ScmUpdateCacheTimeout int            `bson:"scm_update_cache_timeout,omitempty" json:"scm_update_cache_timeout,omitempty"`
	ModifiedBy            bson.ObjectId  `bson:"modified_by" json:"-"`
	Modified              time.Time      `bson:"modified" json:"-"`
}

All optional

type PatchTeam added in v0.0.3

type PatchTeam struct {
	Name           string        `bson:"name,omitempty" json:"name,omitempty" binding:"omitempty,min=1,max=500"`
	OrganizationID bson.ObjectId `bson:"organization_id,omitempty" json:"organization,omitempty"`
	Description    string        `bson:"description,omitempty" json:"description,omitempty"`
	ModifiedBy     bson.ObjectId `bson:"modified_by" json:"-"`
	Modified       time.Time     `bson:"modified" json:"-"`
}

type Project

type Project struct {
	ID bson.ObjectId `bson:"_id" json:"id"`

	Type    string `bson:"-" json:"type"`
	Url     string `bson:"-" json:"url"`
	Related gin.H  `bson:"-" json:"related"`
	Summary gin.H  `bson:"-" json:"summary_fields"`

	// required feilds
	Name           string        `bson:"name" json:"name" binding:"required,min=1,max=500"`
	ScmType        string        `bson:"scm_type" json:"scm_type" binding:"required,scmtype"`
	OrganizationID bson.ObjectId `bson:"organization_id" json:"organization" binding:"required"`

	Description           string         `bson:"description,omitempty" json:"description"`
	LocalPath             string         `bson:"local_path,omitempty" json:"local_path" binding:"omitempty,naproperty"`
	ScmUrl                string         `bson:"scm_url,omitempty" json:"scm_url" binding:"url"`
	ScmBranch             string         `bson:"scm_branch,omitempty" json:"scm_branch"`
	ScmClean              bool           `bson:"scm_clean,omitempty" json:"scm_clean"`
	ScmDeleteOnUpdate     bool           `bson:"scm_delete_on_update,omitempty" json:"scm_delete_on_update"`
	ScmCredentialID       *bson.ObjectId `bson:"credentail_id,omitempty" json:"credential"`
	ScmDeleteOnNextUpdate bool           `bson:"scm_delete_on_next_update,omitempty" json:"scm_delete_on_next_update"`
	ScmUpdateOnLaunch     bool           `bson:"scm_update_on_launch,omitempty" json:"scm_update_on_launch"`
	ScmUpdateCacheTimeout int            `bson:"scm_update_cache_timeout,omitempty" json:"scm_update_cache_timeout"`

	// only output
	LastJob          *bson.ObjectId `bson:"last_job,omitempty" json:"last_job" binding:"omitempty,naproperty"`
	LastJobRun       *time.Time     `bson:"last_job_run,omitempty" json:"last_job_run" binding:"omitempty,naproperty"`
	LastJobFailed    bool           `bson:"last_job_failed,omitempty" json:"last_job_failed" binding:"omitempty,naproperty"`
	HasSchedules     bool           `bson:"has_schedules,omitempty" json:"has_schedules" binding:"omitempty,naproperty"`
	NextJobRun       *time.Time     `bson:"next_job_run,omitempty" json:"next_job_run" binding:"omitempty,naproperty"`
	Status           string         `bson:"status,omitempty" json:"status" binding:"omitempty,naproperty"`
	LastUpdateFailed bool           `bson:"last_update_failed,omitempty" json:"last_update_failed" binding:"omitempty,naproperty"`
	LastUpdated      *time.Time     `bson:"last_updated,omitempty" json:"last_updated" binding:"omitempty,naproperty"`

	CreatedBy  bson.ObjectId `bson:"created_by" json:"-"`
	ModifiedBy bson.ObjectId `bson:"modified_by" json:"-"`

	Created  time.Time `bson:"created" json:"created" binding:"omitempty,naproperty"`
	Modified time.Time `bson:"modified" json:"modified" binding:"omitempty,naproperty"`

	Roles []AccessControl `bson:"roles" json:"-"`
}

Project is the model for project collection

type Response

type Response struct {
	Count    int         `json:"count"`
	Next     interface{} `json:"next"`
	Previous interface{} `json:"previous"`
	Results  interface{} `json:"results"`
}

type SCMUpdate added in v0.0.4

type SCMUpdate struct {
	ExtraVars gin.H `bson:"extra_vars,omitempty" json:"extra_vars,omitempty"`
}

type SystemJob added in v0.0.3

type SystemJob struct {
	ID bson.ObjectId `bson:"_id" json:"id"`

	Name string `bson:"name" json:"name" binding:"required"`

	Description     string    `bson:"description,omitempty" json:"description"`
	LaunchType      string    `bson:"launch_type" json:"launch_type"`
	CancelFlag      bool      `bson:"cancel_flag" json:"cancel_flag"`
	Status          string    `bson:"status" json:"status"`
	Failed          bool      `bson:"failed" json:"failed"`
	Started         time.Time `bson:"started" json:"started"`
	Finished        time.Time `bson:"finished" json:"finished"`
	Elapsed         uint32    `bson:"elapsed" json:"elapsed"`
	ResultStdout    string    `bson:"result_stdout" json:"result_stdout"`
	ResultTraceback string    `bson:"result_traceback" json:"result_traceback"`
	JobExplanation  string    `bson:"job_explanation" json:"job_explanation"`
	JobType         string    `bson:"job_type" json:"job_type"`

	Playbook      string `bson:"playbook" json:"playbook"`
	Forks         uint8  `bson:"forks" json:"forks"`
	Limit         string `bson:"limit,omitempty" json:"limit"`
	Verbosity     uint8  `bson:"verbosity" json:"verbosity"`
	ExtraVars     gin.H  `bson:"extra_vars,omitempty" json:"extra_vars"`
	JobTags       string `bson:"job_tags,omitempty" json:"job_tags"`
	SkipTags      string `bson:"skip_tags,omitempty" json:"skip_tags"`
	ForceHandlers bool   `bson:"force_handlers" json:"force_handlers"`
	StartAtTask   string `bson:"start_at_task,omitempty" json:"start_at_task"`

	CredentialID  bson.ObjectId `bson:"credential_id,omitempty" json:"credential"`
	ProjectID     bson.ObjectId `bson:"project_id" json:"project"`
	BecomeEnabled bool          `bson:"become_enabled" json:"become_enabled"`

	// system generated items
	JobCWD  string   `bson:"job_cwd" json:"job_cwd"`
	JobARGS []string `bson:"job_args" json:"job_args"`
	JobENV  []string `bson:"job_env" json:"job_env"`

	Created  time.Time `bson:"created" json:"created"`
	Modified time.Time `bson:"modified" json:"modified"`

	Type    string `bson:"-" json:"type"`
	Url     string `bson:"-" json:"url"`
	Related gin.H  `bson:"-" json:"related"`
	Summary gin.H  `bson:"-" json:"summary_fields"`
}

type Team

type Team struct {
	ID bson.ObjectId `bson:"_id" json:"id"`

	Type          string `bson:"-" json:"type"`
	Url           string `bson:"-" json:"url"`
	Related       gin.H  `bson:"-" json:"related"`
	SummaryFields gin.H  `bson:"-" json:"summary_fields"`

	Name           string        `bson:"name" json:"name" binding:"required,min=1,max=500"`
	OrganizationID bson.ObjectId `bson:"organization_id" json:"organization" binding:"required"`

	Description *string `bson:"description,omitempty" json:"description"`

	CreatedBy  bson.ObjectId `bson:"created_by" json:"-"`
	ModifiedBy bson.ObjectId `bson:"modified_by" json:"-"`

	Created  time.Time `bson:"created" json:"created"`
	Modified time.Time `bson:"modified" json:"modified"`

	Roles []AccessControl `bson:"roles" json:"-"`
}

team is the model for organization collection

type User

type User struct {
	ID      bson.ObjectId `bson:"_id" json:"id"`
	Type    string        `bson:"-" json:"type"`
	Url     string        `bson:"-" json:"url"`
	Related gin.H         `bson:"-" json:"related"`

	Username        string         `bson:"username" json:"username" binding:"required,min=1,max=500"`
	FirstName       string         `bson:"first_name" json:"first_name"`
	LastName        string         `bson:"last_name" json:"last_name"`
	Email           string         `bson:"email" json:"email" binding:"required"`
	IsSuperUser     bool           `bson:"is_superuser" json:"is_superuser"`
	IsSystemAuditor bool           `bson:"is_system_auditor" json:"is_system_auditor"`
	Password        string         `bson:"password" json:"-"`
	OrganizationID  *bson.ObjectId `bson:"organization_id" json:"organization"`

	Deleted bool `bson:"deleted" json:"-"`

	Created time.Time `bson:"created" json:"created"`
}

User is model for user collection

Jump to

Keyboard shortcuts

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