DDI-DHCP
- GET /ddi/dhcp/leases
List DHCP leases
Retrieves all DHCP leases for a specific scope
- Query Parameters:
scope_name (string) – DHCP Scope Name
state (string) – Lease state filter (active, expired, released)
- Status Codes:
200 OK – OK
400 Bad Request – Bad Request
500 Internal Server Error – Internal Server Error
- Response JSON Object:
data.leases[].first_seen (string)
data.leases[].hostname (string)
data.leases[].ip (string)
data.leases[].last_renewal (string)
data.leases[].lease_expires (string)
data.leases[].lease_time (string)
data.leases[].lease_type (string) – dynamic, reserved
data.leases[].mac (string)
data.leases[].scope (string)
data.leases[].state (string) – active, expired, released
data.scope (string)
data.total_count (integer)
message (string)
success (boolean)
- DELETE /ddi/dhcp/leases/{mac_address}
Remove a DHCP lease
Removes/releases a DHCP lease
- Parameters:
mac_address (string) – MAC Address
- Query Parameters:
scope_name (string) – DHCP Scope Name
- Status Codes:
200 OK – OK
404 Not Found – Not Found
500 Internal Server Error – Internal Server Error
- Response JSON Object:
message (string)
success (boolean)
- GET /ddi/dhcp/leases/{mac_address}
Get DHCP lease by MAC address
Retrieves a specific DHCP lease by MAC address
- Parameters:
mac_address (string) – MAC Address
- Status Codes:
200 OK – OK
404 Not Found – Not Found
500 Internal Server Error – Internal Server Error
- Response JSON Object:
data.first_seen (string)
data.hostname (string)
data.ip (string)
data.last_renewal (string)
data.lease_expires (string)
data.lease_time (string)
data.lease_type (string) – dynamic, reserved
data.mac (string)
data.scope (string)
data.state (string) – active, expired, released
message (string)
success (boolean)
- POST /ddi/dhcp/leases/{mac_address}/convert
Convert a DHCP lease
Converts a dynamic lease to reservation or vice versa
- Parameters:
mac_address (string) – MAC Address
- Request JSON Object:
comment (string)
hostname (string) – Required for reserved mode
mac (string) – (required)
mode (string) – “reserved” or “dynamic” (required)
scope_name (string) – (required)
- Status Codes:
200 OK – OK
400 Bad Request – Bad Request
500 Internal Server Error – Internal Server Error
- Response JSON Object:
message (string)
success (boolean)
- GET /ddi/dhcp/reservations
List DHCP reservations
Retrieves all DHCP reservations for a specific scope
- Query Parameters:
scope_name (string) – DHCP Scope Name
network_id (string) – CloudStack network ID filter
vm_id (string) – VM ID filter
lease_type (string) – Lease type filter (reserved, dynamic)
include_dns (boolean) – Include DNS information
- Status Codes:
200 OK – OK
400 Bad Request – Bad Request
500 Internal Server Error – Internal Server Error
- Response JSON Object:
data.reservations[].comment (string)
data.reservations[].created_at (string)
data.reservations[].enabled (boolean)
data.reservations[].hostname (string)
data.reservations[].ip (string)
data.reservations[].mac (string)
data.reservations[].modified_at (string)
data.reservations[].scope (string)
data.scope (string)
data.total_count (integer)
message (string)
success (boolean)
- POST /ddi/dhcp/reservations
Create a DHCP reservation
Creates a new DHCP IP reservation
- Request JSON Object:
comment (string)
create_dns (boolean) – Create A+PTR records
create_ptr (boolean) – Create PTR record
dns_zone (string) – Required if CreateDNS=true
hostname (string) – (required)
ip (string) – Optional, if empty find free IP
mac (string) – (required)
scope_name (string) – (required)
- Status Codes:
201 Created – Created
400 Bad Request – Bad Request
500 Internal Server Error – Internal Server Error
- Response JSON Object:
dns_created (boolean)
fqdn (string)
hostname (string)
ip (string)
mac (string)
message (string)
scope (string)
success (boolean)
- DELETE /ddi/dhcp/reservations/{mac_address}
Delete a DHCP reservation
Deletes an existing DHCP reservation
- Parameters:
mac_address (string) – MAC Address
- Request JSON Object:
dns_zone (string) – Required if RemoveDNS=true
mac (string) – (required)
remove_dns (boolean) – Remove A+PTR records
scope_name (string) – (required)
- Status Codes:
200 OK – OK
404 Not Found – Not Found
500 Internal Server Error – Internal Server Error
- Response JSON Object:
message (string)
success (boolean)
- PUT /ddi/dhcp/reservations/{mac_address}
Update a DHCP reservation
Updates an existing DHCP reservation
- Parameters:
mac_address (string) – MAC Address
- Request JSON Object:
comment (string)
enabled (boolean)
hostname (string)
mac (string) – (required)
new_ip (string)
scope_name (string) – (required)
update_dns (boolean) – Update DNS records if IP changed
- Status Codes:
200 OK – OK
400 Bad Request – Bad Request
500 Internal Server Error – Internal Server Error
- Response JSON Object:
hostname (string)
ip (string)
mac (string)
message (string)
scope (string)
success (boolean)
- GET /ddi/dhcp/scopes
List all DHCP scopes
Retrieves all DHCP scopes from IPAM with optional filters
- Query Parameters:
network_id (string) – CloudStack network ID filter
zone_id (string) – Zone ID filter
enabled (boolean) – Filter by enabled state
include_stats (boolean) – Include utilization stats
- Status Codes:
200 OK – OK
500 Internal Server Error – Internal Server Error
- Response JSON Object:
data.scopes[].active_count (integer)
data.scopes[].available_count (integer)
data.scopes[].description (string)
data.scopes[].dns_servers[] (string)
data.scopes[].enabled (boolean)
data.scopes[].end_address (string)
data.scopes[].gateway (string)
data.scopes[].lease_time (string)
data.scopes[].name (string)
data.scopes[].network (string)
data.scopes[].reserved_count (integer)
data.scopes[].start_address (string)
data.scopes[].updated_at (string)
data.scopes[].utilization (number)
data.total_count (integer)
message (string)
success (boolean)
- POST /ddi/dhcp/scopes
Create a DHCP scope
Creates a new DHCP scope
- Request JSON Object:
description (string)
dns_servers[] (string)
enabled (boolean)
end_address (string) – (required)
excluded_ranges[] (string)
gateway (string) – (required)
lease_time (string) – e.g., “24h”, “86400s”
name (string) – (required)
network_cidr (string) – e.g., “10.1.1.0/24” (required)
network_id (string) – CloudStack network ID (optional)
start_address (string) – (required)
- Status Codes:
201 Created – Created
400 Bad Request – Bad Request
500 Internal Server Error – Internal Server Error
- Response JSON Object:
end_address (string)
message (string)
network (string)
scope_name (string)
start_address (string)
success (boolean)
- DELETE /ddi/dhcp/scopes/{scope_name}
Delete a DHCP scope
Deletes an existing DHCP scope
- Parameters:
scope_name (string) – DHCP Scope Name
- Status Codes:
200 OK – OK
404 Not Found – Not Found
500 Internal Server Error – Internal Server Error
- Response JSON Object:
message (string)
success (boolean)
- GET /ddi/dhcp/scopes/{scope_name}
Get DHCP scope details
Retrieves detailed information about a specific DHCP scope including reservations and leases
- Parameters:
scope_name (string) – DHCP Scope Name
- Status Codes:
200 OK – OK
404 Not Found – Not Found
500 Internal Server Error – Internal Server Error
- Response JSON Object:
data.active_leases[].first_seen (string)
data.active_leases[].hostname (string)
data.active_leases[].ip (string)
data.active_leases[].last_renewal (string)
data.active_leases[].lease_expires (string)
data.active_leases[].lease_time (string)
data.active_leases[].lease_type (string) – dynamic, reserved
data.active_leases[].mac (string)
data.active_leases[].scope (string)
data.active_leases[].state (string) – active, expired, released
data.reservations[].comment (string)
data.reservations[].created_at (string)
data.reservations[].enabled (boolean)
data.reservations[].hostname (string)
data.reservations[].ip (string)
data.reservations[].mac (string)
data.reservations[].modified_at (string)
data.reservations[].scope (string)
data.scope.active_count (integer)
data.scope.available_count (integer)
data.scope.description (string)
data.scope.dns_servers[] (string)
data.scope.enabled (boolean)
data.scope.end_address (string)
data.scope.gateway (string)
data.scope.lease_time (string)
data.scope.name (string)
data.scope.network (string)
data.scope.reserved_count (integer)
data.scope.start_address (string)
data.scope.updated_at (string)
data.scope.utilization (number)
data.statistics.active_leases (integer)
data.statistics.additional_stats (object)
data.statistics.available_addresses (integer)
data.statistics.avg_lease_duration (string)
data.statistics.excluded_ranges[] (string)
data.statistics.expired_leases (integer)
data.statistics.last_updated (string)
data.statistics.peak_utilization (number)
data.statistics.recent_leases[].first_seen (string)
data.statistics.recent_leases[].hostname (string)
data.statistics.recent_leases[].ip (string)
data.statistics.recent_leases[].last_renewal (string)
data.statistics.recent_leases[].lease_expires (string)
data.statistics.recent_leases[].lease_time (string)
data.statistics.recent_leases[].lease_type (string) – dynamic, reserved
data.statistics.recent_leases[].mac (string)
data.statistics.recent_leases[].scope (string)
data.statistics.recent_leases[].state (string) – active, expired, released
data.statistics.reserved_count (integer)
data.statistics.scope_name (string)
data.statistics.top_reservations[].comment (string)
data.statistics.top_reservations[].created_at (string)
data.statistics.top_reservations[].enabled (boolean)
data.statistics.top_reservations[].hostname (string)
data.statistics.top_reservations[].ip (string)
data.statistics.top_reservations[].mac (string)
data.statistics.top_reservations[].modified_at (string)
data.statistics.top_reservations[].scope (string)
data.statistics.total_addresses (integer)
data.statistics.utilization_percent (number)
message (string)
success (boolean)
- PUT /ddi/dhcp/scopes/{scope_name}
Update a DHCP scope
Updates an existing DHCP scope
- Parameters:
scope_name (string) – DHCP Scope Name
- Request JSON Object:
description (string)
dns_servers[] (string)
enabled (boolean)
end_address (string)
exclude_range (string) – Add excluded range
gateway (string)
include_range (string) – Remove excluded range
lease_time (string)
name (string) – (required)
start_address (string)
- Status Codes:
200 OK – OK
400 Bad Request – Bad Request
500 Internal Server Error – Internal Server Error
- Response JSON Object:
message (string)
success (boolean)
- POST /ddi/dhcp/scopes/{scope_name}/disable
Disable a DHCP scope
Disables a DHCP scope
- Parameters:
scope_name (string) – DHCP Scope Name
- Status Codes:
200 OK – OK
500 Internal Server Error – Internal Server Error
- Response JSON Object:
message (string)
success (boolean)
- POST /ddi/dhcp/scopes/{scope_name}/enable
Enable a DHCP scope
Enables a DHCP scope
- Parameters:
scope_name (string) – DHCP Scope Name
- Status Codes:
200 OK – OK
500 Internal Server Error – Internal Server Error
- Response JSON Object:
message (string)
success (boolean)
- GET /ddi/dhcp/scopes/{scope_name}/statistics
Get DHCP scope statistics
Retrieves detailed statistics for a DHCP scope
- Parameters:
scope_name (string) – DHCP Scope Name
- Status Codes:
200 OK – OK
404 Not Found – Not Found
500 Internal Server Error – Internal Server Error
- Response JSON Object:
data.active_leases (integer)
data.additional_stats (object)
data.available_addresses (integer)
data.avg_lease_duration (string)
data.excluded_ranges[] (string)
data.expired_leases (integer)
data.last_updated (string)
data.peak_utilization (number)
data.recent_leases[].first_seen (string)
data.recent_leases[].hostname (string)
data.recent_leases[].ip (string)
data.recent_leases[].last_renewal (string)
data.recent_leases[].lease_expires (string)
data.recent_leases[].lease_time (string)
data.recent_leases[].lease_type (string) – dynamic, reserved
data.recent_leases[].mac (string)
data.recent_leases[].scope (string)
data.recent_leases[].state (string) – active, expired, released
data.reserved_count (integer)
data.scope_name (string)
data.top_reservations[].comment (string)
data.top_reservations[].created_at (string)
data.top_reservations[].enabled (boolean)
data.top_reservations[].hostname (string)
data.top_reservations[].ip (string)
data.top_reservations[].mac (string)
data.top_reservations[].modified_at (string)
data.top_reservations[].scope (string)
data.total_addresses (integer)
data.utilization_percent (number)
success (boolean)