Skip to main content

Credit allocation rules and usage

POST 

/license/api/v1/credit-allocation-rules

Get credit allocation rules and usage with pagination.

Request

Body

    timeRange object

    Time range for credit allocation rule request

    type stringrequired

    Possible values: [relative, absolute, to_now, from_now]

    One of 'relative', 'absolute', 'to_now', or 'from_now'

    value object

    Time range value for credit allocation rule request. For relative, provide an object with unit and amount fields. For absolute, provide an object with startTime and endTime fields. For to_now or from_now, provide a string time unit.

    unit string

    Possible values: [hour, day, week, month, year]

    Time unit when type=relative, to_now, or from_now. The unit 'week' is only supported when type=relative.

    amount int32

    Possible values: >= 1

    Number of time units when type=relative

    startTime int64

    Start time when type=absolute. startTime must be milli-seconds since epoch.

    endTime int64

    End time when type=absolute. endTime must be milli-seconds since epoch.

    ruleNames string[]

    Filter rules by name

    accountGroupIds string[]

    Filter by account group ids

    thresholdFilter string

    Possible values: [AboveThreshold, BelowThreshold]

    Filter by above or below threshold

    limit int32

    Possible values: >= 1

    Limit of items per page. Values greater than 1000 are set to 1000. Default is 300.

    pageToken string

    The pageToken returned from a previous call to this endpoint. The next page is returned.

Responses

Success

Schema
    rules object[]

    Credit allocation rules. Null when no rules.

  • Array [
  • id stringrequired

    Unique id. Ignored on create. Must match path param on update.

    customerId int32

    Customer id. Ignored on create and update.

    prismaId int64

    Customer prisma id. Ignored on create and update.

    name stringrequired

    Possible values: non-empty and <= 200 characters

    Rule name. Must be non-empty and unique. Required on create. Ignored on update if null.

    targetType stringrequired

    Possible values: [AccountGroup]

    Must be 'AccountGroup'. Required on create. Ignored on update if null.

    allocatedCredits int32required

    Possible values: <= 2147483647

    Credits allocated to this rule. Required on create. Ignored on update if null.

    alarmThreshold int32required

    Possible values: <= 100

    Percent usage of allocatedCredits to trigger alarm. Required on create. Ignored on update if null.

    accountGroups string[]required

    Possible values: >= 1, <= 2147483647

    Account group ids. Must be at least one. Required on create. Ignored on update if null.

    usedCredits int32

    Credit usage for the requested time period

    percentage int32

    Percent credit usage of the rule allocated credits

  • ]
  • pageToken string

    Non-null when there is another page of rules available. Use value as 'pageToken' to get the next page.

Loading...