Storage in SDK

Access your storage using the SDK.


Overview

Manage geospatial data in your storage.

View repository

Constants

ConstantDescriptionValue
OrderSortBySorting fields for orders.

Literal["createdAt", "updatedAt",

"dataProvider", "type", "status"]

OrderType

Order types:

  • TASKING: Tasking orders.
  • ARCHIVE: Catalog orders.
Literal["TASKING", "ARCHIVE"]

Class: AllowedStatuses

This class is deprecated and will be removed in 3.0.0 in favor of data management functionality.

An enumeration class that defines possible statuses for an order.

Constants

ConstantDescriptionValue
CREATEDThe order has been created, but not yet placed.CREATED
BEING_PLACEDThe order is being placed.BEING_PLACED
PLACEDThe order has been placed.PLACED
PLACEMENT_FAILEDAn error occurred while placing the order. Please wait until it’s resolved.PLACEMENT_FAILED
DELIVERY_INITIALIZATION_FAILEDAn error occurred while delivering the order assets. Please wait until it’s resolved.DELIVERY_INITIALIZATION_FAILED
BEING_FULFILLEDThe order is in progress. Some assets may already be delivered to your storage.BEING_FULFILLED
DOWNLOAD_FAILEDAn error occurred while delivering the order assets. Please wait until it’s resolved.DOWNLOAD_FAILED
DOWNLOADEDThe order assets are being delivered to your storage.DOWNLOADED
FULFILLEDThe order is complete, and all assets have been delivered to your storage.FULFILLED
FAILED_PERMANENTLYThe order has permanently failed or has been canceled.FAILED_PERMANENTLY
Python
# Select an order
order_id = "3bf00b63-7188-4b04-aa27-d78e4cd32c01"
# Fetch order info
order = up42.Order.get(order_id)
# Define output
if order.status == up42.storage.AllowedStatuses.FULFILLED.value:
print(f"Order {order_id} is fulfilled.")
else:
print(f"Order {order_id} is not fulfilled. Current status: {order.status}")

Class: Storage

This class is deprecated and will be removed in 3.0.0 in favor of data management functionality.

A class that represents storage in the system.

Methods

get_assets

This method is deprecated and will be removed in 3.0.0. Use the search method.

Retrieves assets from storage. Returns Union[list[Asset], dict].

ParameterDescription
created_after

Optional[Union[str, datetime.datetime]]

A time condition for search. Use to search for assets created after the timestamp specified in the YYYY-MM-DD format.

created_before

Optional[Union[str, datetime.datetime]]

A time condition for search. Use to search for assets created before the timestamp specified in the YYYY-MM-DD format.

workspace_id

Optional[str]

The workspace ID. Use to get assets from a specific workspace. Otherwise, assets from the entire account will be returned.

collection_names

Optional[List[str]]

The names of geospatial collections. Use to search for assets from any of the provided collections.

producer_names

Optional[List[str]]

The names of producers. Use to search for assets from any of the provided producers. A producer is the type of geospatial collection provider that initially acquired and processed the source data. Data acquired by a producer can be distributed to various hosts.

tags

Optional[List[str]]

Asset tags. Use to search for assets with any of the provided tags. A tag can consist of letters, numbers, spaces, and special characters (., -, _, /, :).

sources

Optional[List[str]]

Asset sources. Use to search for assets from any of the provided sources. The allowed values are as follows:

  • ARCHIVE: Assets from catalog orders
  • TASKING: Assets from tasking orders
search

Optional[str]

Additional search terms. Use to search for assets that partially or fully match the provided query in their name, title, or order ID.

limit

Optional[str]

The number of assets on a result page.

sortby

str

Arranges elements in the order specified in descending based on a chosen field. The allowed values are as follows:

  • id
  • workspaceId
  • accountId
  • createdAt
  • updatedAt
  • name
  • size
  • contentType
  • geospatialMetadataExtractionStatus
  • productId
  • orderId
  • producerName
  • collectionName
  • source

The default value is createdAt.

descending

bool

Determines the sorting order of elements.

  • True: Arranges elements in descending order based on the field specified in sortby.
  • False: Arranges elements in ascending order based on the field specified in sortby.

The default value is True.

return_json

bool

Determines how to return assets.

  • True: Returns JSON.
  • False: Returns a list of asset objects.

The default value is False.

Python
# Initialize storage
storage = up42.initialize_storage()
# Retrieve assets
storage.get_assets(
created_after="2021-01-01",
created_before="2023-01-01",
workspace_id="68567134-27ad-7bd7-4b65-d61adb11fc78",
collection_names=["phr"],
producer_names=["airbus"],
tags=["optical", "us"],
sources=["ARCHIVE"],
search="NY Central Park",
limit=5,
sortby="productId",
descending=False,
return_json=True,
)

get_orders

This method is deprecated and will be removed in 3.0.0. Use the all method.

Retrieves tasking and catalog orders. Returns Union[list[Order], dict].

ParameterDescription
workspace_orders

bool

Determines the scope of orders to return.

  • True: Returns orders from your workspace.

  • False: Returns orders from the entire account.

    The default value is True.

return_json

bool

Determines how to return orders.

  • True: Returns JSON.
  • False: Returns a list of order objects.

The default value is False.

limit

Optional[int]

The number of orders on a result page.

sortby

OrderSortBy

Arranges elements in the order specified in descending based on a chosen field. The default value is createdAt.

descending

bool

Determines the arrangement of elements:

  • True: Arranges elements in descending order based on the field specified in sortby.
  • False: Arranges elements in ascending order based on the field specified in sortby.

The default value is True.

order_type

Optional[OrderType]

The type of orders to return. To get orders of all types, omit the parameter.

statuses

Optional[List[str]]

The status of the order.

name

Optional[str]

The name of the order.

tags

Optional[List[str]]

Order tags. Use to search for orders with any of the provided tags. A tag can consist of letters, numbers, spaces, and special characters (., -, _, /, :).

Python
# Initialize storage
storage = up42.initialize_storage()
# Retrieve orders
storage.get_orders(
workspace_orders=False,
return_json=True,
limit=2,
sortby="status",
descending=False,
order_type="ARCHIVE",
statuses=["FULFILLED"],
name="Spot 6/7 Central Park",
tags=["optical","us"],
)

Learn more


Last updated: