List of API Operations

The following tables provide a list of Site Recovery Manager API methods organized by approximate order of use.

Table 1. Solution User Information
Method Description of Operation
GetSolutionUserInfo Obtain the Site Recovery Manager solution user name for the local site.
GetPairedSiteSolutionUserInfo Obtain the Site Recovery Manager solution user name for the remote site.
Table 2. SAML Token Authentication
Method Description of Operation
SrmLoginByTokenLocale Begin a session with Site Recovery Manager Server.
SrmLoginSitesByToken Log in to both the local and remote vCenter Server.
SrmLoginRemoteSiteByToken

Log in to remote site when escalated privileges are required and the current session has already been authenticated using SrmLoginSitesByToken.

Table 3. Credential-Based Authentication
Method Description of Operation
SrmLoginLocale Begin a session with Site Recovery Manager Server.
SrmLoginSites Log in to both the local and remote vCenter Server.
SrmLogoutLocale Log out sites and terminate the current session.
SrmLoginRemoteSite

Log in to remote site when escalated privileges are required on the remote site and the current session has already been authenticated using SrmLoginSites.

Table 4. Service Instance
Method Description of Operation
GetSiteName Get the name of the current local site. (deprecated in 6.5)
GetPairedSite Retrieve information about the remote site that is paired with this local site.
RetrieveContent

Retrieve the properties of a service instance. Additionally the AboutInfo data object provides information about this service.

GetLocalSiteInfo Get information about the local site
Table 5. SRM ExtApi Task
Method Description of Operation
IsSrmExtApiTaskComplete Returns True if this task has been completed
GetSrmExtApiTaskInfo Gets the results of this task
Table 6. Inventory Mapping
Method Description of Operation
AddFolderMapping Add a folder mapping between the primary and secondary vCenter Server.
AddNetworkMapping Add a network mapping between the primary and secondary vCenter Server.
AddResourcePoolMapping Add resource pool mapping between primary and secondary vCenter Server.
AddTestNetworkMapping Add a test network mapping.
RemoveFolderMapping Remove a folder mapping.
RemoveNetworkMapping Remove a network mapping.
RemoveResourcePoolMapping Remove a resource pool mapping.
RemoveTestNetworkMapping Remove a test network mapping.
GetFolderMappings Returns an array of the folder mappings for a specific inventory mapper.
GetnetworkMappings Returns an array of the network mappings for a specific inventory mapper.
GettestNetworkMappings Returns an array of the test network mappings for a specific inventory mapper.
GetresourcePoolMappings Returns an array of the resource pool mappings for a specific inventory mapper.
Table 7. Storage
Method Description of Operation
DiscoverDevices Loops through all array managers, local and remote, discovering devices.
QueryArrayManagers Returns a list of all the available array managers.
Table 8. Auto Protect Manager
Method Description of Operation
SetAutoprotectUser Configures the user to be used by automatic protection on this site. If not called, the default autoprotect user is used.
GetAutoprotectUser Gets the user for the automatic protection.
SetDefaultAutoprotectUser Reverts the current user to the default user.
IsActive Checks if the automatic protection is globally activated (true) or deactivated (false).
Table 9. Protection
Method Description of Operation
ListProtectionGroups Get a list of the protection groups that are currently configured.
ListInventoryMappings (New in 8.2) Get a list of the configured inventory mappings on the protection site.
ListReplicatedDatastores Get a list of the replicated datastores. (deprecated in 6.0)
GetProtectionGroupRootFolder

Get the root folder for all protection groups, so as to navigate folder hierarchy. The methods below give users the ability to locate replicated resources and construct protection groups, key features of the 5.8 API.

