curl --request PUT \
--url https://use.hoop.dev/api/runbooks/rules/{id} \
--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"
}
'import requests
url = "https://use.hoop.dev/api/runbooks/rules/{id}"
payload = {
"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"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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'
})
};
fetch('https://use.hoop.dev/api/runbooks/rules/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/runbooks/rules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'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'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/runbooks/rules/{id}"
payload := strings.NewReader("{\n \"connections\": [\n \"pgdemo\",\n \"bash\"\n ],\n \"name\": \"Default Runbook Rules\",\n \"runbooks\": [\n {\n \"name\": \"ops/update-user.runbook.sh\",\n \"repository\": \"github.com/myorg/myrepo\"\n }\n ],\n \"user_groups\": [\n \"dba-team\",\n \"devops-team\"\n ],\n \"description\": \"Runbook rules for production databases\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://use.hoop.dev/api/runbooks/rules/{id}")
.header("Content-Type", "application/json")
.body("{\n \"connections\": [\n \"pgdemo\",\n \"bash\"\n ],\n \"name\": \"Default Runbook Rules\",\n \"runbooks\": [\n {\n \"name\": \"ops/update-user.runbook.sh\",\n \"repository\": \"github.com/myorg/myrepo\"\n }\n ],\n \"user_groups\": [\n \"dba-team\",\n \"devops-team\"\n ],\n \"description\": \"Runbook rules for production databases\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/runbooks/rules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"connections\": [\n \"pgdemo\",\n \"bash\"\n ],\n \"name\": \"Default Runbook Rules\",\n \"runbooks\": [\n {\n \"name\": \"ops/update-user.runbook.sh\",\n \"repository\": \"github.com/myorg/myrepo\"\n }\n ],\n \"user_groups\": [\n \"dba-team\",\n \"devops-team\"\n ],\n \"description\": \"Runbook rules for production databases\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Update Runbook Rule
Update an existing Runbook Rule by ID
curl --request PUT \
--url https://use.hoop.dev/api/runbooks/rules/{id} \
--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"
}
'import requests
url = "https://use.hoop.dev/api/runbooks/rules/{id}"
payload = {
"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"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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'
})
};
fetch('https://use.hoop.dev/api/runbooks/rules/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/runbooks/rules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'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'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/runbooks/rules/{id}"
payload := strings.NewReader("{\n \"connections\": [\n \"pgdemo\",\n \"bash\"\n ],\n \"name\": \"Default Runbook Rules\",\n \"runbooks\": [\n {\n \"name\": \"ops/update-user.runbook.sh\",\n \"repository\": \"github.com/myorg/myrepo\"\n }\n ],\n \"user_groups\": [\n \"dba-team\",\n \"devops-team\"\n ],\n \"description\": \"Runbook rules for production databases\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://use.hoop.dev/api/runbooks/rules/{id}")
.header("Content-Type", "application/json")
.body("{\n \"connections\": [\n \"pgdemo\",\n \"bash\"\n ],\n \"name\": \"Default Runbook Rules\",\n \"runbooks\": [\n {\n \"name\": \"ops/update-user.runbook.sh\",\n \"repository\": \"github.com/myorg/myrepo\"\n }\n ],\n \"user_groups\": [\n \"dba-team\",\n \"devops-team\"\n ],\n \"description\": \"Runbook rules for production databases\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/runbooks/rules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"connections\": [\n \"pgdemo\",\n \"bash\"\n ],\n \"name\": \"Default Runbook Rules\",\n \"runbooks\": [\n {\n \"name\": \"ops/update-user.runbook.sh\",\n \"repository\": \"github.com/myorg/myrepo\"\n }\n ],\n \"user_groups\": [\n \"dba-team\",\n \"devops-team\"\n ],\n \"description\": \"Runbook rules for production databases\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Path Parameters
Runbook Rule ID
Body
Runbook Rule
The connection names that this rule applies to
["pgdemo", "bash"]
The name of the runbook rule
"Default Runbook Rules"
The runbook files associated with this rule
Show child attributes
Show child attributes
The user groups names that can access this runbook rule
["dba-team", "devops-team"]
The description of the runbook rule
"Runbook rules for production databases"
Response
OK
The connection names that this rule applies to
["pgdemo", "bash"]
The name of the runbook rule
"Default Runbook Rules"
The runbook files associated with this rule
Show child attributes
Show child attributes
The user groups names that can access this runbook rule
["dba-team", "devops-team"]
The time the resource was created
"2024-07-25T15:56:35.317601Z"
The description of the runbook rule
"Runbook rules for production databases"
The unique identifier of the runbook rule
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7"
Organization ID that owns this runbook rule
"37EEBC20-D8DF-416B-8AC2-01B6EB456318"
The time the resource was updated
"2024-07-25T15:56:35.317601Z"
Was this page helpful?