public static final class Quota.Builder extends GeneratedMessageV3.Builder<Quota.Builder> 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 | Method and Description |
---|---|
Quota.Builder |
addAllLimits(java.lang.Iterable<? extends QuotaLimit> values)
List of `QuotaLimit` definitions for the service.
|
Quota.Builder |
addAllMetricRules(java.lang.Iterable<? extends MetricRule> values)
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
Quota.Builder |
addLimits(int index,
QuotaLimit.Builder builderForValue)
List of `QuotaLimit` definitions for the service.
|
Quota.Builder |
addLimits(int index,
QuotaLimit value)
List of `QuotaLimit` definitions for the service.
|
Quota.Builder |
addLimits(QuotaLimit.Builder builderForValue)
List of `QuotaLimit` definitions for the service.
|
Quota.Builder |
addLimits(QuotaLimit value)
List of `QuotaLimit` definitions for the service.
|
QuotaLimit.Builder |
addLimitsBuilder()
List of `QuotaLimit` definitions for the service.
|
QuotaLimit.Builder |
addLimitsBuilder(int index)
List of `QuotaLimit` definitions for the service.
|
Quota.Builder |
addMetricRules(int index,
MetricRule.Builder builderForValue)
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
Quota.Builder |
addMetricRules(int index,
MetricRule value)
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
Quota.Builder |
addMetricRules(MetricRule.Builder builderForValue)
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
Quota.Builder |
addMetricRules(MetricRule value)
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
MetricRule.Builder |
addMetricRulesBuilder()
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
MetricRule.Builder |
addMetricRulesBuilder(int index)
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
Quota.Builder |
addRepeatedField(Descriptors.FieldDescriptor field,
java.lang.Object value) |
Quota |
build() |
Quota |
buildPartial() |
Quota.Builder |
clear() |
Quota.Builder |
clearField(Descriptors.FieldDescriptor field) |
Quota.Builder |
clearLimits()
List of `QuotaLimit` definitions for the service.
|
Quota.Builder |
clearMetricRules()
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
Quota.Builder |
clearOneof(Descriptors.OneofDescriptor oneof) |
Quota.Builder |
clone() |
Quota |
getDefaultInstanceForType() |
static Descriptors.Descriptor |
getDescriptor() |
Descriptors.Descriptor |
getDescriptorForType() |
QuotaLimit |
getLimits(int index)
List of `QuotaLimit` definitions for the service.
|
QuotaLimit.Builder |
getLimitsBuilder(int index)
List of `QuotaLimit` definitions for the service.
|
java.util.List<QuotaLimit.Builder> |
getLimitsBuilderList()
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.
|
MetricRule.Builder |
getMetricRulesBuilder(int index)
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
java.util.List<MetricRule.Builder> |
getMetricRulesBuilderList()
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.
|
protected GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
Quota.Builder |
mergeFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
Quota.Builder |
mergeFrom(Message other) |
Quota.Builder |
mergeFrom(Quota other) |
Quota.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields) |
Quota.Builder |
removeLimits(int index)
List of `QuotaLimit` definitions for the service.
|
Quota.Builder |
removeMetricRules(int index)
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
Quota.Builder |
setField(Descriptors.FieldDescriptor field,
java.lang.Object value) |
Quota.Builder |
setLimits(int index,
QuotaLimit.Builder builderForValue)
List of `QuotaLimit` definitions for the service.
|
Quota.Builder |
setLimits(int index,
QuotaLimit value)
List of `QuotaLimit` definitions for the service.
|
Quota.Builder |
setMetricRules(int index,
MetricRule.Builder builderForValue)
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
Quota.Builder |
setMetricRules(int index,
MetricRule value)
List of `MetricRule` definitions, each one mapping a selected method to one
or more metrics.
|
Quota.Builder |
setRepeatedField(Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) |
Quota.Builder |
setUnknownFields(UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
addAll, addAll, mergeFrom, newUninitializedMessageException
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
mergeFrom
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3.Builder<Quota.Builder>
public Quota.Builder clear()
clear
in interface Message.Builder
clear
in interface MessageLite.Builder
clear
in class GeneratedMessageV3.Builder<Quota.Builder>
public Descriptors.Descriptor getDescriptorForType()
getDescriptorForType
in interface Message.Builder
getDescriptorForType
in interface MessageOrBuilder
getDescriptorForType
in class GeneratedMessageV3.Builder<Quota.Builder>
public Quota getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
public Quota build()
build
in interface Message.Builder
build
in interface MessageLite.Builder
public Quota buildPartial()
buildPartial
in interface Message.Builder
buildPartial
in interface MessageLite.Builder
public Quota.Builder clone()
clone
in interface Message.Builder
clone
in interface MessageLite.Builder
clone
in class GeneratedMessageV3.Builder<Quota.Builder>
public Quota.Builder setField(Descriptors.FieldDescriptor field, java.lang.Object value)
setField
in interface Message.Builder
setField
in class GeneratedMessageV3.Builder<Quota.Builder>
public Quota.Builder clearField(Descriptors.FieldDescriptor field)
clearField
in interface Message.Builder
clearField
in class GeneratedMessageV3.Builder<Quota.Builder>
public Quota.Builder clearOneof(Descriptors.OneofDescriptor oneof)
clearOneof
in interface Message.Builder
clearOneof
in class GeneratedMessageV3.Builder<Quota.Builder>
public Quota.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, java.lang.Object value)
setRepeatedField
in interface Message.Builder
setRepeatedField
in class GeneratedMessageV3.Builder<Quota.Builder>
public Quota.Builder addRepeatedField(Descriptors.FieldDescriptor field, java.lang.Object value)
addRepeatedField
in interface Message.Builder
addRepeatedField
in class GeneratedMessageV3.Builder<Quota.Builder>
public Quota.Builder mergeFrom(Message other)
mergeFrom
in interface Message.Builder
mergeFrom
in class AbstractMessage.Builder<Quota.Builder>
public Quota.Builder mergeFrom(Quota other)
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3.Builder<Quota.Builder>
public Quota.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
mergeFrom
in interface Message.Builder
mergeFrom
in interface MessageLite.Builder
mergeFrom
in class AbstractMessage.Builder<Quota.Builder>
java.io.IOException
public java.util.List<QuotaLimit> getLimitsList()
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
getLimitsList
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 Quota.Builder setLimits(int index, QuotaLimit value)
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
public Quota.Builder setLimits(int index, QuotaLimit.Builder builderForValue)
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
public Quota.Builder addLimits(QuotaLimit value)
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
public Quota.Builder addLimits(int index, QuotaLimit value)
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
public Quota.Builder addLimits(QuotaLimit.Builder builderForValue)
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
public Quota.Builder addLimits(int index, QuotaLimit.Builder builderForValue)
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
public Quota.Builder addAllLimits(java.lang.Iterable<? extends QuotaLimit> values)
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
public Quota.Builder clearLimits()
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
public Quota.Builder removeLimits(int index)
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
public QuotaLimit.Builder getLimitsBuilder(int index)
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
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<? extends QuotaLimitOrBuilder> getLimitsOrBuilderList()
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
getLimitsOrBuilderList
in interface QuotaOrBuilder
public QuotaLimit.Builder addLimitsBuilder()
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
public QuotaLimit.Builder addLimitsBuilder(int index)
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
public java.util.List<QuotaLimit.Builder> getLimitsBuilderList()
List of `QuotaLimit` definitions for the service.
repeated .google.api.QuotaLimit limits = 3;
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 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 Quota.Builder setMetricRules(int index, MetricRule value)
List of `MetricRule` definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
public Quota.Builder setMetricRules(int index, MetricRule.Builder builderForValue)
List of `MetricRule` definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
public Quota.Builder addMetricRules(MetricRule value)
List of `MetricRule` definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
public Quota.Builder addMetricRules(int index, MetricRule value)
List of `MetricRule` definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
public Quota.Builder addMetricRules(MetricRule.Builder builderForValue)
List of `MetricRule` definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
public Quota.Builder addMetricRules(int index, MetricRule.Builder builderForValue)
List of `MetricRule` definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
public Quota.Builder addAllMetricRules(java.lang.Iterable<? extends MetricRule> values)
List of `MetricRule` definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
public Quota.Builder clearMetricRules()
List of `MetricRule` definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
public Quota.Builder removeMetricRules(int index)
List of `MetricRule` definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
public MetricRule.Builder getMetricRulesBuilder(int index)
List of `MetricRule` definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
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 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 MetricRule.Builder addMetricRulesBuilder()
List of `MetricRule` definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
public MetricRule.Builder addMetricRulesBuilder(int index)
List of `MetricRule` definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
public java.util.List<MetricRule.Builder> getMetricRulesBuilderList()
List of `MetricRule` definitions, each one mapping a selected method to one or more metrics.
repeated .google.api.MetricRule metric_rules = 4;
public final Quota.Builder setUnknownFields(UnknownFieldSet unknownFields)
setUnknownFields
in interface Message.Builder
setUnknownFields
in class GeneratedMessageV3.Builder<Quota.Builder>
public final Quota.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
mergeUnknownFields
in interface Message.Builder
mergeUnknownFields
in class GeneratedMessageV3.Builder<Quota.Builder>