Order¶
The Order class enables you to place, inspect and get information on orders.
Use an existing order:
order = up42.initialize_order(order_id="ea36dee9-fed6-457e-8400-2c20ebd30f44")
Source code in up42/order.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|
Attributes¶
info: dict
property
¶
Gets and updates the order information.
status: str
property
¶
Gets the Order status. One of PLACED
, FAILED
, FULFILLED
, BEING_FULFILLED
, FAILED_PERMANENTLY
.
is_fulfilled: bool
property
¶
Gets True
if the order is fulfilled, False
otherwise.
Also see status attribute.
Functions¶
estimate(auth, order_parameters)
staticmethod
¶
Returns an estimation of the cost of an order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Auth
|
An authentication object. |
required |
order_parameters |
dict
|
A dictionary like {dataProduct: ..., "params": {"id": ..., "aoi": ...}} |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The estimated cost of the order |
Source code in up42/order.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
get_assets()
¶
Gets the Order assets or results.
Source code in up42/order.py
73 74 75 76 77 78 79 80 81 82 |
|
place(auth, order_parameters)
classmethod
¶
Places an order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Auth
|
An authentication object. |
required |
order_parameters |
dict
|
A dictionary like {dataProduct: ..., "params": {"id": ..., "aoi": ...}} |
required |
Returns:
Name | Type | Description |
---|---|---|
Order |
Order
|
The placed order. |
Source code in up42/order.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
|
track_status(report_time=120)
¶
Continuously gets the order status until order is fulfilled or failed.
Internally checks every report_time
(s) for the status and prints the log.
Warning
When placing orders of items that are in archive or cold storage,
the order fulfillment can happen up to 24h after order placement.
In such cases,
please make sure to set an appropriate report_time
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
report_time |
int
|
The interval (in seconds) when to get the order status. |
120
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The final order status. |
Source code in up42/order.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|