Reference documentation and code samples for the Google Cloud Compute V1 API class Google::Cloud::Compute::V1::MetadataFilter.
Opaque filter criteria used by load balancers to restrict routing configuration to a limited set of load balancing proxies. Proxies and sidecars involved in load balancing would typically present metadata to the load balancers that need to match criteria specified here. If a match takes place, the relevant configuration is made available to those proxies. For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. An example for using metadataFilters would be: if load balancing involves Envoys, they receive routing configuration when values in metadataFilters match values supplied in of their XDS requests to loadbalancers.
(::Array<::Google::Cloud::Compute::V1::MetadataFilterLabelMatch>) — The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list must not be empty and can have at the most 64 entries.
value (::Array<::Google::Cloud::Compute::V1::MetadataFilterLabelMatch>) — The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list must not be empty and can have at the most 64 entries.
Returns
(::Array<::Google::Cloud::Compute::V1::MetadataFilterLabelMatch>) — The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list must not be empty and can have at the most 64 entries.
#filter_match_criteria
deffilter_match_criteria()->::String
Returns
(::String) — Specifies how individual filter label matches within the list of filterLabels and contributes toward the overall metadataFilter match. Supported values are: - MATCH_ANY: at least one of the filterLabels must have a matching label in the provided metadata. - MATCH_ALL: all filterLabels must have matching labels in the provided metadata.
Check the FilterMatchCriteria enum for the list of possible values.
#filter_match_criteria=
deffilter_match_criteria=(value)->::String
Parameter
value (::String) — Specifies how individual filter label matches within the list of filterLabels and contributes toward the overall metadataFilter match. Supported values are: - MATCH_ANY: at least one of the filterLabels must have a matching label in the provided metadata. - MATCH_ALL: all filterLabels must have matching labels in the provided metadata.
Check the FilterMatchCriteria enum for the list of possible values.
Returns
(::String) — Specifies how individual filter label matches within the list of filterLabels and contributes toward the overall metadataFilter match. Supported values are: - MATCH_ANY: at least one of the filterLabels must have a matching label in the provided metadata. - MATCH_ALL: all filterLabels must have matching labels in the provided metadata.
Check the FilterMatchCriteria enum for the list of possible values.
[[["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-08-29 UTC."],[],[],null,["# Google Cloud Compute V1 API - Class Google::Cloud::Compute::V1::MetadataFilter (v3.0.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.0.0 (latest)](/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.22.0](/ruby/docs/reference/google-cloud-compute-v1/2.22.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.21.1](/ruby/docs/reference/google-cloud-compute-v1/2.21.1/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.20.0](/ruby/docs/reference/google-cloud-compute-v1/2.20.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.19.1](/ruby/docs/reference/google-cloud-compute-v1/2.19.1/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.18.0](/ruby/docs/reference/google-cloud-compute-v1/2.18.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.17.0](/ruby/docs/reference/google-cloud-compute-v1/2.17.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.16.0](/ruby/docs/reference/google-cloud-compute-v1/2.16.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.15.0](/ruby/docs/reference/google-cloud-compute-v1/2.15.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.14.0](/ruby/docs/reference/google-cloud-compute-v1/2.14.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.13.0](/ruby/docs/reference/google-cloud-compute-v1/2.13.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.12.0](/ruby/docs/reference/google-cloud-compute-v1/2.12.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.11.0](/ruby/docs/reference/google-cloud-compute-v1/2.11.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.10.0](/ruby/docs/reference/google-cloud-compute-v1/2.10.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.9.0](/ruby/docs/reference/google-cloud-compute-v1/2.9.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.8.0](/ruby/docs/reference/google-cloud-compute-v1/2.8.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.7.2](/ruby/docs/reference/google-cloud-compute-v1/2.7.2/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.6.0](/ruby/docs/reference/google-cloud-compute-v1/2.6.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.5.0](/ruby/docs/reference/google-cloud-compute-v1/2.5.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.4.0](/ruby/docs/reference/google-cloud-compute-v1/2.4.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.3.0](/ruby/docs/reference/google-cloud-compute-v1/2.3.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.2.0](/ruby/docs/reference/google-cloud-compute-v1/2.2.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.1.0](/ruby/docs/reference/google-cloud-compute-v1/2.1.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [2.0.0](/ruby/docs/reference/google-cloud-compute-v1/2.0.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [1.10.0](/ruby/docs/reference/google-cloud-compute-v1/1.10.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [1.9.0](/ruby/docs/reference/google-cloud-compute-v1/1.9.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [1.8.0](/ruby/docs/reference/google-cloud-compute-v1/1.8.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [1.7.1](/ruby/docs/reference/google-cloud-compute-v1/1.7.1/Google-Cloud-Compute-V1-MetadataFilter)\n- [1.6.0](/ruby/docs/reference/google-cloud-compute-v1/1.6.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [1.5.0](/ruby/docs/reference/google-cloud-compute-v1/1.5.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [1.4.0](/ruby/docs/reference/google-cloud-compute-v1/1.4.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [1.3.0](/ruby/docs/reference/google-cloud-compute-v1/1.3.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [1.2.0](/ruby/docs/reference/google-cloud-compute-v1/1.2.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [1.1.0](/ruby/docs/reference/google-cloud-compute-v1/1.1.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [1.0.0](/ruby/docs/reference/google-cloud-compute-v1/1.0.0/Google-Cloud-Compute-V1-MetadataFilter)\n- [0.5.0](/ruby/docs/reference/google-cloud-compute-v1/0.5.0/Google-Cloud-Compute-V1-MetadataFilter) \nReference documentation and code samples for the Google Cloud Compute V1 API class Google::Cloud::Compute::V1::MetadataFilter.\n\nOpaque filter criteria used by load balancers to restrict routing configuration to a limited set of load balancing proxies. Proxies and sidecars involved in load balancing would typically present metadata to the load balancers that need to match criteria specified here. If a match takes place, the relevant configuration is made available to those proxies. For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. An example for using metadataFilters would be: if load balancing involves Envoys, they receive routing configuration when values in metadataFilters match values supplied in of their XDS requests to loadbalancers. \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### #filter_labels\n\n def filter_labels() -\u003e ::Array\u003c::Google::Cloud::Compute::V1::MetadataFilterLabelMatch\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::Compute::V1::MetadataFilterLabelMatch](./Google-Cloud-Compute-V1-MetadataFilterLabelMatch)\\\u003e) --- The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list must not be empty and can have at the most 64 entries.\n\n### #filter_labels=\n\n def filter_labels=(value) -\u003e ::Array\u003c::Google::Cloud::Compute::V1::MetadataFilterLabelMatch\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Cloud::Compute::V1::MetadataFilterLabelMatch](./Google-Cloud-Compute-V1-MetadataFilterLabelMatch)\\\u003e) --- The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list must not be empty and can have at the most 64 entries. \n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::Compute::V1::MetadataFilterLabelMatch](./Google-Cloud-Compute-V1-MetadataFilterLabelMatch)\\\u003e) --- The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list must not be empty and can have at the most 64 entries.\n\n### #filter_match_criteria\n\n def filter_match_criteria() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Specifies how individual filter label matches within the list of filterLabels and contributes toward the overall metadataFilter match. Supported values are: - MATCH_ANY: at least one of the filterLabels must have a matching label in the provided metadata. - MATCH_ALL: all filterLabels must have matching labels in the provided metadata. Check the FilterMatchCriteria enum for the list of possible values.\n\n### #filter_match_criteria=\n\n def filter_match_criteria=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Specifies how individual filter label matches within the list of filterLabels and contributes toward the overall metadataFilter match. Supported values are: - MATCH_ANY: at least one of the filterLabels must have a matching label in the provided metadata. - MATCH_ALL: all filterLabels must have matching labels in the provided metadata. Check the FilterMatchCriteria enum for the list of possible values. \n**Returns**\n\n- (::String) --- Specifies how individual filter label matches within the list of filterLabels and contributes toward the overall metadataFilter match. Supported values are: - MATCH_ANY: at least one of the filterLabels must have a matching label in the provided metadata. - MATCH_ALL: all filterLabels must have matching labels in the provided metadata. Check the FilterMatchCriteria enum for the list of possible values."]]