Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Menghapus instance
Anda dapat menghapus instance secara terprogram saat menggunakan salah satu
library klien Bigtable atau secara manual menggunakan
Google Cloud konsol, Google Cloud CLI, atau
cbt CLI
:
Konsol
Buka daftar instance Bigtable di konsol Google Cloud .
// Deletes an instance from the project.// Initialize request argument(s).DeleteInstanceRequestrequest=newDeleteInstanceRequest{InstanceName=newInstanceName(projectId,instanceId)};try{// Make request.Console.WriteLine("Waiting for operation to complete...");bigtableInstanceAdminClient.DeleteInstance(request);}catch(Exceptionex){Console.WriteLine($"Exception while deleting {instanceId} instance");Console.WriteLine(ex.Message);}
Java
Untuk mempelajari cara menginstal dan menggunakan library klien untuk Bigtable, lihat
library klien Bigtable.
print("\nDeleting instance")ifnotinstance.exists():print("Instance {} does not exist.".format(instance_id))else:instance.delete()print("Deleted instance: {}".format(instance_id))
Ruby
Untuk mempelajari cara menginstal dan menggunakan library klien untuk Bigtable, lihat
library klien Bigtable.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[[["\u003cp\u003eDeleting a Bigtable instance is permanent and cannot be undone, resulting in the loss of all data within the instance's clusters.\u003c/p\u003e\n"],["\u003cp\u003eInstances can be deleted manually using the Google Cloud console, the Google Cloud CLI (gcloud), or the cbt CLI.\u003c/p\u003e\n"],["\u003cp\u003eDeleting an instance programmatically can be achieved by leveraging the provided Bigtable client libraries for various languages like C++, C#, Java, Node.js, PHP, Python, and Ruby.\u003c/p\u003e\n"],["\u003cp\u003eThe process for deleting an instance through the console involves opening the instance list, selecting the instance, and confirming the deletion in the dialog box.\u003c/p\u003e\n"],["\u003cp\u003eThe Google cloud CLI (gcloud) and cbt CLI require you to use specific commands to delete your instances, with the \u003ccode\u003edeleteinstance\u003c/code\u003e and \u003ccode\u003einstances delete\u003c/code\u003e commands being the main ones respectively, requiring the unique instance ID.\u003c/p\u003e\n"]]],[],null,["Delete an instance **Warning:** When you delete a Bigtable instance, you permanently delete the instance's clusters and all of the data in those clusters. Deleting an instance cannot be undone.\n\nYou can delete an instance programmatically when you use one of the\n[Bigtable client libraries](/bigtable/docs/reference/libraries) or manually using the\nGoogle Cloud console, the Google Cloud CLI, or the\ncbt CLI\n: \n\nConsole\n\n1.\n Open the list of Bigtable instances in the Google Cloud console.\n\n\n [Open the instance list](https://console.cloud.google.com/bigtable/instances)\n2.\n Click the instance you want to delete, then click **Delete instance**.\n A confirmation dialog appears.\n\n3.\n Follow the instructions in the confirmation dialog, then click **Delete**.\n The instance is permanently deleted.\n\ngcloud\n\n1. [Install the Google Cloud CLI](/bigtable/docs/installing-cloud-sdk) if you haven't already.\n2.\n If you don't know the instance ID, use the\n [`bigtable instances\n list` command](/sdk/gcloud/reference/bigtable/instances/list) to view a list of your project's instances:\n\n gcloud bigtable instances list\n\n3. Use the [`bigtable instances delete` command](/sdk/gcloud/reference/bigtable/instances/delete) to\n delete an instance:\n\n gcloud bigtable instances delete \u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003eINSTANCE_ID\u003c/code\u003e\u003c/var\u003e with the permanent identifier for your instance.\n\ncbt\n\n1. [Install the\n `cbt` CLI](/bigtable/docs/installing-cloud-sdk) if you haven't already.\n2.\n If you don't know the instance ID, use the `listinstances` command to view a list of your\n project's instances:\n\n cbt listinstances\n\n3. Use the `deleteinstance` command to delete an instance:\n\n cbt deleteinstance \u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003eINSTANCE_ID\u003c/code\u003e\u003c/var\u003e with the permanent identifier for your instance.\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 instance_name = cbt::InstanceName(project_id, instance_id);\n Status status = instance_admin.DeleteInstance(instance_name);\n if (!status.ok()) throw std::runtime_error(status.message());\n std::cout \u003c\u003c \"Successfully deleted the instance \" \u003c\u003c instance_id \u003c\u003c \"\\n\";\n }\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 // Deletes an instance from the project.\n // Initialize request argument(s).\n DeleteInstanceRequest request = new DeleteInstanceRequest\n {\n InstanceName = new InstanceName(projectId, instanceId)\n };\n try\n {\n // Make request.\n Console.WriteLine(\"Waiting for operation to complete...\");\n bigtableInstanceAdminClient.DeleteInstance(request);\n }\n catch (Exception ex)\n {\n Console.WriteLine($\"Exception while deleting {instanceId} instance\");\n Console.WriteLine(ex.Message);\n }\n\nJava\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 try {\n adminClient.deleteInstance(instanceId);\n System.out.println(\"Instance deleted: \" + instanceId);\n } catch (NotFoundException e) {\n System.err.println(\"Failed to delete non-existent instance: \" + e.getMessage());\n }\n\nNode.js\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 console.log('Deleting Instance');\n await instance.delete();\n console.log(`Instance deleted: ${instance.id}`);\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\\DeleteInstanceRequest;\n\n /**\n * Delete a bigtable instance\n *\n * @param string $projectId The Google Cloud project ID\n * @param string $instanceId The ID of the Bigtable instance to be deleted\n */\n function delete_instance(\n string $projectId,\n string $instanceId\n ): void {\n $instanceAdminClient = new BigtableInstanceAdminClient();\n $instanceName = $instanceAdminClient-\u003einstanceName($projectId, $instanceId);\n\n printf('Deleting Instance' . PHP_EOL);\n try {\n $deleteInstanceRequest = (new DeleteInstanceRequest())\n -\u003esetName($instanceName);\n $instanceAdminClient-\u003edeleteInstance($deleteInstanceRequest);\n printf('Deleted Instance: %s.' . PHP_EOL, $instanceId);\n } catch (ApiException $e) {\n if ($e-\u003egetStatus() === 'NOT_FOUND') {\n printf('Instance %s does not exists.' . PHP_EOL, $instanceId);\n } else {\n throw $e;\n }\n }\n }\n\nPython\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 print(\"\\nDeleting instance\")\n if not instance.exists():\n print(\"Instance {} does not exist.\".format(instance_id))\n else:\n instance.delete()\n print(\"Deleted instance: {}\".format(instance_id))\n\nRuby\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 instance.delete"]]