remotepass – password for that user on the remote vCenter Server
locale – name of the locale for this session
SrmLogoutLocale
This method logs out of the SRM server and terminates the current session. It takes the same managed object
reference as for SrmLoginLocale, and should be called with other methods to clean up a connection.
Example 3-6. C# code to log out
public void Disconnect()
{
if (_service != null)
{
_service.SrmLogoutLocale(_svcRef);
_service.Dispose();
_service = null;
_sic = null;
}
}
The Java code is simpler than the C# code.
Example 3-7. Java code to log out
private static void disconnect() throws Exception {
if (isConnected) {
srmPort.srmLogoutLocale(SVC_INST_REF);
}
isConnected = false;
}
GetApiVersion
This method gets the API version on the SRM Server that the program is logged into. Note that this is an old
version 1.0 method, part of managed object SrmApi, and unlike most other methods local to SrmApi, has no
direct replacement in the 5.0 API.
Example 3-8. Method to get API version
apiversion = _service.GetApiVersion(_svcRef);
Parameter and return value:
_svcRef – managed object reference to SrmServiceInstance
apiversion – a string representing the API version, such as "5.0"
Table
3‐1 shows the remaining old 1.0 APIs and their replacement 5.0 APIs.
Table 3-1. Replaced APIs
SrmApi
ListRecoveryPlans
RecoveryPlanAnswerPrompt
RecoveryPlanSettings
RecoveryPlanStart, RecoveryPlanCancel
GetFinalStatus
VMware, Inc.
Replacement 5.0 API
SrmRecovery.ListPlans
SrmRecoveryPlan.AnswerPrompt
SrmRecoveryPlan.RecoveryPlanGetInfo
SrmRecoveryPlan.Start, SrmRecoveryPlan.Cancel
SrmRecoveryHistory.GetRecoveryResult
Chapter 3 Logical Order API Usage
21
Need help?
Do you have a question about the VC-SRM4-A - vCenter Site Recovery Manager and is the answer not in the manual?