本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
管理您的地理围栏收集资源
使用 Amazon Location 控制台、或亚马逊位置 API 管理您的 geofence 馆藏。AWS CLI
列出您的地理围栏收集资源
您可以使用亚马逊位置控制台、或亚马逊位置 API 查看您的 geofence 收藏列表:AWS CLI
- Console
-
使用 Amazon Location 控制台查看地理围栏集合列表
-
通过 https://console.aws.amazon.com/location/
打开亚马逊定位控制台。 -
选择左侧导航窗格中的 Getfumen ts(Getpost
-
在 “我的地理围栏” 集合下查看您的地理围栏集合列表。
-
- API
-
使用 Amazon Location Geofences API 中的
ListGeofenceCollections
操作。以下示例是一个 API 请求,用于获取AWS账户中的 geofence 集合列表。
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账户中的 geofence 集合列表。
aws location list-geofence-collections
获取地理围栏详细信息:
您可以使用亚马逊位置控制台、或 Amazon Location API 获取有关您AWS账户中任何 geofence 收集资源的详细信息:AWS CLI
- Console
-
使用 Amazon Location 控制台查看地理围栏集合的详细信息
-
通过 https://console.aws.amazon.com/location/
打开亚马逊定位控制台。 -
选择左侧导航窗格中的 Getfumen ts(Getpost
-
在 “我的地理围栏集合” 下,选择目标 geofence 集合的名称链接。
-
- API
-
使用 Amazon Location Geofences 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 Location API 从您的AWS账户中AWS CLI删除 geofence 集合。
- Console
-
使用 Amazon Location 控制台删除地理围栏集合
警告
此操作将永久删除该资源。
-
通过 https://console.aws.amazon.com/location/
打开亚马逊定位控制台。 -
选择左侧导航窗格中的 Getfumen ts(Getpost
-
在我的地理围栏集合下,选择目标地理围栏集合。
-
选择 “删除 geofence 集合”。
-
- API
-
使用亚马逊位置 API 中的
DeleteGeofenceCollection
操作。以下示例是删除地理围栏集合的 API 请求
ExampleCollection
。DELETE /geofencing/v0/collections/
ExampleCollection
为例
DeleteGeofenceCollection
::::::::::::::。HTTP/1.1 200
- CLI
-
使用
delete-geofence-collection
命令。以下示例是删除 geofence 集合的AWS CLI命令
ExampleCollection
。aws location delete-geofence-collection \ --collection-name "
ExampleCollection
"
列出存储的地理围栏
您可以使用亚马逊位置控制台、或 Amazon Location API 列出存储在指定地理围栏集合中的地理围栏。AWS CLI
- Console
-
使用亚马逊位置控制台查看地理围栏列表
-
通过 https://console.aws.amazon.com/location/
打开亚马逊定位控制台。 -
选择左侧导航窗格中的 Getfumen ts(Getpost
-
在 “我的地理围栏” 集合下,选择目标 geofence 集合的名称链接。
-
在 Geofences 下查看地理围栏集合中的地理围栏
-
- API
-
使用 Amazon Location Geofences API 中的
ListGeofences
操作。以下示例是一个 API 请求,用于获取存储在 geofence 集合中的地理围栏列表
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用于获取存储在 geofence 集合中的地理围栏列表
ExampleCollection
。aws location list-geofences \ --collection-name "
ExampleCollection
"
获取地理围栏详细信息:
您可以使用 Amazon Location 控制台或 Amazon Location API 从地理围栏集合中获取特定地理围栏的详细信息,例如创建时间AWS CLI、更新时间、几何和状态。
- Console
-
使用 Amazon Location 控制台查看地理围栏的状态
-
通过 https://console.aws.amazon.com/location/
打开亚马逊定位控制台。 -
选择左侧导航窗格中的 Getfumen ts(Getpost
-
在 “我的地理围栏” 集合下,选择目标 geofence 集合的名称链接。
-
在 Geofences 下,您将能够查看地理围栏的状态。
-
- API
-
使用 Amazon Location Geofences 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 Location API 从地理围栏集合中AWS CLI删除 geofence。
- Console
-
使用亚马逊定位控制台删除地理围栏
警告
此操作将永久删除该资源。
-
通过 https://console.aws.amazon.com/location/
打开亚马逊定位控制台。 -
选择左侧导航窗格中的 Getfumen ts(Getpost
-
在 “我的地理围栏” 集合下,选择目标 geofence 集合的名称链接。
-
在 “地理围栏” 下,选择目标地理围栏。
-
选择 “删除地理围栏”。
-
- API
-
使用 Amazon Location Geofences API 中的
BatchDeleteGeofence
操作。以下示例是一个 API 请求,用于从 geofence 集合中删除 geofence
ExampleCollection
。POST /geofencing/v0/collections/
ExampleCollection
/delete-geofences Content-type: application/json { "GeofenceIds": [ "ExampleGeofence11
" ] }为例::::::::::::::::
BatchDeleteGeofence
。HTTP/1.1 200
- CLI
-
使用
batch-delete-geofence
命令。以下示例是从 geofence 集合中删除 geofence 的AWS CLI命令
ExampleCollection
。aws location
batch-delete-geofence
\ --collection-name "ExampleCollection
" \ --geofence-ids "ExampleGeofence11
"