Touchstone Re 2023 API Reference
GetProjects Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > ProjectManagementServiceClient Class : GetProjects Method
Contains a GetProjectsRequest that identifies the Touchstone-generated Business Unit Sequential Identifier (SID) and SQL Instance SID associated with the list of Projects that you want to retrieve.
Retrieves a list of all existing Touchstone® Projects for a given Business Unit and SQL Server Instance.
Syntax
Public Function GetProjects( _
   ByVal request As GetProjectsRequest _
) As GetProjectsResponse
Dim instance As ProjectManagementServiceClient
Dim request As GetProjectsRequest
Dim value As GetProjectsResponse
 
value = instance.GetProjects(request)
public GetProjectsResponse GetProjects( 
   GetProjectsRequest request
)

Parameters

request
Contains a GetProjectsRequest that identifies the Touchstone-generated Business Unit Sequential Identifier (SID) and SQL Instance SID associated with the list of Projects that you want to retrieve.

Return Value

A GetProjectsResponse containing a list of Projects in the specified SQL Server Instance in the specified Business Unit.
Remarks
To find the Business Unit SID to pass into this method, call the GetBusinessUnits() method.

To find the SQL Instance SID to pass into this method, call the GetSqlInstances() method.

Example
The following example shows how to retrieve a list of all Touchstone Projects for a given Business Unit and SQL Server Instance using the GetProjects() method:
using System;
using AIR.Services.Common.Data;
using AIR.Services.ProjectManagement.Api;
using AIR.Services.ProjectManagement.Data;
            
class SnippetGetProjectsRequest
{
    private static void GetProjects(int businessUnitSid, int sqlInstanceSid)
    {
        ProjectManagementServiceClient projectClient = new ProjectManagementServiceClient();
        GetProjectsRequest request = new GetProjectsRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
        GetProjectsResponse response = projectClient.GetProjects(request);
        if (response.Status.Code == StatusCode.Success)
        {
            foreach (Project project in response.Projects)
            {
                Console.WriteLine("SID: " + project.Sid);
                Console.WriteLine("Name: " + project.Name);
                Console.WriteLine("Total Exposure Sets: " + project.ExposureSetCount);
                Console.WriteLine("Total Exposure Views: " + project.ExposureViewCount);
                Console.WriteLine("Total Result Sets: " + project.ResultSetCount);
            }
        }
    }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ProjectManagementServiceClient Class
ProjectManagementServiceClient Members