models

package
v0.3.9-5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

View Source
const (
	NAMESPACE_USER    = "user"
	NAMESPACE_SERVICE = "service"
)

Variables

This section is empty.

Functions

func InitDB

func InitDB() error

Types

type SParameter

type SParameter struct {
	db.SResourceBase

	Id          int64                `primary:"true" auto_increment:"true" list:"user"`                                          // = Column(BigInteger, primary_key=True)
	CreatedBy   string               `width:"128" charset:"ascii" nullable:"false" create:"required" list:"user"`                // Column(VARCHAR(length=128, charset='ascii'), nullable=False)
	UpdatedBy   string               `width:"128" charset:"ascii" nullable:"false" create:"required" update:"user" list:"user"`  // Column(VARCHAR(length=128, charset='ascii'), nullable=False)  "user"/ serviceName/ "admin"
	Namespace   string               `width:"64" charset:"ascii" default:"user" nullable:"false" create:"required" list:"admin"` // Column(VARCHAR(length=128, charset='ascii'), nullable=False)  user_id / serviceid
	NamespaceId string               `width:"128" charset:"ascii" nullable:"false" index:"true" create:"required" list:"admin"`  // Column(VARCHAR(length=128, charset='ascii'), nullable=False)
	Name        string               `width:"128" charset:"ascii" nullable:"false" index:"true" create:"required" list:"user"`   // Column(VARCHAR(length=128, charset='ascii'), nullable=false)
	Value       jsonutils.JSONObject `charset:"utf8" create:"required" update:"user" update:"user" list:"user"`                  // Column(VARCHAR(charset='utf-8'))
}

func (*SParameter) CustomizeDelete

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

func (*SParameter) Delete

func (model *SParameter) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SParameter) GetId

func (model *SParameter) GetId() string

func (*SParameter) GetName

func (model *SParameter) GetName() string

func (*SParameter) GetOwnerId

func (model *SParameter) GetOwnerId() mcclient.IIdentityProvider

func (*SParameter) IsOwner

func (model *SParameter) IsOwner(userCred mcclient.TokenCredential) bool

func (*SParameter) ValidateUpdateData

func (model *SParameter) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SParameterManager

type SParameterManager struct {
	db.SResourceBaseManager
}
var ParameterManager *SParameterManager

func (*SParameterManager) CreateByInsertOrUpdate

func (manager *SParameterManager) CreateByInsertOrUpdate() bool

func (*SParameterManager) FetchOwnerId

func (*SParameterManager) FilterById

func (manager *SParameterManager) FilterById(q *sqlchemy.SQuery, idStr string) *sqlchemy.SQuery

func (*SParameterManager) FilterByName

func (manager *SParameterManager) FilterByName(q *sqlchemy.SQuery, name string) *sqlchemy.SQuery

func (*SParameterManager) FilterByOwner

func (*SParameterManager) ListItemFilter

func (manager *SParameterManager) ListItemFilter(
	ctx context.Context,
	q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential,
	query api.ParameterListInput,
) (*sqlchemy.SQuery, error)

配置参数列表

func (*SParameterManager) NamespaceScope

func (manager *SParameterManager) NamespaceScope() rbacutils.TRbacScope

func (*SParameterManager) OrderByExtraFields

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

func (*SParameterManager) QueryDistinctExtraField

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

func (*SParameterManager) ResourceScope

func (manager *SParameterManager) ResourceScope() rbacutils.TRbacScope

func (*SParameterManager) ValidateCreateData

func (manager *SParameterManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SScopedPolicy

type SScopedPolicy struct {
	db.SInfrasResourceBase

	// 策略类别
	Category string `width:"64" charset:"utf8" nullable:"false" list:"domain" create:"domain_required" index:"true"`

	// 策略内容
	Policies jsonutils.JSONObject `charset:"utf8" nullable:"true" list:"domain" update:"domain" create:"domain_optional"`
}

func (*SScopedPolicy) PerformBind

func (*SScopedPolicy) ValidateDeleteCondition

func (policy *SScopedPolicy) ValidateDeleteCondition(ctx context.Context, info jsonutils.JSONObject) error

func (*SScopedPolicy) ValidateUpdateData

type SScopedPolicyBinding

type SScopedPolicyBinding struct {
	db.SResourceBase

	Category  string `width:"64" charset:"utf8" nullable:"false" primary:"true" list:"user"`
	DomainId  string `width:"128" charset:"ascii" nullable:"false" primary:"true" list:"user"`
	ProjectId string `width:"128" charset:"ascii" nullable:"false" primary:"true" list:"user"`

	PolicyId string `width:"128" charset:"ascii" nullable:"false" list:"user"`

	Priority int `nullable:"false" list:"user"`
}

func (*SScopedPolicyBinding) GetId

func (binding *SScopedPolicyBinding) GetId() string

func (*SScopedPolicyBinding) GetName

func (binding *SScopedPolicyBinding) GetName() string

type SScopedPolicyBindingManager

type SScopedPolicyBindingManager struct {
	db.SResourceBaseManager
}

+onecloud:swagger-gen-model-singular=scopedpolicybinding +onecloud:swagger-gen-model-plural=scopedpolicybindings

var ScopedPolicyBindingManager *SScopedPolicyBindingManager

func (*SScopedPolicyBindingManager) FetchCustomizeColumns

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

func (*SScopedPolicyBindingManager) FilterById

func (manager *SScopedPolicyBindingManager) FilterById(q *sqlchemy.SQuery, idStr string) *sqlchemy.SQuery

func (*SScopedPolicyBindingManager) FilterByName

func (manager *SScopedPolicyBindingManager) FilterByName(q *sqlchemy.SQuery, name string) *sqlchemy.SQuery

func (*SScopedPolicyBindingManager) FilterByNotId

func (manager *SScopedPolicyBindingManager) FilterByNotId(q *sqlchemy.SQuery, idStr string) *sqlchemy.SQuery

func (*SScopedPolicyBindingManager) GetResourceCount

func (manager *SScopedPolicyBindingManager) GetResourceCount() ([]db.SScopeResourceCount, error)

func (*SScopedPolicyBindingManager) ListItemExportKeys

func (*SScopedPolicyBindingManager) ListItemFilter

范围策略列表

func (*SScopedPolicyBindingManager) OrderByExtraFields

func (*SScopedPolicyBindingManager) QueryDistinctExtraField

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

func (*SScopedPolicyBindingManager) ResourceScope

func (manager *SScopedPolicyBindingManager) ResourceScope() rbacutils.TRbacScope

type SScopedPolicyManager

type SScopedPolicyManager struct {
	db.SInfrasResourceBaseManager
}

+onecloud:swagger-gen-model-singular=scopedpolicy +onecloud:swagger-gen-model-plural=scopedpolicies

var ScopedPolicyManager *SScopedPolicyManager

func (*SScopedPolicyManager) FetchCustomizeColumns

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

func (*SScopedPolicyManager) ListItemExportKeys

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

func (*SScopedPolicyManager) ListItemFilter

func (manager *SScopedPolicyManager) ListItemFilter(
	ctx context.Context,
	q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential,
	query api.ScopedPolicyListInput,
) (*sqlchemy.SQuery, error)

范围策略列表

func (*SScopedPolicyManager) OrderByExtraFields

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

func (*SScopedPolicyManager) QueryDistinctExtraField

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

func (*SScopedPolicyManager) ValidateCreateData

Jump to

Keyboard shortcuts

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