Class: Google::Apis::ComputeAlpha::PathMatcher

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

A matcher for the path portion of the URL. The BackendService from the longest- matched rule will serve the URL. If no rule was matched, the default service will be used.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ PathMatcher

Returns a new instance of PathMatcher.



27416
27417
27418
# File 'lib/google/apis/compute_alpha/classes.rb', line 27416

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

Instance Attribute Details

#default_route_actionGoogle::Apis::ComputeAlpha::HttpRouteAction

defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. Only one of defaultRouteAction or defaultUrlRedirect must be set. UrlMaps for external HTTP(S) load balancers support only the urlRewrite action within a pathMatcher's defaultRouteAction. Corresponds to the JSON property defaultRouteAction



27351
27352
27353
# File 'lib/google/apis/compute_alpha/classes.rb', line 27351

def default_route_action
  @default_route_action
end

#default_serviceString

The full or partial URL to the BackendService resource. This will be used if none of the pathRules or routeRules defined by this PathMatcher are matched. For example, the following are all valid URLs to a BackendService resource:

  • https://www.googleapis.com/compute/v1/projects/project/global/ backendServices/backendService
  • compute/v1/projects/project/global/backendServices/backendService
  • global/backendServices/backendService If defaultRouteAction is additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. Only one of defaultService, defaultUrlRedirect or defaultRouteAction. weightedBackendService must be set. Authorization requires one or more of the following Google IAM permissions on the specified resource default_service:
  • compute.backendBuckets.use
  • compute.backendServices.use Corresponds to the JSON property defaultService

Returns:

  • (String)


27373
27374
27375
# File 'lib/google/apis/compute_alpha/classes.rb', line 27373

def default_service
  @default_service
end

#default_url_redirectGoogle::Apis::ComputeAlpha::HttpRedirectAction

Specifies settings for an HTTP redirect. Corresponds to the JSON property defaultUrlRedirect



27378
27379
27380
# File 'lib/google/apis/compute_alpha/classes.rb', line 27378

def default_url_redirect
  @default_url_redirect
end

#descriptionString

An optional description of this resource. Provide this property when you create the resource. Corresponds to the JSON property description

Returns:

  • (String)


27384
27385
27386
# File 'lib/google/apis/compute_alpha/classes.rb', line 27384

def description
  @description
end

#header_actionGoogle::Apis::ComputeAlpha::HttpHeaderAction

The request and response header transformations that take effect before the request is passed along to the selected backendService. Corresponds to the JSON property headerAction



27390
27391
27392
# File 'lib/google/apis/compute_alpha/classes.rb', line 27390

def header_action
  @header_action
end

#nameString

The name to which this PathMatcher is referred by the HostRule. Corresponds to the JSON property name

Returns:

  • (String)


27395
27396
27397
# File 'lib/google/apis/compute_alpha/classes.rb', line 27395

def name
  @name
end

#path_rulesArray<Google::Apis::ComputeAlpha::PathRule>

The list of path rules. Use this list instead of routeRules when routing based on simple path matching is all that's required. The order by which path rules are specified does not matter. Matches are always done on the longest-path- first basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* irrespective of the order in which those paths appear in this list. Within a given pathMatcher, only one of pathRules or routeRules must be set. Corresponds to the JSON property pathRules



27406
27407
27408
# File 'lib/google/apis/compute_alpha/classes.rb', line 27406

def path_rules
  @path_rules
end

#route_rulesArray<Google::Apis::ComputeAlpha::HttpRouteRule>

The list of HTTP route rules. Use this list instead of pathRules when advanced route matching and routing actions are desired. routeRules are evaluated in order of priority, from the lowest to highest number. Within a given pathMatcher, you can set only one of pathRules or routeRules. Corresponds to the JSON property routeRules



27414
27415
27416
# File 'lib/google/apis/compute_alpha/classes.rb', line 27414

def route_rules
  @route_rules
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



27421
27422
27423
27424
27425
27426
27427
27428
27429
27430
# File 'lib/google/apis/compute_alpha/classes.rb', line 27421

def update!(**args)
  @default_route_action = args[:default_route_action] if args.key?(:default_route_action)
  @default_service = args[:default_service] if args.key?(:default_service)
  @default_url_redirect = args[:default_url_redirect] if args.key?(:default_url_redirect)
  @description = args[:description] if args.key?(:description)
  @header_action = args[:header_action] if args.key?(:header_action)
  @name = args[:name] if args.key?(:name)
  @path_rules = args[:path_rules] if args.key?(:path_rules)
  @route_rules = args[:route_rules] if args.key?(:route_rules)
end