ListUnassignedReplicatedDatastores Get list of replicated datastores that can be used to create new protection groups.
ProtectionListProtectedDatastores Get list of replicated datastores that are protected by Site Recovery Manager.
ListUnassignedReplicatedVms Get list of replicated VMs not currently assigned to a Site Recovery Manager protection group.
ProtectionListProtectedVms Get list of virtual machines that are protected by Site Recovery Manager.
CreateAbrProtectionGroup Create an array‐based replication (ABR) protection group. The method returns a CreateProtectionGroupTask.
CreateHbrProtectionGroup Create a host‐based replication (HBR) protection group. The method returns a CreateProtectionGroupTask.
RemoveProtectionGroup Delete a protection group.
CreateVvolProtectionGroup Creates a new vVol protection group.
Table 10. Protection Group Folder
Method Description of Operation
ListChildProtectionGroupFolders Return the child ProtectionGroupFolders located in this folder.
ListChildProtectionGroups Return the SrmProtectionGroup objects located in this folder.
GetProtectionGroup Return a reference to the protection group.
GetParentFolder Get parent folder for a ProtectionGroupFolder or RecoveryPlanFolder.
Table 11. Create Protection Group Task
Method Description of Operation
IsCreateProtectionGroupComplete Check completeness of the task to create a new protection group.
GetCreateProtectionGroupResult Once task is complete, check the result to ensure that it succeeded.
GetNewProtectionGroup After checking task result, obtain the newly created SrmProtectionGroup.
Table 12. Protection Group
Method Description of Operation
GetInfo Retrieve basic information about this protection group.
ProtectionGroupGetParentFolder Retrieve the folder that contains this protection group.
GetPeer Retrieve the peer protection group.
ListProtectedVms List VMs protected in this group with information about their protection state.
ListProtectedDatastores Retrieve a list of the Datastores protected by this protection group.
ListAssociatedVms Retrieve a list of VMs associated with this group. Only for vSphere Replication and vVol.
GetProtectionState Get the current state of the protection group.
ProtectionGroupListRecoveryPlans Retrieve a list of all Recovery Plans this protection group is a member of.
ProtectionGroupQueryVmProtection

Determine whether the specified VMs can be or currently are protected, which must be mapped to the recovery site as per ListInventoryMappings.

ProtectVms

Protect the specified VMs. The folder, resource pool, and network of each virtual machine must be mapped to the recovery site. Returns a ProtectionTask.

UnprotectVms Unprotect the specified VMs.
AssociateVms

Associate the specified VMs with a group. This is a prerequisite for protection. Only for vSphere Replication.

UnassociateVms Unassociate the specified VMs with this group. Only for vSphere Replication and vVol.
ProtectionGroupGetOperationalLocation Get the effective location of the protection group.
CheckConfigured

Check the protection group for VMs that are not configured, have configuration issues, and protected VMs that must be configured.

AddDatastores

(New in 8.1) Adds datastores to the protection group. Additionally, the virtual machines on these datastores can be protected by the protection group. This can be done by calling protectVms method from this interface.

RemoveDatastores

(New in 8.1) Removes datastores from the protection group. Virtual machines on the removed datastores are no longer protected by the protection group.

ReconfigureVvolProtectionGroup Reconfigure settings for this group. For a vVvol ProtectionGroup this method can reconfigure the name, description, fault domain, and associated virtual machines. If the clearAssociatedVms flag is set to true, then the associated virtual machines with this protection group will be cleared. If the flag is not set and the associated Vm's list is not empty, then the associated virtual machines will be added to this protection group replacing the old virtual machines.
GetVvolGroupDetails Gets vVol specific details for this protection group.
Table 13. Protection Task
Method Description of Operation
GetProtectionStatus Get the results of ProtectVms or UnprotectVms
GetTasks

Get Task information from the vCenter Server for each virtual machine that was requested to be protected or unprotected.

IsComplete Check if this Task has finished.
GetResult Get the results of this Task.
Table 14. Recovery
Method Description of Operation
ListPlans Retrieve all the Recovery Plans for Site Recovery Manager Server.
GetHistory Retrieve the history for a given Recovery Plan.
GetRecoveryPlanRootFolder Retrieve the root folder for all Recovery Plans.
CreateRecoveryPlan Create a recovery plan.
DeleteRecoveryPlan Delete a recovery plan.
Table 15. Recovery Plan Folder
Method Description of Operation
ListChildRecoveryPlanFolders Return the child RecoveryPlanFolders located in the folder.
ListChildRecoveryPlans Return an array of SrmRecoveryPlan objects located in the folder.
GetRecoveryPlan Get MoRef to recovery plan with the specified name in the RecoveryPlanFolder.
GetName, GetParentFolder See Protection Group Folder
Table 16. Recovery Plan
Method Description of Operation
RecoveryPlanGetInfo Retrieve basic information about the specified Recovery Plan.
RecoveryPlanGetPeer

Get the peer plan for this Recovery Plan. The returned object refers to a plan at the paired site, not the local site.

Start

Start the Recovery Plan in a selected mode: test, cleanupTest, recovery, or reprotect. Requires Run privilege for tests, and the Failover privilege for the others.

Cancel Cancel the specified Recovery Plan.
ListPrompts

List the current prompts that are waiting for input. When a prompt step is reached, the plan goes into the waiting state until AnswerPrompt is received. Prompts are given in the same order in which VMs are scheduled to start up.

