AppProfile löschen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
AppProfile löschen
Codebeispiel
Nächste Schritte
Wenn Sie nach Codebeispielen für andere Google Cloud -Produkte suchen und filtern möchten, können Sie den Google Cloud -Beispielbrowser verwenden.
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],[],[[["\u003cp\u003eThis page provides instructions and code samples for deleting an AppProfile in Google Cloud Bigtable using C++ and PHP.\u003c/p\u003e\n"],["\u003cp\u003eThe code examples demonstrate how to use the \u003ccode\u003eBigtableInstanceAdminClient\u003c/code\u003e to delete a specified AppProfile by its ID within a given project and instance.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves setting up authentication via Application Default Credentials and installing the appropriate Bigtable client libraries.\u003c/p\u003e\n"],["\u003cp\u003eThe provided code snippets show how to construct and execute a \u003ccode\u003eDeleteAppProfileRequest\u003c/code\u003e, along with handling potential exceptions, such as a \u003ccode\u003eNOT_FOUND\u003c/code\u003e error, in PHP.\u003c/p\u003e\n"],["\u003cp\u003eUsers can refer to the Google Cloud sample browser for more code samples related to other Google Cloud products.\u003c/p\u003e\n"]]],[],null,["Delete an AppProfile.\n\nCode sample \n\nC++\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::Status;\n [](cbta::BigtableInstanceAdminClient instance_admin,\n std::string const& project_id, std::string const& instance_id,\n std::string const& profile_id, bool ignore_warnings) {\n std::string profile_name =\n cbt::AppProfileName(project_id, instance_id, profile_id);\n\n google::bigtable::admin::v2::DeleteAppProfileRequest req;\n req.set_name(profile_name);\n req.set_ignore_warnings(ignore_warnings);\n\n Status status = instance_admin.DeleteAppProfile(std::move(req));\n if (!status.ok()) throw std::runtime_error(status.message());\n std::cout \u003c\u003c \"Application Profile deleted\\n\";\n }\n\nPHP\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\\DeleteAppProfileRequest;\n\n /**\n * Delete an App Profile from a Bigtable instance.\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 be deleted\n */\n function delete_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 $ignoreWarnings = true;\n\n printf('Deleting the App Profile: %s' . PHP_EOL, $appProfileId);\n\n try {\n // If $ignoreWarnings is set to false, Bigtable will warn you that all future requests using the AppProfile will fail\n $deleteAppProfileRequest = (new DeleteAppProfileRequest())\n -\u003esetName($appProfileName)\n -\u003esetIgnoreWarnings($ignoreWarnings);\n $instanceAdminClient-\u003edeleteAppProfile($deleteAppProfileRequest);\n printf('App Profile %s deleted.' . PHP_EOL, $appProfileId);\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\nWhat's next\n\n\nTo search and filter code samples for other Google Cloud products, see the\n[Google Cloud sample browser](/docs/samples?product=bigtable)."]]