REST API
15
REST API for Luna Network HSMs
|
Initializes the partition.
Users with the following role privileges can perform this command:
The serial number of the HSM of interest.
Use: Required
JSON Schema:
Object type: integer minValue: 1 maxValue: 9999999999
The identifier of the partition of interest.
Use: Required
JSON Schema:
Object type: integer minValue: 1000000 maxValue: 9999999999999999
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_!@#$%^*()-_=+{}[]:,.'/~])$
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 !@#$%^*()-_=+{}[]:',./~]*)$
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 !@#$%^*()-_=+{}[]:,.'/~]*)$
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_. -]
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])$
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:
Partition initialized successfully.
"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.
Failed to execute due to malformed request.
An internal error has occurred.
The HSM specified does not exist.
The partition specified does not exist.
Non-existent file name specified.
The specified filename is invalid or contains system reserved name.
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" }
PUT https://1.2.3.4:8443/api/lunasa/hsms/154704/partitions/273087011507 { "password": "password", "domain": "domain" }
PUT https://1.2.3.4:8443/api/lunasa/hsms/154704/partitions/273087011507 { "label": "ABC123", "domainLabel": "testLabel", "pptFile": "sample_ppt_file.ppt", "ped": "0" }
PUT https://1.2.3.4:8443/api/lunasa/hsms/154704/partitions/273087011507 { }
{ 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'} }