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

PATCH /api/lunasa/hsms/{hsmid}/partitions/{partitionid}/roles/{roleid}

Changes the password for a partition role.

Parameters

hsmid

The serial number of the HSM of interest.

Use: Required

JSON Schema:

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

roleid

The identifier of the role of interest

Use: Required

JSON Schema:

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

oldPassword

The current password for the role.

Use: Required

JSON Schema:

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

newPassword

The desired password for the role.

Use: Required

JSON Schema:

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

changeSecret

(Optional) Change the secret for a PED-authenticated partition. This parameter applies for CO (Crypto Officer) and CU (Crypto User) roles.

Use: Required

JSON Schema:

   Object
   type: boolean

changeChallenge

(Optional) Change the challenge for a PED-authenticated partition. This parameter applies for CO (Crypto Officer) and CU (Crypto User) roles.

Use: Required

JSON Schema:

   Object
   type: boolean

Responses

204

Success

202

Task generated for resource

Location

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

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


For PED-based partitions, "Location" is the URL to the task spawned to change the password for the partition role.

400

FRAMEWORK_BAD_REQUEST

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

404

HSM, partition or role does not exist.

Example Request

   PATCH 
   https://1.2.3.4:8443/api/lunasa/hsms/154704/partitions/273087011784/roles/cu
   {
   "oldPassword": "myoldpassword", 
   "newPassword": "mynewpassword"
   }

Example Result

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

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