Touchstone Re 2023 API Reference
SubmitUpgradeDatabase Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > DataSourceManagementServiceClient Class : SubmitUpgradeDatabase Method
Contains a SubmitUpgradeDatabaseRequest that identifies the properties of the Database that you want to upgrade, along with the associated Touchstone-generated Business Unit Sequential Identifier (SID) and SQL Instance SID.
Upgrades an existing Touchstone® Database.

Upgrading a Database means updating it to the latest version.

You can upgrade a database from one release of Touchstone to the next major release of Touchstone. For example, you can upgrade a Touchstone 3.x database to Touchstone 4.x.

To view the current version of your Touchstone client, use the GetSecurityPolicy() method.

Syntax
Public Function SubmitUpgradeDatabase( _
   ByVal request As SubmitUpgradeDatabaseRequest _
) As SubmitUpgradeDatabaseResponse
Dim instance As DataSourceManagementServiceClient
Dim request As SubmitUpgradeDatabaseRequest
Dim value As SubmitUpgradeDatabaseResponse
 
value = instance.SubmitUpgradeDatabase(request)

Parameters

request
Contains a SubmitUpgradeDatabaseRequest that identifies the properties of the Database that you want to upgrade, along with the associated Touchstone-generated Business Unit Sequential Identifier (SID) and SQL Instance SID.

Return Value

A SubmitUpgradeDatabaseResponse containing the Activity SID that uniquely identifies the asynchronous web service call that you made to upgrade the specified Database.
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.

To upgrade a Database, perform the following steps:

  1. Get the Database that you want to upgrade by calling the GetDatabases() method.
  2. Pass the desired Database object from the previous step as part of the SubmitUpgradeDatabaseRequest object for the SubmitUpgradeDatabase() method.
Example
The following example shows how to upgrade a Touchstone Database using the SubmitUpgradeDatabase() method:
using System;
using System.Linq;
using AIR.Services.Common.Data;
using AIR.Services.DataSourceManagement.Api;
using AIR.Services.DataSourceManagement.Data;
            
class SnippetSubmitUpgradeDatabaseRequest
{
    private static void SubmitUpgradeDatabase(int businessUnitSid, int sqlInstanceSid, string dbServerName, string dbName)
    {
        DataSourceManagementServiceClient dsClient = new DataSourceManagementServiceClient();
        GetDatabasesRequest request = new GetDatabasesRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
        request.DataServerName = dbServerName;
        GetDatabasesResponse response = dsClient.GetDatabases(request);
        if (response.Status.Code == StatusCode.Success)
        {
            /// Find the Data Source object.
            Database db = response.Databases.FirstOrDefault(d => d.Name == dbName);
            if (db == null)
            {
                Console.WriteLine("Database not found");
                return;
            }
            SubmitUpgradeDatabaseRequest upgradeDatabaseRequest = new SubmitUpgradeDatabaseRequest();
            /// Set the BusinessUnitSid property (required property)
            upgradeDatabaseRequest.BusinessUnitSid = businessUnitSid;
            /// Set the SqlInstanceSid property (required property)
            upgradeDatabaseRequest.SqlInstanceSid = sqlInstanceSid;
            /// Set the database to upgrade (required property)
            upgradeDatabaseRequest.Database = db;
            
            /// Submit the request and get response back
            SubmitUpgradeDatabaseResponse upgradeDatabaseResponse = dsClient.SubmitUpgradeDatabase(upgradeDatabaseRequest);
            if (upgradeDatabaseResponse.Status.Code == StatusCode.Success)
                Console.WriteLine("Submitted successfully to HPC with Activity ID: " + upgradeDatabaseResponse.ActivitySid);
        }
    }
}
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

DataSourceManagementServiceClient Class
DataSourceManagementServiceClient Members