Skip to content

How to use cf-nodejs-client to control the start and stop of hana cloud #199

@aiddren

Description

@aiddren

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:
[catch block]: {
"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
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions