We use cf-nodejs-client to control the start and stop of hana cloud db, but an error occurred.
How can I fix this error? Does cf-nodejs-client have the feature of controlling hana cloud db?
const CloudController = new (require("cf-nodejs-client")).CloudController(endpoint);
const UsersUAA = new (require("cf-nodejs-client")).UsersUAA;
const ServiceInstances = new (require("cf-nodejs-client")).ServiceInstances(endpoint);
dear support team
We use cf-nodejs-client to control the start and stop of hana cloud db, but an error occurred. How can I fix this error? Does cf-nodejs-client have the feature of controlling hana cloud db?
source code: "use-strict"; const cron = require("node-cron"); const endpoint = "https://api.cf.jp10.hana.ondemand.com"; const username = "XXXXX"; const password = "XXXXX";
const CloudController = new (require("cf-nodejs-client")).CloudController(endpoint); const UsersUAA = new (require("cf-nodejs-client")).UsersUAA; const ServiceInstances = new (require("cf-nodejs-client")).ServiceInstances(endpoint);
controlTarget(ServiceInstances, "stop", name, id);
function controlTarget(target, operation, name, id) { CloudController.getInfo().then((result) => { UsersUAA.setEndPoint(result.authorization_endpoint); return UsersUAA.login(username, password); }).then((result) => { target.setToken(result); return target.stop(id); }).then((result) => { console.log(result); }).catch((reason) => { console.log("catch block: " + reason); }); };
error:
"description": "Service broker error: Service broker hana-cloud failed with: Internal error [ref 2TJgeT5Gp5ZblIEXLjSoSbzN4ko]", "error_code": "CF-ServiceBrokerRequestRejected", "code": 10001, "http": { "method": "PATCH", "status": 422 } }