AppProfile 세부정보
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
AppProfile 세부정보를 가져옵니다.
코드 샘플
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 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)."]]