summaryrefslogtreecommitdiffstats
path: root/lib/policy.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/policy.js')
-rw-r--r--lib/policy.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/policy.js b/lib/policy.js
index 7c47dd3..4a3248d 100644
--- a/lib/policy.js
+++ b/lib/policy.js
@@ -51,7 +51,7 @@ function policyUpdate(req, res, next) {
removed_policy_ids : {}
};
- logger.debug(req.dcaeReqId, "policyUpdate "
+ logger.info(req.dcaeReqId, "policyUpdate "
+ req.method + ' ' + req.protocol + '://' + req.get('host') + req.originalUrl
+ " catch_up: " + policy_update.catch_up
+ " latest_policies: " + policy_update.latest_policies
@@ -95,7 +95,7 @@ function policyUpdate(req, res, next) {
&& !node_instance.runtime_properties.policy_filters)) {
return;
}
- logger.debug(req.dcaeReqId, "checking policies on node_instance: " + JSON.stringify(node_instance));
+ logger.info(req.dcaeReqId, "checking policies on node_instance: " + JSON.stringify(node_instance));
const deployment = policy_update.policy_deployments[node_instance.deployment_id] || {
"deployment_id": node_instance.deployment_id,
@@ -122,7 +122,7 @@ function policyUpdate(req, res, next) {
have_policies = true;
deployment.removed_policy_ids[policy_id] = true;
policy_update.removed_policy_ids[policy_id] = true;
- logger.debug(req.dcaeReqId, "going to remove policy " + policy_id + " from node_instance: " + JSON.stringify(node_instance));
+ logger.info(req.dcaeReqId, "going to remove policy " + policy_id + " from node_instance: " + JSON.stringify(node_instance));
return;
}
@@ -135,13 +135,13 @@ function policyUpdate(req, res, next) {
have_policies = true;
deployment.updated_policies[policy_id] = latest_policy;
policy_update.updated_policy_ids[policy_id] = true;
- logger.debug(req.dcaeReqId, "going to update policy " + policy_id + " on node_instance: " + JSON.stringify(node_instance));
+ logger.info(req.dcaeReqId, "going to update policy " + policy_id + " on node_instance: " + JSON.stringify(node_instance));
});
const policy_filters = node_instance.runtime_properties.policy_filters || {};
const policy_filter_ids = Object.keys(policy_filters);
if (policy_filter_ids.length) {
- logger.debug(req.dcaeReqId, "matching latest policies to policy_filters[" + policy_filter_ids.length + "] on node_instance: " + JSON.stringify(node_instance));
+ logger.info(req.dcaeReqId, "matching latest policies to policy_filters[" + policy_filter_ids.length + "] on node_instance: " + JSON.stringify(node_instance));
try {
Object.keys(policy_update.latest_policies).forEach(policy_id => {
if (!deployment.is_deployment_busy && deployed_policies[policy_id]) {return;}
@@ -206,7 +206,7 @@ function policyUpdate(req, res, next) {
}
deployment.added_policies[policy_filter_id].policies[policy_id] = latest_policy;
policy_update.added_policy_ids[policy_id] = true;
- logger.debug(req.dcaeReqId, "going to add policy " + JSON.stringify(latest_policy)
+ logger.info(req.dcaeReqId, "going to add policy " + JSON.stringify(latest_policy)
+ " per policy_filter_id " + policy_filter_id
+ " on node_instance: " + JSON.stringify(node_instance));
return true;
@@ -225,11 +225,11 @@ function policyUpdate(req, res, next) {
}
});
- logger.debug(req.dcaeReqId, "collected policy_deployments to update " + JSON.stringify(policy_update.policy_deployments));
+ logger.info(req.dcaeReqId, "collected policy_deployments to update " + JSON.stringify(policy_update.policy_deployments));
};
const update_policies_on_deployments = function(result) {
- logger.debug(req.dcaeReqId, "finished loading policy_deployments" + JSON.stringify(result));
+ logger.info(req.dcaeReqId, "finished loading policy_deployments" + JSON.stringify(result));
if (result.status !== 200) {
const error_msg = "failed to retrieve component policies from cloudify " + result.message;
logger.error(createError(error_msg, result.status, "api", 502, 'cloudify-manager'), req);
@@ -248,7 +248,7 @@ function policyUpdate(req, res, next) {
+ "] and added policies[" + Object.keys(policy_update.added_policy_ids).length
+ "] and removed policies[" + Object.keys(policy_update.removed_policy_ids).length
+ "] to deployments[" + deployment_ids.length + "]";
- logger.debug(req.dcaeReqId, audit_msg + ": " + JSON.stringify(deployment_ids));
+ logger.info(req.dcaeReqId, audit_msg + ": " + JSON.stringify(deployment_ids));
logger.audit(req, result.status, audit_msg);
deployment_ids.forEach(deployment_id => {
const deployment = policy_update.policy_deployments[deployment_id];
@@ -257,7 +257,7 @@ function policyUpdate(req, res, next) {
});
deployment.removed_policy_ids = Object.keys(deployment.removed_policy_ids);
- logger.debug(req.dcaeReqId, "ready to execute-operation policy-update on deployment " + JSON.stringify(deployment));
+ logger.info(req.dcaeReqId, "ready to execute-operation policy-update on deployment " + JSON.stringify(deployment));
cloudify.executeOperation(req, deployment.deployment_id, POLICY_UPDATE_OPERATION,
{
'updated_policies': deployment.updated_policies,
@@ -276,7 +276,7 @@ function policyUpdate(req, res, next) {
* retrieve all component-policies from cloudify
*/
function getComponentPoliciesFromCloudify(req, res, next) {
- logger.debug(req.dcaeReqId, "getComponentPoliciesFromCloudify " + req.originalUrl);
+ logger.info(req.dcaeReqId, "getComponentPoliciesFromCloudify " + req.originalUrl);
const response = {"requestID": req.dcaeReqId};
response.started = new Date();
response.server_instance_uuid = process.mainModule.exports.config.server_instance_uuid;
@@ -324,7 +324,7 @@ function getComponentPoliciesFromCloudify(req, res, next) {
}
});
- logger.debug(req.dcaeReqId, "collected " + response.node_instance_ids.length
+ logger.info(req.dcaeReqId, "collected " + response.node_instance_ids.length
+ " node_instance_ids: " + JSON.stringify(response.node_instance_ids)
+ " component_policies: " + JSON.stringify(response.component_policies)
+ " component_policy_filters: " + JSON.stringify(response.component_policy_filters)
@@ -334,7 +334,7 @@ function getComponentPoliciesFromCloudify(req, res, next) {
response.ended = new Date();
response.status = result.status;
response.message = result.message;
- logger.debug(req.dcaeReqId, result.message);
+ logger.info(req.dcaeReqId, result.message);
if (result.status !== 200) {
logger.error(createError(result.message, result.status, "api", 502, 'cloudify-manager'), req);
}
@@ -351,7 +351,7 @@ app.set('etag', false);
app.use(require('./middleware').checkType('application/json'));
app.use(require('body-parser').json({strict: true}));
app.use(function(req, res, next) {
- logger.debug(req.dcaeReqId,
+ logger.info(req.dcaeReqId,
"new req: " + req.method + " " + req.originalUrl +
" from: " + req.ip + " body: " + JSON.stringify(req.body)
);