Oracle Cloud Platform Services API

I’ve recently been using the platform services API a lot – it’s really really powerful to help reduce the TCO – you can dynamically scale the up & down as needs arise – for example, scale it up during batch processing periods to get the batch to run quicker, but scale it back down again during normal BAU.

When you combine that with automated starting & stopping that the API also offers, this creates a compelling TCO!

However – the purpose of this post of to highlight a bug in the PSM Client API documentation. We actually run our own python wrapper rather than use the PSM API Client – but that’s the benchmark. The documentation for the PSM API is here.

A normal PSM command to scale the environment up might be as follows:

psm analytics scale -s OACESSDEV01 -c payload.json

And the contents of the payload file according to the documentation is as follows:

{ "components": 
    { "analytics": 
        { "shape":"oc4", 
        "hosts":["oacessdev01-bi-1"] 
        } 
    } 
}

So this scale command will tell the platform to scale the platform to an OC4 shape – 2x OCPUS, 4x VCPUS. Unfortunately it doesn’t work (it did last month, so it’s obviously a recent change – but a bit of a gotcha if your using this API!) – we get the following error:

Error: 
{ 
    "details":{ 
        "message":"Failed to submit job to for the scale operation.", 
        "issues":[ 
            "[Invalid [analytics] parameter [hosts] contained in request payload.]", 
            "[Invalid [analytics] parameter [shape] contained in request payload.]" 
        ] 
    } 
}

Fortunately we’ve been writing our own wrapper for the API in Qubix Cloudbridge, so we know the insides of the API. The format of the payload file has changed, it now needs to be:

{ "components": 
  { "BI": 
    { "shape":"oc4", 
      "hosts":["oacessdev01-bi-1"] 
    } 
  } 
}

Note the word “analytics” has changed to “BI” – and everything now works!

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s