Search code examples
ibm-cloud-infrastructure

extra parameter is required? SoftLayer_Network_Storage::failbackFromReplicant & SoftLayer_Network_Storage::failoverToReplicant


from the document:

SoftLayer_Network_Storage::failoverToReplicant, requires 1 parameter: replicantId SoftLayer_Network_Storage::failbackFromReplicant, requires none parameter.

but from the python client:

SoftLayer_Network_Storage::failoverToReplicant, requires 2 parameters: replicantId, immediate SoftLayer_Network_Storage::failbackFromReplicant, requires 1 parameter: replicantId

I'm not sure which is correct, but the python client makes more sense to me.

I guess metadata(https://api.softlayer.com/metadata/v3.1) needs fixes to:

        "failbackFromReplicant":
        {
            "name": "failbackFromReplicant",
            "type": "boolean",
            "doc": "Failback from a volume replicant. In order to failback the volume must have already been failed over to a replicant. "
        },
        "failoverToReplicant":
        {
            "name": "failoverToReplicant",
            "type": "boolean",
            "doc": "Failover to a volume replicant.  During the time which the replicant is in use the local nas volume will not be available. ",
            "parameters":
            [
                {
                    "name": "replicantId",
                    "type": "int",
                    "doc": "Replicant ID to failover to"
                }
            ]
        },

Solution

  • The SLDN documentation is fine,

    you can failover using this RestFul request:

    POST https://$USERNAME:$APIKEY@api.softlayer.com/rest/v3.1/SoftLayer_Network_Storage/111111/failoverToReplicant
    
    payload:
    
    {
        "parameters": [22222]
    }
    
    where 22222 is the ID of object storage's replica and 111111 is the ID of the block storage.
    

    For failback you need to use this RESTFul:

    GET https://$USERNAME:$APIKEY@api.softlayer.com/rest/v3.1/SoftLayer_Network_Storage/111111/failbackFromReplicant
    
    where 111111 is the ID of the block storage
    

    It looks confuse, but that is the way softlayer make it. I guess the Softlayer Python client is trying to avoid that confusion by adding those extra parameters. Anyway if you wish you could submit an issue in the Git project of Softlayer Python client in order the client honored the documentation.

    Regards