1117 lines
46 KiB
Text
1117 lines
46 KiB
Text
<!-- Sidebar -->
|
|
<div class="hidden lg:fixed lg:inset-y-0 lg:z-40 lg:flex lg:w-72 lg:flex-col xl:w-80">
|
|
<div class="flex grow flex-col gap-y-5 overflow-y-auto border-r border-zinc-900/10 px-6 pt-4 pb-8 dark:border-white/10">
|
|
<!-- Logo -->
|
|
<div class="flex h-16 shrink-0 items-center">
|
|
<.link navigate={~p"/"} class="text-2xl font-bold text-zinc-900 dark:text-white">
|
|
Towerops API
|
|
</.link>
|
|
</div>
|
|
|
|
<!-- Navigation -->
|
|
<nav class="flex flex-1 flex-col">
|
|
<ul role="list" class="flex flex-1 flex-col gap-y-7">
|
|
<!-- Guides Section -->
|
|
<li>
|
|
<h2 class="text-xs font-semibold text-zinc-900 dark:text-white">Guides</h2>
|
|
<ul role="list" class="mt-3 space-y-1 border-l border-zinc-900/10 dark:border-white/5">
|
|
<li>
|
|
<a
|
|
href="#introduction"
|
|
class="block py-1 pl-4 pr-3 text-sm text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
|
>
|
|
Introduction
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#authentication"
|
|
class="block py-1 pl-4 pr-3 text-sm text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
|
>
|
|
Authentication
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#errors"
|
|
class="block py-1 pl-4 pr-3 text-sm text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
|
>
|
|
Errors
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<!-- Resources Section -->
|
|
<li>
|
|
<h2 class="text-xs font-semibold text-zinc-900 dark:text-white">Resources</h2>
|
|
<ul role="list" class="mt-3 space-y-1 border-l border-zinc-900/10 dark:border-white/5">
|
|
<li>
|
|
<a
|
|
href="#sites"
|
|
class="block py-1 pl-4 pr-3 text-sm text-emerald-500 font-medium border-l-2 border-emerald-500 -ml-px"
|
|
>
|
|
Sites
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a
|
|
href="#devices"
|
|
class="block py-1 pl-4 pr-3 text-sm text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white"
|
|
>
|
|
Devices
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Main content -->
|
|
<div class="lg:ml-72 xl:ml-80">
|
|
<div class="relative flex h-full flex-col px-4 pt-14 sm:px-6 lg:px-8">
|
|
<main class="flex-auto max-w-7xl">
|
|
<!-- Introduction -->
|
|
<section id="introduction" class="scroll-mt-24 mb-16">
|
|
<h1 class="text-4xl font-bold tracking-tight text-zinc-900 dark:text-white sm:text-5xl">
|
|
Towerops API Reference
|
|
</h1>
|
|
<p class="mt-4 text-lg text-zinc-600 dark:text-zinc-400">
|
|
Use the Towerops API to manage your network monitoring infrastructure programmatically. Create and monitor sites, devices, and alerts.
|
|
</p>
|
|
</section>
|
|
|
|
<!-- Authentication -->
|
|
<section id="authentication" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Authentication
|
|
</h2>
|
|
<p class="mt-4 text-base text-zinc-600 dark:text-zinc-400">
|
|
All API requests require authentication using an API token. Include your token in the Authorization header:
|
|
</p>
|
|
<div class="mt-6 overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl https://towerops.net/api/v1/sites \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
<p class="mt-4 text-base text-zinc-600 dark:text-zinc-400">
|
|
API tokens are created and managed in your organization settings. Each token is scoped to a single organization.
|
|
</p>
|
|
</section>
|
|
|
|
<!-- Errors -->
|
|
<section id="errors" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Errors
|
|
</h2>
|
|
<p class="mt-4 text-base text-zinc-600 dark:text-zinc-400">
|
|
The API uses conventional HTTP response codes to indicate success or failure:
|
|
</p>
|
|
<div class="mt-6">
|
|
<table class="min-w-full divide-y divide-zinc-200 dark:divide-zinc-800">
|
|
<thead>
|
|
<tr>
|
|
<th class="py-3 text-left text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Code
|
|
</th>
|
|
<th class="py-3 text-left text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Description
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-zinc-200 dark:divide-zinc-800">
|
|
<tr>
|
|
<td class="py-3 text-sm font-mono text-emerald-600 dark:text-emerald-400">200</td>
|
|
<td class="py-3 text-sm text-zinc-600 dark:text-zinc-400">Success</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="py-3 text-sm font-mono text-emerald-600 dark:text-emerald-400">201</td>
|
|
<td class="py-3 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Created successfully
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="py-3 text-sm font-mono text-red-600 dark:text-red-400">400</td>
|
|
<td class="py-3 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Bad request - missing or invalid parameters
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="py-3 text-sm font-mono text-red-600 dark:text-red-400">401</td>
|
|
<td class="py-3 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Unauthorized - invalid or missing API token
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="py-3 text-sm font-mono text-red-600 dark:text-red-400">403</td>
|
|
<td class="py-3 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Forbidden - you don't have access to this resource
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="py-3 text-sm font-mono text-red-600 dark:text-red-400">404</td>
|
|
<td class="py-3 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Not found - resource doesn't exist
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="py-3 text-sm font-mono text-red-600 dark:text-red-400">422</td>
|
|
<td class="py-3 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Unprocessable entity - validation errors
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
|
|
<hr class="my-16 border-zinc-200 dark:border-zinc-800" />
|
|
|
|
<!-- Sites Resource -->
|
|
<section id="sites" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Sites
|
|
</h2>
|
|
<p class="mt-4 text-base text-zinc-600 dark:text-zinc-400">
|
|
Sites represent physical locations where your network devices are deployed. Each site can have multiple devices and may have default SNMP configuration.
|
|
</p>
|
|
|
|
<!-- Site Model -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">The site model</h3>
|
|
<div class="mt-6">
|
|
<dl class="divide-y divide-zinc-200 dark:divide-zinc-800">
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
id
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Unique identifier for the site (UUID).
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
name
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
The name of the site.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
location
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Physical location or address of the site.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_community
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Default SNMP community string for devices at this site (optional).
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
inserted_at
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
timestamp
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Timestamp when the site was created.
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-zinc-200 dark:border-zinc-800" />
|
|
|
|
<!-- List all sites -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">List all sites</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-zinc-600 dark:text-zinc-400">/api/v1/sites</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<!-- Left column - description -->
|
|
<div>
|
|
<p class="text-sm text-zinc-600 dark:text-zinc-400">
|
|
Lists all sites for the authenticated organization.
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Right column - code example -->
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -G https://towerops.net/api/v1/sites \\
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"sites": [
|
|
{
|
|
"id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"name": "Main Office",
|
|
"location": "New York, NY",
|
|
"snmp_community": "public",
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
]
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-zinc-200 dark:border-zinc-800" />
|
|
|
|
<!-- Create a site -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Create a site</h3>
|
|
<span class="inline-flex items-center rounded-md bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700 ring-1 ring-inset ring-blue-600/20 dark:bg-blue-400/10 dark:text-blue-400 dark:ring-blue-400/30">
|
|
POST
|
|
</span>
|
|
<span class="text-sm font-mono text-zinc-600 dark:text-zinc-400">/api/v1/sites</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<!-- Left column -->
|
|
<div>
|
|
<p class="text-sm text-zinc-600 dark:text-zinc-400">
|
|
Creates a new site for the authenticated organization.
|
|
</p>
|
|
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Required parameters
|
|
</h4>
|
|
<dl class="mt-3 divide-y divide-zinc-200 dark:divide-zinc-800">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
name
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
The name of the site.
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
location
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Physical location of the site.
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Optional parameters
|
|
</h4>
|
|
<dl class="mt-3 divide-y divide-zinc-200 dark:divide-zinc-800">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_community
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Default SNMP community string for devices at this site.
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
|
|
<!-- Right column -->
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl https://towerops.net/api/v1/sites \
|
|
-H "Authorization: Bearer #{@sample_token}" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"site": {
|
|
"name": "Main Office",
|
|
"location": "New York, NY",
|
|
"snmp_community": "public"
|
|
}
|
|
}'
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"name": "Main Office",
|
|
"location": "New York, NY",
|
|
"snmp_community": "public",
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-zinc-200 dark:border-zinc-800" />
|
|
|
|
<!-- Get a site -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Retrieve a site</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-zinc-600 dark:text-zinc-400">
|
|
/api/v1/sites/:id
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-zinc-600 dark:text-zinc-400">
|
|
Retrieves a single site by ID.
|
|
</p>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl https://towerops.net/api/v1/sites/550e8400-e29b-41d4-a716-446655440000 \
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"name": "Main Office",
|
|
"location": "New York, NY",
|
|
"snmp_community": "public",
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-zinc-200 dark:border-zinc-800" />
|
|
|
|
<!-- Update a site -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Update a site</h3>
|
|
<span class="inline-flex items-center rounded-md bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700 ring-1 ring-inset ring-amber-600/20 dark:bg-amber-400/10 dark:text-amber-400 dark:ring-amber-400/30">
|
|
PATCH
|
|
</span>
|
|
<span class="text-sm font-mono text-zinc-600 dark:text-zinc-400">
|
|
/api/v1/sites/:id
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-zinc-600 dark:text-zinc-400">
|
|
Updates an existing site. Only provided fields will be updated.
|
|
</p>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X PATCH https://towerops.net/api/v1/sites/550e8400-e29b-41d4-a716-446655440000 \
|
|
-H "Authorization: Bearer #{@sample_token}" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"site": {
|
|
"name": "Updated Office Name"
|
|
}
|
|
}'
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"name": "Updated Office Name",
|
|
"location": "New York, NY",
|
|
"snmp_community": "public",
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-zinc-200 dark:border-zinc-800" />
|
|
|
|
<!-- Delete a site -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Delete a site</h3>
|
|
<span class="inline-flex items-center rounded-md bg-red-50 px-2 py-1 text-xs font-medium text-red-700 ring-1 ring-inset ring-red-600/20 dark:bg-red-400/10 dark:text-red-400 dark:ring-red-400/30">
|
|
DELETE
|
|
</span>
|
|
<span class="text-sm font-mono text-zinc-600 dark:text-zinc-400">
|
|
/api/v1/sites/:id
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-zinc-600 dark:text-zinc-400">
|
|
Deletes a site. Note: This will also delete all devices associated with the site.
|
|
</p>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X DELETE https://towerops.net/api/v1/sites/550e8400-e29b-41d4-a716-446655440000 \
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"success": true
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<hr class="my-16 border-zinc-200 dark:border-zinc-800" />
|
|
|
|
<!-- Devices Resource -->
|
|
<section id="devices" class="scroll-mt-24 mb-16">
|
|
<h2 class="text-3xl font-bold tracking-tight text-zinc-900 dark:text-white">
|
|
Devices
|
|
</h2>
|
|
<p class="mt-4 text-base text-zinc-600 dark:text-zinc-400">
|
|
Devices are network equipment monitored by Towerops. Each device belongs to a site and can be monitored via ICMP ping and SNMP.
|
|
</p>
|
|
|
|
<!-- Device Model -->
|
|
<div class="mt-12">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">The device model</h3>
|
|
<div class="mt-6">
|
|
<dl class="divide-y divide-zinc-200 dark:divide-zinc-800">
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
id
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Unique identifier for the device (UUID).
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
name
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
The name of the device.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
ip_address
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
IP address of the device.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
site_id
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
ID of the site this device belongs to.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
description
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Optional description of the device.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
monitoring_enabled
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
boolean
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Whether monitoring is enabled for this device.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
check_interval_seconds
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
integer
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
How often to poll this device (in seconds).
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_enabled
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
boolean
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Whether SNMP monitoring is enabled.
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_version
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
SNMP version to use (e.g., "2c").
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_port
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
integer
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
SNMP port (default: 161).
|
|
</dd>
|
|
</div>
|
|
<div class="py-4">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
inserted_at
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
timestamp
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Timestamp when the device was created.
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-zinc-200 dark:border-zinc-800" />
|
|
|
|
<!-- List all devices -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">List all devices</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-zinc-600 dark:text-zinc-400">
|
|
/api/v1/devices
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-zinc-600 dark:text-zinc-400">
|
|
Lists all devices for the authenticated organization.
|
|
</p>
|
|
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Optional parameters
|
|
</h4>
|
|
<dl class="mt-3 divide-y divide-zinc-200 dark:divide-zinc-800">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
site_id
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Filter devices by site ID.
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -G https://towerops.net/api/v1/devices \
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"devices": [
|
|
{
|
|
"id": "650e8400-e29b-41d4-a716-446655440001",
|
|
"name": "Core Router",
|
|
"ip_address": "192.168.1.1",
|
|
"site_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"monitoring_enabled": true,
|
|
"snmp_enabled": true,
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
]
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-zinc-200 dark:border-zinc-800" />
|
|
|
|
<!-- Create a device -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Create a device</h3>
|
|
<span class="inline-flex items-center rounded-md bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700 ring-1 ring-inset ring-blue-600/20 dark:bg-blue-400/10 dark:text-blue-400 dark:ring-blue-400/30">
|
|
POST
|
|
</span>
|
|
<span class="text-sm font-mono text-zinc-600 dark:text-zinc-400">
|
|
/api/v1/devices
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-zinc-600 dark:text-zinc-400">
|
|
Creates a new device.
|
|
</p>
|
|
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Required parameters
|
|
</h4>
|
|
<dl class="mt-3 divide-y divide-zinc-200 dark:divide-zinc-800">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
site_id
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
ID of the site this device belongs to.
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
name
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
The name of the device.
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
ip_address
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
IP address of the device.
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
|
|
<h4 class="mt-6 text-sm font-semibold text-zinc-900 dark:text-white">
|
|
Optional parameters
|
|
</h4>
|
|
<dl class="mt-3 divide-y divide-zinc-200 dark:divide-zinc-800">
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
description
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Description of the device.
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
monitoring_enabled
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
boolean
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Enable monitoring (default: true).
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_enabled
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
boolean
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
Enable SNMP monitoring (default: true).
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_version
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
SNMP version (default: "2c").
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_community
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
string
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
SNMP community string (inherits from site/org if not set).
|
|
</dd>
|
|
</div>
|
|
<div class="py-3">
|
|
<dt class="text-sm font-mono font-medium text-zinc-900 dark:text-white">
|
|
snmp_port
|
|
<span class="ml-2 font-sans text-xs font-normal text-zinc-500 dark:text-zinc-400">
|
|
integer
|
|
</span>
|
|
</dt>
|
|
<dd class="mt-1 text-sm text-zinc-600 dark:text-zinc-400">
|
|
SNMP port (default: 161).
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl https://towerops.net/api/v1/devices \
|
|
-H "Authorization: Bearer #{@sample_token}" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"device": {
|
|
"site_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"name": "Core Router",
|
|
"ip_address": "192.168.1.1",
|
|
"description": "Main router",
|
|
"snmp_community": "public"
|
|
}
|
|
}'
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"id": "650e8400-e29b-41d4-a716-446655440001",
|
|
"name": "Core Router",
|
|
"ip_address": "192.168.1.1",
|
|
"site_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"monitoring_enabled": true,
|
|
"snmp_enabled": true,
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-zinc-200 dark:border-zinc-800" />
|
|
|
|
<!-- Get a device -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Retrieve a device</h3>
|
|
<span class="inline-flex items-center rounded-md bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700 ring-1 ring-inset ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-400 dark:ring-emerald-400/30">
|
|
GET
|
|
</span>
|
|
<span class="text-sm font-mono text-zinc-600 dark:text-zinc-400">
|
|
/api/v1/devices/:id
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-zinc-600 dark:text-zinc-400">
|
|
Retrieves a single device by ID, including all configuration details.
|
|
</p>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl https://towerops.net/api/v1/devices/650e8400-e29b-41d4-a716-446655440001 \
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"id": "650e8400-e29b-41d4-a716-446655440001",
|
|
"name": "Core Router",
|
|
"ip_address": "192.168.1.1",
|
|
"site_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"description": "Main router",
|
|
"monitoring_enabled": true,
|
|
"check_interval_seconds": 300,
|
|
"snmp_enabled": true,
|
|
"snmp_version": "2c",
|
|
"snmp_port": 161,
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-zinc-200 dark:border-zinc-800" />
|
|
|
|
<!-- Update a device -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Update a device</h3>
|
|
<span class="inline-flex items-center rounded-md bg-amber-50 px-2 py-1 text-xs font-medium text-amber-700 ring-1 ring-inset ring-amber-600/20 dark:bg-amber-400/10 dark:text-amber-400 dark:ring-amber-400/30">
|
|
PATCH
|
|
</span>
|
|
<span class="text-sm font-mono text-zinc-600 dark:text-zinc-400">
|
|
/api/v1/devices/:id
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-zinc-600 dark:text-zinc-400">
|
|
Updates an existing device. Only provided fields will be updated.
|
|
</p>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X PATCH https://towerops.net/api/v1/devices/650e8400-e29b-41d4-a716-446655440001 \
|
|
-H "Authorization: Bearer #{@sample_token}" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"device": {
|
|
"name": "Updated Router Name",
|
|
"monitoring_enabled": false
|
|
}
|
|
}'
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"id": "650e8400-e29b-41d4-a716-446655440001",
|
|
"name": "Updated Router Name",
|
|
"ip_address": "192.168.1.1",
|
|
"site_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
"description": "Main router",
|
|
"monitoring_enabled": false,
|
|
"check_interval_seconds": 300,
|
|
"snmp_enabled": true,
|
|
"snmp_version": "2c",
|
|
"snmp_port": 161,
|
|
"inserted_at": "2026-01-15T19:44:25Z"
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-12 border-zinc-200 dark:border-zinc-800" />
|
|
|
|
<!-- Delete a device -->
|
|
<div class="mt-12">
|
|
<div class="flex items-center gap-x-3">
|
|
<h3 class="text-xl font-semibold text-zinc-900 dark:text-white">Delete a device</h3>
|
|
<span class="inline-flex items-center rounded-md bg-red-50 px-2 py-1 text-xs font-medium text-red-700 ring-1 ring-inset ring-red-600/20 dark:bg-red-400/10 dark:text-red-400 dark:ring-red-400/30">
|
|
DELETE
|
|
</span>
|
|
<span class="text-sm font-mono text-zinc-600 dark:text-zinc-400">
|
|
/api/v1/devices/:id
|
|
</span>
|
|
</div>
|
|
|
|
<div class="mt-6 grid grid-cols-1 gap-x-12 gap-y-8 lg:grid-cols-2">
|
|
<div>
|
|
<p class="text-sm text-zinc-600 dark:text-zinc-400">
|
|
Deletes a device. Note: This will also delete all monitoring data associated with the device.
|
|
</p>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Request</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
curl -X DELETE https://towerops.net/api/v1/devices/650e8400-e29b-41d4-a716-446655440001 \
|
|
-H "Authorization: Bearer #{@sample_token}"
|
|
""") %></code></pre>
|
|
</div>
|
|
|
|
<div class="mt-4 overflow-hidden rounded-lg bg-zinc-900 dark:bg-zinc-950">
|
|
<div class="border-b border-zinc-800 px-4 py-2">
|
|
<p class="text-xs font-medium text-zinc-400">Response</p>
|
|
</div>
|
|
<pre class="p-4 text-sm text-zinc-100 overflow-x-auto"><code><%= raw("""
|
|
{
|
|
"success": true
|
|
}
|
|
""") %></code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Footer -->
|
|
<footer class="mt-24 border-t border-zinc-200 dark:border-zinc-800 pt-8 pb-16">
|
|
<p class="text-sm text-zinc-600 dark:text-zinc-400">
|
|
© 2026 Towerops. All rights reserved.
|
|
</p>
|
|
</footer>
|
|
</main>
|
|
</div>
|
|
</div>
|