Column operations
Operations that modify the columns/blocks within a block model
Start a block model data update
Block Model API
Starts the workflow to update the latest version of the block model. On workflow success, a new version of the block model will be created that will contain the changes specified in the request.
When a user wishes to update the blocks of a block model, they need to hit multiple endpoints to complete the workflow. This includes:
- An initial request;
- An upload of data (for
newandupdateoperations); - And finally, a confirmation that the update job can proceed from the state
PENDING_UPLOADtoQUEUED.
This endpoint is the initial request, where the server does a sanity check/validation on what the client is attempting to do.
With regards to the request body,
- We require the
columnsfield to be supplied, which is used to convey which operations the client wishes the service to perform on the block model during the update. The sub-fields of columns (or operations)new,update,rename,update_metadata, anddeletespecify the downstream behaviour on the specified columns during the update workflow. Note thatnew,update, anddeletecan be provided in concert, whilstrenamecan only be provided by itself.update_metadatacan be provided along withnew,update, anddelete, but only when there are no columns being renamed (i.e. when only the unit ID is being updated). Some general rules/mechanics for all of these fields:- The reserved system columns [
i,j,k,sidx,x,y,z,dx,dy,dz,version_id] and any other model type specific sub-block index columns, cannot be targeted using any of the update operations.- Note for Datamine file imports, this restriction extends to the fields
[IJK, XC, YC, ZC, XINC, YINC, ZINC]. These will be mapped automatically from the file to their BMS equivalents.
- Note for Datamine file imports, this restriction extends to the fields
- Any list of titles provided cannot contain duplicates.
- In all cases, unless specifically stated otherwise, columns that are targeted in one operation cannot be targeted in another.
- The reserved system columns [
- There is an optional field
update_type, which is used to determine which blocks are updated in the block model. The supported update types arereplaceandmerge.- If
update_typeis set toreplace, the values of the columns provided in the update file are updated for all blocks within the block model. If a block is not provided in the update file, the column values for that block are set tonull. The columns not provided in the update file are not affected. - If
update_typeis set tomerge(the default), only the blocks and columns that are provided in the update file are updated. The blocks and columns not provided in the update file are not affected.
- If
- Note that the optional field
geometry_changecan only be provided for sub-blocked models.- If
geometry_changeis set tofalse, no new sub-blocks can be created nor destroyed, only sub-blocks that exist in the latest version can be updated. - If
geometry_changeis set totrue, new sub-blocks can be created and/or existing sub-blocks can be destroyed, but all columns must be provided. Ifupdate_typeis set tomerge, then all sub-blocks within a parent block must be provided.
- If
- For
newandupdateoperations, the details of the data file for upload can be specified using the optionalinput_optionsfield.
If the request is successful, the server then sends back a pollable job_url and an upload_url (if required). The upload_url is where the data associated with a new or update operation should be uploaded to, which can be done with a PUT request. Note that the generated URL contains a SAS token, which is used to authenticate the upload. An upload can be started no later than 30 minutes after the generation of the SAS token.
With regards to the data file to be uploaded,
- The file can either be in Parquet, CSV, or Datamine (.dm) format.
- The file needs to contain either IJK (block index) or XYZ (centroid coordinate) information for each block/row, along with the data for the columns specified in the request body, using the correct data type.
- If both IJK and XYZ columns are supplied in the data file, the service will only make use of the IJK information.
- Datamine is an exception to this rule - for these files, BlockSync only uses the XYZ information and ignores the IJK field.
- The file must include the required system columns, which vary depending on the block model type:
- Regular models: Require
i,j,k(block indices) orx,y,z(centroid coordinates). - Fully sub-blocked models: Require
i,j,k,sidx(sub-block index) orx,y,z,dx,dy,dz(sub-block sizes along each axis). - Octree models: Requirements are the same as fully sub-blocked models.
- Flexible models: Require
i,j,k,start_si,start_sj,start_sk,end_si,end_sj,end_sk(sub-block grid indices) orx,y,z,dx,dy,dz.
- Regular models: Require
- Reserved system columns must use the correct data types:
- Indices
i,j,k, andsidxmust beUInt32. - Coordinates
x,y,z,dx,dy, anddzmust beFloat64. - Sub-block grid indices
start_si,start_sj,start_sk,end_si,end_sj,end_skmust beUInt8.
- Indices
A minimum workspace role of Editor is required to use this endpoint.
Parameters
{
"columns": {
"delete": [
"string"
],
"new": [
{
"data_type": "Boolean",
"title": "string",
"unit_id": "string"
}
],
"rename": [
{
"new_title": "string",
"title": "string"
}
],
"update": [
"string"
],
"update_metadata": [
{
"title": "string",
"values": {
"title": "string",
"unit_id": "string"
}
}
]
},
"comment": "string",
"fill_subblocks": true,
"geometry_change": true,
"input_options": {
"column_name_mapping": [
{
"column_title": "string",
"file_column_name": "string"
}
],
"file_format": "parquet"
},
"lineage": {
"events": [
{
"eventTime": "string",
"eventType": "string",
"inputs": [
{
"facets": {
"additionalProp1": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp2": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp3": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
}
},
"inputFacets": {
"additionalProp1": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp2": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp3": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
}
},
"name": "string",
"namespace": "string"
}
],
"job": {
"facets": {
"additionalProp1": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp2": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp3": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
}
},
"name": "string",
"namespace": "string"
},
"outputs": [
{
"facets": {
"additionalProp1": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp2": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp3": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
}
},
"name": "string",
"namespace": "string",
"outputFacets": {
"additionalProp1": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp2": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp3": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
}
}
}
],
"producer": "string",
"run": {
"facets": {
"additionalProp1": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp2": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp3": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
}
},
"runId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"schemaURL": "string"
}
],
"self_link": "string"
},
"update_type": "merge"
}
Returns
202
Successful Response
Endpoint
Request
curl -X PATCH 'https://{service_host}/blockmodel/orgs/{org_id}/workspaces/{workspace_id}/block-models/{bm_id}/blocks' \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
Response
{
"changes": {
"base_version_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"bbox": {
"i_minmax": {
"max": 0,
"min": 0
},
"j_minmax": {
"max": 0,
"min": 0
},
"k_minmax": {
"max": 0,
"min": 0
}
},
"columns": {
"delete": [
"string"
],
"new": [
{
"col_id": "string",
"data_type": "Boolean",
"title": "string",
"unit_id": "string"
}
],
"rename": [
{
"col_id": "string",
"new_title": "string"
}
],
"update": [
"string"
],
"update_metadata": [
{
"col_id": "string",
"values": {
"title": "string",
"unit_id": "string"
}
}
]
},
"comment": "string",
"fill_subblocks": true,
"geometry_change": true,
"lineage": {
"events": [
{
"eventTime": "string",
"eventType": "string",
"inputs": [
{
"facets": {
"additionalProp1": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp2": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp3": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
}
},
"inputFacets": {
"additionalProp1": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp2": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp3": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
}
},
"name": "string",
"namespace": "string"
}
],
"job": {
"facets": {
"additionalProp1": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp2": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp3": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
}
},
"name": "string",
"namespace": "string"
},
"outputs": [
{
"facets": {
"additionalProp1": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp2": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp3": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
}
},
"name": "string",
"namespace": "string",
"outputFacets": {
"additionalProp1": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp2": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp3": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
}
}
}
],
"producer": "string",
"run": {
"facets": {
"additionalProp1": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp2": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
},
"additionalProp3": {
"additionalProp1": "string",
"additionalProp2": "number",
"additionalProp3": "boolean"
}
},
"runId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"schemaURL": "string"
}
],
"self_link": "string"
},
"update_type": "merge"
},
"job_url": "https://example.com",
"job_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"upload_url": "https://example.com",
"version_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
Advise that the update file has finished uploading
Block Model API
Signals that you have finished uploading the update file to the server blob storage indicated by the upload_url, and that the update can continue. This moves the job_status from PENDING_UPLOAD to QUEUED.
After this endpoint is called, the job_url should then be polled with a GET request to wait for the job_status field of the job to become either FAILED or COMPLETE. On workflow success, a new version of the block model will be created that will contain the changes specified in the update request.
Note that this endpoint still needs to be hit even when an update does not require a file upload.
A minimum workspace role of Editor is required to use this endpoint.
Parameters
Returns
201
Successful Response
Endpoint
Request
curl -X POST 'https://{service_host}/blockmodel/orgs/{org_id}/workspaces/{workspace_id}/block-models/{bm_id}/jobs/{job_id}/uploaded' \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
Response
{
"job_url": "https://example.com"
}