I want to get information about recovery plan and protection group like protected site, recovery site etc by using SRM API . I am not able to get this information. So how to get this information programmatically.
Thanks in advance.
I have gone through this . but according to this doc what we can get related to any Recovery Plan is only its name, description, status and same for PG. not the details like which is the protected site, recovery site etc. Can you point me to how we can get these details or getting this details is not at all possible ?
I think you are looking for the "state" attribute of the RecoveryPlanInfo you get back with the method getInfo() on a RecoveryPlan:
Enum - SrmRecoveryPlanRecoveryState
cancelling The recovery plan is in the process of cancelling.
error The recovery plan has errors.
failedOver The recovery plan has failed over.
needsCleanup Need to cleanup a test run.
needsFailover Need to re-run failover.
needsReprotect Need to re-run reprotect.
needsRollback Need to re-run rollback.
prompting The recovery plan is running, but requires user-interaction before it may continue.
protecting The recovery plan is protecting to the remote site, please run the peer recovery plan on the remote site.
ready The recovery plan is not in a running state and may be run.
running The recovery plan is currently running.
If the state is protecting, you are on the protection site. If it is "ready", you are on the recovery site. With the getPeer() method of a RecoveryPlan you can find the corresponding other.
I once put together a powershell script that does some ProtectionGroup reporting with SRM, shouldn't be to hard to adjust it to your needs:
Thanks Joerg for your reply.
Actually I want to know what is the protected site and recovery site related to any Recovery Plan or Protection Group programmatically.
This information is shown on summary page of Recovery Plan or Protection Group in SRM UI. So same information i want to get programmatically.
For a ProtectionGroup you can use the getPeer()-method, an then examine the "state" attribute of the ProtectionGroupPeer.
There you can see for instance if it's ready, or "shadowing".
A consolidated information like in the summary page I haven't found in the API :-(.
You should file a feature request for that.