models

package
v0.3.9-9 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Apache-2.0 Imports: 31 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MonitorAgent = "monitor agent"

Functions

func AddOneCronjob

func AddOneCronjob(item *SCronjob, s *mcclient.ClientSession) error

func InitDB

func InitDB() error

func InitializeCronjobs

func InitializeCronjobs() error

Types

type SCronjob

type SCronjob struct {
	SVSCronjob
	AnsiblePlaybookID string `width:"36" nullable:"false" create:"required" index:"true" list:"user" update:"user"`
	TemplateID        string `width:"36" nullable:"true" create:"optional" index:"true" list:"user" update:"user"`
	ServerID          string `width:"36" nullable:"true" create:"optional" index:"true" list:"user" update:"user"`
	db.SVirtualResourceBase
}

func (*SCronjob) PostCreate

func (job *SCronjob) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerID mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SCronjob) PostDelete

func (job *SCronjob) PostDelete(ctx context.Context, userCred mcclient.TokenCredential)

func (*SCronjob) PostUpdate

func (job *SCronjob) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject)

type SCronjobManager

type SCronjobManager struct {
	db.SVirtualResourceBaseManager
}
var (
	CronjobManager     *SCronjobManager
	DevToolCronManager *cronman.SCronJobManager
)

type SDevtoolTemplate

type SDevtoolTemplate struct {
	SVSCronjob
	Playbook *ansible.Playbook `length:"text" nullable:"false" create:"required" get:"user" update:"user"`
	db.SVirtualResourceBase
}

func (*SDevtoolTemplate) Binding

func (*SDevtoolTemplate) PerformBind

func (*SDevtoolTemplate) PerformUnbind

func (*SDevtoolTemplate) PostUpdate

func (obj *SDevtoolTemplate) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SDevtoolTemplate) TaskUpdate

func (*SDevtoolTemplate) Unbinding

func (*SDevtoolTemplate) ValidateDeleteCondition

func (obj *SDevtoolTemplate) ValidateDeleteCondition(ctx context.Context, info jsonutils.JSONObject) error

type SDevtoolTemplateManager

type SDevtoolTemplateManager struct {
	db.SVirtualResourceBaseManager
}
var (
	DevtoolTemplateManager *SDevtoolTemplateManager
)

type SScript

type SScript struct {
	db.SSharableVirtualResourceBase
	// remote
	Type                string `width:"16" nullable:"false"`
	PlaybookReferenceId string `width:"128" nullable:"false"`
	MaxTryTimes         int    `default:"1"`
}

func (*SScript) ApplyInfos

func (s *SScript) ApplyInfos() ([]api.SApplyInfo, error)

func (*SScript) CustomizeCreate

func (s *SScript) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SScript) PerformApply

func (*SScript) PerformBatchApply

type SScriptApply

type SScriptApply struct {
	db.SStatusStandaloneResourceBase
	ScriptId string `width:"36" nullable:"false" index:"true"`
	GuestId  string `width:"36" nullable:"false" index:"true"`
	//
	Args          jsonutils.JSONObject
	TryTimes      int
	ArgsGenerator string `width:"36" nullable:"false"`
}

func (*SScriptApply) Script

func (sa *SScriptApply) Script() (*SScript, error)

func (*SScriptApply) StartApply

func (sa *SScriptApply) StartApply(ctx context.Context, userCred mcclient.TokenCredential) (err error)

func (*SScriptApply) StopApply

func (sa *SScriptApply) StopApply(userCred mcclient.TokenCredential, record *SScriptApplyRecord, success bool, failCode string, reason string) error

type SScriptApplyManager

type SScriptApplyManager struct {
	db.SStatusStandaloneResourceBaseManager
	Session *sScriptApplySession
}
var ScriptApplyManager *SScriptApplyManager

type SScriptApplyRecord

type SScriptApplyRecord struct {
	db.SStatusStandaloneResourceBase
	ScriptApplyId string    `width:"36" charset:"ascii" nullable:"true" list:"user" index:"true"`
	StartTime     time.Time `list:"user"`
	EndTime       time.Time `list:"user"`
	Reason        string    `list:"user"`
	FailCode      string    `list:"user"`
}

func (*SScriptApplyRecord) Fail

func (sar *SScriptApplyRecord) Fail(code string, reason string) error

func (*SScriptApplyRecord) GetOwnerId

func (sar *SScriptApplyRecord) GetOwnerId() mcclient.IIdentityProvider

func (*SScriptApplyRecord) ScriptApply

func (sar *SScriptApplyRecord) ScriptApply() (*SScriptApply, error)

func (*SScriptApplyRecord) SetResult

func (sar *SScriptApplyRecord) SetResult(status, failCode, reason string) error

func (*SScriptApplyRecord) Succeed

func (sar *SScriptApplyRecord) Succeed(reason string) error

type SScriptApplyRecordManager

