Reference documentation and code samples for the Google Cloud Network Services V1 Client class HeaderMatch.
Specifies how to select a route rule based on HTTP request headers.
Generated from protobuf message google.cloud.networkservices.v1.HttpRoute.HeaderMatch
Namespace
Google \ Cloud \ NetworkServices \ V1 \ HttpRouteMethods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ exact_match |
string
The value of the header should match exactly the content of exact_match. |
↳ regex_match |
string
The value of the header must match the regular expression specified in regex_match. For regular expression grammar, please see: https://github.com/google/re2/wiki/Syntax |
↳ prefix_match |
string
The value of the header must start with the contents of prefix_match. |
↳ present_match |
bool
A header with header_name must exist. The match takes place whether or not the header has a value. |
↳ suffix_match |
string
The value of the header must end with the contents of suffix_match. |
↳ range_match |
HeaderMatch\IntegerRange
If specified, the rule will match if the request header value is within the range. |
↳ header |
string
The name of the HTTP header to match against. |
↳ invert_match |
bool
If specified, the match result will be inverted before checking. Default value is set to false. |
getExactMatch
The value of the header should match exactly the content of exact_match.
| Returns | |
|---|---|
| Type | Description |
string |
|
hasExactMatch
setExactMatch
The value of the header should match exactly the content of exact_match.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getRegexMatch
The value of the header must match the regular expression specified in regex_match. For regular expression grammar, please see: https://github.com/google/re2/wiki/Syntax
| Returns | |
|---|---|
| Type | Description |
string |
|
hasRegexMatch
setRegexMatch
The value of the header must match the regular expression specified in regex_match. For regular expression grammar, please see: https://github.com/google/re2/wiki/Syntax
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getPrefixMatch
The value of the header must start with the contents of prefix_match.
| Returns | |
|---|---|
| Type | Description |
string |
|
hasPrefixMatch
setPrefixMatch
The value of the header must start with the contents of prefix_match.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getPresentMatch
A header with header_name must exist. The match takes place whether or not the header has a value.
| Returns | |
|---|---|
| Type | Description |
bool |
|
hasPresentMatch
setPresentMatch
A header with header_name must exist. The match takes place whether or not the header has a value.
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getSuffixMatch
The value of the header must end with the contents of suffix_match.
| Returns | |
|---|---|
| Type | Description |
string |
|
hasSuffixMatch
setSuffixMatch
The value of the header must end with the contents of suffix_match.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getRangeMatch
If specified, the rule will match if the request header value is within the range.
| Returns | |
|---|---|
| Type | Description |
HeaderMatch\IntegerRange|null |
|
hasRangeMatch
setRangeMatch
If specified, the rule will match if the request header value is within the range.
| Parameter | |
|---|---|
| Name | Description |
var |
HeaderMatch\IntegerRange
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getHeader
The name of the HTTP header to match against.
| Returns | |
|---|---|
| Type | Description |
string |
|
setHeader
The name of the HTTP header to match against.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getInvertMatch
If specified, the match result will be inverted before checking. Default value is set to false.
| Returns | |
|---|---|
| Type | Description |
bool |
|
setInvertMatch
If specified, the match result will be inverted before checking. Default value is set to false.
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getMatchType
| Returns | |
|---|---|
| Type | Description |
string |
|