REST API  17
REST API for Luna Network HSMs
POST /api/lunasa/hsms/{hsmid}/partitions/{partitionid}/object/actions/{actionid}

POST /api/lunasa/hsms/{hsmid}/partitions/{partitionid}/object/actions/{actionid}

Performs the partition object action.

Parameters

hsmid

The serial number of the HSM of interest.

Use: Required

JSON Schema:

   Object
   type: integer
   format: int64
   minimum: 1
   maximum: 9999999999

partitionid

The identifier of the partition of interest

Use: Required

JSON Schema:

   Object
   type: integer
   format: int64
   minimum: 1000000
   maximum: 99999999999999999

actionid

The identifier of the action to be performed.

Use: Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 32
   pattern: ^[a-zA-Z0-9_.-]*$

See Partition Object Actions

name

The reference to be assigned to a backup device

Use: Required

JSON Schema:

   Object
   type: string

ids

A list of object identifiers to be backed up or restored

Use: Required

JSON Schema:

Array
    id: Object
        type: string
        description:  id is a reference to an object.
                      A null list ([]) means backup or restore all objects.

Responses

200

Success, response returned

JSON Schema:

    Response returned is specific to the object action performed.

204

Success, no response returned

Location

"Location" is the URL to the task spawned to perform the requested action on the partition object.

400

Unexpected error

404

HSM, partition, or action does not exist.

Example Requests

   POST
   https://1.2.3.4:8443/api/lunasa/hsms/154704/partitions/273087011507/object/actions/backup
   {"ids":["31","22","35","36"], "name":"targetBackupName"}

   POST
   https://1.2.3.4:8443/api/lunasa/hsms/154704/partitions/273087011507/object/actions/restore
   {"ids":["0","1","2"]}

Example Result

{'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json', 'Location': '/tasks/13', 'Content-Length': '712', 'Access-Control-Allow-Credentials': 'true'}

{}

In this example, do GET on '/tasks/13/response' to get the results of the task, assuming the action was 'restore':

{
    "ids": [
        "19",
        "23",
        "24"
    ]
}

Notes

The 'restore' action returns the new object handles.