Equipment operations
CREATE_EQUIPMENT
Used to bulk add new equipment to a single site in the platform. The operation supports importing nested equipment and preserves the original hierarchy.
Operation structure:
{
"operation": "CREATE_EQUIPMENT",
"params": {
"owner_name": "INFRA_01",
"site_id": "aershed_site_id"
},
"data": [
{
"equipment_sub_class": "Reciprocating",
"manufacturer_make": "GE",
"manufacturer_model": "XYZ-123",
"geometry": "{\"type\": \"Point\",\"coordinates\": [-106.84104739463146, 34.78220541516408]}",
...
"children": [
{
"equipment_sub_class": "Reciprocating",
"manufacturer_make": "GE",
...
}
]
}
]
}Parameters:
owner_name: operator name of equipment to add (example:N345).site_id(optional): if the site already exists in AERSHED, provide theaershed_iddirectly here.pipeline_id(optional): used to link equipment to a pipeline in the platform, provide theaershed_iddirectly.
You will need to provide either site_id or pipeline_id for the operation to be valid.
Data fields (all fields are required, even if empty!):
| Parameter | Type | Example |
|---|---|---|
| equipment_type | One of EQUIPMENT, EQUIPMENT_GROUP, EQUIPMENT_COMPONENT | EQUIPMENT |
| group_name | string - If this is an equipment group (like a tank battery), it’ll use this as the display name in the map/tables | Tank Battery IS-123 |
| equipment_class | string | Compressor |
| equipment_sub_class | string | Reciprocating |
| manufacturer_make | string | GE |
| manufacturer_model | string | DF-2344 |
| manufacturer_serial_number | string | SN123456 |
| operator_status | string | Retired |
| date_of_installation | date | 2022-10-20 |
| operator_unique_id | string | OP_ID-123D12F |
| other_operator_ids | string | ISD-123,ADB-124 |
| material | string | Steel |
| fuel | string | NGL |
| geometry | string representation of GeoJSON or WKT This accepts a Geometry or GeometryCollection with any type of geometry inside! | {\\"type\\": \\"Point\\",\\"coordinates\\": [-106.84455467396093, 34.78297044770471]} (string-encoded!)POINT (-106.84455467396093 34.78297044770471 |
| geometry_source | One of UNKNOWN, BRIDGER, OPERATOR_PROVIDED, DRAWN_BY_AERSCAPE, SCRAPED_FROM_PUBLIC_DATA, GROUND_SURVEY | GROUND_SURVEY |
| start_date | date | 2022-10-12 |
| end_date | date | 2022-10-12 |
| change_transactions | List of objects (any valid JSON object is accepted) | [{}, {}][{”date”: “2020-10-12”, “operation”: “import from operator DB”}] |
| equipment_data_source | string | “Operator GIS System” |
| children | A list of equipment objects containing all parameters described here. You can nest as many levels of equipment as needed. | [{<EQUIPMENT_CHILD_1_DATA>}, {<EQUIPMENT_CHILD_2_DATA>}] |
| Any other fields | string (will be stored inside extra_data) |
UPDATE_EQUIPMENT
Similar to the previous operation, but with the goal updating data for already existing equipment.
Operation structure:
{
"operation": "UPDATE_EQUIPMENT",
"params": {},
"data": [
...
],
}Data fields:
| Parameter | Type | Example |
|---|---|---|
| id | string - ID of equipment already in the database | 12345678-1234-5678-1234-567812345678 |
| owner | non-editable (don’t send or send blank) | |
| pipeline | non-editable (don’t send or send blank) | |
| site | non-editable (don’t send or send blank) | |
| All other properties | Same as the the UPDATE_EQUIPMENT operation | See previous operation table. |
Only send the fields you want to modify (empty fields will be changed to empty values if provided!).
UPDATE_EQUIPMENT_RELATIONSHIPS
Updates equipment relationships for existing equipment.
Example: Considering equipment_a and equipment_b, as well as equipment_group_1, it allows us to set the hierarchical relationship between those:
- equipment_group_1
- equipment_a
- equipment_b
Operation structure:
{
"operation": "UPDATE_EQUIPMENT_RELATIONSHIPS",
"params": {},
"data": [
{ "equipment_id": "AERSHED_ID", "new_parent": "AERSHED_ID_OF_ANOTHER_EQUIPMENT"},
{ "equipment_id": "AERSHED_ID_2", "new_parent": null },
]
}Parameters: None.
Data: An array of equipment change operations:
| Parameter | Type | Example |
|---|---|---|
| equipment_id | string - ID of equipment already in the database | 12345678-1234-5678-1234-567812345678 |
| new_parent | string or null - ID of equipment already in the database, cannot be the same as equipment id | 12345678-1234-5678-1234-567812345699 |
Error Conditions:
- Fails if any equipment ID in the data array is invalid
- Fails if the equipments to be linked have different owners
- Fails if the equipments to be linked have different sites
- Fails if a equipment is linked to itself
- Fails if an equipment is assigned a parent twice in the same operation
Effects:
When this operation runs successfully:
- The
parentfield is updated and the relationship is set.
The effects of this are visible in the sidebar of the map and in the site page, where the hierarchy of equipment for each site is displayed.