Management Plane API > Networking > Services > DHCP

Update a DHCP server profile

If both the edge_cluster_member_indexes in the DhcpProfile are changed in
a same PUT API, e.g. change from [a,b] to [x,y], the current DHCP server
leases will be lost, which could cause the network crash due to ip conflicts.
Hence the suggestion is to change only one member index in one single update,
e.g. from [a, b] to [a,y].

Please note, the edge_cluster_id in DhcpProfile can NOT be changed by this
PUT operation because all existing DHCP leases will lost. If losing leases
is not a problem, a dedicated re-allocation API is suggested to modify the
edge-cluster-id, i.e. "POST /api/v1/dhcp/dhcp-profiles/?action=reallocate".

Meanwhile, if the edge_cluster_member_indexes was specified currently but
now is changed to none (not specified) via a PUT operation, the edge nodes
will not be auto-selected from edge cluster. Instead, the previously-allocated
edge nodes will continue to be used by the DHCP server. This is because
changing both edge nodes of a DHCP server will lose all existing leases.
In case re-allocation is required and leases lost is not a problem (or can
be recovered), please invoke the reallocate API mentioned above with new
DhcpProfile to accomplish the intent.

Request:

Method:
PUT
URI Path(s):
/api/v1/dhcp/server-profiles/<profile-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
DhcpProfile+

Example Request:

PUT https://<nsx-mgr>/api/v1/dhcp/server-profiles/ee5711ce-e4d5-4f88-8330-b79c01d3bf7c { "display_name" : "DHCP-server-profile-3", "edge_cluster_id" : "4a6a13e0-eb66-4c02-96c3-85c9a250a946", "_revision" : 0 }

Successful Response:

Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
DhcpProfile+

Example Response:

{ "resource_type" : "DhcpProfile", "id" : "ee5711ce-e4d5-4f88-8330-b79c01d3bf7c", "display_name" : "DHCP-server-profile-3", "edge_cluster_id" : "4a6a13e0-eb66-4c02-96c3-85c9a250a946", "enable_standby_relocation" : false, "_last_modified_user" : "admin", "_last_modified_time" : 1478301632680, "_revision" : 1 }

Required Permissions:

crud

Feature:

dhcp_server_profiles

Additional Errors: