# hooks

Hook scripts for specific events.
Set management node URL:

# GET /events/hooks/hook-points

List of all available hook points.

# Parameters

  • AuthorizationstringheaderOAuth bearer token authorization header.

# Endpoint

curl -X GET http://mgmt-node:8080/api/events/hooks/hook-points

# Response 200

  • namestringoptional-
  • canChooseServerbooleanoptionalTrue for hook points running on Ceph nodes. False for hook points running on the management node.

# Example response

[
  {
    "name": "string",
    "canChooseServer": true
  }
]

# GET /events/hooks

List of all installed hook scripts.

# Parameters

  • AuthorizationstringheaderOAuth bearer token authorization header.

# Endpoint

curl -X GET http://mgmt-node:8080/api/events/hooks

# Response 200

  • idintegeroptional-
  • scriptIdintegeroptional-
  • scriptNamestringoptional-
  • eventstringoptional[PreNetworkConfig, PostNetworkConfig, PreDaemonStart, PostDaemonStart, PreFormatDisk, PostFormatDisk, PostCephDaemonStart, OnHealthDegrade, OnHealthRecover, PreCrushMapChange, PostCrushMapChange, PostConfigChanged]
  • allServersbooleanoptional-
  • serverIdsarrayoptional-
  • serverNamesarrayoptional-

# Example response

[
  {
    "id": 0,
    "scriptId": 0,
    "scriptName": "string",
    "event": "PreNetworkConfig",
    "allServers": true,
    "serverIds": [
      0
    ],
    "serverNames": [
      "string"
    ]
  }
]

# POST /events/hooks

Install a hook script at a given hook point.

# Parameters

  • bodyobjectoptional-
    • scriptIdintegeroptional-
    • eventstringoptional[PreNetworkConfig, PostNetworkConfig, PreDaemonStart, PostDaemonStart, PreFormatDisk, PostFormatDisk, PostCephDaemonStart, OnHealthDegrade, OnHealthRecover, PreCrushMapChange, PostCrushMapChange, PostConfigChanged]
    • allServersbooleanoptional-
    • serverIdsarrayoptional-
  • AuthorizationstringheaderOAuth bearer token authorization header.

# Endpoint

curl -X POST http://mgmt-node:8080/api/events/hooks

# Example body

{
  "scriptId": 0,
  "event": "PreNetworkConfig",
  "allServers": true,
  "serverIds": [
    0
  ]
}

# DELETE /events/hooks/{id}

Delete a hook event.

# Parameters

  • idintegerpath-
  • AuthorizationstringheaderOAuth bearer token authorization header.

# Endpoint

curl -X DELETE http://mgmt-node:8080/api/events/hooks/{id}

# PATCH /events/hooks/{id}

Install a hook script at a given hook point.

# Parameters

  • idintegerpath-
  • bodyobjectoptional-
    • scriptIdintegeroptional-
    • eventstringoptional[PreNetworkConfig, PostNetworkConfig, PreDaemonStart, PostDaemonStart, PreFormatDisk, PostFormatDisk, PostCephDaemonStart, OnHealthDegrade, OnHealthRecover, PreCrushMapChange, PostCrushMapChange, PostConfigChanged]
    • allServersbooleanoptional-
    • serverIdsarrayoptional-
  • AuthorizationstringheaderOAuth bearer token authorization header.

# Endpoint

curl -X PATCH http://mgmt-node:8080/api/events/hooks/{id}

# Example body

{
  "scriptId": 0,
  "event": "PreNetworkConfig",
  "allServers": true,
  "serverIds": [
    0
  ]
}

# POST /events/hooks/{id}/execute

Run a hook script now.

# Parameters

  • idintegerpath-
  • AuthorizationstringheaderOAuth bearer token authorization header.

# Endpoint

curl -X POST http://mgmt-node:8080/api/events/hooks/{id}/execute

# GET /events/scripts/{id}

Get the script file contents.

# Parameters

  • idintegerpath-
  • AuthorizationstringheaderOAuth bearer token authorization header.

# Endpoint

curl -X GET http://mgmt-node:8080/api/events/scripts/{id}

# Response 200

# Example response

"string"

# DELETE /events/scripts/{id}

Delete a script file.

# Parameters

  • idintegerpath-
  • AuthorizationstringheaderOAuth bearer token authorization header.

# Endpoint

curl -X DELETE http://mgmt-node:8080/api/events/scripts/{id}

# PATCH /events/scripts/{id}

Update or rename a script file.

# Parameters

  • idintegerpath-
  • bodyobjectoptional-
    • namestringoptional-
    • contentsstringoptional-
  • AuthorizationstringheaderOAuth bearer token authorization header.

# Endpoint

curl -X PATCH http://mgmt-node:8080/api/events/scripts/{id}

# Example body

{
  "name": "string",
  "contents": "string"
}

# GET /events/scripts

List of all script files.

# Parameters

  • AuthorizationstringheaderOAuth bearer token authorization header.

# Endpoint

curl -X GET http://mgmt-node:8080/api/events/scripts

# Response 200

  • idintegeroptional-
  • namestringoptional-

# Example response

[
  {
    "id": 0,
    "name": "string"
  }
]

# POST /events/scripts

Create a script file.

# Parameters

  • bodyobjectoptional-
    • namestringoptional-
    • contentsstringoptional-
  • AuthorizationstringheaderOAuth bearer token authorization header.

# Endpoint

curl -X POST http://mgmt-node:8080/api/events/scripts

# Example body

{
  "name": "string",
  "contents": "string"
}

# Response 200

  • idobjectoptional-

# Example response

{
  "id": {}
}