![]() |
REST API
17
REST API for Luna Network HSMs
|
Initializes a specific HSM.
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 format: int64 minimum: 1 maximum: 9999999999
Indicator of whether HSM is local PED (0) or remote PED (> 0): not applicable for password-based HSMs. Optional in case of Password based HSM.
Use: Not Required
JSON Schema:
Object type: string minLength: 1 maxLength: 1 pattern: ^(?:$|0|1)$
The Security Officer password if password-based HSM. Optional in case of PED based HSM.
Use: Not Required
JSON Schema:
Object
type: string
format: password
minLength: 8
maxLength: 255
pattern: ^([a-zA-Z0-9_!#$%'()*+,./:=? @[]^{}~-]*)$
The cloning domain if password-based HSM. Optional in case of PED based HSM.
Use: Not Required
JSON Schema:
Object
type: string
minLength: 1
maxLength: 128
pattern: ^[^ &|<>`;"\][a-zA-Z0-9_ !@#$%^*=+[]{}()/:',.~?-]+$
The user-friendly name to identify the HSM.
Use: Required
JSON Schema:
Object type: string minLength: 1 maxLength: 32 pattern: ^[a-zA-Z0-9_]*$
Optional for both of Password and PED based HSM with default value "false". Only applicable for password-based HSM.
Use: Not Required
JSON Schema:
Object type: boolean
Specifies the filename for a template file use to initialize the HSM. The filename should be either of '.txt' or '.ppt' format.
Use: Not Required
JSON Schema:
Object type: string minLength: 1 maxLength: 64 pattern: ^([a-zA-Z0-9_-]|[a-zA-Z0-9_.-][a-zA-Z0-9_. -]*[a-zA-Z0-9_.-])$
Successful.
"Location" is the URL to the HSM instance and is returned in the server response. You can use "Location" to form a GET resource to query the HSM instance.
see GET /api/lunasa/hsms/{hsmid}
For PED-based HSMs, "Location" is the URL to the task spawned to initialize the HSM.
Returned when the input data does not conform to the required validation schema.
The specified filename is invalid or contains system reserved name.
Policy template file provided is not valid.
The hsm specified does not exist.
Non-existent file name specified.
Unexpected error.
PUT
https://1.2.3.4:8443/api/lunasa/hsms/154704
{
"label": "myPasswordHsm",
"ped": "0"
}
PUT
https://1.2.3.4:8443/api/lunasa/hsms/154704
{
"ped": "1",
"label": "myPEDHSM",
"pptFile": "template.txt"
}
PUT
https://1.2.3.4:8443/api/lunasa/hsms/151256
{
"label": "myPasswordHSM",
"password": "myPassword",
"defaultDomain": false,
"domain": "myDomain"
}
PUT
https://1.2.3.4:8443/api/lunasa/hsms/151256
{
"label": "myPasswordHSM",
"password": "myPassword",
"defaultDomain": false,
"domain": "myDomain",
"pptFile": "template.txt"
}
{
password-based HSM:
{'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json', 'Location': '/api/lunasa/hsms/151256', 'Content-Length': '2', 'Access-Control-Allow-Credentials': 'true'}
PED-based HSM
{'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json', 'Location': '/tasks/2', 'Content-Length': '712', 'Access-Control-Allow-Credentials': 'true'}
}
Note: