hooks

Hook scripts for specific events.

GET /events/scripts/{id}

Parameters

id
integer
path
-

Endpoint

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

Response 200

Example response

"string"
                  

DELETE /events/scripts/{id}

Parameters

id
integer
path
-

Endpoint

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

PATCH /events/scripts/{id}

Parameters

id
integer
path
-
body
object
optional
-

Endpoint

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

Example body

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

POST /events/scripts/execute

Parameters

body
object
optional
-

Endpoint

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

Example body

{
  "scriptId": 0,
  "script": "string",
  "args": [
    "string"
  ],
  "servers": [
    0
  ]
}
                

Response 200

result
object
optional
-
statusCode
integer
optional
-
id
integer
optional
-
done
boolean
optional
-
startedAt
integer
optional
-
startedBy
string
optional
-
name
string
optional
-
state
string
optional
[WAITING, RUNNING, FINISHED, FAILED, CANCELED]
object
string
optional
-
output
string
optional
-

Example response

{
  "result": {},
  "statusCode": 0,
  "id": 0,
  "done": true,
  "startedAt": 0,
  "startedBy": "string",
  "name": "string",
  "state": "WAITING",
  "object": "string",
  "output": "string"
}
                  

GET /events/scripts

Parameters

No parameters...

Endpoint

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

Response 200

id
integer
optional
-
name
string
optional
-

Example response

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

POST /events/scripts

Parameters

body
object
optional
-

Endpoint

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

Example body

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

Response 200

id
object
optional
-

Example response

{
  "id": {}
}
                  

GET /events/hooks/hook-points

Parameters

No parameters...

Endpoint

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

Response 200

name
string
optional
-
canChooseServer
boolean
optional
True for hook points running on Ceph nodes. False for hook points running on the management node.
description
string
optional
Description of the hook point.
parameters
array
optional
Information on parameters passed to the script.

Example response

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

GET /events/hooks

Parameters

No parameters...

Endpoint

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

Response 200

id
integer
optional
-
scriptId
integer
optional
-
scriptName
string
optional
-
event
string
optional
[PreNetworkConfig, PostNetworkConfig, PreDaemonStart, PostDaemonStart, PreFormatDisk, PostFormatDisk, PostCephDaemonStart, OnHealthDegrade, OnHealthRecover, PreCrushMapChange, PostCrushMapChange, PostConfigChanged, OnDhcpLeaseUpdate, OnPersistentAvailable, OnCephFsSnapshotComplete, OnRbdSnapshotComplete]
allServers
boolean
optional
-
serverIds
array
optional
-
serverNames
array
optional
-

Example response

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

POST /events/hooks

Parameters

body
object
optional
-

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}

Parameters

id
integer
path
-

Endpoint

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

PATCH /events/hooks/{id}

Parameters

id
integer
path
-
body
object
optional
-

Endpoint

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

Example body

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