This page covers configuration and management of View collection objects.
Object Overview
Webhook rules dictate the conditions by which webhooks are invoked.
Endpoint, URL, and Supported Methods
Objects are managed via the Configuration server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/webhookrules
Supported methods include: GET
HEAD
PUT
DELETE
Structure
Objects have the following structure:
{
"GUID": "b4cf5430-9c25-4514-b3e5-fe7fd1108edb",
"TenantGUID": "00000000-0000-0000-0000-000000000000",
"TargetGUID": "00000000-0000-0000-0000-000000000000",
"Name": "My webhook rule",
"EventType": "ObjectWrite",
"MaxAttempts": 5,
"RetryIntervalMs": 10000,
"TimeoutMs": 30000,
"CreatedUtc": "2025-03-29T09:23:23.035429Z"
}
GUID
GUID
globally unique identifier for the objectTenantGUID
GUID
globally unique identifier for the tenantTargetGUID
GUID
globally unique identifier for the targetName
string
name of the objectEventType
string
event typeMaxAttempts
number
number of max attempts for webhookRetryIntervalMs
number
inter between attempts in msTimeoutMs
number
time out in msCreatedUtc
datetime
timestamp from creation, in UTC time
Create
To create, call PUT /v1.0/tenants/[tenant-guid]/webhookrules
with the following properties using the Configuration server
curl --location --request PUT 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookrules' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"Name": "My webhook rule",
"TargetGUID": "00000000-0000-0000-0000-000000000000",
"EventType": "ObjectWrite",
"MaxAttempts": 5,
"RetryIntervalMs": 10000,
"TimeoutMs": 30000
}'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"http://localhost:8000/", //endpoint
"default", //tenant Id
"default" //access key
);
const createWebhookRules = async () => {
try {
const response = await api.WebhookRule.create({
Name: "My webhook rule",
TargetGUID: "<target-guid>",
EventType: "ObjectWrite",
MaxAttempts: 5,
RetryIntervalMs: 10000,
TimeoutMs: 30000,
});
console.log(response, "Webhook rules created successfully");
} catch (err) {
console.log("Error creating Webhook rules:", err);
}
};
createWebhookRules();
import view_sdk
from view_sdk import configuration
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def createWebhookRule():
webhookRule = configuration.WebhookRule.create(
Name="My webhook rule",
TargetGUID="<target-guid>",
EventType="ObjectWrite",
MaxAttempts=5,
RetryIntervalMs=10000,
TimeoutMs=30000
)
print(webhookRule)
createWebhookRule()
using View.Sdk;
using View.Sdk.Configuration;
ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
WebhookRule newWebhookRule = new WebhookRule
{
Name = "My webhook rule",
TargetGUID = Guid.Parse("<target-guid>"),
EventType = WebhookEventTypeEnum.ObjectWrite,
MaxAttempts = 5,
RetryIntervalMs = 10000,
TimeoutMs = 30000,
};
WebhookRule createdWebhookRule = await sdk.CreateWebhookRule(newWebhookRule);
Enumerate
Enumerate objects by using GET /v2.0/tenants/[tenant-guid]/webhookrules
curl --location 'http://view.homedns.org:8000/v2.0/tenants/00000000-0000-0000-0000-000000000000/webhookrules' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"http://localhost:8000/", //endpoint
"default", //tenant Id
"default" //access key
);
const enumerateWebhookRules = async () => {
try {
const response = await api.WebhookRule.enumerate();
console.log(response, "Webhook rules fetched successfully");
} catch (err) {
console.log("Error fetching Webhook rules:", err);
}
};
enumerateWebhookRules();
import view_sdk
from view_sdk import configuration
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def enumerateWebhookRules():
webhookRules = configuration.WebhookRule.enumerate()
print(webhookRules)
enumerateWebhookRules()
Read
To read an object by GUID, call GET /v1.0/tenants/[tenant-guid]/webhookrules/[webhookrule-guid]
. If the object exists, it will be returned as a JSON object in the response body. If it does not exist, a 404 will be returned with a NotFound
error response.
curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookrules/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"http://localhost:8000/", //endpoint
"default", //tenant Id
"default" //access key
);
const readWebhookRule = async () => {
try {
const response = await api.WebhookRule.read(
"<webhookrule-guid>"
);
console.log(response, "Webhook rule fetched successfully");
} catch (err) {
console.log("Error fetching Webhook rule:", err);
}
};
readWebhookRule();;
import view_sdk
from view_sdk import configuration
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def readWebhookRule():
webhookRule = configuration.WebhookRule.retrieve("<webhookrule-guid>")
print(webhookRule)
readWebhookRule()
using View.Sdk;
using View.Sdk.Configuration;
ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
WebhookRule webhookRule = await sdk.RetrieveWebhookRule(Guid.Parse("<webhookrule-guid>"));
Read all
To read all objects, call GET /v1.0/tenants/[tenant-guid]/webhookrules/
. If the object exists, it will be returned as an array of JSON object in the response body
curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookrules' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"http://localhost:8000/", //endpoint
"default", //tenant Id
"default" //access key
);
const readAllWebhookRules = async () => {
try {
const response = await api.WebhookRule.readAll();
console.log(response, "All webhook rules fetched successfully");
} catch (err) {
console.log("Error fetching All webhook rules:", err);
}
};
readAllWebhookRules();
import view_sdk
from view_sdk import configuration
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def readAllWebhookRules():
webhookRules = configuration.WebhookRule.retrieve_all()
print(webhookRules)
readAllWebhookRules()
using View.Sdk;
using View.Sdk.Configuration;
ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
List<WebhookRule> webhookRules = await sdk.RetrieveWebhookRules();
Update
To update, call PUT /v1.0/tenants/[tenant-guid]/webhookrules/{webhookrule-guid}
with the object properties using the Configuration server
curl --location --request PUT 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookrules/00000000-0000-0000-0000-000000000000' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"TargetGUID": "00000000-0000-0000-0000-000000000000",
"Name": "My updated webhook rule",
"EventType": "ObjectWrite",
"MaxAttempts": 5,
"RetryIntervalMs": 10000,
"TimeoutMs": 30000
}'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"http://localhost:8000/", //endpoint
"default", //tenant Id
"default" //access key
);
const updateWebhookRule = async () => {
try {
const response = await api.WebhookRule.update({
GUID: "<webhookrule-guid>",
TenantGUID: "<tenant-guid>",
TargetGUID: "<target-guid>",
Name: "My webhook rule [UPDATED]",
EventType: "ObjectWrite",
MaxAttempts: 5,
RetryIntervalMs: 10000,
TimeoutMs: 30000,
CreatedUtc: "2025-03-29T11:27:22.814177Z",
});
console.log(response, "Webhook rule updated successfully");
} catch (err) {
console.log("Error updating Webhook rule:", err);
}
};
updateWebhookRule();
import view_sdk
from view_sdk import configuration
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def updateWebhookRule():
webhookRule = configuration.WebhookRule.update("<webhookrule-guid>",
Name="My webhook rule [updated]",
TargetGUID="<target-guid>",
EventType="ObjectWrite",
MaxAttempts=5,
)
print(webhookRule)
updateWebhookRule()
using System.Text.Json;
using View.Sdk;
using View.Sdk.Configuration;
public static class Configuration {
public static async Task Main(string[] args)
{
ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
var webhookRule = new WebhookRule
{
GUID = Guid.Parse("<webhookrule-guid>"),
TenantGUID = Guid.Parse("<tenant-guid>"),
TargetGUID = Guid.Parse("<target-guid>"),
Name = "My webhook rule [UPDATED]",
EventType = WebhookEventTypeEnum.ObjectWrite,
MaxAttempts = 5,
RetryIntervalMs = 10000,
TimeoutMs = 30000
};
WebhookRule updatedWebhookRule = await sdk.UpdateWebhookRule(webhookRule);
string updatedWebhookRuleJson = JsonSerializer.Serialize(updatedWebhookRule, new JsonSerializerOptions {
WriteIndented = true
});
Console.WriteLine("WebhookRule updated successfully");
Console.WriteLine(updatedWebhookRuleJson);
}
}
Delete
To delete an object by GUID, call DELETE /v1.0/tenants/[tenant-guid]/webhookrules/[webhookrule-guid]
.
curl --location --request DELETE 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookrules/00000000-0000-0000-0000-000000000000' \
--header 'Content-Type: text/plain' \
--header 'Authorization: ••••••' \
--data '{
"TenantGUID": "05b702a6-9c0e-4741-a465-581f2456e994",
"Name": "Another Storage Pool",
"Provider": "Disk",
"WriteMode": "GUID",
"UseSsl": false,
"DiskDirectory": "./disk2/",
"Dedupe": false,
"Compress": "None",
"EnableReadCaching": false,
"Encrypt": "None"
}'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"http://localhost:8000/", //endpoint
"default", //tenant Id
"default" //access key
);
const deleteWebhookRule = async () => {
try {
const response = await api.WebhookRule.delete(
"<webhookrule-guid>"
);
console.log(response, "Webhook rule deleted successfully");
} catch (err) {
console.log("Error deleting Webhook rule:", err);
}
};
deleteWebhookRule();
import view_sdk
from view_sdk import configuration
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def deleteWebhookRule():
webhookRule = configuration.WebhookRule.delete("<webhookrule-guid>")
print(webhookRule)
deleteWebhookRule()
using View.Sdk;
using View.Sdk.Configuration;
ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
bool deleted = await sdk.DeleteWebhookRule(Guid.Parse("<webhookrule-guid>"));
Check Existence
Note: the HEAD
method can be used as an alternative to get to simply check the existence of the object. HEAD
requests return either a 200/OK
in the event the object exists, or a 404/Not Found
if not. No response body is returned with a HEAD
request.
curl --location --head 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookrules/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";
const api = new ViewConfigurationSdk(
"http://localhost:8000/", //endpoint
"default", //tenant Id
"default" //access key
);
const webhookRuleExists = async () => {
try {
const response = await api.WebhookRule.exists(
"<webhookrule-guid>"
);
console.log(response, "Webhook rule exists");
} catch (err) {
console.log("Error checking Webhook rule:", err);
}
};
webhookRuleExists();
import view_sdk
from view_sdk import configuration
sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")
def existsWebhookRule():
webhookRule = configuration.WebhookRule.exists("<webhookrule-guid>")
print(webhookRule)
existsWebhookRule()
using View.Sdk;
using View.Sdk.Configuration;
ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
bool exists = await sdk.ExistsWebhookRule(Guid.Parse("<webhookrule-guid>"));