CobraServicesGetEnvironmentDetails Method |
GetEnvironmentDetails Cobra Web Service
Namespace: Cobra.WebService.ClientAPI.ClientAssembly: Cobra.WebService.ClientAPI (in Cobra.WebService.ClientAPI.dll) Version: 8.7.700.3793 (8.7.0700.3793)
Syntax
Example
This example shows how to get the environment details.
using Cobra.WebService.ClientAPI;
using Cobra.WebService.ClientAPI.Client;
using Cobra.WebService.ClientAPI.Application.Files;
using Cobra.Model.WebService;
.
.
.
CobraServices cobraServices = new CobraServices();
cobraServices.ServiceIdentityData.Username = "SYSADMIN";
cobraServices.ServiceIdentityData.SecurePassword = new SecurePassword();
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('P');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('A');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('S');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('S');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('W');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('O');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('R');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('D');
cobraServices.ServiceIdentityData.DataSourceKey = "COBRA";
LoginResult loginResult = cobraServices.Login();
if (!loginResult.Success) {
Console.WriteLine("Login failed.");
return;
}
Console.WriteLine("Login Success.");
Console.WriteLine("Getting environment details...");
EnvironmentDetailResult getEnvironmentDetailsServiceResult = _cobraServices.GetEnvironmentDetails();
foreach (ServiceEnvironment serviceEnvironment in getEnvironmentDetailsServiceResult.ServiceEnvironments) {
Console.WriteLine(string.Format("Server URL: ", serviceEnvironment.ServiceURL));
Console.WriteLine(string.Format("Service Name: {0}", serviceEnvironment.ServiceName));
Console.WriteLine(string.Format("Machine Id: {0}", serviceEnvironment.MachineId));
Console.WriteLine(string.Format("Service Type: {0}", serviceEnvironment.ServiceType));
Console.WriteLine(string.Format("Connection Successful: {0}", serviceEnvironment.ConnectionSuccessful));
Console.WriteLine(string.Format("Application Version: {0}", serviceEnvironment.ApplicationVersion));
Console.WriteLine(string.Format("Database Version: {0}", serviceEnvironment.DatabaseVersion));
Console.WriteLine(string.Format("Version Updated: {0}", serviceEnvironment.VersionUpdated));
Console.WriteLine(string.Format("Need database update: {0}", serviceEnvironment.NeedDatabaseUpdate));
Console.WriteLine(string.Format("Need engine update: {0}", serviceEnvironment.NeedEngineUpdate));
Console.WriteLine(string.Format("Processlog Directory: {0}", serviceEnvironment.ProcessLogDirectory));
Console.WriteLine(string.Format("Report Template Directory: {0}", serviceEnvironment.ReportTemplateDirectory));
Console.WriteLine(string.Format("Is Report Template Directory accessible to Cobra engine: {0}", serviceEnvironment.IsReportTemplateDirectoryAccessible));
}
cobraServices.Logout();
See Also