type SScriptApplyRecordManager struct {
	db.SStatusStandaloneResourceBaseManager
}
var ScriptApplyRecordManager *SScriptApplyRecordManager

func (*SScriptApplyRecordManager) CreateRecord

func (sarm *SScriptApplyRecordManager) CreateRecord(ctx context.Context, scriptApplyId string) (*SScriptApplyRecord, error)

func (*SScriptApplyRecordManager) FetchCustomizeColumns

func (sarm *SScriptApplyRecordManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, objs []interface{}, fields stringutils2.SSortedStrings, isList bool) []api.ScriptApplyRecordDetails

func (*SScriptApplyRecordManager) FetchOwnerId

func (*SScriptApplyRecordManager) FileterByOwner

func (*SScriptApplyRecordManager) ListItemFilter

func (*SScriptApplyRecordManager) NamespaceScope

func (sarm *SScriptApplyRecordManager) NamespaceScope() rbacutils.TRbacScope

func (*SScriptApplyRecordManager) ResourceScope

func (sarm *SScriptApplyRecordManager) ResourceScope() rbacutils.TRbacScope

type SScriptManager

type SScriptManager struct {
	db.SSharableVirtualResourceBaseManager
}
var ScriptManager *SScriptManager

func (*SScriptManager) FetchCustomizeColumns

func (sm *SScriptManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, objs []interface{}, fields stringutils2.SSortedStrings, isList bool) []api.ScriptDetails

func (*SScriptManager) InitializeData

func (sm *SScriptManager) InitializeData() error

func (*SScriptManager) ValidateCreateData

type SServerAnisbleInfo

type SServerAnisbleInfo struct {
	User string `json:"user"`
	IP   string `json:"ip"`
	Port int    `json:"port"`
	Name string `json:"name"`
}

func (*SServerAnisbleInfo) IsZero

func (ai *SServerAnisbleInfo) IsZero() bool

func (*SServerAnisbleInfo) String

func (ai *SServerAnisbleInfo) String() string

type SServiceUrl

type SServiceUrl struct {
	db.SStatusStandaloneResourceBase
	Service           string              `width:"32" charset:"ascii" list:"user" create:"required"`
	ServerId          string              `width:"128" charset:"ascii" list:"user" create:"required"`
	Url               string              `wdith:"32" charset:"ascii" list:"user"`
	ServerAnsibleInfo *SServerAnisbleInfo `width:"128" list:"user" create:"required"`
	FailedReason      string
}

func (*SServiceUrl) MarkCreateFailed

func (su *SServiceUrl) MarkCreateFailed(reason string)

func (*SServiceUrl) PostCreate

type SServiceUrlManager

type SServiceUrlManager struct {
	db.SStatusStandaloneResourceBaseManager
}
var ServiceUrlManager *SServiceUrlManager

type SSshInfo

type SSshInfo struct {
	db.SStatusStandaloneResourceBase
	ServerId         string `width:"128" charset:"ascii" list:"user" create:"required"`
	ServerName       string `width:"128" charset:"utf8" list:"user" create:"optional"`
	ServerHypervisor string `width:"16" charset:"ascii" create:"optional"`
	ForwardId        string `width:"128" charset:"ascii" create:"optional"`
	User             string `width:"36" list:"user" create:"optional"`
	Host             string `width:"36" charset:"ascii" list:"user" create:"optional"`
	Port             int    `width:"8" charset:"ascii" list:"user" create:"optional"`
	NeedClean        tristate.TriState
	FailedReason     string
}

func (*SSshInfo) CustomizeDelete

func (si *SSshInfo) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SSshInfo) Delete

func (si *SSshInfo) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SSshInfo) MarkCreateFailed

func (si *SSshInfo) MarkCreateFailed(reason string)

func (*SSshInfo) MarkDeleteFailed

func (si *SSshInfo) MarkDeleteFailed(reason string)

func (*SSshInfo) PostCreate

func (*SSshInfo) RealDelete

func (si *SSshInfo) RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error

type SSshInfoManager

type SSshInfoManager struct {
	db.SStatusStandaloneResourceBaseManager
}
var SshInfoManager *SSshInfoManager

type SVSCronjob

type SVSCronjob struct {
	Day      int   `json:"day" nullable:"true" create:"optional" list:"user" update:"user" default:"0"`
	Hour     int   `nullable:"true" create:"optional" list:"user" update:"user" default:"0"`
	Min      int   `nullable:"true" create:"optional" list:"user" update:"user" default:"0"`
	Sec      int   `nullable:"true" create:"optional" list:"user" update:"user" default:"0"`
	Interval int64 `nullable:"true" create:"optional" list:"user" update:"user" default:"0"`
	Start    bool  `nullable:"true" create:"optional" list:"user" update:"user" default:"false"`
	Enabled  bool  `nullable:"true" create:"optional" list:"user" update:"user" default:"false"`
}

Jump to

Keyboard shortcuts

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