liara_delete_zone
Remove a DNS zone from the Liara cloud platform by specifying its zone ID to manage infrastructure configurations.
Instructions
Delete a DNS zone
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zoneId | Yes | The zone ID to delete |
Implementation Reference
- src/services/dns.ts:49-55 (handler)The core handler function that deletes a DNS zone using the Liara API client. This implements the logic for the 'liara_delete_zone' tool.export async function deleteZone( client: LiaraClient, zoneId: string ): Promise<void> { validateRequired(zoneId, 'Zone ID'); await client.delete(`/v1/zones/${zoneId}`); }
- src/api/types.ts:213-219 (schema)Type definition for DNS Zone, relevant for input/output of DNS operations including deleteZone.export interface Zone { _id: string; name: string; status: 'ACTIVE' | 'PENDING'; createdAt: string; nameservers?: string[]; }
- src/services/dns.ts:1-55 (helper)Imports LiaraClient used in deleteZone to make the API call.import { LiaraClient } from '../api/client.js'; import { Zone, DnsRecord, CreateDnsRecordRequest, DomainCheck, PaginationOptions, paginationToParams, } from '../api/types.js'; import { validateRequired, unwrapApiResponse } from '../utils/errors.js'; /** * List all DNS zones */ export async function listZones( client: LiaraClient, pagination?: PaginationOptions ): Promise<Zone[]> { const params = paginationToParams(pagination); const response = await client.get<any>('/v1/zones', params); return unwrapApiResponse<Zone[]>(response, ['zones', 'data', 'items']); } /** * Get details of a specific DNS zone */ export async function getZone( client: LiaraClient, zoneId: string ): Promise<Zone> { validateRequired(zoneId, 'Zone ID'); return await client.get<Zone>(`/v1/zones/${zoneId}`); } /** * Create a new DNS zone */ export async function createZone( client: LiaraClient, name: string ): Promise<Zone> { validateRequired(name, 'Zone name'); return await client.post<Zone>('/v1/zones', { name }); } /** * Delete a DNS zone */ export async function deleteZone( client: LiaraClient, zoneId: string ): Promise<void> { validateRequired(zoneId, 'Zone ID'); await client.delete(`/v1/zones/${zoneId}`); }