Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Cloud DNS ghi lại các bản cập nhật vùng được quản lý mà bạn thực hiện (sửa đổi nội dung mô tả hoặc định cấu hình trạng thái DNSSEC) dưới dạng thao tác. Thao tác tạo và xoá vùng được quản lý sẽ không được ghi lại; việc xoá vùng được quản lý cũng sẽ xoá các thao tác đã ghi lại trên vùng đó.
Các thao tác này độc lập với những thay đổi mà bạn thực hiện đối với tài nguyên trong vùng được quản lý. Bạn có thể sử dụng Google Cloud CLI hoặc REST API để xem quá trình cập nhật.
Các quyền cần thiết cho tác vụ này
Để thực hiện nhiệm vụ này, bạn phải được cấp các quyền sau hoặc các vai trò IAM sau.
Quyền
dns.managedZoneOperations.list
dns.managedZoneOperations.get
Vai trò
roles/dns.admin
Hiển thị nhật ký kiểm tra của các hoạt động
gcloud
Chạy lệnh sau:
gcloud dns operations list --zones="ZONE_NAME"
Thay thế ZONE_NAME bằng tên của một vùng DNS trong dự án.
Lệnh này in các tập hợp bản ghi tài nguyên được định dạng JSON cho 100 bản ghi đầu tiên. Bạn có thể chỉ định một tham số bổ sung:
--limit: số lượng thao tác tối đa để liệt kê
Python
from apiclient import errors
from apiclient.discovery import build
PROJECT_NAME='PROJECT_NAME'
ZONE_NAME='ZONE_NAME'
try:
service = build('dns', 'v1')
response = service.operations().list(project=PROJECT_NAME,
managedZone=ZONE_NAME).execute()
print(response)
except errors.HttpError, error:
print('An error occurred: %s' % error)
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Khó hiểu","hardToUnderstand","thumb-down"],["Thông tin hoặc mã mẫu không chính xác","incorrectInformationOrSampleCode","thumb-down"],["Thiếu thông tin/mẫu tôi cần","missingTheInformationSamplesINeed","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-06-27 UTC."],[[["\u003cp\u003eCloud DNS records managed zone updates, such as modifying descriptions or configuring DNSSEC state, are recorded as operations.\u003c/p\u003e\n"],["\u003cp\u003eYou can use the Google Cloud CLI or the REST API to view the history of managed zone update operations, which are separate from changes to resources within the zone.\u003c/p\u003e\n"],["\u003cp\u003eTo view these operations, you must have either the \u003ccode\u003edns.managedZoneOperations.list\u003c/code\u003e and \u003ccode\u003edns.managedZoneOperations.get\u003c/code\u003e permissions or the \u003ccode\u003eroles/dns.admin\u003c/code\u003e role.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud dns operations list --zones="ZONE_NAME"\u003c/code\u003e command can be used to display a JSON-formatted list of managed zone operations, with an optional \u003ccode\u003e--limit\u003c/code\u003e parameter to specify the number of operations.\u003c/p\u003e\n"],["\u003cp\u003eThe Python code provided can also be used to programmatically display the managed zone operations.\u003c/p\u003e\n"]]],[],null,["# View operations on managed zones\n\nCloud DNS records managed zone updates that you make (modifying descriptions\nor configuring DNSSEC state) as operations. Managed zone creation and\ndeletion are not recorded; deletion of a managed zone also deletes recorded\noperations on the zone.\n\nThese operations are independent of\n[changes that you make](/dns/docs/monitoring#dns-propagation) to the resources\nwithin the managed zone. You can use the Google Cloud CLI or the REST API to see\nthe history of these updates.\n\n#### Permissions required for this task\n\nTo perform this task, you must have been granted the following permissions\n*or* the following IAM roles.\n\n**Permissions**\n\n- `dns.managedZoneOperations.list`\n- `dns.managedZoneOperations.get`\n\n**Roles**\n\n- `roles/dns.admin`\n\nDisplay audit log of operations\n-------------------------------\n\n### gcloud\n\nRun the following command: \n\n```\ngcloud dns operations list --zones=\"ZONE_NAME\"\n```\n\nReplace \u003cvar translate=\"no\"\u003eZONE_NAME\u003c/var\u003e with the name of a DNS zone in\nyour project.\n\nThis command prints the JSON formatted resource record sets for\nthe first 100 records. You can specify an additional parameter:\n\n- `--limit`: maximum number of operations to list\n\n### Python\n\n```\nfrom apiclient import errors\nfrom apiclient.discovery import build\n\nPROJECT_NAME='PROJECT_NAME'\nZONE_NAME='ZONE_NAME'\n\ntry:\n service = build('dns', 'v1')\n response = service.operations().list(project=PROJECT_NAME,\n managedZone=ZONE_NAME).execute()\n print(response)\nexcept errors.HttpError, error:\n print('An error occurred: %s' % error)\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e: the name of your project\n- \u003cvar translate=\"no\"\u003eZONE_NAME\u003c/var\u003e: the name of a DNS zone in your project\n\nWhat's next\n-----------\n\n- To work with managed zones, see [Create, modify, and delete zones](/dns/docs/zones).\n- To find solutions for common issues that you might encounter when using Cloud DNS, see [Troubleshooting](/dns/docs/troubleshooting).\n- To get an overview of Cloud DNS, see [Cloud DNS overview](/dns/docs/overview).\n- For the Cloud DNS command-line, see the [Google Cloud CLI](/sdk/gcloud/reference/dns) documentation."]]