PlanWebService.AddHostsAsIpAddressesToAccountPlan Method 

Creates hosts for a specified IP addresses (if there are no hosts linked to the IP address) and then add the hosts to a plan of an account specified by accountId.

[C#]
public PlanHostResult[] AddHostsAsIpAddressesToAccountPlan(
   string accountId,
   string[] ipAddresses
);

Parameters

accountId
ID of the account. Hosts will be added to the plan of this account.
ipAddresses
IP addresses to be added to the plan as hosts.

Remarks

Only administrators and resellers are allowed to use this method. New hosts are created for a user specified in SOAP-header (see CredentialsSoapHeader). The account specified by accountId must belong to the accounts subtree of the user specified in SOAP-header. If the account login is same as the user's login, then no plan modifications occurs, only the host processing will be executed. The hosts are added to all plans recursively: from the plan of the account specified by accountId upto all child plans of the user specified by SOAP-header.

Example SOAP 1.1

Request
POST /sbw_trunk/ServiceFacade/4.5/PlanWebService.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://swsoft.com/webservices/sb/4.5/PlanService/AddHostsAsIpAddressesToAccountPlan"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <CredentialsSoapHeader xmlns="http://swsoft.com/webservices/sb/4.5/PlanService">
      <Login>string</Login>
      <Password>string</Password>
    </CredentialsSoapHeader>
  </soap:Header>
  <soap:Body>
    <AddHostsAsIpAddressesToAccountPlan xmlns="http://swsoft.com/webservices/sb/4.5/PlanService">
      <accountId>string</accountId>
      <ipAddresses>
        <string>string</string>
        <string>string</string>
      </ipAddresses>
    </AddHostsAsIpAddressesToAccountPlan>
  </soap:Body>
</soap:Envelope>
Response
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <AddHostsAsIpAddressesToAccountPlanResponse xmlns="http://swsoft.com/webservices/sb/4.5/PlanService">
      <AddHostsAsIpAddressesToAccountPlanResult>
        <PlanHostResult>
          <IPAddress>string</IPAddress>
          <ResultCode>UnknownError or Found or Added or Invalid or NotFound or AccessDenied</ResultCode>
          <HostId>string</HostId>
        </PlanHostResult>
        <PlanHostResult>
          <IPAddress>string</IPAddress>
          <ResultCode>UnknownError or Found or Added or Invalid or NotFound or AccessDenied</ResultCode>
          <HostId>string</HostId>
        </PlanHostResult>
      </AddHostsAsIpAddressesToAccountPlanResult>
    </AddHostsAsIpAddressesToAccountPlanResponse>
  </soap:Body>
</soap:Envelope>

See Also

PlanWebService Web Service | Web services