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: INT64Protobuf type
google.api.Quota
Modifier and Type | Class and Description |
---|---|
static class |
Quota.Builder
Quota configuration helps to achieve fairness and budgeting in service
usage.
|
GeneratedMessageV3.BuilderParent, GeneratedMessageV3.ExtendableBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage,BuilderType extends GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageV3.ExtendableMessage<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.FieldAccessorTable
Modifier and Type | Field and Description |
---|---|
static int |
LIMITS_FIELD_NUMBER |
static int |
METRIC_RULES_FIELD_NUMBER |
alwaysUseFieldBuilders, unknownFields
memoizedSize
memoizedHashCode
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
static Quota |
getDefaultInstance() |
Quota |
getDefaultInstanceForType() |
static Descriptors.Descriptor |
getDescriptor() |
QuotaLimit |
getLimits(int index)
List of `QuotaLimit` definitions for the service.
|
int |
getLimitsCount()
List of `QuotaLimit` definitions for the service.
|
java.util.List<QuotaLimit> |
getLimitsList()
List of `QuotaLimit` definitions for the service.
|
QuotaLimitOrBuilder |
getLimitsOrBuilder(int index)
List of `QuotaLimit` definitions for the service.
|
java.util.List<? extends QuotaLimitOrBuilder> |
getLimitsOrBuilderList()
List of `QuotaLimit` definitions for the service.
|
MetricRule |
getMetricRules(int index)
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
int |
getMetricRulesCount()
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
java.util.List<MetricRule> |
getMetricRulesList()
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
MetricRuleOrBuilder |
getMetricRulesOrBuilder(int index)
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
java.util.List<? extends MetricRuleOrBuilder> |
getMetricRulesOrBuilderList()
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
Parser<Quota> |
getParserForType() |
int |
getSerializedSize() |
UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
protected GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static Quota.Builder |
newBuilder() |
static Quota.Builder |
newBuilder(Quota prototype) |
Quota.Builder |
newBuilderForType() |
protected Quota.Builder |
newBuilderForType(GeneratedMessageV3.BuilderParent parent) |
static Quota |
parseDelimitedFrom(java.io.InputStream input) |
static Quota |
parseDelimitedFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Quota |
parseFrom(byte[] data) |
static Quota |
parseFrom(byte[] data,
ExtensionRegistryLite extensionRegistry) |
static Quota |
parseFrom(java.nio.ByteBuffer data) |
static Quota |
parseFrom(java.nio.ByteBuffer data,
ExtensionRegistryLite extensionRegistry) |
static Quota |
parseFrom(ByteString data) |
static Quota |
parseFrom(ByteString data,
ExtensionRegistryLite extensionRegistry) |
static Quota |
parseFrom(CodedInputStream input) |
static Quota |
parseFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
static Quota |
parseFrom(java.io.InputStream input) |
static Quota |
parseFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Parser<Quota> |
parser() |
Quota.Builder |
toBuilder() |
void |
writeTo(CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof
toByteArray, toByteString, writeDelimitedTo, writeTo
public static final int LIMITS_FIELD_NUMBER
public static final int METRIC_RULES_FIELD_NUMBER
public final UnknownFieldSet getUnknownFields()
getUnknownFields
in interface MessageOrBuilder
getUnknownFields
in class GeneratedMessageV3
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3
public java.util.List<QuotaLimit> getLimitsList()
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
getLimitsList
in interface QuotaOrBuilder
public java.util.List<? extends QuotaLimitOrBuilder> getLimitsOrBuilderList()
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
getLimitsOrBuilderList
in interface QuotaOrBuilder
public int getLimitsCount()
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
getLimitsCount
in interface QuotaOrBuilder
public QuotaLimit getLimits(int index)
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
getLimits
in interface QuotaOrBuilder
public QuotaLimitOrBuilder getLimitsOrBuilder(int index)
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
getLimitsOrBuilder
in interface QuotaOrBuilder
public java.util.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;
getMetricRulesList
in interface QuotaOrBuilder
public java.util.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;
getMetricRulesOrBuilderList
in interface QuotaOrBuilder
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;
getMetricRulesCount
in interface QuotaOrBuilder
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;
getMetricRules
in interface QuotaOrBuilder
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;
getMetricRulesOrBuilder
in interface QuotaOrBuilder
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3
public void writeTo(CodedOutputStream output) throws java.io.IOException
writeTo
in interface MessageLite
writeTo
in class GeneratedMessageV3
java.io.IOException
public int getSerializedSize()
getSerializedSize
in interface MessageLite
getSerializedSize
in class GeneratedMessageV3
public boolean equals(java.lang.Object obj)
equals
in interface Message
equals
in class AbstractMessage
public int hashCode()
hashCode
in interface Message
hashCode
in class AbstractMessage
public static Quota parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Quota parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Quota parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Quota parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Quota parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Quota parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Quota parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static Quota parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static Quota parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static Quota parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static Quota parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOException
public static Quota parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public Quota.Builder newBuilderForType()
newBuilderForType
in interface Message
newBuilderForType
in interface MessageLite
public static Quota.Builder newBuilder()
public static Quota.Builder newBuilder(Quota prototype)
public Quota.Builder toBuilder()
toBuilder
in interface Message
toBuilder
in interface MessageLite
protected Quota.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType
in class GeneratedMessageV3
public static Quota getDefaultInstance()
public Parser<Quota> getParserForType()
getParserForType
in interface Message
getParserForType
in interface MessageLite
getParserForType
in class GeneratedMessageV3
public Quota getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder