本页面上的部分或全部信息可能不适用于 Trusted Cloud by S3NS。
查看对代管可用区的操作
Cloud DNS 会记录您执行的代管可用区更新(对说明或配置 DNSSEC 状态)的修改。系统不会记录创建和删除代管可用区的操作;删除某一代管可用区也会删除针对该可用区记录的操作。
这些操作与您对代管区域内的资源所做的更改无关。您可以使用 Google Cloud CLI 或 REST API 查看这些更新的历史记录。
执行此任务所需的权限
如需执行此任务,您必须已获得以下权限或 IAM 角色。
权限
dns.managedZoneOperations.list
dns.managedZoneOperations.get
角色
显示操作审核日志
gcloud
运行以下命令:
gcloud dns operations list --zones="ZONE_NAME"
将 ZONE_NAME
替换为项目中某个 DNS 可用区的名称:
此命令会输出前 100 条记录对应的 JSON 格式资源记录集。您可以指定一个附加参数:
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)
请替换以下内容:
PROJECT_NAME
:您的项目的名称
ZONE_NAME
:项目中的 DNS 可用区的名称
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-11。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-11。"],[[["Cloud DNS records managed zone updates, such as modifying descriptions or configuring DNSSEC state, are recorded as operations."],["You 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."],["To view these operations, you must have either the `dns.managedZoneOperations.list` and `dns.managedZoneOperations.get` permissions or the `roles/dns.admin` role."],["The `gcloud dns operations list --zones=\"ZONE_NAME\"` command can be used to display a JSON-formatted list of managed zone operations, with an optional `--limit` parameter to specify the number of operations."],["The Python code provided can also be used to programmatically display the managed zone operations."]]],[]]