本頁面中的部分或全部資訊可能不適用於 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 區域名稱。
這個指令會以 JSON 格式列出前 100 筆記錄的資源記錄集。您可以指定額外的參數:
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 區域名稱
後續步驟
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間: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"]],["上次更新時間: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."]]],[]]