Reference documentation and code samples for the Storage Control V2 API class Google::Api::RoutingParameter.
A projection from an input message to the GRPC or REST header.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#field
deffield()->::String
Returns
(::String) — A request field to extract the header key-value pair from.
#field=
deffield=(value)->::String
Parameter
value (::String) — A request field to extract the header key-value pair from.
Returns
(::String) — A request field to extract the header key-value pair from.
#path_template
defpath_template()->::String
Returns
(::String) — A pattern matching the key-value field. Optional.
If not specified, the whole field specified in the field field will be
taken as value, and its name used as key. If specified, it MUST contain
exactly one named segment (along with any number of unnamed segments) The
pattern will be matched over the field specified in the field field, then
if the match is successful:
the name of the single named segment will be used as a header name,
the match value of the segment will be used as a header value;
if the match is NOT successful, nothing will be sent.
Example:
-- This is a field in the request message
| that the header value will be extracted from.
|
| -- This is the key name in the
| | routing header.
V |
field: "table_name" v
path_template: "projects/*/{table_location=instances/*}/tables/*"
^ ^
| |
In the {} brackets is the pattern that -- |
specifies what to extract from the |
field as a value to be sent. |
|
The string in the field must match the whole pattern --
before brackets, inside brackets, after brackets.
When looking at this specific example, we can see that:
A key-value pair with the key table_location
and the value matching instances/* should be added
to the x-goog-request-params routing header.
The value is extracted from the request message's table_name field
if it matches the full pattern specified:
projects/*/instances/*/tables/*.
NB: If the path_template field is not provided, the key name is
equal to the field name, and the whole field should be sent as a value.
This makes the pattern for the field and the value functionally equivalent
to **, and the configuration
value (::String) — A pattern matching the key-value field. Optional.
If not specified, the whole field specified in the field field will be
taken as value, and its name used as key. If specified, it MUST contain
exactly one named segment (along with any number of unnamed segments) The
pattern will be matched over the field specified in the field field, then
if the match is successful:
the name of the single named segment will be used as a header name,
the match value of the segment will be used as a header value;
if the match is NOT successful, nothing will be sent.
Example:
-- This is a field in the request message
| that the header value will be extracted from.
|
| -- This is the key name in the
| | routing header.
V |
field: "table_name" v
path_template: "projects/*/{table_location=instances/*}/tables/*"
^ ^
| |
In the {} brackets is the pattern that -- |
specifies what to extract from the |
field as a value to be sent. |
|
The string in the field must match the whole pattern --
before brackets, inside brackets, after brackets.
When looking at this specific example, we can see that:
A key-value pair with the key table_location
and the value matching instances/* should be added
to the x-goog-request-params routing header.
The value is extracted from the request message's table_name field
if it matches the full pattern specified:
projects/*/instances/*/tables/*.
NB: If the path_template field is not provided, the key name is
equal to the field name, and the whole field should be sent as a value.
This makes the pattern for the field and the value functionally equivalent
to **, and the configuration
(::String) — A pattern matching the key-value field. Optional.
If not specified, the whole field specified in the field field will be
taken as value, and its name used as key. If specified, it MUST contain
exactly one named segment (along with any number of unnamed segments) The
pattern will be matched over the field specified in the field field, then
if the match is successful:
the name of the single named segment will be used as a header name,
the match value of the segment will be used as a header value;
if the match is NOT successful, nothing will be sent.
Example:
-- This is a field in the request message
| that the header value will be extracted from.
|
| -- This is the key name in the
| | routing header.
V |
field: "table_name" v
path_template: "projects/*/{table_location=instances/*}/tables/*"
^ ^
| |
In the {} brackets is the pattern that -- |
specifies what to extract from the |
field as a value to be sent. |
|
The string in the field must match the whole pattern --
before brackets, inside brackets, after brackets.
When looking at this specific example, we can see that:
A key-value pair with the key table_location
and the value matching instances/* should be added
to the x-goog-request-params routing header.
The value is extracted from the request message's table_name field
if it matches the full pattern specified:
projects/*/instances/*/tables/*.
NB: If the path_template field is not provided, the key name is
equal to the field name, and the whole field should be sent as a value.
This makes the pattern for the field and the value functionally equivalent
to **, and the configuration
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[],[],null,["# Storage Control V2 API - Class Google::Api::RoutingParameter (v1.5.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.5.0 (latest)](/ruby/docs/reference/google-cloud-storage-control-v2/latest/Google-Api-RoutingParameter)\n- [1.4.0](/ruby/docs/reference/google-cloud-storage-control-v2/1.4.0/Google-Api-RoutingParameter)\n- [1.3.0](/ruby/docs/reference/google-cloud-storage-control-v2/1.3.0/Google-Api-RoutingParameter)\n- [1.2.1](/ruby/docs/reference/google-cloud-storage-control-v2/1.2.1/Google-Api-RoutingParameter)\n- [1.1.0](/ruby/docs/reference/google-cloud-storage-control-v2/1.1.0/Google-Api-RoutingParameter)\n- [1.0.1](/ruby/docs/reference/google-cloud-storage-control-v2/1.0.1/Google-Api-RoutingParameter)\n- [0.1.1](/ruby/docs/reference/google-cloud-storage-control-v2/0.1.1/Google-Api-RoutingParameter) \nReference documentation and code samples for the Storage Control V2 API class Google::Api::RoutingParameter.\n\nA projection from an input message to the GRPC or REST header. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #field\n\n def field() -\u003e ::String\n\n**Returns**\n\n- (::String) --- A request field to extract the header key-value pair from.\n\n### #field=\n\n def field=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- A request field to extract the header key-value pair from. \n**Returns**\n\n- (::String) --- A request field to extract the header key-value pair from.\n\n### #path_template\n\n def path_template() -\u003e ::String\n\n**Returns**\n\n- (::String) --- A pattern matching the key-value field. Optional. If not specified, the whole field specified in the `field` field will be taken as value, and its name used as key. If specified, it MUST contain exactly one named segment (along with any number of unnamed segments) The pattern will be matched over the field specified in the `field` field, then if the match is successful:\n\n\n - the name of the single named segment will be used as a header name,\n - the match value of the segment will be used as a header value; if the match is NOT successful, nothing will be sent.\n\n Example: \n\n -- This is a field in the request message\n | that the header value will be extracted from.\n |\n | -- This is the key name in the\n | | routing header.\n V |\n field: \"table_name\" v\n path_template: \"projects/*/{table_location=instances/*}/tables/*\"\n ^ ^\n | |\n In the {} brackets is the pattern that -- |\n specifies what to extract from the |\n field as a value to be sent. |\n |\n The string in the field must match the whole pattern --\n before brackets, inside brackets, after brackets.\n\n When looking at this specific example, we can see that:\n - A key-value pair with the key `table_location` and the value matching `instances/*` should be added to the x-goog-request-params routing header.\n - The value is extracted from the request message's `table_name` field if it matches the full pattern specified: `projects/*/instances/*/tables/*`.\n\n **NB:** If the `path_template` field is not provided, the key name is\n equal to the field name, and the whole field should be sent as a value.\n This makes the pattern for the field and the value functionally equivalent\n to `**`, and the configuration \n\n {\n field: \"table_name\"\n }\n\n is a functionally equivalent shorthand to: \n\n {\n field: \"table_name\"\n path_template: \"{table_name=**}\"\n }\n\n See Example 1 for more details.\n\n### #path_template=\n\n def path_template=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- A pattern matching the key-value field. Optional. If not specified, the whole field specified in the `field` field will be taken as value, and its name used as key. If specified, it MUST contain exactly one named segment (along with any number of unnamed segments) The pattern will be matched over the field specified in the `field` field, then if the match is successful:\n\n\n - the name of the single named segment will be used as a header name,\n - the match value of the segment will be used as a header value; if the match is NOT successful, nothing will be sent.\n\n Example: \n\n -- This is a field in the request message\n | that the header value will be extracted from.\n |\n | -- This is the key name in the\n | | routing header.\n V |\n field: \"table_name\" v\n path_template: \"projects/*/{table_location=instances/*}/tables/*\"\n ^ ^\n | |\n In the {} brackets is the pattern that -- |\n specifies what to extract from the |\n field as a value to be sent. |\n |\n The string in the field must match the whole pattern --\n before brackets, inside brackets, after brackets.\n\n When looking at this specific example, we can see that:\n - A key-value pair with the key `table_location` and the value matching `instances/*` should be added to the x-goog-request-params routing header.\n - The value is extracted from the request message's `table_name` field if it matches the full pattern specified: `projects/*/instances/*/tables/*`.\n\n **NB:** If the `path_template` field is not provided, the key name is\n equal to the field name, and the whole field should be sent as a value.\n This makes the pattern for the field and the value functionally equivalent\n to `**`, and the configuration \n\n {\n field: \"table_name\"\n }\n\n is a functionally equivalent shorthand to: \n\n {\n field: \"table_name\"\n path_template: \"{table_name=**}\"\n }\n\nSee Example 1 for more details. \n**Returns**\n\n- (::String) --- A pattern matching the key-value field. Optional. If not specified, the whole field specified in the `field` field will be taken as value, and its name used as key. If specified, it MUST contain exactly one named segment (along with any number of unnamed segments) The pattern will be matched over the field specified in the `field` field, then if the match is successful:\n\n\n - the name of the single named segment will be used as a header name,\n - the match value of the segment will be used as a header value; if the match is NOT successful, nothing will be sent.\n\n Example: \n\n -- This is a field in the request message\n | that the header value will be extracted from.\n |\n | -- This is the key name in the\n | | routing header.\n V |\n field: \"table_name\" v\n path_template: \"projects/*/{table_location=instances/*}/tables/*\"\n ^ ^\n | |\n In the {} brackets is the pattern that -- |\n specifies what to extract from the |\n field as a value to be sent. |\n |\n The string in the field must match the whole pattern --\n before brackets, inside brackets, after brackets.\n\n When looking at this specific example, we can see that:\n - A key-value pair with the key `table_location` and the value matching `instances/*` should be added to the x-goog-request-params routing header.\n - The value is extracted from the request message's `table_name` field if it matches the full pattern specified: `projects/*/instances/*/tables/*`.\n\n **NB:** If the `path_template` field is not provided, the key name is\n equal to the field name, and the whole field should be sent as a value.\n This makes the pattern for the field and the value functionally equivalent\n to `**`, and the configuration \n\n {\n field: \"table_name\"\n }\n\n is a functionally equivalent shorthand to: \n\n {\n field: \"table_name\"\n path_template: \"{table_name=**}\"\n }\n\n See Example 1 for more details."]]