3DM Publisher Admin API - Resource Management
This page describes the resource management API's for 3DM Publisher.
Please familiarize yourself with the basics first before continuing.
Table of Contents
Model: Resource
A Resource models a physical resource, or an abstract resource with children (a resource group).
Properties:
| Property | Required | Type | Description |
|---|---|---|---|
| id | * | number | Unique identifier. |
| name | * | string | User-friendly name of the resource. |
| description | string | Description of the resource. | |
| file | * | string | File system path to the main file of the resource. |
| type | * | string | Type of the resource (usually the file extension). |
| thumbnail_image | string | The resource thumbnail. | |
| tags | string | Tags of the resource, serialized to a string. | |
| is_basemap | number | Is the resource a basemap? (1 is true, 0 is false) | |
| is_dem | number | Is the resource a DEM/Terrain? (1 is true, 0 is false) | |
| is_lref | number | Is the resource a Linear Reference? (1 is true, 0 is false) | |
| resource_metadata | Array<ResourceMetadata> | Metadata of the resource. | |
| resource_link | Array<ResourceLink> | Links to child resources. | |
| created_at | string (ISO 8601) | Date of creation of the resource. | |
| modified_at | string (ISO 8601) | Date of last modification of the resource. | |
| refreshed_at | string (ISO 8601) | Date of last reload of the resource. |
Resource Type is defined by:
- Resource Type (resource
typeproperty) - Resource Content Type (resource
content_typemetadata field)
The most-used Resource Types:
| Resource | Resource Type | Resource Content Type |
|---|---|---|
| Vector Data (ovf) | ovf | - |
| Vector Data (ovt) | ovt | - |
| Vector Data (odb) | odb | - |
| Image (omi) | omi | - |
| Image (otm) | otm | - |
| Point cloud (opc) | opc | - |
| Point cloud (3dtiles) | 3dtiles | pointcloud |
| Mapping Resource (mobile) | omr | - |
| Mapping Resource (oblique) | omr | oblique |
| Mapping Resource (aerial) | omr | uas |
| … |
Possible values for Resource status:
ready- File is ready for use.missing- File was not found on the filesystem.
Properties ending on _image are Base64-encoded JPEG images on create, but will be URL's to the image cache on retrieval.
Model: Resource Group
A Resource Group is also just a Resource object.
It has the following defining characteristics:
- Resource
fileset tofile.omp(for Mapping Resource) orfile.ogp(for all other types). - Resource
typeset toomp(for Mapping Resource) orogp(for all other types). - Resource
group_child_typemetadata field set to the child resource type - Resource
group_child_content_typemetadata field set to the child resource content_type
The Resource Group Type is defined by the group_child_type and group_child_content_type metadata fields.
Model: ResourceMetadata
| Property | Type | Description |
|---|---|---|
| name | string | Name of this metadata field. |
| value | string | Value of the metadata field. |
Model: ResourceLink
| Property | Type | Description |
|---|---|---|
| child_resource | Resource | Reference to the child resource (only the id field is required). |
Operation: List Resources
Discussion
This operation retrieves all resources and resource groups.
Fields: see Model: Resource
Request
GET /api/3/resource
Response (http 200)
[ { "id": 14, "name": "BE Project", "storage_space": { "id": 1 }, "file": "D:/Data/Run/orbit_mm_run.omr", "type": "omr", "num_bytes": 110, "created_at": "2022-01-03 10:00:32", "modified_at": "2023-04-25 07:21:19", "refreshed_at": "2023-04-25 07:21:19", "status": "ready", "tags": "[]", "is_basemap": 0, "is_dem": 0, "is_lref": 0, "resource_metadata": [ { "name": "panorama_timestamp", "value": "false" }, { "name": "pointcloud_intensity", "value": "false" }, { "name": "dtm_available", "value": "false" }, { "name": "planar_timestamp", "value": "false" }, { "name": "pointcloud_timestamp", "value": "false" }, { "name": "trajectory_timestamp", "value": "false" }, { "name": "pointcloud_rgb", "value": "false" }, { "name": "ortho_available", "value": "false" }, { "name": "mesh_available", "value": "false" } ] }, ... ]
Operation: Create Resource
Discussion
- After creation, a resource is also reloaded.
Fields: see Model: Resource
Request
POST /api/3/resource
{ "name": "test", "file": "test" }
Response (http 200)
{ "id": 199, "name": "test", "storage_space": { "id": 1 }, "file": "test", "type": "", "created_at": "2024-11-27 09:29:37", "modified_at": "2024-11-27 09:29:37", "refreshed_at": "2024-11-27 09:29:37", "status": "missing", "tags": "[]", "is_basemap": 0, "is_dem": 0, "is_lref": 0 }
Operation: Update Resource
Discussion
- After creation, a resource is also reloaded.
The following fields can be updated:
- name
- file
- type
- description
- tags
- is_basemap
- is_dem
- is_lref
- thumbnail_image
- resource_link
- resource_metadata
Fields: see Model: Resource
Request
POST /api/3/resource/151
{ "name": "BEGE MM06 test" }
Response (http 204)
No content
Operation: Delete Resource
Discussion
When deleting a resource, it is also removed from all resource groups and publications.
Request
DELETE /api/3/resource/151
Response (http 204)
No content
Response (http 404)
{ "code": "not_found", "message": "Resource with id '151' was not found." }
Operation: Create Resource Group
Discussion
Creating a resource group is similar to creating a Resource.
To create a resource group, you need to specify the correct properties. See Model: Resource Group for more information on these requirements.
- After creation, a resource group is also reloaded.
- The
Resource Typeof child resources that are added, must match theResource Group Type.
Fields: Model: Resource
Request
POST /api/3/resource
{ "name": "Test", "file": "file.omp", "type": "omp", "tags": "[]", "resource_metadata": [ { "name": "collection_start", "value": "2024-11-27" }, { "name": "collection_stop", "value": "2024-11-28" }, { "name": "group_child_type", "value": "omr" }, { "name": "group_child_content_type", "value": "oblique" } ], "resource_link": [ { "child_resource": { "id": 15 } }, { "child_resource": { "id": 157 } } ] }
Response (http 200)
{ "id": 200, "name": "Test", "storage_space": { "id": 1 }, "file": "file.omp", "type": "omp", "created_at": "2024-11-27 09:32:57", "modified_at": "2024-11-27 09:32:57", "refreshed_at": "2024-11-27 09:32:57", "status": "ready", "tags": "[]", "is_basemap": 0, "is_dem": 0, "is_lref": 0, "is_wfs": 0, "is_wms": 0, "resource_metadata": [ { "name": "group_child_type", "value": "omr" }, { "name": "collection_stop", "value": "2024-11-28" }, { "name": "group_child_content_type", "value": "" }, { "name": "collection_start", "value": "2024-11-27" } ] }
Operation: Update Resource Group
Discussion
Updating a resource group is the same as Operation: Update Resource so all the same fields can be updated.
Specific to a Resource Group are :
- Child resources are set by specifying the resource_link property.
Resource Group Typeis set by updating specific properties and metadata types as described in Model: Resource Group.- Child resources must have a
Resource Typethat matches theResource Group Type.
Fields: Model: Resource
Fields: Model: Resource Group
Fields: Model: Resource Link
Request
POST /api/3/resource/123
{ "resource_link": [ { "child_resource": { "id": 15 } }, { "child_resource": { "id": 157 } } ] }
Response (http 204)
No content
Operation: Delete Resource Group
Discussion
Deleting a resource group is the same as Operation: Delete Resource.
Operation: Resource Reload
Discussion
This operation will check if a resource exists on disk and update dynamic fields and metadata.
- For a resource:
- Update
num_bytes - Update
status - Update
resource_metadatafrom the metadata.xml file, when it exists.
- For a resource group:
- Update
resource_metadataby merging metadata of the child resources.
Request
GET /api/3/resource/[resourceId]/refresh
Response (http 204)
No content