- 2.61.0 (latest)
- 2.60.0
- 2.59.2
- 2.58.0
- 2.57.0
- 2.56.0
- 2.54.1
- 2.53.0
- 2.52.0
- 2.51.0
- 2.50.1
- 2.49.0
- 2.48.0
- 2.46.0
- 2.45.1
- 2.44.0
- 2.43.0
- 2.42.0
- 2.41.0
- 2.40.0
- 2.39.1
- 2.38.0
- 2.37.1
- 2.36.0
- 2.34.0
- 2.33.0
- 2.32.0
- 2.30.0
- 2.29.0
- 2.28.0
- 2.27.0
- 2.26.0
- 2.25.1
- 2.24.0
- 2.23.1
- 2.22.1
- 2.21.1
- 2.15.0
- 2.14.3
- 2.13.0
- 2.12.0
- 2.11.0
- 2.10.0
- 2.9.6
- 2.8.4
- 2.7.4
public
final
class
Quota
extends
GeneratedMessageV3
implements
QuotaOrBuilder
Quota configuration helps to achieve fairness and budgeting in service usage.
The metric based quota configuration works this way:
- The service configuration defines a set of metrics.
- For API calls, the quota.metric_rules maps methods to metrics with corresponding costs.
-
The quota.limits defines limits on the metrics, which will be used for quota checks at runtime.
An example quota configuration in yaml format:
quota: limits:
- name: apiWriteQpsPerProject metric: library.googleapis.com/write_calls unit: "1/min/{project}" # rate limit for consumer projects values: STANDARD: 10000
(The metric rules bind all methods to the read_calls metric,
except for the UpdateBook and DeleteBook methods. These two methods
are mapped to the write_calls metric, with the UpdateBook method
consuming at twice rate as the DeleteBook method.)
metric_rules:
- selector: "*"
metric_costs:
library.googleapis.com/read_calls: 1
- selector: google.example.library.v1.LibraryService.UpdateBook
metric_costs:
library.googleapis.com/write_calls: 2
- selector: google.example.library.v1.LibraryService.DeleteBook
metric_costs:
library.googleapis.com/write_calls: 1
Corresponding Metric definition:
metrics:
- name: library.googleapis.com/read_calls
display_name: Read requests
metric_kind: DELTA
value_type: INT64
- name: library.googleapis.com/write_calls
display_name: Write requests
metric_kind: DELTA
value_type: INT64
Protobuf type google.api.Quota
Inheritance
Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessageV3 > QuotaImplements
QuotaOrBuilderStatic Fields
LIMITS_FIELD_NUMBER
public
static
final
int
LIMITS_FIELD_NUMBER
METRIC_RULES_FIELD_NUMBER
public
static
final
int
METRIC_RULES_FIELD_NUMBER
Static Methods
getDefaultInstance()
public
static
Quota
getDefaultInstance
()
getDescriptor()
public
static
final
Descriptors
.
Descriptor
getDescriptor
()
newBuilder()
public
static
Quota
.
Builder
newBuilder
()
newBuilder(Quota prototype)
public
static
Quota
.
Builder
newBuilder
(
Quota
prototype
)
parseDelimitedFrom(InputStream input)
public
static
Quota
parseDelimitedFrom
(
InputStream
input
)
parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public
static
Quota
parseDelimitedFrom
(
InputStream
input
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(byte[] data)
public
static
Quota
parseFrom
(
byte
[]
data
)
data
byte
[]
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public
static
Quota
parseFrom
(
byte
[]
data
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(ByteString data)
public
static
Quota
parseFrom
(
ByteString
data
)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public
static
Quota
parseFrom
(
ByteString
data
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(CodedInputStream input)
public
static
Quota
parseFrom
(
CodedInputStream
input
)
parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public
static
Quota
parseFrom
(
CodedInputStream
input
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(InputStream input)
public
static
Quota
parseFrom
(
InputStream
input
)
parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public
static
Quota
parseFrom
(
InputStream
input
,
ExtensionRegistryLite
extensionRegistry
)
parseFrom(ByteBuffer data)
public
static
Quota
parseFrom
(
ByteBuffer
data
)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public
static
Quota
parseFrom
(
ByteBuffer
data
,
ExtensionRegistryLite
extensionRegistry
)
parser()
public
static
Parser<Quota>
parser
()
Methods
equals(Object obj)
public
boolean
equals
(
Object
obj
)
getDefaultInstanceForType()
public
Quota
getDefaultInstanceForType
()
getLimits(int index)
public
QuotaLimit
getLimits
(
int
index
)
List of QuotaLimit definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
getLimitsCount()
public
int
getLimitsCount
()
List of QuotaLimit definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
getLimitsList()
public
List<QuotaLimit>
getLimitsList
()
List of QuotaLimit definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
getLimitsOrBuilder(int index)
public
QuotaLimitOrBuilder
getLimitsOrBuilder
(
int
index
)
List of QuotaLimit definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
getLimitsOrBuilderList()
public
List
< ?
extends
QuotaLimitOrBuilder
>
getLimitsOrBuilderList
()
List of QuotaLimit definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
getMetricRules(int index)
public
MetricRule
getMetricRules
(
int
index
)
List of MetricRule definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
getMetricRulesCount()
public
int
getMetricRulesCount
()
List of MetricRule definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
getMetricRulesList()
public
List<MetricRule>
getMetricRulesList
()
List of MetricRule definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
getMetricRulesOrBuilder(int index)
public
MetricRuleOrBuilder
getMetricRulesOrBuilder
(
int
index
)
List of MetricRule definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
getMetricRulesOrBuilderList()
public
List
< ?
extends
MetricRuleOrBuilder
>
getMetricRulesOrBuilderList
()
List of MetricRule definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
getParserForType()
public
Parser<Quota>
getParserForType
()
getSerializedSize()
public
int
getSerializedSize
()
hashCode()
public
int
hashCode
()
internalGetFieldAccessorTable()
protected
GeneratedMessageV3
.
FieldAccessorTable
internalGetFieldAccessorTable
()
isInitialized()
public
final
boolean
isInitialized
()
newBuilderForType()
public
Quota
.
Builder
newBuilderForType
()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected
Quota
.
Builder
newBuilderForType
(
GeneratedMessageV3
.
BuilderParent
parent
)
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected
Object
newInstance
(
GeneratedMessageV3
.
UnusedPrivateParameter
unused
)
toBuilder()
public
Quota
.
Builder
toBuilder
()
writeTo(CodedOutputStream output)
public
void
writeTo
(
CodedOutputStream
output
)