Site Recovery Manager API Developer’s Guide

3y ago
39 Views
2 Downloads
1.16 MB
54 Pages
Last View : 4d ago
Last Download : 3m ago
Upload by : Mariam Herr
Transcription

Site Recovery Manager APIDeveloper’s GuideVMware vCenter Site Recovery Manager 5.8EN-001401-00

Site Recovery Manager API Developer’s GuideYou can find the most up-to-date technical documentation on the VMware Web site at:http://www.vmware.com/support/The VMware Web site also provides the latest product updates.If you have comments about this documentation, submit your feedback to:docfeedback@vmware.comCopyright 2011–2014 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright andintellectual property laws. VMware products are covered by one or more patents listed athttp://www.vmware.com/go/patents.VMware is a registered trademark or trademark of VMware, Inc. in the United States and/or other jurisdictions. All other marksand names mentioned herein may be trademarks of their respective companies.VMware, Inc.3401 Hillview Ave.Palo Alto, CA 94304www.vmware.com2VMware, Inc.

ContentsAbout This Book71 The Site Recovery Manager API 9Introduction to the API 9API Releases 9Terminology 9List of API Operations 10Managed Object Hierarchy 12WSDL Programming Environments 14SRM Objects as WSDL 14C# and Visual Studio 16Java JAX‐WS Framework 16Java Axis Client 16Accessing vCenter Site Recovery Manager 16Location of the API 16Associated vCenter Server 162 SDK Installation and Setup 17Contents of the SDK Package 17SDK Directory Structure 17Download and Setup Procedure 18About the C# .NET Samples 19About the Java JAX‐WS Samples 20About the Java Axis Samples 213 Logical Order API Usage 23Protection and Recovery Plans 23Connecting to an SRM Server 23Managed Object Reference 23SrmLoginLocale 24SrmLoginSites 24SrmLogoutLocale 25GetApiVersion 25Protection Groups and Replication 26ListInventoryMappings 26ListProtectionGroups 26ListReplicatedDatastores 26ProtectVms 27UnprotectVms 27GetTasks 27IsComplete 27GetResult 28GetProtectionStatus 28GetInfo 28GetPeer 28GetProtectionState 29ListProtectedDatastores 29VMware, Inc.3

Site Recovery Manager API Developer’s GuideListProtectedVms 29ProtectionGroupQueryVmProtection 30ProtectionGroupListRecoveryPlans 30Recovery Plans and Reprotect 31ListPlans 31GetHistory 31RecoveryPlanGetInfo 31RecoveryPlanGetPeer 32Start 33Cancel 33ListPrompts 33AnswerPrompt 33GetHistory 34GetRecoveryResult 34GetResultCount 34GetResultLength 35RetrieveStatus 35vSphere Replication Methods 35ListAssociatedVms 35AssociateVms 36UnassociateVms 364 Protection Group APIs 37Protection Groups for Virtual Machines 37Resource Mappings 37MoRef – Managed Object Reference 37Protection Group API for Virtual Machines 38AddFolderMapping 38AddNetworkMapping 38AddProtectionGroup 38AddResourcePoolMapping 39CreateAbrProtectionGroup 39CreateHbrProtectionGroup 39GetCreateProtectionGroupResult 40GetName 40GetNewProtectionGroup 40GetPairedSite 40GetParentFolder 41GetProtectionGroupRootFolder 41GetProtectionGroup 41GetRecoveryPlanRootFolder 41GetRecoveryPlan 42GetRecoverySettings 42GetSiteName 42IsCreateProtectionGroupComplete 43ListChildProtectionGroupFolders 43ListChildProtectionGroups 43ListChildRecoveryPlanFolders 43ListChildRecoveryPlans 44ListUnassignedReplicatedDatastores 44ListUnassignedReplicatedVms 44ProtectionGroupGetParentFolder 44ProtectionListProtectedDatastores 45ProtectionListProtectedVms 45RecoveryPlanGetParentFolder 45SetRecoverySettings 454VMware, Inc.

ContentsSrmLoginRemoteSite 46SRM Faults 47A SSL Certificates and SNMP Traps 49SSL Certificates 49Server Certificate Requirements 49Exporting Cached Certificates to a Local Directory 50About the Virtual Machine Keystore 50SNMP Traps 51MIB Names for SNMP Traps 51Configuring SNMP Receivers in vCenter Server 52SNMP Traps and Object IDs 52Index 53VMware, Inc.5

