VMware VC-SRM4-A Developer's Guide - Page 19
Logical Order API Usage, Protection and Recovery Plans, Connecting to an SRM Server
View all VMware VC-SRM4-A manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 19 highlights
3 Logical Order API Usage 3 This chapter contains the following major sections: "Connecting to an SRM Server" on page 19 "Protection Groups and Replication" on page 22 "Recovery Plans and Reprotection" on page 26 "vSphere Replication Methods" on page 31 Protection and Recovery Plans You use the UI to create protection groups and set up replication, or to create recovery plans and reprotection. The API does not contain methods for these. For details about the UI, see the SRM Administration Guide. Connecting to an SRM Server Programs connect to an SRM server using the SrmLoginLocale API, or to SRM servers at both the protected site and the recovery site using the SrmLoginSites API. Managed Object Reference SRM methods take a managed object reference _this, which references the SessionManager used for making method calls. Programs obtain _this by retrieving content of the ServiceInstance, which is accomplished by creating a new managed object reference of type SrmServiceInstance. Example 3-1. C# code to create SrmServiceInstance public SvcConnection(string svcRefVal) { ... _svcRef = new ManagedObjectReference(); _svcRef.type = "SrmServiceInstance"; _svcRef.Value = svcRefVal; } The Java code is similar to the C# code. Example 3-2. Java code to create SrmServiceInstance private static final String SVC_INST_NAME = "SrmServiceInstance"; private static ManagedObjectReference SVC_INST_REF = new ManagedObjectReference(); ... SVC_INST_REF.setType(SVC_INST_NAME); SVC_INST_REF.setValue(SVC_INST_NAME); srmService = new SrmService(); VMware, Inc. 19