Closed techguydave closed 6 years ago
I should have searched the repo for examples/tests before filing the issue! It looks like changing
change_role = system.api.post('replicas/' + str(replica_id) + '/change_role')
to
change_role = system.api.post('replicas/' + str(replica_id) + '/change_role', data={})
solved it! This was omitted from the InfiniSDK documentation and might be a helpful addition on the Getting Started page.
@synth3tk replica objects have a change_role()
method. Due to a mistake on our part it does not appear in the API documentation page (will be fixed in the next release).
This means you just have to write replica.change_role()
and everything works.
@vmalloc Thank you very much, that worked!
I'm trying to recreate the "Change Role" menu option in the replication GUI in a script, either through an SDK function or manually. From what I can tell, the
switch_role()
function doesn't work for async (as the documentation states). So I tried to call the API through the SDK atapi/rest/replicas/{id}/change_role
, but that returns a 415. I can confirm that I receive the same result in Postman.I don't claim to be a Python guru, so let me know if I'm doing something wrong in my script.
Script:
Response: