REST API  15
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
   minValue: 1
   maxValue: 9999999999

partitionid

The identifier of the partition of interest.

Use: Required

JSON Schema:

   Object
   type: integer
   minValue: 1000000
   maxValue: 9999999999999999

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
      characterSet: abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789!@#$%^*()-_=+{}[]:,.'/~ and space(spaces at the start or end will be ignored)
      pattern: ^([a-zA-Z0-9!@#$%^*()-_=+{}[]:,.'/~][a-zA-Z0-9 !@#$%^*()-_=+{}[]:,.'/~]*[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
   chracterSet: abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789!@#$%^*()-_=+[]{}/:',.~ and space
   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
   minLength: 8
   maxLength: 255
   characterSet: abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789!@#$%^*()-_=+{}[]:,.'/~ and space
   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: 64
   CharacterSet: abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.- and space
   pattern: [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
   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
   characterSet: abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()_+`-={}|[]\:";'<>?,./ and space
   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

Failed to execute due to malformed request.

400

SERVERPLUGIN_INTERNAL_ERROR

An internal error has occurred.

404

HSMPLUGIN_INVALID_HSM

The HSM specified does not exist.

404

HSMPLUGIN_INVALID_PARTITION

The partition specified does not exist.

404

SERVERPLUGIN_FILEID_DOES_NOT_EXIST

Non-existent file name specified.

400

HSMPLUGIN_INVALID_FILENAME

The specified filename is invalid or contains system reserved name.

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'}
}