ds_stoa.order._order ==================== .. py:module:: ds_stoa.order._order .. autoapi-nested-parse:: This module is designed to facilitate sending order requests to the Stoa API, allowing for the automated ordering of data or services provided by the Stoa platform. It utilizes the `order` function to communicate with the Stoa API, sending order requests based on specified parameters and an authentication token. The function is designed to work in different environments (development and production) by selecting the appropriate API endpoint. The `order` function returns the response from the Stoa API as a JSON object, which typically includes details about the order that was placed. Dependencies: - requests: For making HTTP requests to the Stoa API. - os: For reading environment variables to determine the running environment. - utils.exceptions: For enriching HTTP exceptions with more context. - utils.logger: For logging information about the order request and its outcome. **Example Usage**:: from ds_stoa.order import order # Authentication token and parameters for the order token = "your_auth_token" params = { "product_group_name": "your_product_group_name", "product_name": "your_product_name", "workspace": "your_workspace", "owner_id": "your_owner_id", "version": "1.0", "offset": "0", "limit": "20", "ascending": "False", } # Send an order request order_ids = order(token=token, params=params) print(order_ids) Attributes ---------- .. autoapisummary:: ds_stoa.order._order.LOGGER ds_stoa.order._order.BUILDING_MODE Functions --------- .. autoapisummary:: ds_stoa.order._order.enrich_http_exception ds_stoa.order._order.order Module Contents --------------- .. py:function:: enrich_http_exception(exc: requests.exceptions.HTTPError) -> None Enriches an HTTP exception with additional context without re-raising it. :param exc: Exception :return: None .. py:data:: LOGGER .. py:data:: BUILDING_MODE .. py:function:: order(token: str, params: Dict) -> List[str] Send order request to Stoa API. :param token: Authentication token required for the API request. :param params: Parameters for the order request, such as product ID and quantity. :return: A dictionary containing the response from the Stoa API. **Example**:: >>> order(token=token, params=params) ["12345.snappy.parquet", "67890.snappy.parquet"]