Go 1.11 はサポートが終了しており、2026 年 1 月 31 日に
非推奨になります。非推奨になると、過去に組織のポリシーを使用して以前のランタイムのデプロイを再度有効にしていた場合でも、Go 1.11 アプリケーションをデプロイできなくなります。既存の Go 1.11 アプリケーションは、
非推奨日以降も引き続き実行され、トラフィックを受信します。
サポートされている最新バージョンの Go に移行することをおすすめします。
Google Cloud Storage の機能について
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
バケット、オブジェクト、ACL
バケットはファイルを読み取ったり書き込んだりするストレージの場所です。Cloud Storage 用の App Engine クライアント ライブラリを使用するときには、バケットを必ず指定する必要があります。プロジェクトで複数のバケットにアクセスできます。クライアント ライブラリではバケットの作成がサポートされないことに注意してください。
アクセス制御リスト(ACL)は、バケットおよびバケットに含まれるオブジェクトへのアクセスを制御します。プロジェクトと App Engine アプリは、プロジェクト内にバケットを作成するときに、バケットへのアクセスを許可する ACL へ自動的に追加されます。
バケットへのアクセスを許可する ACL は、バケット内のオブジェクトを制御する数多くの ACL とは別のものです。したがって、アプリには有効になっているバケットに対する読み取りと書き込みの権限がありますが、すべての権限を持っているのはバケット内に作成したオブジェクトに対してのみです。他のアプリまたは人物によって作成されたオブジェクトに対するアプリのアクセス権は、オブジェクトの作成者によってそのアプリに対して付与された権限に限定されます。
明示的に ACL が定義されていないバケット内にオブジェクトが作成された場合、バケットのオーナーによってバケットに割り当てられたデフォルトのオブジェクト ACL を使用します。バケットのオーナーがデフォルトのオブジェクト ACL を指定していない場合、オブジェクトのデフォルトは public-read
です。つまり、バケットへのアクセスを許可されている人物はすべてオブジェクトを読み取ることができます。
ACL とクライアント ライブラリ
クライアント ライブラリを使用するアプリでバケット ACL を変更できます。また、作成するオブジェクトへのアクセスを制御する ACL も指定できます。利用可能な ACL 設定については、
Storage API のドキュメントをご覧ください。
Cloud Storage オブジェクトの変更
バケット内に作成したオブジェクトへの変更や追加は、その処理を行ったオブジェクトでの置き換えで行います。
Cloud Storage とサブディレクトリ
Cloud Storage 用の App Engine クライアント ライブラリでは、オブジェクトの作成時にサブディレクトリの区切り文字を指定できますが、実際には Cloud Storage にはサブディレクトリがありません。Cloud Storage でのサブディレクトリは、オブジェクトのファイル名の一部です。
たとえば、オブジェクト somewhere/over/the/rainbow.mp3
を作成する場合、そのファイル rainbow.mp3
がサブディレクトリ somewhere/over/the/
に格納されるのではなく、オブジェクト名が somewhere/over/the/rainbow.mp3
に設定されます。
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-04 UTC。
[[["わかりやすい","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-04 UTC。"],[[["\u003cp\u003eThis API supports first-generation runtimes and can be used when upgrading to corresponding second-generation runtimes, with a migration guide available for App Engine Go 1.12+ runtime updates.\u003c/p\u003e\n"],["\u003cp\u003eA bucket serves as the storage location for reading and writing files, and it must be specified when using the App Engine client library, although the library does not support bucket creation.\u003c/p\u003e\n"],["\u003cp\u003eAccess control lists (ACLs) manage access to buckets and their contents, automatically granting your project and App Engine app bucket access, but object access depends on the creator's permissions.\u003c/p\u003e\n"],["\u003cp\u003eWhile the client library allows for subdirectory delimiters in object creation, Cloud Storage does not have true subdirectories; they are simply part of the object's filename.\u003c/p\u003e\n"],["\u003cp\u003eOnce an object is created in Cloud Storage it cannot be directly modified, and instead must be overwritten with a new object containing the desired changes.\u003c/p\u003e\n"]]],[],null,["# Understanding Google Cloud Storage Features\n\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| go\n| /services/access). If you are updating to the App Engine Go 1.12+ runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/go-differences) to learn about your migration options for legacy bundled services.\n\nBuckets, objects, and ACLs\n--------------------------\n\nA bucket is the storage location you read files from and write files to. You\nmust always specify a bucket when using the App Engine client library for\nCloud Storage. Your project can access multiple buckets. Note that the client\nlibrary doesn't support\n[bucket creation](/appengine/docs/legacy/standard/go111/googlecloudstorageclient/setting-up-cloud-storage#activating_a_cloud_storage_bucket).\n\nAccess control lists (ACLs) control access to the buckets and to the objects\ncontained in them. Your project and your App Engine app are automatically added\nto the ACL that permits bucket access when you create a bucket in your project.\n\nNote that the ACL that permits bucket access is distinct from the potentially\nmany ACLs governing the objects in that bucket. Thus, your app has read and\nwrite privileges to the bucket(s) it is activated for, but it only has full\nrights to the objects it creates in the bucket. Your app's access to objects\ncreated by other apps or persons is limited to the rights given to your app by\nthe objects' creator.\n\nIf an object is created in the bucket without an ACL explicitly defined for it,\nit uses the default object ACL assigned to the bucket by the bucket owner. If\nthe bucket owner has not specified a default object ACL, the object default is\n`public-read`, which means that anyone allowed bucket access can read the object.\n\nACLs and the client library\n---------------------------\n\nAn app using the client library can change the bucket ACL and can also specify an ACL that controls access to the objects it creates. The available ACL settings are described under documentation for the [storage API](/go/docs/reference/cloud.google.com/go/storage/latest#functions).\n\nModifying Cloud Storage objects\n-------------------------------\n\nOnce you create an object in a bucket, you cannot modify or append to it. Instead,\nyou must overwrite the object with a new object of the same name that contains\nyour desired changes.\n\nCloud Storage and subdirectories\n--------------------------------\n\nThe App Engine client library for Cloud Storage lets you supply subdirectory\ndelimiters when you create an object, but there are no true subdirectories in\nCloud Storage. Instead, a subdirectory in Cloud Storage is a part of the object\nfilename.\n\nFor example, you might assume that creating an object\n`somewhere/over/the/rainbow.mp3` would store the file `rainbow.mp3` in the\nsubdirectory `somewhere/over/the/`. Instead, the object name is set to\n`somewhere/over/the/rainbow.mp3`.\n\nWhat's next\n-----------\n\n- Visit the [API Reference documentation](https://godoc.org/cloud.google.com/go/storage).\n- Learn how to [set up Cloud Storage](/appengine/docs/legacy/standard/go111/googlecloudstorageclient/setting-up-cloud-storage)."]]