Apply advanced processing to purchased geospatial data.
A data class that represents errors encountered during job validation.
Attributes
Attribute | Description |
---|---|
message | str The message of the validation error. |
name | str The name of the validation error. |
An enumeration class that defines possible statuses for a job.
Constants
Constant | Description | Value |
---|---|---|
CREATED | The job has been created, but not yet accepted. | created |
LICENSED | The EULA has been accepted for this process. The job will move on to the validation stage. | licensed |
UNLICENSED | The EULA hasn’t been accepted for this process. The job will fail. Accept the EULA through the console or the API and try again. | unlicensed |
VALID | The job has been validated. | valid |
INVALID | The job has failed validation. Fix your input parameters and try again. | invalid |
ACCEPTED | The job has been validated and accepted. The credits corresponding to the price are temporarily withheld until the job is completed. | accepted |
REJECTED | The job has been canceled due to an insufficient account balance. Top up your balance and try again. | rejected |
RUNNING | The job is in progress. | running |
SUCCESSFUL | The job has been completed, and the results have been delivered to your storage. | successful |
FAILED | The job has failed. | failed |
CAPTURED | The job has been completed, the results have been delivered to your storage, and any withheld credits have been deducted from your account balance. | captured |
RELEASED | The job has failed. Any withheld credits have been released. Try again, and if the issue persists, contact support. | released |
Terminal statuses:
CAPTURED
RELEASED
INVALID
REJECTED
UNLICENSED
A dictionary class that contains job results.
Attributes
Attribute | Description |
---|---|
collection | Optional[str] The URL of the resulting STAC collection. |
errors | Optional[List[dict]] A list of errors. |
A dictionary class that contains job metadata.
Attributes
Attribute | Description |
---|---|
processID | str The process ID in a name format. |
jobID | str The job ID. |
accountID | str The account ID. |
workspaceID | Optional[str] The workspace ID. |
definition | dict An implementation of the OGC Standard, but with different default response values. Results are always provided with permanent links and a job’s results field only contains references or errors. |
results | Optional[JobResults] Job results. |
creditConsumption | Optional[dict] The number of consumed credits. If the process has failed, the value is null. |
status | str The job status. |
created | str The timestamp when the job was created. |
started | Optional[str] The timestamp when the job was started. |
finished | Optional[str] The timestamp when the job was finished. |
updated | str The timestamp when the job was last updated. |
An exception class that is raised when a job hasn’t yet been finished.
A class that contains predefined sorting fields.
Attributes
Attribute | Description |
---|---|
process_id | utils.SortingField Sorts by process ID. The default order is ascending. |
status | utils.SortingField Sorts by job status. The default order is descending. |
created | utils.SortingField Sorts by creation date. The default order is descending. |
credits | utils.SortingField Sorts by credit consumption. The default order is descending. |
Python
up42.Job.all(sort_by=up42.JobSorting.credits.asc) # Sort by credit amount, from the least to the most expensive
up42.Job.all(sort_by=up42.JobSorting.created.desc) # Sort by creation date, from the most recent to the earliest
A data class that represents a job in the system.
Attributes
Attribute | Description |
---|---|
process_id | str The process ID in a name format. |
id | str The job ID. |
account_id | str The account ID. |
workspace_id | Optional[str] The workspace ID. |
definition | dict The inputs and other parameters used to execute the job. |
status | JobStatus The job status. |
created | datetime.datetime The timestamp when the job was created. |
updated | datetime.datetime The timestamp when the job was last updated. |
collection_url | Optional[str] = None The URL of the resulting STAC collection. Available only if the job status is terminal. |
errors | Optional[List[ValidationError]] Job errors. Available only if the job status is INVALID . |
credits | Optional[int] The job cost, in credits. |
started | Optional[datetime.datetime] The timestamp when the job was started. |
finished | Optional[datetime.datetime] The timestamp when the job was finished. |
Functions
Contains the URL of the resulting STAC collection. Available only if the job status is terminal. Returns pystac.Collection
.
Python
up42.Job.get(id="d290f1ee-6c54-4b01-90e6-d701748f0851")
up42.Job.collection()
Tracks the job status by retrying until the status changes to a terminal status. It will query the job status every 60 seconds for 3 days.
Parameter | Description |
---|---|
wait | int An interval between queries, in seconds. The value is 60 . |
retries | int The duration of querying. The value is 60 * 24 * 3 . |
Python
up42.Job.get(id="d290f1ee-6c54-4b01-90e6-d701748f0851")
up42.Job.track()
Fetches a specific job by its ID. Returns Job
.
Parameter | Description |
---|---|
job_id | str The job ID. |
Python
up42.Job.get(id="d290f1ee-6c54-4b01-90e6-d701748f0851")
Retrieves all jobs, with optional filtering. Returns Iterator["Job"]
.
Parameter | Description |
---|---|
process_id | Optional[List[str]] Process IDs. Use to search for jobs running any of the provided processes. |
workspace_id | Optional[str] The workspace ID. Use to get jobs from a specific workspace. Otherwise, jobs from the entire account will be returned. |
status | Optional[List[JobStatus]] Job statuses. Use to search for jobs with any of the provided statuses. |
min_duration | Optional[int] The minimum duration of a job. Use to get jobs with runtimes greater than or equal to a specific number of seconds. Only jobs with the following statuses will be displayed:
|
max_duration | Optional[int] The maximum duration of a job. Use to get jobs with runtimes less than or equal to a specific number of seconds. Only jobs with the following statuses will be displayed:
|
sort_by | Optional[utils.SortingField] The results sorting method that arranges elements in ascending or descending order based on a chosen field. To view the list of possible values, see JobSorting . |
Python
up42.Job.all(
max_duration=500,
sort_by=up42.JobSorting.process_id,
)
A data class that compares the cost of a process with custom values. Supported comparison operators:
- Greater than:
<
- Greater than or equal to:
>
- Less than:
<=
- Less than or equal to:
=>
Attributes
Attribute | Description |
---|---|
strategy | str The pricing strategy used to calculate the cost. |
credits | int The process cost, in credits. |
size | Optional[int] The size of the input STAC item. |
unit | Optional[str] The unit of measurement used to calculate the size. |
Python
asset = up42.initialize_asset(asset_id="68567134-27ad-7bd7-4b65-d61adb11fc78")
template = processing_templates.DetectionTreesSpacept(
title="Detect trees over UK",
item=asset.stac_items[0],
)
assert template.cost <= 100
template.cost
A class for job templates that define the process ID and input validation logic.
Attributes
Attribute | Description |
---|---|
process_id | ClassVar[str] The process ID in a name format. |
workspace_id | Union[str, base.WorkspaceId] The workspace ID. |
errors | set[ValidationError] A list of errors populated if the job isn’t valid. |
Functions
Checks if the job is valid. Returns bool
:
True
: the job is valid.False
: the job isn’t valid.
Python
asset = up42.initialize_asset(asset_id="68567134-27ad-7bd7-4b65-d61adb11fc78")
job = processing_templates.DetectionTreesSpacept(
title="Detect trees over UK",
item=asset.stac_items[0]
)
if not job.is_valid:
print(template.errors)
Executes the job. Returns Job
.
Python
asset = up42.initialize_asset(asset_id="68567134-27ad-7bd7-4b65-d61adb11fc78")
job = processing_templates.DetectionTreesSpacept(
title="Detect trees over UK",
item=asset.stac_items[0]
)
job.execute()
A data class for the process templates that require one STAC item as input:
Python
{
"title": self.title,
"item": self.item.get_self_href()
}
Atributes
Attribute | Description |
---|---|
title | str The title of the resulting objects: STAC item and STAC collection. |
item | pystac.Item The STAC item to process. |
A data class for the process templates that require multiple STAC items as input:
Python
{
"title": self.title,
"items": [item.get_self_href() for item in self.items]
}
Atributes
Attribute | Description |
---|---|
title | str The title of the resulting objects: STAC item and STAC collection. |
items | List[pystac.Item] The STAC items to process. |