Python client library for managing Azure Maps resources through the Azure Resource Manager
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Management of Azure Maps Creator resources for uploading and managing custom map data, including indoor maps, floor plans, and custom geographic datasets. Creator resources enable advanced mapping scenarios beyond standard map services.
from azure.mgmt.maps.models import Creator, CreatorUpdateParameters, CreatorProperties
from typing import Union, IOCreate, update, delete, and retrieve Azure Maps Creator resources within Maps accounts.
def create_or_update(
resource_group_name: str,
account_name: str,
creator_name: str,
creator_resource: Union[Creator, IO],
**kwargs
) -> Creator:
"""
Create or update a Creator resource.
Args:
resource_group_name: Name of the resource group
account_name: Name of the parent Maps account
creator_name: Name of the Creator resource
creator_resource: Creator resource object or JSON payload
Returns:
Creator: The created or updated Creator resource
Raises:
HttpResponseError: If the request fails
"""
def update(
resource_group_name: str,
account_name: str,
creator_name: str,
creator_update_parameters: Union[CreatorUpdateParameters, IO],
**kwargs
) -> Creator:
"""
Update an existing Creator resource.
Args:
resource_group_name: Name of the resource group
account_name: Name of the parent Maps account
creator_name: Name of the Creator resource
creator_update_parameters: Update parameters
Returns:
Creator: The updated Creator resource
"""
def delete(
resource_group_name: str,
account_name: str,
creator_name: str,
**kwargs
) -> None:
"""
Delete a Creator resource.
Args:
resource_group_name: Name of the resource group
account_name: Name of the parent Maps account
creator_name: Name of the Creator resource to delete
Raises:
HttpResponseError: If the request fails
"""
def get(
resource_group_name: str,
account_name: str,
creator_name: str,
**kwargs
) -> Creator:
"""
Get details of a Creator resource.
Args:
resource_group_name: Name of the resource group
account_name: Name of the parent Maps account
creator_name: Name of the Creator resource
Returns:
Creator: The Creator resource details
"""Usage example:
from azure.mgmt.maps.models import Creator, CreatorProperties
# Create a new Creator resource
creator = Creator(
location="eastus",
properties=CreatorProperties(
storage_units=10, # Storage capacity in units
consumed_storage_unit_size_in_bytes=0 # Read-only, will be populated
),
tags={"purpose": "indoor-mapping", "project": "office-floor-plans"}
)
created_creator = client.creators.create_or_update(
resource_group_name="my-rg",
account_name="my-maps-account",
creator_name="my-creator",
creator_resource=creator
)
print(f"Created Creator: {created_creator.name}")
print(f"Storage units: {created_creator.properties.storage_units}")List Creator resources associated with Maps accounts.
def list_by_account(
resource_group_name: str,
account_name: str,
**kwargs
) -> Iterable[Creator]:
"""
List Creator resources for a Maps account.
Args:
resource_group_name: Name of the resource group
account_name: Name of the Maps account
Returns:
Iterable[Creator]: Iterator of Creator resources
"""Usage example:
# List all Creator resources for an account
creators = list(client.creators.list_by_account("my-rg", "my-maps-account"))
for creator in creators:
print(f"Creator: {creator.name}")
print(f"Location: {creator.location}")
print(f"Storage units: {creator.properties.storage_units}")
print(f"Consumed storage: {creator.properties.consumed_storage_unit_size_in_bytes} bytes")
print("---")Monitor and manage storage usage for Creator resources.
# Check storage consumption across all creators
total_allocated = 0
total_consumed = 0
for creator in client.creators.list_by_account("my-rg", "my-account"):
allocated = creator.properties.storage_units or 0
consumed_bytes = creator.properties.consumed_storage_unit_size_in_bytes or 0
total_allocated += allocated
total_consumed += consumed_bytes
print(f"{creator.name}: {allocated} units allocated, {consumed_bytes:,} bytes used")
print(f"\nTotal: {total_allocated} units allocated, {total_consumed:,} bytes used")class Creator:
"""Azure Maps Creator resource for custom map data management."""
# Azure resource properties
id: Optional[str] # Resource ID
name: Optional[str] # Creator name
type: Optional[str] # Resource type
location: Optional[str] # Azure region
tags: Optional[Dict[str, str]] # Resource tags
# Creator-specific configuration
properties: Optional[CreatorProperties] # Creator properties
system_data: Optional[SystemData] # System metadata
class CreatorProperties:
"""Creator resource properties and configuration."""
# Storage configuration
storage_units: Optional[int] # Allocated storage units
# Storage monitoring (read-only)
consumed_storage_unit_size_in_bytes: Optional[int] # Used storage in bytes
# Provisioning status (read-only)
provisioning_state: Optional[str] # Resource provisioning state
class CreatorUpdateParameters:
"""Parameters for updating Creator resources."""
properties: Optional[CreatorProperties] # Updated properties
tags: Optional[Dict[str, str]] # Updated tagsclass CreatorList:
"""Collection of Creator resources."""
value: Optional[List[Creator]] # List of Creator resources
next_link: Optional[str] # Link to next page of resultsCreator resources use storage units to manage capacity for custom map data:
consumed_storage_unit_size_in_bytes propertyCommon storage patterns:
# Scale up storage for a Creator
from azure.mgmt.maps.models import CreatorUpdateParameters, CreatorProperties
# Update storage allocation
update_params = CreatorUpdateParameters(
properties=CreatorProperties(storage_units=20) # Increase to 20 units
)
updated_creator = client.creators.update(
resource_group_name="my-rg",
account_name="my-maps-account",
creator_name="my-creator",
creator_update_parameters=update_params
)
print(f"Updated storage to {updated_creator.properties.storage_units} units")Common error scenarios when working with Creator resources:
from azure.core.exceptions import HttpResponseError, ResourceNotFoundError
try:
creator = client.creators.get("my-rg", "my-account", "nonexistent-creator")
except ResourceNotFoundError:
print("Creator not found")
except HttpResponseError as e:
print(f"HTTP error: {e.status_code} - {e.message}")
# Check if Creator exists before operations
try:
existing_creator = client.creators.get("my-rg", "my-account", "my-creator")
print(f"Creator exists: {existing_creator.name}")
except ResourceNotFoundError:
print("Creator does not exist, creating new one...")
# Create new CreatorInstall with Tessl CLI
npx tessl i tessl/pypi-azure-mgmt-maps