AnswerPrompt

Answer the current prompt displayed by a Recovery Plan. Requires the Run privilege for test, or the Failover privilege for the other modes.

RecoveryPlanGetParentFolder Retrieve the root folder for all Recovery Plans.
GetRecoverySettings Retrieve the per‐VM recovery settings for VMs in the Recovery Plan.
SetRecoverySettings Modify the per‐VM recovery settings for VMs in the Recovery Plan. (New in 8.1) Configure the IP address and corresponding DNS, WINS of the virtual machine, after the migration is complete, using the VmIpCustomization API.
AddProtectionGroup Add a protection group to this Recovery Plan.
RemoveProtectionGroupFromRecoveryPlan Remove a protection group from a recovery plan.
AddTestNetworkMappingToRecoveryPlan Add a test network mapping to a recovery plan.
RemoveTestNetworkMappingFromRecoveryPlan Remove a test network mapping from a recovery plan.
RecoveryPlanGetLocation Check whether the recovery plan is hosted locally or on the paired site.
RecoveryPlanHasRunningTask Check whether there is a task that is associated with the recovery plan.
Table 17. Recovery History
Method Description of Operation
GetRecoveryResult Retrieve the recovery result for a given run of a Recovery Plan.
GetResultCount Retrieve total number of stored results, including Recovery and peer plans.
GetResultLength Get length of XML result document for the requested recovery result.
RetrieveStatus Retrieve XML document for a historical run of the specified Recovery Plan.
Table 18. IP Subnet Mapper
Method Description of Operation
GetIpSubnetMappings Returns an array of the IP subnet mappings for this IP Subnet Mapper.
AddIpMapping Associates an IPMapping object with an inventory-mapped protected site network.
RemoveIpMappings Removes IPMappings from mapped protected site networks. This must be called on secondary (recovery) site.
Table 19. Array Manager
Method Description of Operation
ReadInfo (New in 8.2) Returns information specific to the ArrayManager instance.
QueryReplicatedArrayPairs (New in 8.2) Returns list of all the replicated array pairs in the ArrayManager.
Table 20. Replicated Array Pair
Method Description of Operation
QueryReplicatedRdms (New in 8.2) Returns info for all replicated RDMs in the ReplicatedArrayPair.
Table 21. Vvol Replication
Method Description of Operation
GetDomains Returns a list of local vVol fault domains with their replication groups which target fault domains matching SRM peer site.
GetUnprotectedVms Returns a list of unprotected vVol replicated virtual machines part of vVol replication groups that target the SRM peer site.
Rescan Initiates a rescan of the server's local vVol configuration. The server keeps updating its view of the local vVol configuration periodically. This results in the newly provisioned vVol virtual machines being available for protection only after the passage of update interval. This function is called to force an update.
Table 22. Deprecated DisasterRecoveryApi
Method Description of Operation
Login, Logout, LoginByToken Log in to and out of Site Recovery Manager Server.
GetApiVersion Obtain the API version.
ListRecoveryPlans Get a list of Recovery Plans at the SRM site.
RecoveryPlanSettings Get the settings of a specific Recovery Plan at the SRM site.
RecoveryPlanStart Start a specific Recovery Plan in recovery or test mode.
RecoveryPlanPause Pause a running Recovery Plan.
RecoveryPlanResume Restart a paused Recovery Plan.
RecoveryPlanAnswerPrompt Answer a prompt.
RecoveryPlanCancel Cancel a Recovery Plan.
GetFinalStatus Get the final status of a Recovery Plan.

New vCenter Single Sign-On APIs

A set of login‐by‐token functions was added to the ServiceInstance managed object. For an example of use, see the Functions for Logging Into Sites table.

Deprecated APIs

The version 1.0 DisasterRecoveryApi was discontinued in Site Recovery Manager 5.8 and marked deprecated in Site Recovery Manager 6.0, although a new login‐by‐token function was implemented for backward compatibility.
Note: The InvalidLogin fault and others use a different namespace in DisasterRecoveryApi (drextapi.fault.InvalidLogin) than in ServiceInstance (vim.fault.InvalidLogin).

In the RemoteSite managed object, the vcHost and vcPort fields are deprecated. They are replaced by the lkpUrl (Lookup Service URL) and vcInstanceUUID (vCenter Server unique ID).

The GetSiteName method is deprecated in Site Recovery Manager 6.5. You must use LocalSiteInfo.siteInfo to get the local site name.