[[["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-09 UTC."],[],[],null,["# Cloud OS Config V1 API - Class Google::Cloud::OsConfig::V1::OSPolicyAssignment::InstanceFilter (v1.4.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.4.0 (latest)](/ruby/docs/reference/google-cloud-os_config-v1/latest/Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter)\n- [1.3.0](/ruby/docs/reference/google-cloud-os_config-v1/1.3.0/Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter)\n- [1.2.1](/ruby/docs/reference/google-cloud-os_config-v1/1.2.1/Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter)\n- [1.1.0](/ruby/docs/reference/google-cloud-os_config-v1/1.1.0/Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter)\n- [1.0.1](/ruby/docs/reference/google-cloud-os_config-v1/1.0.1/Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter)\n- [0.16.0](/ruby/docs/reference/google-cloud-os_config-v1/0.16.0/Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter)\n- [0.15.2](/ruby/docs/reference/google-cloud-os_config-v1/0.15.2/Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter)\n- [0.14.0](/ruby/docs/reference/google-cloud-os_config-v1/0.14.0/Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter)\n- [0.13.0](/ruby/docs/reference/google-cloud-os_config-v1/0.13.0/Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter)\n- [0.12.0](/ruby/docs/reference/google-cloud-os_config-v1/0.12.0/Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter)\n- [0.11.0](/ruby/docs/reference/google-cloud-os_config-v1/0.11.0/Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter)\n- [0.10.0](/ruby/docs/reference/google-cloud-os_config-v1/0.10.0/Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter)\n- [0.9.1](/ruby/docs/reference/google-cloud-os_config-v1/0.9.1/Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter) \nReference documentation and code samples for the Cloud OS Config V1 API class Google::Cloud::OsConfig::V1::OSPolicyAssignment::InstanceFilter.\n\nFilters to select target VMs for an assignment.\n\n\n\u003cbr /\u003e\n\nIf more than one filter criteria is specified below, a VM will be selected\nif and only if it satisfies all of them. \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### #all\n\n def all() -\u003e ::Boolean\n\n**Returns**\n\n- (::Boolean) --- Target all VMs in the project. If true, no other criteria is permitted.\n\n### #all=\n\n def all=(value) -\u003e ::Boolean\n\n**Parameter**\n\n- **value** (::Boolean) --- Target all VMs in the project. If true, no other criteria is permitted. \n**Returns**\n\n- (::Boolean) --- Target all VMs in the project. If true, no other criteria is permitted.\n\n### #exclusion_labels\n\n def exclusion_labels() -\u003e ::Array\u003c::Google::Cloud::OsConfig::V1::OSPolicyAssignment::LabelSet\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicyAssignment::LabelSet](./Google-Cloud-OsConfig-V1-OSPolicyAssignment-LabelSet)\\\u003e) --- List of label sets used for VM exclusion.\n\n\n If the list has more than one label set, the VM is excluded if any\n of the label sets are applicable for the VM.\n\n### #exclusion_labels=\n\n def exclusion_labels=(value) -\u003e ::Array\u003c::Google::Cloud::OsConfig::V1::OSPolicyAssignment::LabelSet\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicyAssignment::LabelSet](./Google-Cloud-OsConfig-V1-OSPolicyAssignment-LabelSet)\\\u003e) --- List of label sets used for VM exclusion.\n\n\n If the list has more than one label set, the VM is excluded if any\nof the label sets are applicable for the VM. \n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicyAssignment::LabelSet](./Google-Cloud-OsConfig-V1-OSPolicyAssignment-LabelSet)\\\u003e) --- List of label sets used for VM exclusion.\n\n\n If the list has more than one label set, the VM is excluded if any\n of the label sets are applicable for the VM.\n\n### #inclusion_labels\n\n def inclusion_labels() -\u003e ::Array\u003c::Google::Cloud::OsConfig::V1::OSPolicyAssignment::LabelSet\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicyAssignment::LabelSet](./Google-Cloud-OsConfig-V1-OSPolicyAssignment-LabelSet)\\\u003e) --- List of label sets used for VM inclusion.\n\n\n If the list has more than one `LabelSet`, the VM is included if any\n of the label sets are applicable for the VM.\n\n### #inclusion_labels=\n\n def inclusion_labels=(value) -\u003e ::Array\u003c::Google::Cloud::OsConfig::V1::OSPolicyAssignment::LabelSet\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicyAssignment::LabelSet](./Google-Cloud-OsConfig-V1-OSPolicyAssignment-LabelSet)\\\u003e) --- List of label sets used for VM inclusion.\n\n\n If the list has more than one `LabelSet`, the VM is included if any\nof the label sets are applicable for the VM. \n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicyAssignment::LabelSet](./Google-Cloud-OsConfig-V1-OSPolicyAssignment-LabelSet)\\\u003e) --- List of label sets used for VM inclusion.\n\n\n If the list has more than one `LabelSet`, the VM is included if any\n of the label sets are applicable for the VM.\n\n### #inventories\n\n def inventories() -\u003e ::Array\u003c::Google::Cloud::OsConfig::V1::OSPolicyAssignment::InstanceFilter::Inventory\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicyAssignment::InstanceFilter::Inventory](./Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter-Inventory)\\\u003e) --- List of inventories to select VMs.\n\n\n A VM is selected if its inventory data matches at least one of the\n following inventories.\n\n### #inventories=\n\n def inventories=(value) -\u003e ::Array\u003c::Google::Cloud::OsConfig::V1::OSPolicyAssignment::InstanceFilter::Inventory\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicyAssignment::InstanceFilter::Inventory](./Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter-Inventory)\\\u003e) --- List of inventories to select VMs.\n\n\n A VM is selected if its inventory data matches at least one of the\nfollowing inventories. \n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicyAssignment::InstanceFilter::Inventory](./Google-Cloud-OsConfig-V1-OSPolicyAssignment-InstanceFilter-Inventory)\\\u003e) --- List of inventories to select VMs.\n\n\n A VM is selected if its inventory data matches at least one of the\n following inventories."]]