StyleBook configuration

Use APIs to delete config packs

You can use the following StyleBook API to delete config packs.

DELETE https://<ADM-endpoint-name>/stylebook/nitro/v2/config/configpacks/<configpack-ID>?mode=async

An HTTP Status 202 and a response payload are displayed. The response payload has job ID which you can use to track the status of the delete operation.

The response payload is as follows:

{
    "job": {
        "job_id": "1841028854"
    }
}
<!--NeedCopy-->

To track the delete job operation, use the job polling API with the job ID (in this example, the job ID is 1841028854):

GET https://<ADM-endpoint-name>/stylebook/nitro/v2/config/jobs/1841028854

If the status field in the response is set to “completed”, it means that the delete job operation is successful, as shown in the following example:

{
    "job": {
        "job_id": "3920886024",
        "status": "completed",
        "progress_info": [
            {
                "is_last": "false",
                "message": "Validated the parameters",
                "status": "success"
            },
            {
                "is_last": "false",
                "message": "Configuration audit completed",
                "status": "success"
            },
            {
                "is_last": "false",
                "message": "Computed configuration objects",
                "status": "success"
            },
            {
                "is_last": "false",
                "message": "Prepared objects for applying configuration on 192.168.153.165",
                "status": "success"
            },
            {
                "is_last": "false",
                "message": "Retrieved existing data for updatable objects on instance 192.168.153.165",
                "status": "success"
            },
            {
                "is_last": "false",
                "message": "Applied configuration on instance 192.168.153.165",
                "status": "success"
            },
            {
                "is_last": "false",
                "message": "Retrieved data for configuration audit on instance 192.168.153.165",
                "status": "success"
            },
            {
                "is_last": "false",
                "message": "Logged out from instance 192.168.153.165",
                "status": "success"
            },
            {
                "is_last": "true",
                "message": "Removed configpack.",
                "status": "completed"
            }
        ]
    }
}
<!--NeedCopy-->

The delete operation can fail in the following scenarios:

  • The NetScaler instance, on which the configuration is present, is down
  • The NetScaler instance isn’t reachable by the NetScaler Console
  • The configuration is no longer available on the NetScaler

You can force the removal of the configuration from NetScaler Console, even if it cannot be removed from NetScaler. In such cases, the NetScaler configuration would need to be restored manually.

To force the removal of the configuration from NetScaler Console, add the query string “force=true” to the API:

DELETE https://<ADM-endpoint-name>/stylebook/nitro/v2/config/configpacks/<configpack-ID>?mode=async&force=true.

Use APIs to delete config packs

In this article