REST API  17
REST API for Luna Network HSMs
PUT /api/lunasa/hsms/{hsmid}/partitions/{partitionid}

PUT /api/lunasa/hsms/{hsmid}/partitions/{partitionid}

Initializes the partition.

User Privileges

Users with the following role privileges can perform this command:

  • admin
  • operator

Parameters

hsmid

The serial number of the HSM of interest..

Use: Required

JSON Schema:

   Object
   type: integer
   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

label

A user-friendly text string to reference the partition after it is created. The label of the partition will be same as of partition name when no label is provided during partition initialization.

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 32
   pattern: ^[a-zA-Z0-9_ !@#$%^*()=+[]{}/:',.~-]*$

domain

The cloning domain name associated with password-based partitions (not applicable for PED-based partitions).

Use: Required for password-based HSM and optional for PED-based HSM.

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 128
   pattern: ^[^ &|<>`;"\][a-zA-Z0-9_ !@#$%^*=+[]{}()/:',.~?-]+$

password

The password for password-based partitions (not applicable for PED-based partitions).

Use: Required for password-based HSM and optional for PED-based HSM.

JSON Schema:

   Object
   type: string
   format: password
   minLength: 8
   maxLength: 255
   pattern: ^([a-zA-Z0-9_!#$%'()*+,./:=? @[]^{}~-]*)$

pptFile

Specifies the filename for a template file use to initialize the partition. The filename should be either of '.txt' or '.ppt' format.

Use: Not Required

JSON Schema:

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

ped

The identifier of the PED connected to the HSM. '0' is local PED; 1 is remote PED. For remote PED, ped corresponds to the PED identifier. The parameter has no use for password-based HSMs.

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 1
   pattern: ^(?:$|0|1)$

domainLabel

Label for the partition domain to distinguish among domains when a partition has more than one, and to match with domains on other partitions.

Use: Not Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 32
   pattern: ^[a-zA-Z0-9_ $^*()+{}[].'/~!@#%=:,-]+$

Note:

  • If you want to add domain without label, either ignore the parameter or pass empty string.

Responses

204

Partition initialized successfully.

Location

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

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


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

400

FRAMEWORK_BAD_REQUEST

Returned when the input data does not conform to the required validation schema.

HSMPLUGIN_INVALID_FILENAME

The specified filename is invalid or contains system reserved name.

404

HSMPLUGIN_INVALID_HSM

The HSM specified does not exist.

HSMPLUGIN_INVALID_PARTITION

The partition specified does not exist.

SERVERPLUGIN_FILEID_DOES_NOT_EXIST

Non-existent file name specified.

Example Request for password based HSM with all the parameters

   PUT
   https://1.2.3.4:8443/api/lunasa/hsms/154704/partitions/273087011507
   {
      "password": "password",
      "label": "ABC123",
      "domain": "domain",
      "domainLabel": "testLabel",
      "pptFile": "sample_ppt_file.ppt"
   }

Example Request for password based HSM with only mandatory parameters

   PUT
   https://1.2.3.4:8443/api/lunasa/hsms/154704/partitions/273087011507
   {
      "password": "password",
      "domain": "domain"
   }

Example Request for PED based HSM with all the parameters

   PUT
   https://1.2.3.4:8443/api/lunasa/hsms/154704/partitions/273087011507
   {
      "label": "ABC123",
      "domainLabel": "testLabel",
      "pptFile": "sample_ppt_file.ppt",
      "ped": "0"
   }

Example Request for PED based HSM with only mandatory parameters

   PUT
   https://1.2.3.4:8443/api/lunasa/hsms/154704/partitions/273087011507
   {
   }

Example Result

{
password-based partition:
{'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json', 'Location': '/api/lunasa/hsms/154704/partitions/273087011507', 'Content-Length': '2', 'Access-Control-Allow-Credentials': 'true'}

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