管理您的地理围栏收集资源 - Amazon Location Service

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

管理您的地理围栏收集资源

使用 Amazon Location 控制台、或亚马逊位置 API 管理您的 geofence 馆藏。AWS CLI

列出您的地理围栏收集资源

您可以使用亚马逊位置控制台、或亚马逊位置 API 查看您的 geofence 收藏列表:AWS CLI

Console

使用 Amazon Location 控制台查看地理围栏集合列表

  1. 通过 https://console.aws.amazon.com/location/ 打开亚马逊定位控制台。

  2. 选择左侧导航窗格中的 Getfumen ts(Getpost

  3. 在 “我的地理围栏” 集合下查看您的地理围栏集合列表。

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 控制台查看地理围栏集合的详细信息

  1. 通过 https://console.aws.amazon.com/location/ 打开亚马逊定位控制台。

  2. 选择左侧导航窗格中的 Getfumen ts(Getpost

  3. 在 “我的地理围栏集合” 下,选择目标 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 控制台删除地理围栏集合

警告

此操作将永久删除该资源。

  1. 通过 https://console.aws.amazon.com/location/ 打开亚马逊定位控制台。

  2. 选择左侧导航窗格中的 Getfumen ts(Getpost

  3. 我的地理围栏集合下,选择目标地理围栏集合。

  4. 选择 “删除 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

使用亚马逊位置控制台查看地理围栏列表

  1. 通过 https://console.aws.amazon.com/location/ 打开亚马逊定位控制台。

  2. 选择左侧导航窗格中的 Getfumen ts(Getpost

  3. 在 “我的地理围栏” 集合下,选择目标 geofence 集合的名称链接。

  4. 在 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 控制台查看地理围栏的状态

  1. 通过 https://console.aws.amazon.com/location/ 打开亚马逊定位控制台。

  2. 选择左侧导航窗格中的 Getfumen ts(Getpost

  3. 在 “我的地理围栏” 集合下,选择目标 geofence 集合的名称链接。

  4. 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

使用亚马逊定位控制台删除地理围栏

警告

此操作将永久删除该资源。

  1. 通过 https://console.aws.amazon.com/location/ 打开亚马逊定位控制台。

  2. 选择左侧导航窗格中的 Getfumen ts(Getpost

  3. 在 “我的地理围栏” 集合下,选择目标 geofence 集合的名称链接。

  4. 在 “地理围栏” 下,选择目标地理围栏。

  5. 选择 “删除地理围栏”。

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"