Example: Failing over a replication link

Here’s a sample POST request that fails over the link named MA-CA to the local system, hcp-ca.example.com. The request is made using a system-level user account that includes the administrator role.

Request with cURL command line

curl -k -iX POST
    -H "Authorization: HCP YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382"    "https://admin.hcp-ca.example.com:9090/mapi/services/replication/links/
     MA-CA?failOver"

Request in Python using PycURL

import pycurl
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Authorization: HCP \
  YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382"])
curl.setopt(pycurl.URL,
  "https://admin.hcp-ca.example.com:9090/mapi/services/" +
  "replication/links/MA-CA?failOver")
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
curl.setopt(pycurl.CUSTOMREQUEST, "POST")
curl.perform()
print curl.getinfo(pycurl.RESPONSE_CODE)
curl.close()

 

Request headers

POST /mapi/services/replication/links/MA-CA?failOver HTTP/1.1
User-Agent: curl/7.27.0
Host: admin.hcp-ca.example.com:9090
Authorization: HCP YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382
Accept: */*

Response headers

HTTP/1.1 200 OK
X-HCP-SoftwareVersion: 7.0.0.16
Content-Length: 0

Trademarks and Legal Disclaimer

© 2017 Hitachi Data Systems Corporation. All rights reserved.