public final class Quota extends com.google.protobuf.GeneratedMessageV3 implements QuotaOrBuilder
Quota configuration helps to achieve fairness and budgeting in service usage. The 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.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
Modifier and Type | Field and Description |
---|---|
static int |
LIMITS_FIELD_NUMBER |
static int |
METRIC_RULES_FIELD_NUMBER |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
static Quota |
getDefaultInstance() |
Quota |
getDefaultInstanceForType() |
static com.google.protobuf.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.
|
com.google.protobuf.Parser<Quota> |
getParserForType() |
int |
getSerializedSize() |
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static Quota.Builder |
newBuilder() |
static Quota.Builder |
newBuilder(Quota prototype) |
Quota.Builder |
newBuilderForType() |
protected Quota.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
static Quota |
parseDelimitedFrom(java.io.InputStream input) |
static Quota |
parseDelimitedFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Quota |
parseFrom(byte[] data) |
static Quota |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Quota |
parseFrom(java.nio.ByteBuffer data) |
static Quota |
parseFrom(java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Quota |
parseFrom(com.google.protobuf.ByteString data) |
static Quota |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Quota |
parseFrom(com.google.protobuf.CodedInputStream input) |
static Quota |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Quota |
parseFrom(java.io.InputStream input) |
static Quota |
parseFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<Quota> |
parser() |
Quota.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, newBuilderForType, 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
public static final int LIMITS_FIELD_NUMBER
public static final int METRIC_RULES_FIELD_NUMBER
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields
in interface com.google.protobuf.MessageOrBuilder
getUnknownFields
in class com.google.protobuf.GeneratedMessageV3
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class com.google.protobuf.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 com.google.protobuf.MessageLiteOrBuilder
isInitialized
in class com.google.protobuf.GeneratedMessageV3
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException
writeTo
in interface com.google.protobuf.MessageLite
writeTo
in class com.google.protobuf.GeneratedMessageV3
java.io.IOException
public int getSerializedSize()
getSerializedSize
in interface com.google.protobuf.MessageLite
getSerializedSize
in class com.google.protobuf.GeneratedMessageV3
public boolean equals(java.lang.Object obj)
equals
in interface com.google.protobuf.Message
equals
in class com.google.protobuf.AbstractMessage
public int hashCode()
hashCode
in interface com.google.protobuf.Message
hashCode
in class com.google.protobuf.AbstractMessage
public static Quota parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static Quota parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static Quota parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static Quota parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static Quota parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static Quota parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static Quota parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static Quota parseFrom(java.io.InputStream input, com.google.protobuf.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, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static Quota parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
java.io.IOException
public static Quota parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public Quota.Builder newBuilderForType()
newBuilderForType
in interface com.google.protobuf.Message
newBuilderForType
in interface com.google.protobuf.MessageLite
public static Quota.Builder newBuilder()
public static Quota.Builder newBuilder(Quota prototype)
public Quota.Builder toBuilder()
toBuilder
in interface com.google.protobuf.Message
toBuilder
in interface com.google.protobuf.MessageLite
protected Quota.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType
in class com.google.protobuf.GeneratedMessageV3
public static Quota getDefaultInstance()
public static com.google.protobuf.Parser<Quota> parser()
public com.google.protobuf.Parser<Quota> getParserForType()
getParserForType
in interface com.google.protobuf.Message
getParserForType
in interface com.google.protobuf.MessageLite
getParserForType
in class com.google.protobuf.GeneratedMessageV3
public Quota getDefaultInstanceForType()
getDefaultInstanceForType
in interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType
in interface com.google.protobuf.MessageOrBuilder