Server Manager - GetServers

Version: 7C

HC7 Build: 7.00.0012 and later

API Build: 1.00.0001 and later

 

Server Manager - GetServers  retrieves all servers in cluster. This web service call can be made as http://your-domain.com/HC7API/ServerManager.asmx?op=GetServers.

 

Input Parameters

 

Output Parameters

 

 

Sample Optional Parameters

 

<Parameters>

<Parameter Name = "Role">DNS Server</Parameter>

<Parameter Name = "Language">French</Parameter>

</Parameters>

 

Sample SOAP Request

 

 

POST /HC7API/Servermanager.asmx HTTP/1.1

Host: your-domain.com

Content-Type: text/xml; charset=utf-8

Content-Length: length

SOAPAction: "http://tempuri.org/GetServers"

<?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>

    <GetServers xmlns="http://tempuri.org/">

      <HostUserName>host</HostUserName>

      <HostPassword>host123</HostPassword>

      <OwnerName>host</OwnerName>

      <OptionalParam>xml</OptionalParam>

    </GetServers>

  </soap:Body>

</soap:Envelope>

 

 

Sample HTTP Request

 

 

POST /HC7API/Servermanager.asmx/GetServers HTTP/1.1

Host: your-domain.com

Content-Type: application/x-www-form-urlencoded

Content-Length: length

HostUserName=host&HostPassword=host123&OwnerName=host&OptionalParam=xml

 

 

Sample C# Code

 

 

public ServerManager.Response GetServers(string strHostUserName, string strHostPassword, string strOwnerName)

{

         try

         {

                    ServerManager.ServerManager oServer= new ServerManager.ServerManager();

                    ServerManager.Response oResponse = new ServerManager.Response();

                    

                    XmlDocument oDoc = new XmlDocument();

                    //Adding root node

                    XmlNode xOptionalParam = oDoc.CreateNode(XmlNodeType.Element,"Parameters","");

                    //Adding sub nodes

                    XmlNode xParameter = oDoc.CreateNode(XmlNodeType.Element,"Parameter","");

                    XmlAttribute xAttribute = oDoc.CreateAttribute("Name");

                    xAttribute.Value = "Role";

                    xParameter.Attributes.Append(xAttribute);

                    xParameter.InnerText = "DNS Server";

                    xOptionalParam.AppendChild(xParameter);

                    .......

                    .......

                    .......

                    oResponse = oServer.GetServers(strHostUserName, strHostPassword, strOwnerName,           

                    OptionalParam);    

       

          }

          catch

          {

          }

          return oResponse;

}

 

 

Sample Response

 

 

<Response>

    <Method>GetServers</Method>

    <Status>true</Status>    
<ErrorCode>74900001</ErrorCode>    
<ErrorDescription>Operation completed successfully.</ErrorDescription>

    <Result>

        <Servers xmlns="">

            <RecordRow>

                <ServerID>1</ServerID>

                <ServerName>abc</ServerName>

                <Role>Web Server</Role>

                <Capacity>700</Capacity>

                <Consumed>4</Consumed>

            </RecordRow>

            <RecordRow>

                <ServerID>1</ServerID>

                <ServerName>abc</ServerName>

                <Role>DNS Server</Role>

                <Capacity>500</Capacity>

                <Consumed>6</Consumed>

            </RecordRow>

                  .......

                  .......

                  .......

        </Servers>

    </Result>

</Response>