本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
管理您的地理圍欄收集資源
使用 Amazon 位置主控台、或 Amazon 位置 API 管理您的AWS CLI地理圍欄集合。
列出您的地理圍欄收集資源
您可以使用 Amazon 位置主控台、或 Amazon 位置 API 來檢視您的AWS CLI地理圍欄收集清單:
- Console
-
使用 Amazon 位置主控台檢視地理圍欄集合清單
-
在 https://console.aws.amazon.com/location/
打開 Amazon 位置控制台。 -
從左側導覽窗格中選擇地理圍欄集合。
-
在「我的地理圍欄集合」下檢視地理圍欄集合的清單。
-
- API
-
使用來自 Amazon 位置地理圍欄 API 的
ListGeofenceCollections
操作。下列範例是取得帳戶中地理圍欄集合清單的 API 要求。AWS
POST /geofencing/v0/list-collections
以下為範例回應
ListGeofenceCollections
:{ "Entries": [ { "CollectionName": "
ExampleCollection
", "CreateTime": 2020-09-30T22:59:34.142Z, "Description": "string", "UpdateTime": 2020-09-30T23:59:34.142Z }, "NextToken": "1234-5678-9012" } - CLI
-
使用
list-geofence-collections
命令。下列範例是取AWS CLI得帳戶中的地理圍欄集合清單。AWS
aws location list-geofence-collections
獲取地理圍欄收集詳細信息
您可以使用 Amazon 位置主控台、或 Amazon 位置 API,取得AWS帳戶中任何地理圍欄收集資源的AWS CLI詳細資訊:
- Console
-
使用 Amazon 位置主控台檢視地理圍欄收集的詳細資訊
-
在 https://console.aws.amazon.com/location/
打開 Amazon 位置控制台。 -
從左側導覽窗格中選擇地理圍欄集合。
-
在「我的地理圍欄集合」下,選取目標地理圍欄集合的名稱連結。
-
- API
-
使用來自 Amazon 位置地理圍欄 API 的
DescribeGeofenceCollection
操作。下列範例是取得地理圍欄集合詳細資訊的 API 要求。
ExampleCollection
GET /geofencing/v0/collections/
ExampleCollection
以下為範例回應
DescribeGeofenceCollection
:{ "CollectionArn": "arn:aws:geo:us-west-2:123456789012:geofence-collection/GeofenceCollection", "CollectionName": "
ExampleCollection
", "CreateTime": 2020-09-30T22:59:34.142Z, "Description": "string", "KmsKeyId": "1234abcd-12ab-34cd-56ef-1234567890ab", "Tags": { "Tag1" : "Value1" }, "UpdateTime": 2020-09-30T23:59:34.142Z } - CLI
-
使用
describe-geofence-collection
命令。下面的例子是一個獲AWS CLI取地理圍欄集合的詳細信息。
ExampleCollection
aws location describe-geofence-collection \ --collection-name "
ExampleCollection
"
刪除地理圍欄集合
您可以使用 Amazon 位置主控台、或 Amazon 位置 API,從AWS帳戶刪除AWS CLI地理圍欄集合。
- Console
-
若要使用 Amazon 位置主控台刪除地理圍欄集合
警告
此作業會永久刪除資源。
-
在 https://console.aws.amazon.com/location/
打開 Amazon 位置控制台。 -
從左側導覽窗格中選擇地理圍欄集合。
-
在「我的地理圍欄集合」下,選取目標地理圍欄集合。
-
選擇 [刪除地理圍欄集合]。
-
- API
-
使用來自 Amazon 位置 API 的
DeleteGeofenceCollection
操作。下列範例是刪除地理圍欄集合的 API 要求。
ExampleCollection
DELETE /geofencing/v0/collections/
ExampleCollection
以下為範例回應
DeleteGeofenceCollection
:HTTP/1.1 200
- CLI
-
使用
delete-geofence-collection
命令。下列範例是刪除地理圍欄集合的AWS CLI命令。
ExampleCollection
aws location delete-geofence-collection \ --collection-name "
ExampleCollection
"
列出存儲的地理圍欄
您可以使用 Amazon 位置主控台、或 Amazon 位置 API 列出存放在指定地理圍欄集合中的AWS CLI地理圍欄。
- Console
-
使用 Amazon 位置主控台檢視地理圍欄清單
-
在 https://console.aws.amazon.com/location/
打開 Amazon 位置控制台。 -
從左側導覽窗格中選擇地理圍欄集合。
-
在「我的地理圍欄集合」下,選取目標地理圍欄集合的名稱連結。
-
在地理圍欄下查看地理圍欄集合中的地理圍欄
-
- API
-
使用來自 Amazon 位置地理圍欄 API 的
ListGeofences
操作。下面的例子是一個 API 請求,用於獲取存儲在地理圍欄集合中的地理圍欄列表。
ExampleCollection
POST /geofencing/v0/collections/
ExampleCollection
/list-geofences以下為範例回應
ListGeofences
:{ "Entries": [ { "CreateTime": 2020-09-30T22:59:34.142Z, "GeofenceId": "geofence-1", "Geometry": { "Polygon": [ [-5.716667, -15.933333, [-14.416667, -7.933333], [-12.316667, -37.066667], [-5.716667, -15.933333] ] }, "Status": "ACTIVE", "UpdateTime": 2020-09-30T23:59:34.142Z } ], "NextToken": "1234-5678-9012" }
- CLI
-
使用
list-geofences
命令。下面的例子是一個獲AWS CLI取存儲在地理圍欄集合中的地理圍欄列表。
ExampleCollection
aws location list-geofences \ --collection-name "
ExampleCollection
"
取得地理圍欄詳細資訊
您可以使用 Amazon 位置主控台或 Amazon 位置 API,從地理圍欄收集取得特定地理圍欄的詳細資訊,例如建立時間、更新時間AWS CLI、幾何圖形和狀態。
- Console
-
使用 Amazon 位置主控台檢視地理圍欄的狀態
-
在 https://console.aws.amazon.com/location/
打開 Amazon 位置控制台。 -
從左側導覽窗格中選擇地理圍欄集合。
-
在「我的地理圍欄集合」下,選取目標地理圍欄集合的名稱連結。
-
在地理圍欄下,您將能夠查看地理圍欄的狀態。
-
- API
-
使用來自 Amazon 位置地理圍欄 API 的
GetGeofence
操作。以下示例是從地理圍欄集合獲取地理圍欄詳細信息的 API 請求。
ExampleCollection
GET /geofencing/v0/collections/
ExampleCollection
/geofences/ExampleGeofence1
以下為範例回應
GetGeofence
:{ "CreateTime": 2020-09-30T22:59:34.142Z, "GeofenceId": "
ExampleGeofence1
", "Geometry": { "Polygon": [ [-1,-1], [1,-1], [0,1], [-1,-1] ] }, "Status": "ACTIVE", "UpdateTime": 2020-09-30T23:59:34.142Z } - CLI
-
使用
get-geofence
命令。下面的例子是一個獲AWS CLI取地理圍欄集合的詳細信息。
ExampleCollection
aws location get-geofence \ --collection-name "
ExampleCollection
" \ --geofence-id "ExampleGeofence1
"
刪除地理圍欄
您可以使用 Amazon 位置主控台、或 Amazon 位置 API,從地理圍欄集合刪除AWS CLI地理圍欄。
- Console
-
使用 Amazon 位置控制台刪除地理圍欄
警告
此作業會永久刪除資源。
-
在 https://console.aws.amazon.com/location/
打開 Amazon 位置控制台。 -
從左側導覽窗格中選擇地理圍欄集合。
-
在「我的地理圍欄集合」下,選取目標地理圍欄集合的名稱連結。
-
在「地理圍欄」下,選取目標地理圍欄。
-
選擇 [刪除地理圍欄]。
-
- API
-
使用來自 Amazon 位置地理圍欄 API 的
BatchDeleteGeofence
操作。下列範例是從地理圍欄集合中刪除地理圍欄的 API 要求。
ExampleCollection
POST /geofencing/v0/collections/
ExampleCollection
/delete-geofences Content-type: application/json { "GeofenceIds": [ "ExampleGeofence11
" ] }以下是的成功回應範例
BatchDeleteGeofence
。HTTP/1.1 200
- CLI
-
使用
batch-delete-geofence
命令。下面的例子是從地理圍欄集合刪除地理圍欄的AWS CLI命令。
ExampleCollection
aws location
batch-delete-geofence
\ --collection-name "ExampleCollection
" \ --geofence-ids "ExampleGeofence11
"