usages

package
v0.0.0-...-6410feb Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHistoryUsageHandler

func AddHistoryUsageHandler(prefix string, app *appsrv.Application)

func AddUsageHandler

func AddUsageHandler(prefix string, app *appsrv.Application)

Types

type SHistoryUsage

type SHistoryUsage struct {
	Date  string
	Count int
}

type TimeRange

type TimeRange struct {
	StartDate time.Time `json:"start_date"`
	EndDate   time.Time `json:"end_date"`
	Interval  string    `json:"interval"`
}

func (*TimeRange) ValidateInput

func (self *TimeRange) ValidateInput() error

type Usage

type Usage map[string]interface{}

func BaremetalUsage

func BaremetalUsage(ctx context.Context, userToken mcclient.TokenCredential, userCred mcclient.IIdentityProvider, scope rbacscope.TRbacScope, rangeObjs []db.IStandaloneModel,
	hostTypes []string, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func BucketUsage

func BucketUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider, rangeObjs []db.IStandaloneModel, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func DBInstanceUsage

func DBInstanceUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider, rangeObjs []db.IStandaloneModel, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func DisksUsage

func DisksUsage(
	ctx context.Context,
	userToken mcclient.TokenCredential,
	dPrefix string,
	rangeObjs []db.IStandaloneModel,
	hostTypes []string,
	resourceTypes []string,
	providers []string,
	brands []string,
	cloudEnv string,
	scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider,
	pendingDeleted bool, includeSystem bool,
	policyResult rbacutils.SPolicyResult,
) Usage

func DnsZoneUsage

func DnsZoneUsage(ctx context.Context, userToken mcclient.TokenCredential, prefix string, ownerId mcclient.IIdentityProvider, scope rbacscope.TRbacScope, policyResult rbacutils.SPolicyResult) Usage

func EipUsage

func EipUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider, rangeObjs []db.IStandaloneModel, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func ElasticCacheUsage

func ElasticCacheUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider, rangeObjs []db.IStandaloneModel, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func ElasticSearchUsage

func ElasticSearchUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider, rangeObjs []db.IStandaloneModel, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func GuestNormalUsage

func GuestNormalUsage(ctx context.Context, userToken mcclient.TokenCredential, prefix string, scope rbacscope.TRbacScope, cred mcclient.IIdentityProvider,
	rangeObjs []db.IStandaloneModel, hostTypes []string, resourceTypes []string, providers []string,
	brands []string, cloudEnv string, includeSystem bool, since *time.Time, policyResult rbacutils.SPolicyResult) Usage

func GuestPendingDeleteUsage

func GuestPendingDeleteUsage(ctx context.Context, userToken mcclient.TokenCredential, prefix string, scope rbacscope.TRbacScope, cred mcclient.IIdentityProvider,
	rangeObjs []db.IStandaloneModel, hostTypes []string, resourceTypes []string, providers []string,
	brands []string, cloudEnv string, includeSystem bool, since *time.Time, policyResult rbacutils.SPolicyResult) Usage

func GuestReadyUsage

func GuestReadyUsage(ctx context.Context, userToken mcclient.TokenCredential, prefix string, scope rbacscope.TRbacScope, cred mcclient.IIdentityProvider,
	rangeObjs []db.IStandaloneModel, hostTypes []string, resourceTypes []string, providers []string,
	brands []string, cloudEnv string, includeSystem bool, policyResult rbacutils.SPolicyResult) Usage

func GuestRunningUsage

func GuestRunningUsage(ctx context.Context, userToken mcclient.TokenCredential, prefix string, scope rbacscope.TRbacScope, cred mcclient.IIdentityProvider,
	rangeObjs []db.IStandaloneModel, hostTypes []string, resourceTypes []string, providers []string,
	brands []string, cloudEnv string, includeSystem bool,
	policyResult rbacutils.SPolicyResult,
) Usage

func HistoryUsage

func HistoryUsage(ctx context.Context, userCred mcclient.TokenCredential, timeRange *TimeRange, scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider, includeSystem bool, policyResult rbacutils.SPolicyResult) Usage

func HostAllUsage

func HostAllUsage(ctx context.Context, userToken mcclient.TokenCredential, pref string, userCred mcclient.IIdentityProvider, scope rbacscope.TRbacScope, rangeObjs []db.IStandaloneModel,
	hostTypes []string, resourceTypes []string, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func HostEnabledUsage

func HostEnabledUsage(ctx context.Context, userToken mcclient.TokenCredential, pref string, userCred mcclient.IIdentityProvider, scope rbacscope.TRbacScope, rangeObjs []db.IStandaloneModel,
	hostTypes []string, resourceTypes []string, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func InstanceSnapshotUsage

func InstanceSnapshotUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider, rangeObjs []db.IStandaloneModel, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func IsolatedDeviceUsage

func IsolatedDeviceUsage(ctx context.Context, userToken mcclient.TokenCredential, pref string, scope rbacscope.TRbacScope, userCred mcclient.IIdentityProvider, rangeObjs []db.IStandaloneModel, hostType []string, resourceTypes []string, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func KafkaUsage

func KafkaUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider, rangeObjs []db.IStandaloneModel, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func LoadbalancerUsage

func LoadbalancerUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider, rangeObjs []db.IStandaloneModel, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func MongoDBUsage

func MongoDBUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider, rangeObjs []db.IStandaloneModel, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func NetworkUsage

func NetworkUsage(ctx context.Context, userToken mcclient.TokenCredential, prefix string, scope rbacscope.TRbacScope, userCred mcclient.IIdentityProvider, providers []string, brands []string, cloudEnv string, rangeObjs []db.IStandaloneModel, policyResult rbacutils.SPolicyResult) Usage

func RegionUsage

func RegionUsage(rangeObjs []db.IStandaloneModel, providers []string, brands []string, cloudEnv string) Usage

func ReportCloudAccountUsage

func ReportCloudAccountUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, userCred mcclient.IIdentityProvider, isOwner bool, accounts []db.IStandaloneModel, hostTypes []string, providers []string, brands []string, cloudEnv string, includeSystem bool, policyResult rbacutils.SPolicyResult) (Usage, error)

func ReportCloudProviderUsage

func ReportCloudProviderUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, userCred mcclient.IIdentityProvider, isOwner bool, managers []db.IStandaloneModel, hostTypes []string, providers []string, brands []string, cloudEnv string, includeSystem bool, policyResult rbacutils.SPolicyResult) (Usage, error)

func ReportCloudRegionUsage

func ReportCloudRegionUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, userCred mcclient.IIdentityProvider, isOwner bool, cloudRegions []db.IStandaloneModel, hostTypes []string, providers []string, brands []string, cloudEnv string, includeSystem bool, policyResult rbacutils.SPolicyResult) (Usage, error)

func ReportGeneralHistoryUsage

func ReportGeneralHistoryUsage(
	ctx context.Context,
	userToken mcclient.TokenCredential,
	scope rbacscope.TRbacScope,
	userCred mcclient.IIdentityProvider,
	timeRange *TimeRange,
	includeSystem bool,
	policyResult rbacutils.SPolicyResult,
) (count Usage, err error)

func ReportGeneralUsage

func ReportGeneralUsage(
	ctx context.Context,
	userToken mcclient.TokenCredential,
	scope rbacscope.TRbacScope,
	userCred mcclient.IIdentityProvider,
	isOwner bool,
	rangeObjs []db.IStandaloneModel,
	hostTypes []string,
	providers []string,
	brands []string,
	cloudEnv string,
	includeSystem bool,
	policyResult rbacutils.SPolicyResult,
) (count Usage, err error)

func ReportHostUsage

func ReportHostUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, userCred mcclient.IIdentityProvider, isOwner bool, hosts []db.IStandaloneModel, hostTypes []string, providers []string, brands []string, cloudEnv string, includeSystem bool, policyResult rbacutils.SPolicyResult) (Usage, error)

