REST API  14
REST API for Luna Network HSMs
POST /api/lunasa/hsms/{hsmid}/partitions

POST /api/lunasa/hsms/{hsmid}/partitions

Creates a partition.

Parameters

hsmid

The serial number of the HSM of interest

Use: Required

JSON Schema:

   Object
   type: string

name

A user-friendly text string to reference the partition after it is created

Use: Required

JSON Schema:

   Object
      type: string
      pattern: abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789!@#$%^*()-_=+{}[]:,./~ and space
      minLength: 1
      maxLength: 32

allStorageSpace

Indicates whether to create the partition with all available storage space assigned to it. Note that if you set this flag to true the size parameter is ignored. Either the allStorageSpace parameter or the size parameter is required when creating a legacy partition.

Use: Not Required

JSON Schema:

   Object
   type: boolean
         false = do not use all available storage space
         true = assign all remaining, available storage space to the partition

hasPso

Indicates whether to create the partition with a Security Officer

Use: Required

JSON Schema:

   Object
   type: boolean
         false = do not create the partition with a Security Officer
         true = create the partition with a Security Officer

size

The number of bytes of storage space to assign to the partition if allStorageSpace is false Either the allStorageSpace parameter or the size parameter is required when creating a legacy partition.

Use: Not Required

JSON Schema:

   Object
   type: integer

version

The partition version. Options are 0 and 1, defaults to 0.

Use: Not Required

JSON Schema:

   Object
   type: integer

Responses

204

Partition details

JSON Schema: Partition description

Location

"Location" is the URL to the partition and is returned in the server response. You can use "Location" to form a GET resource to obtain the partition.

see GET /api/lunasa/hsms/{hsmid}/partitions/{partitionid}


For PED-based partitions, "Location" is the URL to the task spawned to create the partition.

400

Unexpected error

404

HSM does not exist.

Example Request

   POST
   https://1.2.3.4:8443/api/lunasa/hsms/154704/partitions
   {
      "name": "123",
      "allStorageSpace": false,
      "hasPso": true,
      "size": 324562,
      "version": 1
   }

Example Result

Password-based partition:
{'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json', 'Location': '/api/lunasa/hsms/151256/partitions/352170252337', 'Content-Length': '712', 'Access-Control-Allow-Credentials': 'true'}

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

{
}

GET /api/lunasa/partitionPolicyTemplates/{partitionpolicytemplateid}