Class: Google::Apis::ComputeAlpha::BackendServiceCdnPolicyNegativeCachingPolicy

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/compute_alpha/classes.rb,
lib/google/apis/compute_alpha/representations.rb,
lib/google/apis/compute_alpha/representations.rb

Overview

Specify CDN TTLs for response error codes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ BackendServiceCdnPolicyNegativeCachingPolicy

Returns a new instance of BackendServiceCdnPolicyNegativeCachingPolicy.



4254
4255
4256
# File 'lib/google/apis/compute_alpha/classes.rb', line 4254

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#codeFixnum

The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be specified as values, and you cannot specify a status code more than once. Corresponds to the JSON property code

Returns:

  • (Fixnum)


4244
4245
4246
# File 'lib/google/apis/compute_alpha/classes.rb', line 4244

def code
  @code
end

#ttlFixnum

The TTL (in seconds) for which to cache responses with the corresponding status code. The maximum allowed value is 1800s (30 minutes), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. Corresponds to the JSON property ttl

Returns:

  • (Fixnum)


4252
4253
4254
# File 'lib/google/apis/compute_alpha/classes.rb', line 4252

def ttl
  @ttl
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4259
4260
4261
4262
# File 'lib/google/apis/compute_alpha/classes.rb', line 4259

def update!(**args)
  @code = args[:code] if args.key?(:code)
  @ttl = args[:ttl] if args.key?(:ttl)
end