func ReportSchedtagUsage

func ReportSchedtagUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, userCred mcclient.IIdentityProvider, isOwner bool, schedtags []db.IStandaloneModel, hostTypes []string, providers []string, brands []string, cloudEnv string, includeSystem bool, policyResult rbacutils.SPolicyResult) (Usage, error)

func ReportWireUsage

func ReportWireUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, userCred mcclient.IIdentityProvider, isOwner bool, wires []db.IStandaloneModel, hostTypes []string, providers []string, brands []string, cloudEnv string, includeSystem bool, policyResult rbacutils.SPolicyResult) (Usage, error)

func ReportZoneUsage

func ReportZoneUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, userCred mcclient.IIdentityProvider, isOwner bool, zones []db.IStandaloneModel, hostTypes []string, providers []string, brands []string, cloudEnv string, includeSystem bool, policyResult rbacutils.SPolicyResult) (Usage, error)

func SnapshotUsage

func SnapshotUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider, rangeObjs []db.IStandaloneModel, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func StorageUsage

func StorageUsage(
	ctx context.Context,
	userToken mcclient.TokenCredential,
	prefix string,
	rangeObjs []db.IStandaloneModel,
	hostTypes []string, resourceTypes []string,
	providers []string, brands []string, cloudEnv string,
	pendingDeleted bool, includeSystem bool,
	scope rbacscope.TRbacScope, ownerId mcclient.IIdentityProvider,
	policyResult rbacutils.SPolicyResult,
) Usage

func VpcUsage

func VpcUsage(ctx context.Context, userToken mcclient.TokenCredential, prefix string, providers []string, brands []string, cloudEnv string, ownerId mcclient.IIdentityProvider, scope rbacscope.TRbacScope, rangeObjs []db.IStandaloneModel, policyResult rbacutils.SPolicyResult) Usage

func WireUsage

func WireUsage(ctx context.Context, userToken mcclient.TokenCredential, scope rbacscope.TRbacScope, userCred mcclient.IIdentityProvider, rangeObjs []db.IStandaloneModel, hostTypes []string, providers []string, brands []string, cloudEnv string, policyResult rbacutils.SPolicyResult) Usage

func ZoneUsage

func ZoneUsage(rangeObjs []db.IStandaloneModel, providers []string, brands []string, cloudEnv string) Usage

func (Usage) Add

func (u Usage) Add(key string, value interface{}) Usage

func (Usage) Get

func (u Usage) Get(key string) interface{}

func (Usage) Include

func (u Usage) Include(nus ...Usage) Usage

Jump to

Keyboard shortcuts

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