Documentation ¶
Index ¶
- Variables
- func AddOneCronjob(item *SCronjob, s *mcclient.ClientSession) error
- func InitDB() error
- func InitializeCronjobs(ctx context.Context) error
- func RunAnsibleCronjob(id string, s *mcclient.ClientSession) cronman.TCronJobFunction
- type SCronjob
- type SCronjobManager
- type SDevtoolTemplate
- func (obj *SDevtoolTemplate) Binding(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (obj *SDevtoolTemplate) PerformBind(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (obj *SDevtoolTemplate) PerformUnbind(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (obj *SDevtoolTemplate) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (obj *SDevtoolTemplate) TaskUpdate(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (obj *SDevtoolTemplate) Unbinding(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (obj *SDevtoolTemplate) ValidateDeleteCondition(ctx context.Context, info jsonutils.JSONObject) error
- type SDevtoolTemplateManager
- type SScript
- func (s *SScript) ApplyInfos() ([]api.SApplyInfo, error)
- func (s *SScript) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (s *SScript) PerformApply(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.ScriptApplyOutput, error)
- func (s *SScript) PerformBatchApply(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.ScriptBatchApplyOutput, error)
- type SScriptApply
- type SScriptApplyManager
- type SScriptApplyRecord
- func (sar *SScriptApplyRecord) Fail(code string, reason string) error
- func (sar *SScriptApplyRecord) GetOwnerId() mcclient.IIdentityProvider
- func (sar *SScriptApplyRecord) ScriptApply() (*SScriptApply, error)
- func (sar *SScriptApplyRecord) SetResult(status, failCode, reason string) error
- func (sar *SScriptApplyRecord) Succeed(reason string) error
- type SScriptApplyRecordManager
- func (sarm *SScriptApplyRecordManager) CreateRecord(ctx context.Context, scriptApplyId string) (*SScriptApplyRecord, error)
- func (sarm *SScriptApplyRecordManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, ...) []api.ScriptApplyRecordDetails
- func (sarm *SScriptApplyRecordManager) FetchOwnerId(ctx context.Context, data jsonutils.JSONObject) (mcclient.IIdentityProvider, error)
- func (sarm *SScriptApplyRecordManager) FileterByOwner(q *sqlchemy.SQuery, owner mcclient.IIdentityProvider, ...) *sqlchemy.SQuery
- func (sarm *SScriptApplyRecordManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (sarm *SScriptApplyRecordManager) NamespaceScope() rbacscope.TRbacScope
- func (sarm *SScriptApplyRecordManager) ResourceScope() rbacscope.TRbacScope
- type SScriptManager
- func (sm *SScriptManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, ...) []api.ScriptDetails
- func (sm *SScriptManager) InitializeData() error
- func (sm *SScriptManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.ScriptCreateInput, error)
- type SServerAnisbleInfo
- type SServiceUrl
- type SServiceUrlManager
- type SSshInfo
- func (si *SSshInfo) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (si *SSshInfo) Delete(ctx context.Context, userCred mcclient.TokenCredential) error
- func (si *SSshInfo) MarkCreateFailed(reason string)
- func (si *SSshInfo) MarkDeleteFailed(reason string)
- func (si *SSshInfo) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (si *SSshInfo) RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error
- type SSshInfoManager
- type SVSCronjob
Constants ¶
This section is empty.
Variables ¶
View Source
var MonitorAgent = "monitor agent"
Functions ¶
func AddOneCronjob ¶
func AddOneCronjob(item *SCronjob, s *mcclient.ClientSession) error
func InitializeCronjobs ¶
func RunAnsibleCronjob ¶
func RunAnsibleCronjob(id string, s *mcclient.ClientSession) cronman.TCronJobFunction
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 (obj *SDevtoolTemplate) Binding(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SDevtoolTemplate) PerformBind ¶
func (obj *SDevtoolTemplate) PerformBind(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SDevtoolTemplate) PerformUnbind ¶
func (obj *SDevtoolTemplate) PerformUnbind(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SDevtoolTemplate) PostUpdate ¶
func (obj *SDevtoolTemplate) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SDevtoolTemplate) TaskUpdate ¶
func (obj *SDevtoolTemplate) TaskUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SDevtoolTemplate) Unbinding ¶
func (obj *SDevtoolTemplate) Unbinding(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)
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 (s *SScript) PerformApply(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.ScriptApplyInput) (api.ScriptApplyOutput, error)
func (*SScript) PerformBatchApply ¶
func (s *SScript) PerformBatchApply(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.ScriptBatchApplyInput) (api.ScriptBatchApplyOutput, error)
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 (sarm *SScriptApplyRecordManager) FetchOwnerId(ctx context.Context, data jsonutils.JSONObject) (mcclient.IIdentityProvider, error)
func (*SScriptApplyRecordManager) FileterByOwner ¶
func (sarm *SScriptApplyRecordManager) FileterByOwner(q *sqlchemy.SQuery, owner mcclient.IIdentityProvider, scope rbacscope.TRbacScope) *sqlchemy.SQuery
func (*SScriptApplyRecordManager) ListItemFilter ¶
func (sarm *SScriptApplyRecordManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, input api.ScriptApplyRecoredListInput) (*sqlchemy.SQuery, error)
func (*SScriptApplyRecordManager) NamespaceScope ¶
func (sarm *SScriptApplyRecordManager) NamespaceScope() rbacscope.TRbacScope
func (*SScriptApplyRecordManager) ResourceScope ¶
func (sarm *SScriptApplyRecordManager) ResourceScope() rbacscope.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 ¶
func (sm *SScriptManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, input api.ScriptCreateInput) (api.ScriptCreateInput, error)
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 ¶
func (su *SServiceUrl) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject)
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) MarkCreateFailed ¶
func (*SSshInfo) MarkDeleteFailed ¶
func (*SSshInfo) PostCreate ¶
func (si *SSshInfo) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SSshInfo) RealDelete ¶
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"` }
Click to show internal directories.
Click to hide internal directories.