AppProfile の詳細
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
AppProfile の詳細を取得します。
コードサンプル
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 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 retrieve and display details of a Bigtable AppProfile using both C++ and PHP code examples.\u003c/p\u003e\n"],["\u003cp\u003eThe code samples utilize the Bigtable client libraries, with instructions provided for installation and setup of these libraries.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication to Bigtable is required and should be set up using Application Default Credentials (ADC) as detailed in the documentation.\u003c/p\u003e\n"],["\u003cp\u003eThe PHP code sample specifically demonstrates how to handle potential \u003ccode\u003eNOT_FOUND\u003c/code\u003e errors, which can occur if the specified AppProfile does not exist.\u003c/p\u003e\n"],["\u003cp\u003eThe PHP code highlights various metadata within the App Profile, such as name, Etag, description and routing policies.\u003c/p\u003e\n"]]],[],null,["# AppProfile details\n\nRetrieve AppProfile details.\n\nCode sample\n-----------\n\n### C++\n\n\nTo learn how to install and use the client library for Bigtable, see\n[Bigtable client libraries](/bigtable/docs/reference/libraries).\n\n\nTo authenticate to Bigtable, 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 namespace cbt = ::google::cloud::bigtable;\n namespace cbta = ::google::cloud::bigtable_admin;\n using ::google::cloud::StatusOr;\n [](cbta::BigtableInstanceAdminClient instance_admin,\n std::string const& project_id, std::string const& instance_id,\n std::string const& profile_id) {\n std::string profile_name =\n cbt::AppProfileName(project_id, instance_id, profile_id);\n StatusOr\u003cgoogle::bigtable::admin::v2::AppProfile\u003e profile =\n instance_admin.GetAppProfile(profile_name);\n if (!profile) throw std::move(profile).status();\n std::cout \u003c\u003c \"Application Profile details=\" \u003c\u003c profile-\u003eDebugString()\n \u003c\u003c \"\\n\";\n }\n\n### PHP\n\n\nTo learn how to install and use the client library for Bigtable, see\n[Bigtable client libraries](/bigtable/docs/reference/libraries).\n\n\nTo authenticate to Bigtable, 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 use Google\\ApiCore\\ApiException;\n use Google\\Cloud\\Bigtable\\Admin\\V2\\Client\\BigtableInstanceAdminClient;\n use Google\\Cloud\\Bigtable\\Admin\\V2\\GetAppProfileRequest;\n\n /**\n * Get the App Profile\n *\n * @param string $projectId The Google Cloud project ID\n * @param string $instanceId The ID of the Bigtable instance\n * @param string $appProfileId The ID of the App Profile to fetch\n */\n function get_app_profile(\n string $projectId,\n string $instanceId,\n string $appProfileId\n ): void {\n $instanceAdminClient = new BigtableInstanceAdminClient();\n $appProfileName = $instanceAdminClient-\u003eappProfileName($projectId, $instanceId, $appProfileId);\n\n printf('Fetching the App Profile %s' . PHP_EOL, $appProfileId);\n try {\n $getAppProfileRequest = (new GetAppProfileRequest())\n -\u003esetName($appProfileName);\n $appProfile = $instanceAdminClient-\u003egetAppProfile($getAppProfileRequest);\n } catch (ApiException $e) {\n if ($e-\u003egetStatus() === 'NOT_FOUND') {\n printf('App profile %s does not exist.' . PHP_EOL, $appProfileId);\n return;\n }\n throw $e;\n }\n\n printf('Printing Details:' . PHP_EOL);\n\n // Fetch some commonly used metadata\n printf('Name: %s' . PHP_EOL, $appProfile-\u003egetName());\n printf('Etag: %s' . PHP_EOL, $appProfile-\u003egetEtag());\n printf('Description: %s' . PHP_EOL, $appProfile-\u003egetDescription());\n printf('Routing Policy: %s' . PHP_EOL, $appProfile-\u003egetRoutingPolicy());\n\n if ($appProfile-\u003ehasSingleClusterRouting()) {\n $clusterId = $appProfile-\u003egetSingleClusterRouting()-\u003egetClusterId();\n $singleRowTransactions = $appProfile-\u003egetSingleClusterRouting()-\u003egetAllowTransactionalWrites() ? 'Yes' : 'No';\n printf('Cluster: %s' . PHP_EOL, $clusterId);\n printf('Single-Row Transactions: %s' . PHP_EOL, $singleRowTransactions);\n }\n }\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=bigtable)."]]