2023/02/23 - Amazon Location Service - 5 new4 updated api methods
Changes This release adds support for using Maps APIs with an API Key in addition to AWS Cognito. This includes support for adding, listing, updating and deleting API Keys.
Creates an API key resource in your Amazon Web Services account, which lets you grant geo:GetMap* actions for Amazon Location Map resources to the API key bearer.
See also: AWS API Documentation
Request Syntax
client.create_key( Description='string', ExpireTime=datetime(2015, 1, 1), KeyName='string', NoExpiry=True|False, Restrictions={ 'AllowActions': [ 'string', ], 'AllowReferers': [ 'string', ], 'AllowResources': [ 'string', ] }, Tags={ 'string': 'string' } )
string
An optional description for the API key resource.
datetime
The optional timestamp for when the API key resource will expire in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ. One of NoExpiry or ExpireTime must be set.
string
[REQUIRED]
A custom name for the API key resource.
Requirements:
Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).
Must be a unique API key name.
No spaces allowed. For example, ExampleAPIKey.
boolean
Optionally set to true to set no expiration time for the API key. One of NoExpiry or ExpireTime must be set.
dict
[REQUIRED]
The API key restrictions for the API key resource.
AllowActions (list) -- [REQUIRED]
A list of allowed actions that an API key resource grants permissions to perform
(string) --
AllowReferers (list) --
An optional list of allowed HTTP referers for which requests must originate from. Requests using this API key from other domains will not be allowed.
Requirements:
Contain only alphanumeric characters (A–Z, a–z, 0–9) or any symbols in this list $\-._+!*`(),;/?:@=&
May contain a percent (%) if followed by 2 hexadecimal digits (A-F, a-f, 0-9); this is used for URL encoding purposes.
May contain wildcard characters question mark (?) and asterisk (*). Question mark (?) will replace any single character (including hexadecimal digits). Asterisk (*) will replace any multiple characters (including multiple hexadecimal digits).
No spaces allowed. For example, https://example.com.
(string) --
AllowResources (list) -- [REQUIRED]
A list of allowed resource ARNs that a API key bearer can perform actions on
For more information about ARN format, see Amazon Resource Names (ARNs).
Requirements:
Must be prefixed with arn.
partition and service must not be empty and should begin with only alphanumeric characters (A–Z, a–z, 0–9) and contain only alphanumeric numbers, hyphens (-) and periods (.).
region and account-id can be empty or should begin with only alphanumeric characters (A–Z, a–z, 0–9) and contain only alphanumeric numbers, hyphens (-) and periods (.).
resource-id can begin with any character except for forward slash (/) and contain any characters after, including forward slashes to form a path. resource-id can also include wildcard characters, denoted by an asterisk (*).
arn, partition, service, region, account-id and resource-id must be delimited by a colon (:).
No spaces allowed. For example, arn:aws:geo:region:account-id:map/ExampleMap*.
(string) --
dict
Applies one or more tags to the map resource. A tag is a key-value pair that helps manage, identify, search, and filter your resources by labelling them.
Format: "key" : "value"
Restrictions:
Maximum 50 tags per resource
Each resource tag must be unique with a maximum of one value.
Maximum key length: 128 Unicode characters in UTF-8
Maximum value length: 256 Unicode characters in UTF-8
Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @.
Cannot use "aws:" as a prefix for a key.
(string) --
(string) --
dict
Response Syntax
{ 'CreateTime': datetime(2015, 1, 1), 'Key': 'string', 'KeyArn': 'string', 'KeyName': 'string' }
Response Structure
(dict) --
CreateTime (datetime) --
The timestamp for when the API key resource was created in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ.
Key (string) --
The key value/string of an API key. This value is used when making API calls to authorize the call. For example, see GetMapGlyphs.
KeyArn (string) --
The Amazon Resource Name (ARN) for the API key resource. Used when you need to specify a resource across all Amazon Web Services.
Format example: arn:aws:geo:region:account-id:key/ExampleKey
KeyName (string) --
The name of the API key resource.
Retrieves the API key resource details.
See also: AWS API Documentation
Request Syntax
client.describe_key( KeyName='string' )
string
[REQUIRED]
The name of the API key resource.
dict
Response Syntax
{ 'CreateTime': datetime(2015, 1, 1), 'Description': 'string', 'ExpireTime': datetime(2015, 1, 1), 'Key': 'string', 'KeyArn': 'string', 'KeyName': 'string', 'Restrictions': { 'AllowActions': [ 'string', ], 'AllowReferers': [ 'string', ], 'AllowResources': [ 'string', ] }, 'Tags': { 'string': 'string' }, 'UpdateTime': datetime(2015, 1, 1) }
Response Structure
(dict) --
CreateTime (datetime) --
The timestamp for when the API key resource was created in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ.
Description (string) --
The optional description for the API key resource.
ExpireTime (datetime) --
The timestamp for when the API key resource will expire in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ.
Key (string) --
The key value/string of an API key.
KeyArn (string) --
The Amazon Resource Name (ARN) for the API key resource. Used when you need to specify a resource across all Amazon Web Services.
Format example: arn:aws:geo:region:account-id:key/ExampleKey
KeyName (string) --
The name of the API key resource.
Restrictions (dict) --
API Restrictions on the allowed actions, resources, and referers for an API key resource.
AllowActions (list) --
A list of allowed actions that an API key resource grants permissions to perform
(string) --
AllowReferers (list) --
An optional list of allowed HTTP referers for which requests must originate from. Requests using this API key from other domains will not be allowed.
Requirements:
Contain only alphanumeric characters (A–Z, a–z, 0–9) or any symbols in this list $\-._+!*`(),;/?:@=&
May contain a percent (%) if followed by 2 hexadecimal digits (A-F, a-f, 0-9); this is used for URL encoding purposes.
May contain wildcard characters question mark (?) and asterisk (*). Question mark (?) will replace any single character (including hexadecimal digits). Asterisk (*) will replace any multiple characters (including multiple hexadecimal digits).
No spaces allowed. For example, https://example.com.
(string) --
AllowResources (list) --
A list of allowed resource ARNs that a API key bearer can perform actions on
For more information about ARN format, see Amazon Resource Names (ARNs).
Requirements:
Must be prefixed with arn.
partition and service must not be empty and should begin with only alphanumeric characters (A–Z, a–z, 0–9) and contain only alphanumeric numbers, hyphens (-) and periods (.).
region and account-id can be empty or should begin with only alphanumeric characters (A–Z, a–z, 0–9) and contain only alphanumeric numbers, hyphens (-) and periods (.).
resource-id can begin with any character except for forward slash (/) and contain any characters after, including forward slashes to form a path. resource-id can also include wildcard characters, denoted by an asterisk (*).
arn, partition, service, region, account-id and resource-id must be delimited by a colon (:).
No spaces allowed. For example, arn:aws:geo:region:account-id:map/ExampleMap*.
(string) --
Tags (dict) --
Tags associated with the API key resource.
(string) --
(string) --
UpdateTime (datetime) --
The timestamp for when the API key resource was last updated in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ.
Updates the specified properties of a given API key resource.
See also: AWS API Documentation
Request Syntax
client.update_key( Description='string', ExpireTime=datetime(2015, 1, 1), ForceUpdate=True|False, KeyName='string', NoExpiry=True|False, Restrictions={ 'AllowActions': [ 'string', ], 'AllowReferers': [ 'string', ], 'AllowResources': [ 'string', ] } )
string
Updates the description for the API key resource.
datetime
Updates the timestamp for when the API key resource will expire in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ.
boolean
The boolean flag to be included for updating ExpireTime or Restrictions details.
Must be set to true to update an API key resource that has been used in the past 7 days.
False if force update is not preferred
Default value: False
string
[REQUIRED]
The name of the API key resource to update.
boolean
Whether the API key should expire. Set to true to set the API key to have no expiration time.
dict
Updates the API key restrictions for the API key resource.
AllowActions (list) -- [REQUIRED]
A list of allowed actions that an API key resource grants permissions to perform
(string) --
AllowReferers (list) --
An optional list of allowed HTTP referers for which requests must originate from. Requests using this API key from other domains will not be allowed.
Requirements:
Contain only alphanumeric characters (A–Z, a–z, 0–9) or any symbols in this list $\-._+!*`(),;/?:@=&
May contain a percent (%) if followed by 2 hexadecimal digits (A-F, a-f, 0-9); this is used for URL encoding purposes.
May contain wildcard characters question mark (?) and asterisk (*). Question mark (?) will replace any single character (including hexadecimal digits). Asterisk (*) will replace any multiple characters (including multiple hexadecimal digits).
No spaces allowed. For example, https://example.com.
(string) --
AllowResources (list) -- [REQUIRED]
A list of allowed resource ARNs that a API key bearer can perform actions on
For more information about ARN format, see Amazon Resource Names (ARNs).
Requirements:
Must be prefixed with arn.
partition and service must not be empty and should begin with only alphanumeric characters (A–Z, a–z, 0–9) and contain only alphanumeric numbers, hyphens (-) and periods (.).
region and account-id can be empty or should begin with only alphanumeric characters (A–Z, a–z, 0–9) and contain only alphanumeric numbers, hyphens (-) and periods (.).
resource-id can begin with any character except for forward slash (/) and contain any characters after, including forward slashes to form a path. resource-id can also include wildcard characters, denoted by an asterisk (*).
arn, partition, service, region, account-id and resource-id must be delimited by a colon (:).
No spaces allowed. For example, arn:aws:geo:region:account-id:map/ExampleMap*.
(string) --
dict
Response Syntax
{ 'KeyArn': 'string', 'KeyName': 'string', 'UpdateTime': datetime(2015, 1, 1) }
Response Structure
(dict) --
KeyArn (string) --
The Amazon Resource Name (ARN) for the API key resource. Used when you need to specify a resource across all Amazon Web Services.
Format example: arn:aws:geo:region:account-id:key/ExampleKey
KeyName (string) --
The name of the API key resource.
UpdateTime (datetime) --
The timestamp for when the API key resource was last updated in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ.
Deletes the specified API key. The API key must have been deactivated more than 90 days previously.
See also: AWS API Documentation
Request Syntax
client.delete_key( KeyName='string' )
string
[REQUIRED]
The name of the API key to delete.
dict
Response Syntax
{}
Response Structure
(dict) --
Lists API key resources in your Amazon Web Services account.
See also: AWS API Documentation
Request Syntax
client.list_keys( Filter={ 'KeyStatus': 'Active'|'Expired' }, MaxResults=123, NextToken='string' )
dict
Optionally filter the list to only Active or Expired API keys.
KeyStatus (string) --
Filter on Active or Expired API keys.
integer
An optional limit for the number of resources returned in a single call.
Default value: 100
string
The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page.
Default value: null
dict
Response Syntax
{ 'Entries': [ { 'CreateTime': datetime(2015, 1, 1), 'Description': 'string', 'ExpireTime': datetime(2015, 1, 1), 'KeyName': 'string', 'Restrictions': { 'AllowActions': [ 'string', ], 'AllowReferers': [ 'string', ], 'AllowResources': [ 'string', ] }, 'UpdateTime': datetime(2015, 1, 1) }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Entries (list) --
Contains API key resources in your Amazon Web Services account. Details include API key name, allowed referers and timestamp for when the API key will expire.
(dict) --
An API key resource listed in your Amazon Web Services account.
CreateTime (datetime) --
The timestamp of when the API key was created, in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ.
Description (string) --
The optional description for the API key resource.
ExpireTime (datetime) --
The timestamp for when the API key resource will expire, in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ.
KeyName (string) --
The name of the API key resource.
Restrictions (dict) --
API Restrictions on the allowed actions, resources, and referers for an API key resource.
AllowActions (list) --
A list of allowed actions that an API key resource grants permissions to perform
(string) --
AllowReferers (list) --
An optional list of allowed HTTP referers for which requests must originate from. Requests using this API key from other domains will not be allowed.
Requirements:
Contain only alphanumeric characters (A–Z, a–z, 0–9) or any symbols in this list $\-._+!*`(),;/?:@=&
May contain a percent (%) if followed by 2 hexadecimal digits (A-F, a-f, 0-9); this is used for URL encoding purposes.
May contain wildcard characters question mark (?) and asterisk (*). Question mark (?) will replace any single character (including hexadecimal digits). Asterisk (*) will replace any multiple characters (including multiple hexadecimal digits).
No spaces allowed. For example, https://example.com.
(string) --
AllowResources (list) --
A list of allowed resource ARNs that a API key bearer can perform actions on
For more information about ARN format, see Amazon Resource Names (ARNs).
Requirements:
Must be prefixed with arn.
partition and service must not be empty and should begin with only alphanumeric characters (A–Z, a–z, 0–9) and contain only alphanumeric numbers, hyphens (-) and periods (.).
region and account-id can be empty or should begin with only alphanumeric characters (A–Z, a–z, 0–9) and contain only alphanumeric numbers, hyphens (-) and periods (.).
resource-id can begin with any character except for forward slash (/) and contain any characters after, including forward slashes to form a path. resource-id can also include wildcard characters, denoted by an asterisk (*).
arn, partition, service, region, account-id and resource-id must be delimited by a colon (:).
No spaces allowed. For example, arn:aws:geo:region:account-id:map/ExampleMap*.
(string) --
UpdateTime (datetime) --
The timestamp of when the API key was last updated, in ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ.
NextToken (string) --
A pagination token indicating there are additional pages available. You can use the token in a following request to fetch the next set of results.
{'Key': 'string'}Response
{'CacheControl': 'string'}
Retrieves glyphs used to display labels on a map.
See also: AWS API Documentation
Request Syntax
client.get_map_glyphs( FontStack='string', FontUnicodeRange='string', Key='string', MapName='string' )
string
[REQUIRED]
A comma-separated list of fonts to load glyphs from in order of preference. For example, Noto Sans Regular, Arial Unicode.
Valid fonts stacks for Esri styles:
VectorEsriDarkGrayCanvas – Ubuntu Medium Italic | Ubuntu Medium | Ubuntu Italic | Ubuntu Regular | Ubuntu Bold
VectorEsriLightGrayCanvas – Ubuntu Italic | Ubuntu Regular | Ubuntu Light | Ubuntu Bold
VectorEsriTopographic – Noto Sans Italic | Noto Sans Regular | Noto Sans Bold | Noto Serif Regular | Roboto Condensed Light Italic
VectorEsriStreets – Arial Regular | Arial Italic | Arial Bold
VectorEsriNavigation – Arial Regular | Arial Italic | Arial Bold
Valid font stacks for HERE Technologies styles:
VectorHereContrast – Fira GO Regular | Fira GO Bold
VectorHereExplore, VectorHereExploreTruck, HybridHereExploreSatellite – Fira GO Italic | Fira GO Map | Fira GO Map Bold | Noto Sans CJK JP Bold | Noto Sans CJK JP Light | Noto Sans CJK JP Regular
Valid font stacks for GrabMaps styles:
VectorGrabStandardLight, VectorGrabStandardDark – Noto Sans Regular | Noto Sans Medium | Noto Sans Bold
Valid font stacks for Open Data (Preview) styles:
VectorOpenDataStandardLight – Amazon Ember Regular,Noto Sans Regular | Amazon Ember Bold,Noto Sans Bold | Amazon Ember Medium,Noto Sans Medium | Amazon Ember Regular Italic,Noto Sans Italic | Amazon Ember Condensed RC Regular,Noto Sans Regular | Amazon Ember Condensed RC Bold,Noto Sans Bold
string
[REQUIRED]
A Unicode range of characters to download glyphs for. Each response will contain 256 characters. For example, 0–255 includes all characters from range U+0000 to 00FF. Must be aligned to multiples of 256.
string
The optional API key to authorize the request.
string
[REQUIRED]
The map resource associated with the glyph file.
dict
Response Syntax
{ 'Blob': StreamingBody(), 'CacheControl': 'string', 'ContentType': 'string' }
Response Structure
(dict) --
Blob (:class:`.StreamingBody`) --
The glyph, as binary blob.
CacheControl (string) --
The HTTP Cache-Control directive for the value.
ContentType (string) --
The map glyph content type. For example, application/octet-stream.
{'Key': 'string'}Response
{'CacheControl': 'string'}
Retrieves the sprite sheet corresponding to a map resource. The sprite sheet is a PNG image paired with a JSON document describing the offsets of individual icons that will be displayed on a rendered map.
See also: AWS API Documentation
Request Syntax
client.get_map_sprites( FileName='string', Key='string', MapName='string' )
string
[REQUIRED]
The name of the sprite file. Use the following file names for the sprite sheet:
sprites.png
sprites@2x.png for high pixel density displays
For the JSON document containing image offsets. Use the following file names:
sprites.json
sprites@2x.json for high pixel density displays
string
The optional API key to authorize the request.
string
[REQUIRED]
The map resource associated with the sprite file.
dict
Response Syntax
{ 'Blob': StreamingBody(), 'CacheControl': 'string', 'ContentType': 'string' }
Response Structure
(dict) --
Blob (:class:`.StreamingBody`) --
Contains the body of the sprite sheet or JSON offset file.
CacheControl (string) --
The HTTP Cache-Control directive for the value.
ContentType (string) --
The content type of the sprite sheet and offsets. For example, the sprite sheet content type is image/png, and the sprite offset JSON document is application/json.
{'Key': 'string'}Response
{'CacheControl': 'string'}
Retrieves the map style descriptor from a map resource.
The style descriptor contains specifications on how features render on a map. For example, what data to display, what order to display the data in, and the style for the data. Style descriptors follow the Mapbox Style Specification.
See also: AWS API Documentation
Request Syntax
client.get_map_style_descriptor( Key='string', MapName='string' )
string
The optional API key to authorize the request.
string
[REQUIRED]
The map resource to retrieve the style descriptor from.
dict
Response Syntax
{ 'Blob': StreamingBody(), 'CacheControl': 'string', 'ContentType': 'string' }
Response Structure
(dict) --
Blob (:class:`.StreamingBody`) --
Contains the body of the style descriptor.
CacheControl (string) --
The HTTP Cache-Control directive for the value.
ContentType (string) --
The style descriptor's content type. For example, application/json.
{'Key': 'string'}Response
{'CacheControl': 'string'}
Retrieves a vector data tile from the map resource. Map tiles are used by clients to render a map. they're addressed using a grid arrangement with an X coordinate, Y coordinate, and Z (zoom) level.
The origin (0, 0) is the top left of the map. Increasing the zoom level by 1 doubles both the X and Y dimensions, so a tile containing data for the entire world at (0/0/0) will be split into 4 tiles at zoom 1 (1/0/0, 1/0/1, 1/1/0, 1/1/1).
See also: AWS API Documentation
Request Syntax
client.get_map_tile( Key='string', MapName='string', X='string', Y='string', Z='string' )
string
The optional API key to authorize the request.
string
[REQUIRED]
The map resource to retrieve the map tiles from.
string
[REQUIRED]
The X axis value for the map tile.
string
[REQUIRED]
The Y axis value for the map tile.
string
[REQUIRED]
The zoom value for the map tile.
dict
Response Syntax
{ 'Blob': StreamingBody(), 'CacheControl': 'string', 'ContentType': 'string' }
Response Structure
(dict) --
Blob (:class:`.StreamingBody`) --
Contains Mapbox Vector Tile (MVT) data.
CacheControl (string) --
The HTTP Cache-Control directive for the value.
ContentType (string) --
The map tile's content type. For example, application/vnd.mapbox-vector-tile.