Class: Google::Apis::ConnectorsV1::TrafficShapingConfig
- Inherits:
-
Object
- Object
- Google::Apis::ConnectorsV1::TrafficShapingConfig
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/connectors_v1/classes.rb,
lib/google/apis/connectors_v1/representations.rb,
lib/google/apis/connectors_v1/representations.rb
Overview
- TrafficShapingConfig defines the configuration for shaping API traffic by
specifying a quota limit and the duration over which this limit is enforced.
This configuration helps to control and manage the rate at which API calls are
made on the client side, preventing service overload on the backend. For
example: - if the quota limit is 100 calls per 10 seconds, then the message
would be:
quota_limit: 100 duration:seconds: 10- if the quota limit is 100 calls per 5 minutes, then the message would be:quota_limit: 100 duration:seconds: 300- if the quota limit is 10000 calls per day, then the message would be:quota_limit: 10000 duration:seconds: 86400 ` and so on.
Instance Attribute Summary collapse
-
#duration ⇒ String
Required.
-
#quota_limit ⇒ Fixnum
Required.
Instance Method Summary collapse
-
#initialize(**args) ⇒ TrafficShapingConfig
constructor
A new instance of TrafficShapingConfig.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ TrafficShapingConfig
Returns a new instance of TrafficShapingConfig.
7761 7762 7763 |
# File 'lib/google/apis/connectors_v1/classes.rb', line 7761 def initialize(**args) update!(**args) end |
Instance Attribute Details
#duration ⇒ String
Required. Specifies the duration over which the API call quota limits are
calculated. This duration is used to define the time window for evaluating if
the number of API calls made by a user is within the allowed quota limits. For
example: - To define a quota sampled over 16 seconds, set seconds to 16 - To
define a quota sampled over 5 minutes, set seconds to 300 (5 * 60) - To
define a quota sampled over 1 day, set seconds to 86400 (24 * 60 * 60) and
so on. It is important to note that this duration is not the time the quota is
valid for, but rather the time window over which the quota is evaluated. For
example, if the quota is 100 calls per 10 seconds, then this duration field
would be set to 10 seconds.
Corresponds to the JSON property duration
7754 7755 7756 |
# File 'lib/google/apis/connectors_v1/classes.rb', line 7754 def duration @duration end |
#quota_limit ⇒ Fixnum
Required. Maximum number of api calls allowed.
Corresponds to the JSON property quotaLimit
7759 7760 7761 |
# File 'lib/google/apis/connectors_v1/classes.rb', line 7759 def quota_limit @quota_limit end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
7766 7767 7768 7769 |
# File 'lib/google/apis/connectors_v1/classes.rb', line 7766 def update!(**args) @duration = args[:duration] if args.key?(:duration) @quota_limit = args[:quota_limit] if args.key?(:quota_limit) end |