REST API

The service has two HTTP POST endpoints - Request and Handle.

The swagger UI provided by the

Request

Use this endpoint to send requests to the service.

Property

Type

Description

source_url

string

The USD stage to process, or a folder containing usd files.

destination_url

string

The location to write the optimized stage. It can be a fully specified path or a relative filename scheme. If only a scheme is specified it will be placed in the same directory as the source.

It can contain special tokens from the source URL, these include {stem} (source filename without extension) and {suffix} (file extension including ‘.’). For example, given a source_url of file:://foo/bar.usd if you want to save bar.optimized.usd in the same folder then you would specify {stem}.optimized{suffix}. Default behavior is to export a flattened result (see export below). To overwrite the source and any modified layers in place (with checkpoints) then specify this destination_url to resolve the same as the source e.g. {stem}{suffix}. For this special case the export flag is ignored.

recurse

boolean

If a folder is provided as a source, process all files in the folder.

command

string

Application or command to be executed by the job.

config_url

string

Url of the scene optimizer JSON config that describes the optimization stack of processes to run. It can also contain tokens from the source_url, for example if you are processing file:://foo/bar.usd and wish to use a sidecar config bar.json you could configure as {stem}.json.

export

boolean

If true (default), export the optimized result as a flattened stage. Otherwise, perform a regular save_as. This flag is ignored if the source_url and destination_url resolve to the same location, in which case the source and its referenced layers will be overwritten (with checkpoints if supported).

sync

boolean

If true, process the request immediately and don’t return until it is complete. Otherwise, add the job to the internal work queue (default).

Response

Property

Type

Description

status

string

Response message. Whether the request was computed successfully.

Handle

Handle for events from the Nucleus Transport service.

Property

Type

Description

status

str

Status, OK if this is a specific event, otherwise an indicator of the state of the connection or interaction

ts

dict

A dictionary of timestamps

event

str

Event type, e.g. full, create, delete, rename, copy, etc.

entry

dict

Data about the event including path, branch, timestamps, etc (see below).

Example of “entry” dict as provided by Nucleus transport service.
{
  "status": "OK",
  "ts": {
    "omni_server_out_ts": 1669143047098863
  },
  "entries": [
    {
      "path": "/example.usda",
      "branch": "default",
      "etag": "80673",
      "acl": [
        "read"
      ],
      "created_timestamp": 1661213560,
      "modified_timestamp": 1661213560,
      "path_type": "asset",
      "size": 2383,
      "empty": true,
      "mounted": false,
      "created_by": "user",
      "modified_by": "user",
      "hash_type": "sha-256-flat",
      "hash_value": "939af80fb68fff443d4270c481b2d58578a4ccc211e137e675b5e174f86e76dd",
      "hash_bsize": 1048576,
      "checkpointed": true,
      "transaction_id": 68808,
      "checkpoint_count": 1
    }
  ]
}