Reference documentation and code samples for the Migrate for Compute Engine V1 API class Google::Rpc::PreconditionFailure.
Describes what preconditions have failed.
For example, if an RPC failed because it required the Terms of Service to be
acknowledged, it could list the terms of service violation in the
PreconditionFailure message.
[[["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-28 UTC."],[],[],null,["# Migrate for Compute Engine V1 API - Class Google::Rpc::PreconditionFailure (v2.2.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.2.0 (latest)](/ruby/docs/reference/google-cloud-vm_migration-v1/latest/Google-Rpc-PreconditionFailure)\n- [2.1.1](/ruby/docs/reference/google-cloud-vm_migration-v1/2.1.1/Google-Rpc-PreconditionFailure)\n- [2.0.0](/ruby/docs/reference/google-cloud-vm_migration-v1/2.0.0/Google-Rpc-PreconditionFailure)\n- [1.3.0](/ruby/docs/reference/google-cloud-vm_migration-v1/1.3.0/Google-Rpc-PreconditionFailure)\n- [1.2.0](/ruby/docs/reference/google-cloud-vm_migration-v1/1.2.0/Google-Rpc-PreconditionFailure)\n- [1.1.0](/ruby/docs/reference/google-cloud-vm_migration-v1/1.1.0/Google-Rpc-PreconditionFailure)\n- [1.0.2](/ruby/docs/reference/google-cloud-vm_migration-v1/1.0.2/Google-Rpc-PreconditionFailure)\n- [0.9.0](/ruby/docs/reference/google-cloud-vm_migration-v1/0.9.0/Google-Rpc-PreconditionFailure)\n- [0.8.2](/ruby/docs/reference/google-cloud-vm_migration-v1/0.8.2/Google-Rpc-PreconditionFailure)\n- [0.7.0](/ruby/docs/reference/google-cloud-vm_migration-v1/0.7.0/Google-Rpc-PreconditionFailure)\n- [0.6.1](/ruby/docs/reference/google-cloud-vm_migration-v1/0.6.1/Google-Rpc-PreconditionFailure)\n- [0.5.0](/ruby/docs/reference/google-cloud-vm_migration-v1/0.5.0/Google-Rpc-PreconditionFailure)\n- [0.4.0](/ruby/docs/reference/google-cloud-vm_migration-v1/0.4.0/Google-Rpc-PreconditionFailure)\n- [0.3.0](/ruby/docs/reference/google-cloud-vm_migration-v1/0.3.0/Google-Rpc-PreconditionFailure)\n- [0.2.0](/ruby/docs/reference/google-cloud-vm_migration-v1/0.2.0/Google-Rpc-PreconditionFailure)\n- [0.1.1](/ruby/docs/reference/google-cloud-vm_migration-v1/0.1.1/Google-Rpc-PreconditionFailure) \nReference documentation and code samples for the Migrate for Compute Engine V1 API class Google::Rpc::PreconditionFailure.\n\nDescribes what preconditions have failed.\n\n\n\u003cbr /\u003e\n\nFor example, if an RPC failed because it required the Terms of Service to be\nacknowledged, it could list the terms of service violation in the\nPreconditionFailure message. \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### #violations\n\n def violations() -\u003e ::Array\u003c::Google::Rpc::PreconditionFailure::Violation\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Rpc::PreconditionFailure::Violation](./Google-Rpc-PreconditionFailure-Violation)\\\u003e) --- Describes all precondition violations.\n\n### #violations=\n\n def violations=(value) -\u003e ::Array\u003c::Google::Rpc::PreconditionFailure::Violation\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Rpc::PreconditionFailure::Violation](./Google-Rpc-PreconditionFailure-Violation)\\\u003e) --- Describes all precondition violations. \n**Returns**\n\n- (::Array\\\u003c[::Google::Rpc::PreconditionFailure::Violation](./Google-Rpc-PreconditionFailure-Violation)\\\u003e) --- Describes all precondition violations."]]