Site Recovery Manager API Developer’s Guide6VMware, Inc.

About This BookThe Site Recovery Manager API Developer’s Guide provides information about programming applications withthe Web services interfaces to VMware vCenter Site Recovery Manager .This manual provides information about old and new interfaces in the Site Recovery Manager 5.0 and 5.8releases, for developers who are interested in automating site recovery tasks.Revision HistoryThis book is revised with each product release or when necessary. Table 1 summarizes changes in each release.Table 1. Revision HistoryRevision DateDescription9 September 2014Revised for the 5.8 release to include protection group APIs and improved SDK support for Java.4 October 2013Added cleanupTest mode on page 8, and more about SNMP traps.23 May 2013Specified WSDL port number on page 12.27 January 2012Added Associated vCenter Server on page 12, corrected array based replication on pages 22‐23.17 November 2011Updated Site Recovery Manager API Developer’s Guide published after the 5.0 release.16 June 2008Technical note entitled Site Recovery Manager API published with the 1.0 release.Intended AudienceThis book is intended for developers who need to set up their environment to program applications with theSite Recovery Manager API. These developers are typically programmers using the Java or C# language andlibraries to perform replication, recovery, and reprotection of virtual machines in VMware vSphere.Site Recovery Manager developers should have some familiarity with the Web Services Description Language(WSDL) and the Simple Object Access Protocol (SOAP) for transmitting XML across the network. However theimportant interfaces are completely visible in Java or C# code.VMware Developer PublicationsTo view the current version of this book as well as other VMware API and SDK public documentation, go tohttp://www.vmware.com/support/pubs/sdk pubs.html.VMware Technical Publications GlossaryVMware Technical Publications provides a glossary of terms that might be unfamiliar to you. For definitionsof terms as they are used in VMware technical documentation go to http://www.vmware.com/support/pubs.VMware, Inc.7

Site Recovery Manager API Developer’s GuideDocument FeedbackVMware welcomes your suggestions for improving our documentation. Send your feedback todocfeedback@vmware.com.8VMware, Inc.

1The Site Recovery Manager API1This manual describes a Web services programming interface to protection groups and recovery plans inVMware vCenter Site Recovery Manager (SRM). This chapter presents the following topics. “Introduction to the API” on page 9 “List of API Operations” on page 10 “Managed Object Hierarchy” on page 12 “WSDL Programming Environments” on page 14 “Accessing vCenter Site Recovery Manager” on page 16Introduction to the APIThe SRM API provides an interface similar to the vSphere API, which is an object‐oriented Web service thatprovides access to vSphere and virtual machine management on vCenter Server and ESXi hosts. You programthe vSphere API in Java, C#, or any language that supports Web services definition language (WDSL).The SRM API offers a way for third party systems to initiate test, recovery, reprotect, or revert operations andcollect the results. Protection groups and recovery plans are usually set up from the user interface (UI).API ReleasesThe SRM 5.0 release extended the API with new methods to list and modify protection groups, and revisedmethods to list, modify, and run recovery plans. The SRM 5.8 release introduces 30 methods and four newmanaged objects, adding several requested features to the API, including: Ability to add folder, network, and resource pool mappings Support for planned migrations Navigation capabilities for protection group folders and recovery plan folders Ability to create protection groups Ability to modify selected fields in a virtual machine’s recovery settingsTerminologyThis document uses the following terms as defined below: SOAP – Client applications invoke operations by sending SOAP formatted messages. When passing dataobjects between client and server, you need to build or parse a SOAP message that contains the data objectproperties as XML elements corresponding to the message structures described in the WSDL.Standardized by W3C as Simple Object Access Protocol (SOAP) 1.1. Web service operations – Client interfaces that perform server‐side management and monitoring tasks.Standardized as Web Services Interoperability Organization (WS‐I) Basic Profile 1.0.VMware, Inc.9

