HTTP 404 error "Object not found" returned from a switch that supports multiple REST API versions (10.04)

Symptom

A switch that supports multiple REST API versions returns response code 404 and the response body contains the following text string:

Object not found

Cause

The resource does not exist in the system. The URI in the request is incorrect for the version of the REST API specified in the request.

Action
Verify the URI of the resource and retry the request.

The schema for resources accessed through the REST v10.04 API can differ from the schema for the resources accessed through the REST v1 API.

For example a REST request with to the following URI fails because the ports collection does not exist in the REST v10.04 API:

/rest/v10.04/system/ports/lag50

The correct URI for the lag50 resource in the REST v10.04 API is the following:

/rest/v10.04/system/interfaces/lag50