本頁面說明如何管理使用 Data Transfer Essentials 建立的資源。
管理設定
您可以在專案中列出 Data Transfer Essentials 設定、檢查設定狀態、更新設定或刪除設定。
列出專案中的設定
如要列出專案中某個位置的所有設定,請使用下列其中一種方式:
gcloud
使用 gcloud network-connectivity multicloud-data-transfer-configs list
指令。
gcloud network-connectivity multicloud-data-transfer-configs list \ --location=LOCATION
將 LOCATION
替換為設定的區域。
API
請使用 multicloudDataTransferConfigs.get
方法。
GET https://networkconnectivity.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/multicloudDataTransferConfigs
更改下列內容:
PROJECT_ID
:您的專案 IDLOCATION
:設定的區域
視需要使用 requestID
查詢參數來識別 API 要求。如果重試要求,伺服器可以使用 ID 忽略已回覆的要求。
查看設定詳細資料
如要查看設定詳細資料,請使用下列其中一種方式:
gcloud
使用 gcloud network-connectivity multicloud-data-transfer-configs describe
指令。
gcloud network-connectivity multicloud-data-transfer-configs describe CONFIGURATION_NAME \ --location=LOCATION
更改下列內容:
CONFIGURATION_NAME
:設定名稱LOCATION
:設定的區域
以下輸出範例顯示來自 compute-engine
的流量已可納入 Data Transfer Essentials 帳單。「cloud-sql
」和「cloud-storage
」的更新尚待處理。
effectiveTime
值表示預期狀態生效的時間。範例也會顯示設定中的目的地總數,以及有效目的地數量。
description: 'sample config'
destinationsCount: 2
destinationsActiveCount: 0
name: config1
region: https://www.googleapis.com/network-connectivity/v1/projects/my-project/locations/europe-west3
services:
- cloud-sql:
states:
- effectiveTime: 2024-12-12T08:00:00Z
state: DELETING
- cloud-storage:
states:
- effectiveTime: 2024-12-12T08:00:00Z
state: ADDING
- compute-engine:
states:
- state: ACTIVE
…
API
請使用 multicloudDataTransferConfigs.list
方法。
GET https://networkconnectivity.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/multicloudDataTransferConfigs/CONFIGURATION_NAME
更改下列內容:
PROJECT_ID
:您的專案 IDLOCATION
:設定的區域CONFIGURATION_NAME
:設定名稱
以下輸出內容範例顯示,來自 compute-engine
的流量已可納入資料移轉基本功能帳單。「cloud-storage
」和「cloud-sql
」的更新尚待處理。
effectiveTime
值表示預期狀態生效的時間。樣本也會顯示設定中的目的地總數,以及有效目的地數量。
{
"multicloudDataTransferConfig": [
{
"name": "projects/test-project/locations/europe-west1/multicloudDataTransferConfigs/config1",
"createTime": "2025-05-14T10:16:22.761275571Z",
"updateTime": "2025-05-14T10:16:25.872465362Z",
"etag": "l-WY4OT6hBsMT8sAwEbuSpviLsE9iC_UDJXDyfE265I",
"description": "sample config",
"destinationsCount": 1,
"destinationsActiveCount": 1,
"services": {
"cloud-sql": {
"states": [
{
"effectiveTime": "2025-05-29T07:00:00Z",
"state": "DELETING"
}
]
},
"cloud-storage": {
"states": [
{
"effectiveTime": "2025-05-29T07:00:00Z",
"state": "ADDING"
}
]
},
"compute-engine": {
"states": [
{
"state": "ACTIVE"
}
]
}
}
}
]
}
服務的狀態可能是下列其中一種:
ADDING
:正在新增服務。DELETING
:服務正在刪除。ACTIVE
:服務已設定為使用資料移轉 Essentials 帳單。
更新設定
如要從設定中新增或刪除服務,請使用下列其中一種方法:
gcloud
使用 gcloud network-connectivity multicloud-data-transfer-configs update
指令。
如要指定服務,請使用下列其中一個選項:
services
:以指定清單取代設定中的服務update-services
:將指定服務新增至設定remove-services
:從設定中移除指定服務clear-services
:從設定中移除所有服務
gcloud network-connectivity multicloud-data-transfer-configs update CONFIGURATION_NAME \ --location=LOCATION \ --description=DESCRIPTION \ --services=SERVICE-A,... | --update-services=SERVICE-A,... | --remove-services=SERVICE-A,... | --clear-services
更改下列內容:
CONFIGURATION_NAME
:要更新的設定名稱。LOCATION
:設定的區域。DESCRIPTION
:設定的說明及其用途。SERVICE-A,...
:一系列字串,代表要從設定中新增或刪除的服務。如需有效字串,請參閱「支援的服務和區域」。使用clear-services
從設定中移除所有服務。
API
請使用 multicloudDataTransferConfigs.update
方法。
PATCH https://networkconnectivity.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/multicloudDataTransferConfigs/CONFIGURATION_NAME { "description": "DESCRIPTION", "services": { "SERVICE-A", "SERVICE-B" } }
更改下列內容:
PROJECT_ID
:專案 ID。LOCATION
:設定的區域。CONFIGURATION_NAME
:設定的名稱。DESCRIPTION
:設定的說明及其用途。SERVICE-A
:一系列字串,代表您要從設定中新增或刪除的服務。如需有效字串,請參閱「支援的服務和區域」。
此外,如要避免在更新作業期間覆寫特定欄位集,可以使用 updateMask
選項,該選項遵循 fieldMask 格式。
資料移轉基本版設定更新後,大約會在 24 小時內生效。
刪除設定
如要刪除設定,必須先刪除所有相關聯的目的地。
如要刪除設定,請選擇下列其中一種做法:
gcloud
使用 gcloud network-connectivity multicloud-data-transfer-configs delete
指令。
gcloud network-connectivity multicloud-data-transfer-configs delete CONFIGURATION_NAME \ --location=LOCATION
API
請使用 multicloudDataTransferConfigs.delete
方法。
DELETE https://networkconnectivity.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/multicloudDataTransferConfigs/CONFIGURATION_NAME
管理目的地
您可以在專案中列出 Data Transfer Essentials 目的地、檢查目的地狀態、更新或刪除目的地。
列出專案中的目的地
如要列出專案中的所有目的地,請使用下列其中一種方式:
gcloud
使用 gcloud network-connectivity multicloud-data-transfer-configs destinations list
指令。
gcloud network-connectivity multicloud-data-transfer-configs destinations list \ --multicloud-data-transfer-config=CONFIGURATION_NAME \ --location=LOCATION
更改下列內容:
CONFIGURATION_NAME
:要列出目的地設定的名稱LOCATION
:設定的區域
API
請使用 multicloudDataTransferConfigs.destinations.list
方法。
GET https://networkconnectivity.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/multicloudDataTransferConfigs/CONFIGURATION_NAME
更改下列內容:
PROJECT_ID
:您的專案 IDLOCATION
:設定的區域CONFIGURATION_NAME
:要列出目的地設定的名稱
查看目的地詳細資料
如要查看目的地的詳細資料,請使用下列其中一種方式:
gcloud
使用 gcloud network-connectivity multicloud-data-transfer-configs destinations describe
指令。
gcloud network-connectivity multicloud-data-transfer-configs destinations describe DESTINATION_NAME \ --multicloud-data-transfer-config=CONFIGURATION_NAME \ --location=LOCATION
更改下列內容:
DESTINATION_NAME
:目的地的名稱CONFIGURATION_NAME
:要查看目的地設定的名稱LOCATION
:設定的區域
以下範例顯示為 destination1
指定的端點有效,且目的地會在 effectiveTime
指示的時間新增。
createTime: '2025-05-28T13:08:00.171978514Z'
description: 'sample destination'
endpoints:
- asn: 16509
csp: aws
state: VALID
etag: tag1
ipPrefix: 203.0.113.0/24
name: projects/test-project/locations/europe-west3/multicloudDataTransferConfig/config1/destinations/destination1
stateTimeline:
states:
- effectiveTime: '2025-05-29T07:00:00Z'
state: ADDING
updateTime: '2025-05-28T13:08:03.431862259Z'
…
API
請使用 multicloudDataTransferConfigs.destinations.get
方法。
GET https://networkconnectivity.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/multicloudDataTransferConfigs/CONFIGURATION_NAME/destinations/DESTINATION_NAME
更改下列內容:
PROJECT_ID
:您的專案 IDLOCATION
:設定的區域CONFIGURATION_NAME
:設定名稱DESTINATION_NAME
:目的地的名稱
以下範例輸出內容顯示,為 destination1
指定的端點有效,且目的地會在 effectiveTime
指出的時間新增。
{
"destination": [
{
"name": "projects/test-project/locations/europe-west3/multicloudDataTransferConfig/config1/destinations/destination1",
"createTime": "2025-05-14T10:18:16.941520739Z",
"updateTime": "2025-05-14T10:18:20.028116272Z",
"etag": "tag1",
"description": "sample destination",
"ipPrefix": "203.0.113.0/24",
"endpoints": [
{
"asn": 16509,
"csp": "aws",
"state": "VALID"
}
],
"stateTimeline": {
"states": [
{
"state": "ADDING",
"effectiveTime": "2025-05-29T07:00:00Z"
}
]
}
}
]
}
目的地狀態可能是下列其中一種:
ADDING
:正在新增目的地。DELETING
:正在刪除目的地。SUSPENDING
:系統會根據稽核結果停用目的地。ACTIVE
:系統會將目的地納入資料移轉基本版計費。SUSPENDED
:目的地已刪除或違反使用條款,因此不會計入 Data Transfer Essentials 帳單。
端點的狀態可能是下列其中一種:
VALID
:ASN 和 CSP 值組合有效。INVALID
:ASN 和 CSP 值組合無效。
如果至少有一個端點的狀態為 VALID
,則目的地會視為符合 Data Transfer Essentials 的計費資格。
如果所有端點的狀態都是 INVALID
,則目的地不符合 Data Transfer Essentials 帳單資格。在這種情況下,目的地狀態會設為 SUSPENDING
或 SUSPENDED
,視目前狀態為 ADDING
或 ACTIVE
而定。這類目的地的流量會視為一般網際網路流量。
更新目的地
目的地必須至少有一個端點,且不得超過五個端點。
如要從目的地新增或刪除端點,請使用下列其中一種方法:
gcloud
使用 gcloud network-connectivity multicloud-data-transfer-configs destinations update
指令。
如要指定端點,請使用下列其中一個選項。您可以在同一個指令中多次指定 add-endpoints
或 remove-endpoints
旗標。
endpoints
:以指定清單取代目的地中的端點add-endpoints
:將指定端點新增至目的地remove-endpoints
:從目的地移除指定端點
gcloud network-connectivity multicloud-data-transfer-configs destinations update DESTINATION_NAME \ --multicloud-data-transfer-config=CONFIGURATION_NAME \ --location=LOCATION \ --description=DESCRIPTION \ --ip-prefix=IP_PREFIX \ --endpoints=asn=ASN,csp=CSP | --add-endpoints=asn=ASN,csp=CSP | --remove-endpoints=asn=ASN,csp=CSP
更改下列內容:
DESTINATION_NAME
:目的地的名稱。CONFIGURATION_NAME
:要更新的設定名稱。LOCATION
:設定的區域。DESCRIPTION
:目的地及其用途的說明。IP_PREFIX
:目的地 IP 前置字元,指定為範圍或值。針對每個端點,請指定下列項目:
ASN
:預期會發布前置字元的 ASN。請參閱「已識別的 ASN」。CSP
:代表公告前置字元的 ASN 的 CSP 字串。
API
請使用 multicloudDataTransferConfigs.destinations.update
方法。
PATCH https://networkconnectivity.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/multicloudDataTransferConfigs/CONFIGURATION_NAME/destinations/DESTINATION_NAME { "description": "DESCRIPTION", "ip_prefix": "IP_PREFIX", "endpoints": [ { "asn": "ASN", "csp": "CSP" } ] }
更改下列內容:
PROJECT_ID
:專案 ID。LOCATION
:設定的區域。CONFIGURATION_NAME
:設定的名稱。DESTINATION_NAME
:目的地的名稱。DESCRIPTION
:目的地及其用途的說明。IP_PREFIX
:指定為範圍 (例如203.0.113.0/24
或2001:db8::/32
) 或值 (例如203.0.113.6
或2001:db8:2:2:2:2:2:2
) 的目的地 IP 前置字串。IP 前置字串在設定中只能使用一次,且只能用於一個 ASN。指定要新增至目的地或從目的地移除的端點對應字串:
ASN
:預期會發布前置字元的 ASN。請參閱「已識別的 ASN」。CSP
:代表公告前置字元的 ASN 的 CSP 字串。
此外,如要避免在更新作業期間覆寫特定欄位集,可以使用 updateMask
選項,該選項遵循 fieldMask 格式。
更新資料移轉基本版目的地和相關設定後,大約 24 小時就會生效。
刪除目的地
如要刪除目的地,請使用下列其中一種方法:
gcloud
使用 gcloud network-connectivity multicloud-data-transfer-configs destinations delete
指令。
gcloud network-connectivity multicloud-data-transfer-configs destinations delete DESTINATION_NAME \ --multicloud-data-transfer-config=CONFIGURATION_NAME \ --location=LOCATION
API
請使用 multicloudDataTransferConfigs.destinations.delete
方法。
DELETE https://networkconnectivity.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/multicloudDataTransferConfigs/CONFIGURATION_NAME/destinations/DESTINATION_NAME