Site Recovery Manager API Developer’s Guide WSDL – The Web services API is defined in a WSDL file, which is used by client‐side Web services tocreate proxy code (stubs) that client applications use to interact with the server.Standardized as Web Services Description Language (WSDL) 1.1. XML – A text representation scheme similar to HTML but with more stringent regularized syntax.Standardized by W3C as Extensible Markup Language (XML) 1.0.The Site Recover Manager API is similar to, and derived from, the vSphere API. For information about thevSphere API, see the vSphere Web Services SDK Programming Guide and the vSphere API Reference, both availableon the VMware Web site.List of API OperationsTable 1‐1 provides a list of Site Recovery Manager APIs organized by approximate order of use.Table 1-1. List of API operations by functionMethodDescription of OperationAuthenticationSrmLoginLocaleBegin a session with Site Recovery Manager Server.SrmLoginSitesLog in to both the local and remote vCenter Servers.SrmLogoutLocaleLog out sites and terminate the current session.SrmLoginRemoteSiteLog in to remote site when escalated privileges are required on the remote siteand the current session has already been authenticated using SrmLoginSites.Service InstanceRetrieveContentRetrieve the properties of a service instance.Inventory MappingAddFolderMappingAdd a folder mapping between the primary and secondary vCenter Servers.AddNetworkMappingAdd a network mapping between the primary and secondary vCenter Servers.AddResourcePoolMappingAdd resource pool mapping between primary and secondary vCenter Servers.ProtectionListProtectionGroupsGet a list of the protection groups that are currently configured.ListInventoryMappingsGet a list of the configured inventory mappings on the protection site.ListReplicatedDatastoresGet a list of the replicated datastores.GetProtectionGroupRootFolderGet the root folder for all protection groups, so as to navigate folder hierarchy.The methods below give users the ability to locate replicated resources andconstruct protection groups, key features of the 5.8 API.ListUnassignedReplicatedDatastoresGet list of replicated datastores that can be used to create new protection groups.ProtectionListProtectedDatastoresGet list of replicated datastores that are protected by SRM.ListUnassignedReplicatedVmsGet list of replicated VMs not currently assigned to an SRM protection group.ProtectionListProtectedVmsGet list of virtual machines that are protected by SRM.CreateAbrProtectionGroupCreate an array‐based replication (ABR) protection group.CreateHbrProtectionGroupCreate a host‐based replication (HBR) protection group.Protection Group Folder10Methods to navigate folder hierarchy and retrieve specific protection groups.ListChildProtectionGroupFoldersReturn the child ProtectionGroupFolders located in this folder.ListChildProtectionGroupsReturn the SrmProtectionGroup objects located in this folder.GetProtectionGroupReturn a reference to the protection group.GetNameGet name of folder object, given ProtectionGroupFolder or RecoveryPlanFolder.GetParentFolderGet parent folder for a ProtectionGroupFolder or RecoveryPlanFolder.VMware, Inc.

Chapter 1 The Site Recovery Manager APITable 1-1. List of API operations by function (Continued)MethodDescription of OperationCreate Protection Group TaskMethods to track progress and completion of create protection group calls.IsCreateProtectionGroupCompleteCheck completeness of the task to create a new protection group.GetCreateProtectionGroupResultOnce task is complete, check the result to ensure that it succeeded.GetNewProtectionGroupAfter checking task result, obtain the newly created SrmProtectionGroup.Protection GroupGetInfoRetrieve basic information about this protection group.ProtectionGroupGetParentFolderRetrieve the folder that contains this protection group.GetPeerRetrieve the peer protection group.ListProtectedVmsList VMs protected in this group with information about their protection state.ListProtectedDatastoresRetrieve a list of the Datastores protected by this protection group.ListAssociatedVmsRetrieve a list of VMs associated with this group. Only for vSphere Replication.GetProtectionStateGet the current state of the protection group.ProtectionGroupListRecoveryPlansRetrieve a list of all Recovery Plans this protection group is a member of.ProtectionGroupQueryVmProtectionDetermine whether the specified VMs can be or currently are protected, whichmust be mapped to recovery site as per ListInventoryMappings.ProtectVmsProtect the specified VMs. Each virtual machine’s folder, resource pool, andnetwork must be mapped to the recovery site.UnprotectVmsUnprotect the specified VMs.AssociateVmsAssociate the specified VMs with a group. A prerequisite for protection. Onlyfor vSphere Replication.UnassociateVmsUnassociate the specified VMs with this group. Only for vSphere Replication.Protection TaskGetProtectionStatusGet the results of ProtectVms or UnprotectVms.GetTasksGet Task information from the vCenter Server for each virtual machine that wasrequested to be protected or unprotected.IsCompleteCheck if this Task has finished.GetResultGet the results of this Task.RecoveryListPlansRetrieve all the Recovery Plans for this Site Recovery Manager Server.GetHistoryRetrieve the history for a given Recovery Plan.GetRecoveryPlanRootFolderRetrieve the root folder for all Recovery Plans.Recovery Plan FolderMethods to traverse the folder hierarchy for Recovery Plans.ListChildRecoveryPlanFoldersReturn the child RecoveryPlanFolders located in this folder.ListChildRecoveryPlansReturn an array of SrmRecoveryPlan objects located in this folder,GetRecoveryPlanGet MoRef to Recovery Plan with specified name in this RecoveryPlanFolder.GetName, GetParentFolderSee ProtectionGroupFolder above.Recovery PlanRecoveryPlanGetInfoRetrieve basic information about the specified Recovery Plan.RecoveryPlanGetPeerGet the peer plan for this Recovery Plan. The returned object refers to a plan atthe paired site, not the local site.StartStart the Recovery Plan in a selected mode: test, cleanupTest, recovery, reprotect,or revert. Requires Run privilege for tests, Failover privilege for the others.CancelCancel the specified Recovery Plan.VMware, Inc.11

