保持ポリシーで 1 年間の保持期間が設定されているバケットに 2 つのオブジェクト(オブジェクト A と B)があるとします。オブジェクトをバケットに追加したときに、オブジェクト A にイベントベースの保留が設定され、オブジェクト B に一時保留が設定されています。保留が設定されていなければ、これらのオブジェクトは 1 年後に削除可能になりますが、この場合は保留が設定されているため、オブジェクトを削除できません。
この時点で、両方のオブジェクトの保留を解除します。イベントベースの保留を使用していたオブジェクト A では、バケットの保持期間が再開します。つまり、もう 1 年経過しないと、オブジェクトの削除や置換はできません。一時保留を使用していたオブジェクト B では、一時保留がオブジェクトの保持期間の満了時期に影響を及ぼさないため、すぐに削除または置換できます。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-05 UTC。"],[],[],null,["# Object holds\n\n[Usage](/storage/docs/holding-objects)\n\nThis page discusses object holds, which are metadata flags that you\n[place on individual objects](/storage/docs/holding-objects#set-object-hold). While an object has a hold placed on it,\nthe object cannot be deleted or replaced. You can, however,\n[edit the metadata](/storage/docs/metadata#editable) of the object.\n\nTypes of holds\n--------------\n\nCloud Storage offers the following types of holds:\n\n- **Event-based** holds\n- **Temporary** holds\n\nAn object can have one type of hold, both types, or neither hold placed on it.\nWhen an object does not have a [retention configuration](/storage/docs/object-lock) and is stored in a\nbucket without a [retention policy](/storage/docs/bucket-lock#overview), both hold types behave exactly the same.\nThe following table describes how each hold type behaves if an object has a\nretention configuration or is stored in a bucket with a retention policy:\n\n#### Event-based hold example\n\nSay you have two objects - Object A and Object B - in a bucket whose retention\npolicy sets a 1-year retention period. When you added the objects to the bucket,\nyou placed an event-based hold on Object A and a temporary hold on Object B. A\nyear passes, and while you'd normally be able to delete them at this point,\nbecause both objects still have a hold on them, you can't delete either of them.\n\nAt this point, you release the hold from both objects. For Object A, which was\nusing an event-based hold, its time in the bucket restarts for the purposes of\nthe retention period. This means it must stay in the bucket for another year\nbefore it can be deleted or replaced. Object B, which was using a temporary\nhold, can immediately be deleted or replaced, because the temporary hold has no\neffect on when the object fulfilled its retention time.\n\nThis behavior lets you use event-based holds in conjunction with\n[retention policies](/storage/docs/bucket-lock#overview) to control retention based on the occurrence of some\nevent, such as holding loan documents for a certain period after the loan was\npaid. Temporary holds can be used for regulatory or legal purposes, such\nas holding trading documents for legal investigation.\n\nThe default event-based hold property\n-------------------------------------\n\nIn addition to placing holds on individual objects, you can\n[enable the default event-based property](/storage/docs/holding-objects#set-default-hold) on your bucket. When you do this,\neach new object that subsequently gets added to the bucket automatically has an\nevent-based hold placed on it.\n\nThis behavior is useful when you want an object to persist in your bucket for\na certain length of time after a certain event occurs. For example,\nyour bucket may be meant to store loans that you must retain for a certain\nnumber of years once they've been paid off. With a suitable retention policy\nand the default event-based hold property enabled for your bucket, when you\nupload a loan document to your bucket, it gets an event-based hold placed on it.\nWhen the loan is paid off, you can release the hold, at which point the\nretention policy ensures the loan remains stored and unchangeable until it\nfulfills the retention period set in your retention policy.\n\nRestrictions\n------------\n\n- Requests that attempt to place an event-based hold on an object that has an\n existing [retention configuration](/storage/docs/object-lock) fail.\n\n - Requests that would simultaneously place an event-based hold on an object and set a retention configuration for the object similarly fail.\n- Object holds cannot be managed with the [XML API](/storage/docs/xml-api/overview), and the hold status of\n an object is not included when using the XML API to\n [retrieve object metadata](/storage/docs/viewing-editing-metadata#view).\n\n - However, attempting to delete or replace an object with the XML API still\n fails if the object has a hold on it.\n\n - For [XML API multipart uploads](/storage/docs/multipart-uploads), you can initiate an upload and upload\n parts, but the request to complete the upload fails if it would overwrite\n an object that has a hold on it.\n\n- Object holds are not supported for buckets that use hierarchical namespace.\n\nWhat's next\n-----------\n\n- Learn how to [enable event-based holds by default](/storage/docs/holding-objects#set-default-hold) and how to [set individual object holds](/storage/docs/holding-objects#use-object-holds).\n- Learn about [retention policies](/storage/docs/bucket-lock#overview), which protect data from deletion for a specified period of time.\n- Learn about [lifecycle configurations](/storage/docs/lifecycle) for your bucket, which can automatically delete objects after you remove their holds."]]