REST API  14
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

partitionid

The identifier of the partition of interest

Use: Required

JSON Schema:

   Object
   type: integer

label

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

domain

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

Use: Required

JSON Schema:

   Object
   type: string

password

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

Use: Required

JSON Schema:

   Object
   type: string

defaultDomain

Use a default cloning domain if password-based partition (not applicable for PED-based partitions)

Use: Required

JSON Schema:

   Object
   type: boolean
         false = do not use a default cloning domain
         true = use a default cloning domain

ped

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

Use: Required

JSON Schema:

   Object
   type: string

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

Note:

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

Responses

204

Success

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

Unexpected error

404

HSM or partition does not exist.

Example Request

   PUT
   https://1.2.3.4:8443/api/lunasa/hsms/154704/partitions/273087011507
   {
      "password": "password",
      "label": "ABC123",
      "domain": "domain",
      "defaultDomain": true,
      "domainLabel": "testLabel",
      "ped": "0"
   }

Example Request if wants to initialize partition without domainLabel

   PUT
   https://1.2.3.4:8443/api/lunasa/hsms/154704/partitions/273087011507
   {
      "password": "password",
      "label": "ABC123",
      "domain": "domain",
      "defaultDomain": true,
      "domainLabel": "",
      "ped": "0"
   }

Example Request if wants to initialize partition without domainLabel

   PUT
   https://1.2.3.4:8443/api/lunasa/hsms/154704/partitions/273087011507
   {
     "password": "password",
     "label": "ABC123",
     "domain": "domain",
     "defaultDomain": true,
    "domainLabel": "",
     "ped": "0"
   }

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

{}