Skip to main content
POST
/
runbooks
/
rules
Create Runbook Rule
curl --request POST \
  --url https://use.hoop.dev/api/runbooks/rules \
  --header 'Content-Type: application/json' \
  --data '
{
  "connections": [
    "pgdemo",
    "bash"
  ],
  "name": "Default Runbook Rules",
  "runbooks": [
    {
      "name": "ops/update-user.runbook.sh",
      "repository": "github.com/myorg/myrepo"
    }
  ],
  "user_groups": [
    "dba-team",
    "devops-team"
  ],
  "description": "Runbook rules for production databases"
}
'
{
  "connections": [
    "pgdemo",
    "bash"
  ],
  "name": "Default Runbook Rules",
  "runbooks": [
    {
      "name": "ops/update-user.runbook.sh",
      "repository": "github.com/myorg/myrepo"
    }
  ],
  "user_groups": [
    "dba-team",
    "devops-team"
  ],
  "created_at": "2024-07-25T15:56:35.317601Z",
  "description": "Runbook rules for production databases",
  "id": "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
  "org_id": "37EEBC20-D8DF-416B-8AC2-01B6EB456318",
  "updated_at": "2024-07-25T15:56:35.317601Z"
}

Body

application/json

Runbook Rule

connections
string[]
required

The connection names that this rule applies to

Example:
["pgdemo", "bash"]
name
string
required

The name of the runbook rule

Example:

"Default Runbook Rules"

runbooks
object[]
required

The runbook files associated with this rule

user_groups
string[]
required

The user groups names that can access this runbook rule

Example:
["dba-team", "devops-team"]
description
string

The description of the runbook rule

Example:

"Runbook rules for production databases"

Response

Created

connections
string[]
required

The connection names that this rule applies to

Example:
["pgdemo", "bash"]
name
string
required

The name of the runbook rule

Example:

"Default Runbook Rules"

runbooks
object[]
required

The runbook files associated with this rule

user_groups
string[]
required

The user groups names that can access this runbook rule

Example:
["dba-team", "devops-team"]
created_at
string

The time the resource was created

Example:

"2024-07-25T15:56:35.317601Z"

description
string

The description of the runbook rule

Example:

"Runbook rules for production databases"

id
string<uuid>

The unique identifier of the runbook rule

Example:

"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7"

org_id
string<uuid>

Organization ID that owns this runbook rule

Example:

"37EEBC20-D8DF-416B-8AC2-01B6EB456318"

updated_at
string

The time the resource was updated

Example:

"2024-07-25T15:56:35.317601Z"