Skip to content

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:

json
{
    "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 the aershed_id directly here.
  • pipeline_id (optional): used to link equipment to a pipeline in the platform, provide the aershed_id directly.

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!):

ParameterTypeExample
equipment_typeOne of EQUIPMENT, EQUIPMENT_GROUP, EQUIPMENT_COMPONENTEQUIPMENT
group_namestring - If this is an equipment group (like a tank battery), it’ll use this as the display name in the map/tablesTank Battery IS-123
equipment_classstringCompressor
equipment_sub_classstringReciprocating
manufacturer_makestringGE
manufacturer_modelstringDF-2344
manufacturer_serial_numberstringSN123456
operator_statusstringRetired
date_of_installationdate2022-10-20
operator_unique_idstringOP_ID-123D12F
other_operator_idsstringISD-123,ADB-124
materialstringSteel
fuelstringNGL
geometrystring 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_sourceOne of UNKNOWN, BRIDGER, OPERATOR_PROVIDED, DRAWN_BY_AERSCAPE, SCRAPED_FROM_PUBLIC_DATA, GROUND_SURVEYGROUND_SURVEY
start_datedate2022-10-12
end_datedate2022-10-12
change_transactionsList of objects (any valid JSON object is accepted)[{}, {}][{”date”: “2020-10-12”, “operation”: “import from operator DB”}]
equipment_data_sourcestring“Operator GIS System”
childrenA 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 fieldsstring (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:

json
{
    "operation": "UPDATE_EQUIPMENT",
    "params": {},
    "data": [
        ...
    ],
}

Data fields:

ParameterTypeExample
idstring - ID of equipment already in the database12345678-1234-5678-1234-567812345678
ownernon-editable (don’t send or send blank)
pipelinenon-editable (don’t send or send blank)
sitenon-editable (don’t send or send blank)
All other propertiesSame as the the UPDATE_EQUIPMENT operationSee 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:

json
{
    "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:

ParameterTypeExample
equipment_idstring - ID of equipment already in the database12345678-1234-5678-1234-567812345678
new_parentstring or null - ID of equipment already in the database, cannot be the same as equipment id12345678-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:

  1. The parent field 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.