Site Recovery Manager API Developer’s GuideTable 1-1. List of API operations by function (Continued)MethodDescription of OperationListPromptsList the current prompts that are waiting for input. When a prompt step isreached, the plan goes into waiting state until AnswerPrompt is received.Prompts are given in the same order in which VMs are scheduled to start up.AnswerPromptAnswer the current prompt displayed by a Recovery Plan. Requires the Runprivilege for test, or the Failover privilege for the other modes.RecoveryPlanGetParentFolderRetrieve the root folder for all Recovery Plans.GetRecoverySettingsRetrieve the per‐VM recovery settings for VMs in the Recovery Plan.SetRecoverySettingsModify the per‐VM recovery settings for VMs in the Recovery Plan.AddProtectionGroupAdd a protection group to this Recovery Plan.Recovery HistoryGetRecoveryResultRetrieve the recovery result for a given run of a Recovery Plan.GetResultCountRetrieve total number of stored results, including both Recovery and peer plans.GetResultLengthGet length of XML result document for the requested recovery result.RetrieveStatusRetrieve XML document for an historical run of the specified Recovery Plan.Deprecated 1.0 MethodsSrmLogin, SrmLogoutLog in to and out of Site Recovery Manager Server.GetApiVersionObtain the API version.ListRecoveryPlansGet a list of Recovery Plans at the SRM site.RecoveryPlanSettingsGet the settings of a specific Recovery Plan at the SRM site.RecoveryPlanStartStart a specific Recovery Plan in recovery or test mode.RecoveryPlanPausePause a running Recovery Plan.RecoveryPlanResumeRestart a paused Recovery Plan.RecoveryPlanAnswerPromptAnswer a prompt.RecoveryPlanCancelCancel a Recovery Plan.GetFinalStatusGet the final status of a Recovery Plan.Managed Object HierarchyTable 1‐2 shows the SRM managed object hierarchy with each managed object’s methods, in alphabetic order.Table 1-2. Managed object hierarchy12Managed ObjectRemarksLocal MethodsSrmApiOld version 1.0 API,still provided forbackwardcompatibilityGetApiVersion, GetFinalStatus, ListRecoveryPlans,RecoveryPlanAnswerPrompt, RecoveryPlanCancel,RecoveryPlanPause, RecoveryPlanResume, RecoveryPlanSettings,RecoveryPlanStart, SrmLogin, SrmLogoutSrmProtectionList inventorymappings, queryprotection groupsListInventoryMappings, ListProtectionGroups,ListReplicatedDatastoresNew in 5.8: CreateAbrProtectionGroup,CreateHbrProtectionGroup, tedDatastore,ListUnassignedReplicatedVms, otectedVmsVMware, Inc.

