models

package
v0.0.0-...-2b29b9b Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 25 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCloudevent

func InitCloudevent()

func InitDB

func InitDB() error

Types

type SCloudevent

type SCloudevent struct {
	db.SModelBase
	db.SDomainizedResourceBase

	EventId      int64                `primary:"true" auto_increment:"true" list:"user" clickhouse_partition_by:"toInt64(event_id/100000000000)`
	Name         string               `width:"128" charset:"utf8" nullable:"false" index:"true" list:"user"`
	Service      string               `width:"64" charset:"utf8" nullable:"true" list:"user"`
	ResourceType string               `width:"64" charset:"utf8" nullable:"true" list:"user"`
	Action       string               `width:"64" charset:"utf8" nullable:"true" list:"user"`
	RequestId    string               `width:"128" charset:"utf8" nullable:"true" list:"user"`
	Request      jsonutils.JSONObject `charset:"utf8" nullable:"true" list:"user"`
	Account      string               `width:"64" charset:"utf8" nullable:"true" list:"user"`
	Success      bool                 `nullable:"false" list:"user"`
	CreatedAt    time.Time            `nullable:"false" created_at:"true" index:"true" get:"user" list:"user" clickhouse_ttl:"6m"`

	CloudproviderId string `width:"64" charset:"utf8" nullable:"true" list:"user"`
	Manager         string `width:"128" charset:"utf8" nullable:"false" index:"true" list:"user"`
	Provider        string `width:"64" charset:"ascii" nullable:"false" list:"user"`
	Brand           string `width:"64" charset:"ascii" list:"domain"`
}

func (*SCloudevent) BeforeInsert

func (event *SCloudevent) BeforeInsert()

func (*SCloudevent) CustomizeCreate

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

func (*SCloudevent) GetOwnerId

func (self *SCloudevent) GetOwnerId() mcclient.IIdentityProvider

type SCloudeventManager

type SCloudeventManager struct {
	db.SModelBaseManager
	db.SDomainizedResourceBaseManager
}
var CloudeventManager *SCloudeventManager

func (*SCloudeventManager) CreateByInsertOrUpdate

func (manager *SCloudeventManager) CreateByInsertOrUpdate() bool

func (*SCloudeventManager) FetchCustomizeColumns

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

func (*SCloudeventManager) FetchOwnerId

func (*SCloudeventManager) FilterByOwner

func (*SCloudeventManager) GetPagingConfig

func (manager *SCloudeventManager) GetPagingConfig() *db.SPagingConfig

func (*SCloudeventManager) GetPropertyDistinctField

func (manager *SCloudeventManager) GetPropertyDistinctField(ctx context.Context, userCred mcclient.TokenCredential, input apis.DistinctFieldInput) (jsonutils.JSONObject, error)

func (*SCloudeventManager) ListItemExportKeys

func (manager *SCloudeventManager) ListItemExportKeys(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, keys stringutils2.SSortedStrings) (*sqlchemy.SQuery, error)

func (*SCloudeventManager) ListItemFilter

func (manager *SCloudeventManager) ListItemFilter(
	ctx context.Context,
	q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential,
	input api.CloudeventListInput,
) (*sqlchemy.SQuery, error)

云平台操作日志列表

func (*SCloudeventManager) NamespaceScope

func (manager *SCloudeventManager) NamespaceScope() rbacscope.TRbacScope

func (*SCloudeventManager) OrderByExtraFields

func (manager *SCloudeventManager) OrderByExtraFields(
	ctx context.Context,
	q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential,
	query api.CloudeventListInput,
) (*sqlchemy.SQuery, error)

func (*SCloudeventManager) QueryDistinctExtraField

func (manager *SCloudeventManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field string) (*sqlchemy.SQuery, error)

func (*SCloudeventManager) ResourceScope

func (manager *SCloudeventManager) ResourceScope() rbacscope.TRbacScope

func (*SCloudeventManager) SyncCloudevent

func (manager *SCloudeventManager) SyncCloudevent(ctx context.Context, userCred mcclient.TokenCredential, cloudprovider *SCloudprovider, iEvents []cloudprovider.ICloudEvent) int

type SCloudprovider

type SCloudprovider struct {
	db.SEnabledStatusStandaloneResourceBase
	db.SProjectizedResourceBase

	SyncStatus     string
	LastSync       time.Time
	LastSyncEndAt  time.Time
	LastSyncTimeAt time.Time

	Provider string `width:"64" charset:"ascii" list:"domain"`
	Brand    string `width:"64" charset:"ascii" list:"domain"`
}

func (SCloudprovider) GetExternalId

func (provider SCloudprovider) GetExternalId() string

func (SCloudprovider) GetGlobalId

func (provider SCloudprovider) GetGlobalId() string

func (*SCloudprovider) GetNextTimeRange

func (self *SCloudprovider) GetNextTimeRange() (time.Time, time.Time, error)

func (*SCloudprovider) GetProvider

func (self *SCloudprovider) GetProvider() (cloudprovider.ICloudProvider, error)

func (*SCloudprovider) GetProviderFactory

func (provider *SCloudprovider) GetProviderFactory() (cloudprovider.ICloudProviderFactory, error)

func (*SCloudprovider) MarkEndSync

func (self *SCloudprovider) MarkEndSync(userCred mcclient.TokenCredential) error

func (*SCloudprovider) MarkSyncing

func (self *SCloudprovider) MarkSyncing(userCred mcclient.TokenCredential) error

func (*SCloudprovider) SetLastSyncTimeAt

func (self *SCloudprovider) SetLastSyncTimeAt(userCred mcclient.TokenCredential, last time.Time) error

func (*SCloudprovider) StartCloudeventSyncTask

func (provider *SCloudprovider) StartCloudeventSyncTask(ctx context.Context, userCred mcclient.TokenCredential) error

type SCloudproviderManager

var CloudproviderManager *SCloudproviderManager

func (*SCloudproviderManager) GetLocalCloudproviders

func (manager *SCloudproviderManager) GetLocalCloudproviders() ([]SCloudprovider, error)

func (*SCloudproviderManager) GetRegionCloudproviders

func (manager *SCloudproviderManager) GetRegionCloudproviders(ctx context.Context, userCred mcclient.TokenCredential) ([]SCloudprovider, error)

func (*SCloudproviderManager) InitializeData

func (manager *SCloudproviderManager) InitializeData() error

func (*SCloudproviderManager) QueryDistinctExtraField

func (manager *SCloudproviderManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field string) (*sqlchemy.SQuery, error)

func (*SCloudproviderManager) SyncCloudeventTask

func (manager *SCloudproviderManager) SyncCloudeventTask(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)

func (*SCloudproviderManager) SyncCloudproviders

func (manager *SCloudproviderManager) SyncCloudproviders(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)

Jump to

Keyboard shortcuts

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