Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in SRDF - change the states to Suspended #212

Open
johndanielk opened this issue Jan 26, 2025 · 1 comment
Open

in SRDF - change the states to Suspended #212

johndanielk opened this issue Jan 26, 2025 · 1 comment

Comments

@johndanielk
Copy link

HI
I need to change the states SRDF group from ActiveActive to Suspended
In the gui iits under the > Storage Group > Data Protection > SRDF

I cannot found this option in the new version PyU4V)
I can see only older version
https://developer.dell.com/apis/4458/versions/10.1.0/openapi.json/paths/~1101~1replication~1symmetrix~1%7BsymmetrixId%7D~1storagegroup~1%7BstorageGroupId%7D~1rdf_group~1%7BrdfgNumId%7D/put

I try to understion how to build the body requset to change the states

this is my script , but its not works

var rdfgNumId = "2";
var storageGroupId = "MyStorageGroup";

var url = "/univmax/rest/v1/systems/" + symmetrixId + "/storagegroup/" + storageGroupId + "/rdf_group/" + rdfgNumId;
System.log("URL: " + url);

var payload = {
    "action": "establish"
};

var payloadString = JSON.stringify(payload);
System.log("Payload: " + payloadString);

var req = pmaxHost.createRequest("PUT", url, payloadString);

var authHeader = "Basic " + basicAuto;
req.setHeader("Authorization", authHeader);
req.setHeader("Accept", "application/json");
req.setHeader("Content-Type", "application/json");

var res;
try {
    res = req.execute();
    var statusCode = res.statusCode;

    if (statusCode == 200 || statusCode == 202) {
        System.log("Successfully updated suspend status to true");
    } else {
        System.log("~~~~ Error: Couldn't update suspend status ~~~");
        System.log("Response Content: " + res.contentAsString);
        throw "Couldn't update suspend status. HTTP Status Code: " + statusCode;
    }
} catch (e) {
    System.log("Exception occurred: " + e);
    throw "Failed to send suspend request.";
}
@johndanielk
Copy link
Author

johndanielk commented Jan 27, 2025

update
if the url and the body

var url = "/univmax/restapi/101/replication/symmetrix/" + symmetrixId + "/storagegroup/" + storageGroupId + "/rdf_group/" + rdfgNumId;
System.log("URL: " + url);
var payload = {
    "action": "establish"
};

and this is the full script

var rdfgNumId = "2";
var storageGroupId = "MyStorageGroup";

var url = "/univmax/restapi/101/replication/symmetrix/" + symmetrixId + "/storagegroup/" + storageGroupId + "/rdf_group/" + rdfgNumId;
System.log("URL: " + url);

var body = {
    // "action": "Suspend"
    "action": "Establish"

};


var req = pmaxHost.createRequest("PUT", url, JSON.stringify(body));
var authHeader = "Basic " + basicAuto;
req.setHeader("Authorization", authHeader);
req.setHeader("Accept", "application/json");
req.setHeader("Content-Type", "application/json");
System.log("Full API URL: " + pmaxHost.url + url);

var res = req.execute();
var statusCode = res.statusCode;

if (statusCode == 200 || statusCode == 202) {
        System.log("Successfully updated suspend status to true");
    } else {
        System.log("~~~~ Error: Couldn't update suspend status ~~~");
        System.log("Response Content: " + res.contentAsString);
        throw "Couldn't update suspend status. HTTP Status Code: " + statusCode;
    }

everything works fine !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant