新しい Datastore 管理クライアントを作成する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
新しい Datastore 管理クライアントを作成します。
コードサンプル
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],[],[[["\u003cp\u003eThis content demonstrates how to create a new Datastore admin client using code samples in C#, Go, Python, and Ruby.\u003c/p\u003e\n"],["\u003cp\u003eEach language section directs users to the Datastore mode client libraries for installation and usage instructions.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication for Datastore mode requires setting up Application Default Credentials, with a link provided for setting it up in a local development environment.\u003c/p\u003e\n"],["\u003cp\u003eLinks to the respective API reference documentation for each language are included for further information.\u003c/p\u003e\n"],["\u003cp\u003eThe content provides resources for finding other code samples for different Google Cloud Products via the Google Cloud sample browser.\u003c/p\u003e\n"]]],[],null,["# Create a new Datastore admin client.\n\nCode sample\n-----------\n\n### C#\n\n\nTo learn how to install and use the client library for Datastore mode, see\n[Datastore mode client libraries](/datastore/docs/reference/libraries).\n\n\nFor more information, see the\n[Datastore mode C# API\nreference documentation](https://cloud.google.com/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest).\n\n\nTo authenticate to Datastore mode, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n // Create client\n DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.Create();\n\n### Go\n\n\nTo learn how to install and use the client library for Datastore mode, see\n[Datastore mode client libraries](/datastore/docs/reference/libraries).\n\n\nFor more information, see the\n[Datastore mode Go API\nreference documentation](https://cloud.google.com/go/docs/reference/cloud.google.com/go/datastore/latest).\n\n\nTo authenticate to Datastore mode, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n import (\n \t\"context\"\n \t\"fmt\"\n \t\"io\"\n\n \tadmin \"cloud.google.com/go/datastore/admin/apiv1\"\n )\n\n // clientCreate creates a new Datastore admin client.\n func clientCreate(w io.Writer) (*admin.DatastoreAdminClient, error) {\n \tctx := context.Background()\n \tclient, err := admin.NewDatastoreAdminClient(ctx)\n \tif err != nil {\n \t\treturn nil, fmt.Errorf(\"admin.NewDatastoreAdminClient: %w\", err)\n \t}\n \t// Close client when done using it.\n \t// defer client.Close()\n \tfmt.Fprintf(w, \"Admin client created\\n\")\n \treturn client, nil\n }\n\n### Python\n\n\nTo learn how to install and use the client library for Datastore mode, see\n[Datastore mode client libraries](/datastore/docs/reference/libraries).\n\n\nFor more information, see the\n[Datastore mode Python API\nreference documentation](https://cloud.google.com/python/docs/reference/datastore/latest).\n\n\nTo authenticate to Datastore mode, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n from google.cloud.datastore_admin_v1 import https://cloud.google.com/python/docs/reference/datastore/latest/google.cloud.datastore_admin_v1.services.datastore_admin.client.DatastoreAdminClient.html\n\n\n def client_create():\n \"\"\"Creates a new Datastore admin client.\"\"\"\n client = DatastoreAdminClient()\n\n print(\"Admin client created\\n\")\n return client\n\n### Ruby\n\n\nTo learn how to install and use the client library for Datastore mode, see\n[Datastore mode client libraries](/datastore/docs/reference/libraries).\n\n\nFor more information, see the\n[Datastore mode Ruby API\nreference documentation](/ruby/docs/reference/google-cloud-datastore/latest).\n\n\nTo authenticate to Datastore mode, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n # Import the client library\n require \"google/cloud/datastore/admin/v1\"\n\n # Instantiate a client\n client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new\n\nWhat's next\n-----------\n\n\nTo search and filter code samples for other Google Cloud products, see the\n[Google Cloud sample browser](/docs/samples?product=datastore)."]]