3.1.1.1.30.2.4 GetPoliciesForServerByServerId

The GetPoliciesForServerByServerId procedure retrieves all the DHCP policies that are associated with a specific DHCP server.

The following input parameter is used.

Param_serverId: This is a signed 64-bit integer that represents a RecordId for a DhcpServerv4.

The following is the output parameter from this procedure.

Result_serverPolicies: This is a collection of type DhcpPolicyv4 instances that have the same value in the server column of the row as specified by Param_serverId.

The following steps are involved:

  1. Enumerate the rows in ADM_DhcpPolicyTable having Server equal to Param_serverId and Level equal to PolicyLevel.serverLevel.

  2. Initialize Result_serverPolicies.

  3. For each row meeting the criteria mentioned in step 1, perform the following steps:

  4. Create an instance of DhcpPolicyV4 with the following assignments:

    1. Set DhcpPolicyV4.PolicyId to the PolicyId of the row.

    2. Copy the PolicyDetails to the DhcpPolicyV4 instance.

    3. Initialize DhcpPolicyV4.Server with DhcpServerV4.

    4. Set DhcpPolicyV4.Server.RecordId to the Server of the row.

    5. Initialize DhcpPolicyV4.ServerRecordId with the Server of the row.

    6. Add the DhcpPolicyV4 instance to Result_serverPolicies collection.

  5. Return Result_scopePolicies as the output of the procedure.