|
Version: 8
HC8 Build: 8.00.0010 and later
API Build: 2.00
Server Manager - GetServers retrieves all servers in cluster. This web service call can be made as http://your-domain.com/HC8API/ServerManager.asmx?op=GetServers.
Input Parameters
HostUserName
HostPassword
OptionalParam
Role - possible values are Web Server, DNS Server, Mail Server, Database Server, SharePoint Server, Dynamics CRM Server, BlackBerry Server, OCS Server and Hyper-V Server
ServerName - search filter, if you want to get details of a specific server
Platform - possible values are Windows and Linux
Language
Output Parameters
ServerID - a unique identification number given to each server
ServerName - name of the server
Role - role of the server i.e. Web Server or Mail Server etc
Capacity - capacity of server according to role in cluster
Consumed - consumed part of total capacity
Platform - platform of the server i.e. Windows or Linux
Sample Optional Parameters
<Parameters>
<Parameter Name = "Role">DNS Server</Parameter>
<Parameter Name = "Language">French</Parameter>
<Parameter Name = "Platform">Windows</Parameter>
</Parameters>
Sample SOAP Request
POST /HC8API/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>
<OptionalParam>xml</OptionalParam>
</GetServers>
</soap:Body>
</soap:Envelope>
Sample HTTP Request
POST /HC8API/Servermanager.asmx/GetServers HTTP/1.1
Host: your-domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
HostUserName=host&HostPassword=host123&OptionalParam=xml
Sample C# Code
public ServerManager.Response GetServers(string strHostUserName, string strHostPassword)
{
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, xOptionalParam);
}
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>
<Platform>Windows</Platform>
</RecordRow>
<RecordRow>
<ServerID>1</ServerID>
<ServerName>abc</ServerName>
<Role>DNS Server</Role>
<Capacity>500</Capacity>
<Consumed>6</Consumed>
<Platform>Windows</Platform>
</RecordRow>
.......
.......
.......
</Servers>
</Result>
</Response>