Class: Google::Apis::ComputeV1::CustomErrorResponsePolicy
- Inherits:
-
Object
- Object
- Google::Apis::ComputeV1::CustomErrorResponsePolicy
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/compute_v1/classes.rb,
lib/google/apis/compute_v1/representations.rb,
lib/google/apis/compute_v1/representations.rb
Overview
Specifies the custom error response policy that must be applied when the backend service or backend bucket responds with an error.
Instance Attribute Summary collapse
-
#error_response_rules ⇒ Array<Google::Apis::ComputeV1::CustomErrorResponsePolicyCustomErrorResponseRule>
Specifies rules for returning error responses.
-
#error_service ⇒ String
The full or partial URL to the BackendBucket resource that contains the custom error content.
Instance Method Summary collapse
-
#initialize(**args) ⇒ CustomErrorResponsePolicy
constructor
A new instance of CustomErrorResponsePolicy.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ CustomErrorResponsePolicy
Returns a new instance of CustomErrorResponsePolicy.
8037 8038 8039 |
# File 'lib/google/apis/compute_v1/classes.rb', line 8037 def initialize(**args) update!(**args) end |
Instance Attribute Details
#error_response_rules ⇒ Array<Google::Apis::ComputeV1::CustomErrorResponsePolicyCustomErrorResponseRule>
Specifies rules for returning error responses.
In a given policy, if you specify rules for both a range of error codes
as well as rules for specific error codes then rules with specific error
codes have a higher priority. For example, assume that you configure a rule
for 401 (Un-authorized) code, and another for all 4 series
error codes (4XX). If the backend service returns a401, then the rule for 401
will be applied.
However if the backend service returns a 403, the rule for4xx takes effect.
Corresponds to the JSON property errorResponseRules
8012 8013 8014 |
# File 'lib/google/apis/compute_v1/classes.rb', line 8012 def error_response_rules @error_response_rules end |
#error_service ⇒ String
The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are:
- https://www.googleapis.com/compute/v1/projects/project/global/ backendBuckets/myBackendBucket
- compute/v1/projects/project/global/backendBuckets/myBackendBucket
- global/backendBuckets/myBackendBucket
If errorService is not specified at lower levels likepathMatcher, pathRule and
routeRule,
an errorService specified at a higher level in theUrlMap will be used.
IfUrlMap.defaultCustomErrorResponsePolicy contains one or
moreerrorResponseRules[], it must specifyerrorService.
If load balancer cannot reach
the backendBucket, a simple Not Found Error will
be returned, with the original response code (oroverrideResponseCode if
configured).
errorService is not supported for internal or regionalHTTP/HTTPS load
balancers.
Corresponds to the JSON property
errorService
8035 8036 8037 |
# File 'lib/google/apis/compute_v1/classes.rb', line 8035 def error_service @error_service end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
8042 8043 8044 8045 |
# File 'lib/google/apis/compute_v1/classes.rb', line 8042 def update!(**args) @error_response_rules = args[:error_response_rules] if args.key?(:error_response_rules) @error_service = args[:error_service] if args.key?(:error_service) end |