Chapter 1 The Site Recovery Manager APITable 1-2. Managed object hierarchyManaged ObjectRemarksLocal MethodsSrmProtectionGroupAdd virtual machinesto a protection group,get peer, queryprotected datastoresAssociateVms, GetInfo, GetPeer, GetProtectionState,ListAssociatedVms, ListProtectedDatastores, ProtectionGroupQueryVmProtection, ProtectVms,UnassociateVms, UnprotectVmsNew in 5.8: ProtectionGroupGetParentFolderSrmProtectionTaskGet task status forprotection groupsGetProtectionStatus, GetResult, GetTasks, IsCompleteSrmRecoveryQuery recovery plansGetHistory, ListPlansNew in 5.8: y plan statusGetRecoveryResult, GetResultCount, GetResultLength,RetrieveStatusSrmRecoveryPlanRun a recovery planAnswerPrompt, Cancel, ListPrompts, RecoveryPlanGetInfo,RecoveryPlanGetPeer, StartNew in 5.8: AddProtectionGroup, GetRecoverySettings,RecoveryPlanGetParentFolder, SetRecoverySettingsSrmServiceInstanceOpen and close sessionRetrieveContent, SrmLoginLocale, SrmLoginSites,SrmLogoutLocaleNew in 5.8: GetPairedSite, GetSiteName, SrmLoginRemoteSiteInventoryMappingNew in 5.8: AddFolderMapping, AddNetworkMapping,AddResourcePoolMappingFolderNew in 5.8: GetName, GetParentFolderProtectionGroupFolderNew in 5.8: , ListChildProtectionGroupsRecoveryPlanFolderNew in 5.8: GetRecoveryPlan, sCreateProtectionGroupTaskNew in 5.8: up, IsCreateProtectionGroupCompleteFigure 1‐1, “SRM Object Hierarchy,” on page 14 shows the managed object class hierarchy (unfortunately notyet updated for SRM 5.8) with each managed object’s methods.VMware, Inc.13

Site Recovery Manager API Developer’s GuideFigure 1-1. SRM Object HierarchyWSDL Programming EnvironmentsYou can program Web services and read WSDL files using the C# language with Visual Studio .NET, or usingthe Java language with the Axis framework or the JAX‐WS framework. You can program Web services usingmany other languages and frameworks, but they are beyond the scope of this manual.Figure 1-2. WSDL programming componentsWSDL2Java,wsdl.exe, orother toolWSDLfilesclient va, C#,or other)SRM serverSOAP-encoded WSDLnetworkconnectionmethodexecutionSRM Objects as WSDLFigure 1‐3, “SRM managed objects,” on page 15 shows SRM managed entities and class relationships as theyfit into the VMware WSDL scheme. Classes with dashed lines are vSphere managed objects; for informationabout them, see the vSphere API Reference manual.14VMware, Inc.

Chapter 1 The Site Recovery Manager APIFigure 1-3. SRM managed objectsVMware, Inc.15

Site Recovery Manager API Developer’s GuideC# and Visual StudioThe SRM SDK provides sample C# .NET code prepared for use with V

Site Recovery Manager API Developer’s Guide 10 VMware, Inc. WSDL – The Web services API is defined in a WSDL file, which is used by client‐side Web services to create proxy code (stubs) that client applications use to interact with the server.

Related Documents:

api 20 e rapid 20e api 20 ne api campy api nh api staph api 20 strep api coryne api listeriaapi 20 c aux api 20 a rapid id 32 a api 50 ch api 50 chb/e 50 chl reagents to be ordered. strips ref microorganisms suspension inoculum transfer medium i

Latest API exams,latest API-571 dumps,API-571 pdf,API-571 vce,API-571 dumps,API-571 exam questions,API-571 new questions,API-571 actual tests,API-571 practice tests,API-571 real exam questions Created Date

VMware, Inc. 5 The Site Recovery Manager API Developer’s Guide provides information about programming applications with the Web services interfaces to VMware vSphere Site Recovery Manager (SRM). This manual provides information about both the old interfaces and the new interfaces in the SRM 5.0 release,

vRealize Suite Disaster Recovery by Using Site Recovery Manager 5 1 Disaster Recovery Introduction 6 Overview of VMware Site Recovery Manager 7 Local and Remote Sites 8 Heterogeneous Configurations on the Protected and Recovery Sites 9 Site Recovery Manager Workflow 10 Restoring the Pre-Recovery Site Configuration By Performing Failback 11 2

3 API Industry Guide on API Design Apiary - Apiary jump-started the modern API design movement by making API definitions more than just about API documentation, allowing API designers to define APIs in the machine-readable API definition format API blueprint, then mock, share, and publish

04 As we explored in The API Product Mindset ebook, typical roles on an API product team include an API Product Manager who owns the processes and cross-functional coordination critical to the API's success; an API Architect responsible for designing and guiding the creation of APIs; an API Developer who builds APIs from the API Architect's designs and

consider using Bulk API, which is based on REST principles and optimized for large sets of data. Using Compression REST API uses the same underlying data model and standard objects as those in SOAP API . See the SOAP API Developer's Guide for details. REST API also follows the same limits as SOAP API . See the Limits section

vRelease Version July 2019 CUDA Runtime API API Reference Manual