REST API  17
REST API for Luna Network HSMs
POST /api/lunasa/config/backups/{backupid}/actions/{actionid}

POST /api/lunasa/config/backups/{backupid}/actions/{actionid}

This resource will perform specified action on a backup file stored in local file system.

User Privileges

Users with the following role privileges can perform this command:

  • admin

Parameters

backupid

Specifies the id of the backup file.

Use: Required

JSON Schema:

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

actionid

Specifies the action.
Valid values :

  • restore
    1. Restores the configuration of the selected service(s) from a backup file.
    2. The service(s) must be stopped before restoring their configuration.
    3. It does NOT restore the HSM and Partition configurations.
    4. You must reboot the appliance for the changes to take effect.
    5. Please check the new configurations BEFORE rebooting or restarting the services.
    6. It automatically creates a backup file of the current configurations before restoring a previous configuration. You can restore the previous configurations if the new settings are not acceptable.

Use: Required

JSON Schema:

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

service

Specifies the name of the service.
Valid values: network,ssh,ntls,syslog,ntp,snmp,users,system,webserver,cluster,ismigration,ctc,all.

Note:

If the service being restored is 'webserver'(or if 'all'), the webserver service is restarted on it own. Hence, a new session must be intiated for further communication.

Use: Required

JSON Schema:

    Object
    type:string
    minLength: 3
    maxLength: 12
    pattern: ^(network|ssh|ntls|syslog|ntp|snmp|users|system|webserver|ctc|all|cluster|ismigration)$

Responses

204

Success

400

FRAMEWORK_BAD_REQUEST

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

400

SYSCONF_CONFIG_SERVICE_NAME_INVALID

Specified service name is invalid.

400

SYSCONF_CONFIG_FILE_NAME_MISSING

Missing backup file name.

400

SYSCONF_CONFIG_VERSION_NOT_SUPPORTED

Backup file version cannot be restored in the current version.

400

SYSCONF_CONFIG_BACKUP_FILE_NOT_COMPLETE

Provided backup file is not complete.

400

SYSCONF_CONFIG_BACKUP_FILE_NOT_COMPATIBLE

Provided backup file is not compatible for the service specified.Please use a backup file for the same service being restored or a backup file with all services.

400

SYSCONF_CONFIG_NTLS_SERVICE_RUNNING

NTLS must be stopped before requesting this resource.

409

SYSCONF_CONFIG_NTP_SERVICE_RUNNING

NTP must be stopped before requesting this resource.

400

SYSCONF_CONFIG_SSH_SERVICE_RUNNING

SSH must be stopped before requesting this resource.

400

SYSCONF_CONFIG_SNMP_SERVICE_RUNNING

SNMP must be stopped before requesting this resource.

400

SYSCONF_CONFIG_FAILED_TO_RESTORE

Failed to restore the configuration from specified backup file.

403

FRAMEWORK_CRITICAL_OPERATION_RUNNING

Critical Operation currently in Progress.

404

SYSCONF_CONFIG_BACKUP_NOT_FOUND

Specified backup does not exist.

Example Request

To restore the backup file

    POST
    https://1.2.3.4:8443/api/lunasa/config/backups/{backupid}/actions/restore
    {
        "service": "all"
    }

Example Response

    {
    }