Generic Application resources allow protection of custom applications using user-defined action scripts. You provide scripts for bringing the application in-service (restore), taking it out of service (remove), and optionally for health monitoring and local recovery.
Resource Type: gen/app
Aliases: gen
Subcommands
Generic Application resources are managed by commands of the form:
lkcli resource gen/app <subcommand> [flags]
| Subcommand | Description | Required Role |
|---|---|---|
create |
Create a new Generic Application resource | admin |
extend |
Extend to a standby server | admin |
get-property |
Read a resource property | guest |
set-property |
Update an editable resource property | admin |
update-action-script |
Replace an action script file for this resource | admin |
create
lkcli resource gen/app create --restore=<string> --remove=<string> [flags]
| Flag | Short | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|---|
--restore |
— | string | Yes | — | — | Path to the script that brings the resource in-service |
--remove |
— | string | Yes | — | — | Path to the script that takes the resource out of service |
--quickcheck |
— | string | No | — | — | Path to the script that performs quick health checks |
--deepcheck |
— | string | No | — | — | Path to the script that performs deep health checks (Windows only) |
--recover |
— | string | No | — | — | Path to the script that performs local recovery |
--app-info |
— | string | No | — | — | Resource-specific application information string |
--restore-after-create |
— | enum | No | yes |
yes, no |
Whether to bring the resource in-service immediately after creation |
--tag |
— | string | No | Auto-generated | — | Resource tag name |
--switchback |
— | enum | No | INTELLIGENT |
INTELLIGENT, AUTOMATIC |
Switchback type |
--local-recovery |
— | enum | No | enabled |
enabled, disabled |
Enable local recovery (Windows only) |
--quickcheck-interval |
— | int | No | 180 |
min: 0, max: 604800 | Quickcheck interval in seconds (Windows only) |
--deepcheck-interval |
— | int | No | 300 |
min: 0, max: 604800 | Deepcheck interval in seconds (Windows only) |
extend
lkcli resource gen/app extend --primary-sys=<string> --primary-tag=<string> [flags]
| Flag | Short | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|---|
--primary-sys |
— | string | Yes | — | — | Hostname of the server the existing resource is extended from |
--primary-tag |
— | string | Yes | — | — | Tag of the existing resource to extend |
--standby-sys |
— | string | No | Value of --host (defaults to localhost) |
— | Hostname of the standby server |
--switchback |
— | enum | No | INTELLIGENT |
INTELLIGENT, AUTOMATIC |
Switchback type |
--primary-priority |
— | int | No | Defaults to the current priority of the --primary-sys server, or 1 if the resource has not yet been extended |
min: 1, max: 999 | Failover priority for the primary server |
--standby-priority |
— | int | No | Defaults to an unused value which is computed dynamically based on the priority values currently in-use | min: 1, max: 999 | Failover priority for the standby server |
get-property / set-property
lkcli resource gen/app get-property --tag=<string> --property=<string>
lkcli resource gen/app set-property --tag=<string> --property=<string> --value=<string>
| Flag | Short | Type | Required | Description |
|---|---|---|---|---|
--tag |
-t |
string | Yes | Resource tag name |
--property |
-p |
string | Yes | Property name (see Properties table below) |
--value |
-v |
string | Yes (set-property only) |
New property value |
update-action-script
Replaces one of the action scripts associated with this resource. Changes can optionally be propagated to all cluster nodes.
lkcli resource gen/app update-action-script \
--tag=<string> --script-type=<enum> --new-script-path=<string> [flags]
| Flag | Short | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|---|
--tag |
— | string | Yes | — | — | Resource tag name |
--script-type |
— | enum | Yes | — | restore, remove, quickcheck, deepcheck, recover |
The type of action script to replace |
--new-script-path |
— | string | Yes | — | — | Path to the new script file; provide an empty string to disable the script |
--update-cluster |
— | enum | No | yes |
yes, no |
Whether to propagate the update to all cluster nodes |
Properties
| Property | Type | Constraints | Editable | Description |
|---|---|---|---|---|
action-script-stats |
JSON object | — | No | File statistics for the action scripts used by this resource |
kit-name |
string | — | No | Recovery kit name |
local-recovery |
enum | enabled, disabled |
Yes | Enable local recovery (Windows only) |
switchback |
enum | INTELLIGENT, AUTOMATIC |
Yes | Switchback type |
quickcheck-interval |
int | min: 0, max: 604800 | Yes | Quickcheck interval in seconds (Windows only; default: 180) |
deepcheck-interval |
int | min: 0, max: 604800 | Yes | Deepcheck interval in seconds (Windows only; default: 300) |
Example Usage
# Create a Generic Application resource
lkcli resource gen/app create \
--host=server1 \
--restore="C:\myapp\scripts\restore.ps1" \
--remove="C:\myapp\scripts\remove.ps1" \
--quickcheck="C:\myapp\scripts\quickcheck.ps1" \
--recover="C:\myapp\scripts\recover.ps1" \
--app-info="myapp_config" \
--tag=myapp.0
# Extend to server2
lkcli resource gen/app extend \
--primary-sys=server1 \
--primary-tag=myapp.0 \
--standby-sys=server2
# Update the restore script and propagate to all nodes
lkcli resource gen/app update-action-script \
--host=server1 \
--tag=myapp.0 \
--script-type=restore \
--new-script-path="C:\myapp\scripts\restore_v2.ps1" \
--update-cluster=yes
# Disable the deepcheck script
lkcli resource gen/app update-action-script \
--host=server1 \
--tag=myapp.0 \
--script-type=deepcheck \
--new-script-path="" \
--update-cluster=yes
# Read quickcheck-interval property
lkcli resource gen/app get-property --tag=myapp.0 --property=quickcheck-interval
# Update quickcheck-interval property
lkcli resource gen/app set-property --tag=myapp.0 --property=quickcheck-interval --value=120



Post your comment on this topic.