From 8c6a1e79372ec7f94aeaa3c4e86c6fb1ad20d5ef Mon Sep 17 00:00:00 2001 From: VIJAYKUMARNINGANURE Date: Fri, 14 Oct 2016 17:40:07 +0530 Subject: [PATCH] Implementation of Tag servers --- .../arm-template-blueprint/arm-template-blueprint.js | 1 + .../instance-blueprint/aws-blueprint/aws-blueprint.js | 1 + .../instance-blueprint/azure-blueprint/azure-blueprint.js | 1 + .../openstack-blueprint/openstack-blueprint.js | 1 + .../instance-blueprint/vmware-blueprint/vmware-blueprint.js | 1 + server/app/model/classes/instance/instance.js | 5 +++++ server/app/routes/v1.0/routes_chef.js | 1 + server/app/routes/v1.0/routes_organizations.js | 1 + server/app/routes/v1.0/routes_providercommon.js | 1 + 9 files changed, 13 insertions(+) diff --git a/server/app/model/blueprint/blueprint-types/arm-template-blueprint/arm-template-blueprint.js b/server/app/model/blueprint/blueprint-types/arm-template-blueprint/arm-template-blueprint.js index fd668004f..54908803d 100755 --- a/server/app/model/blueprint/blueprint-types/arm-template-blueprint/arm-template-blueprint.js +++ b/server/app/model/blueprint/blueprint-types/arm-template-blueprint/arm-template-blueprint.js @@ -165,6 +165,7 @@ ARMTemplateBlueprintSchema.methods.launch = function(launchParams, callback) { environmentName: launchParams.envName, providerId: self.cloudProviderId, providerType: 'azure', + tagServer: launchParams.tagServer, keyPairId: 'azure', region: self.region, chefNodeName: instanceData.name, diff --git a/server/app/model/blueprint/blueprint-types/instance-blueprint/aws-blueprint/aws-blueprint.js b/server/app/model/blueprint/blueprint-types/instance-blueprint/aws-blueprint/aws-blueprint.js index 97493a7da..cd8aa5c0a 100755 --- a/server/app/model/blueprint/blueprint-types/instance-blueprint/aws-blueprint/aws-blueprint.js +++ b/server/app/model/blueprint/blueprint-types/instance-blueprint/aws-blueprint/aws-blueprint.js @@ -221,6 +221,7 @@ AWSInstanceBlueprintSchema.methods.launch = function(launchParams, callback) { keyPairId: self.keyPairId, region: aKeyPair.region, chefNodeName: instanceData.InstanceId, + tagServer: launchParams.tagServer, runlist: paramRunList, attributes: paramAttributes, platformId: instanceData.InstanceId, diff --git a/server/app/model/blueprint/blueprint-types/instance-blueprint/azure-blueprint/azure-blueprint.js b/server/app/model/blueprint/blueprint-types/instance-blueprint/azure-blueprint/azure-blueprint.js index 6bf1d2bdc..3b56d2414 100755 --- a/server/app/model/blueprint/blueprint-types/instance-blueprint/azure-blueprint/azure-blueprint.js +++ b/server/app/model/blueprint/blueprint-types/instance-blueprint/azure-blueprint/azure-blueprint.js @@ -276,6 +276,7 @@ azureInstanceBlueprintSchema.methods.launch = function(launchParams, callback) { environmentName: launchParams.envName, providerId: self.cloudProviderId, providerType: self.cloudProviderType, + tagServer: launchParams.tagServer, keyPairId: 'azure', region: self.region, chefNodeName: launchparamsazure.VMName, diff --git a/server/app/model/blueprint/blueprint-types/instance-blueprint/openstack-blueprint/openstack-blueprint.js b/server/app/model/blueprint/blueprint-types/instance-blueprint/openstack-blueprint/openstack-blueprint.js index 0f8c91402..65b26083a 100755 --- a/server/app/model/blueprint/blueprint-types/instance-blueprint/openstack-blueprint/openstack-blueprint.js +++ b/server/app/model/blueprint/blueprint-types/instance-blueprint/openstack-blueprint/openstack-blueprint.js @@ -223,6 +223,7 @@ openstackInstanceBlueprintSchema.methods.launch = function(launchParams, callbac environmentName: launchParams.envName, providerId: self.cloudProviderId, providerType: self.cloudProviderType, + tagServer: launchParams.tagServer, keyPairId: 'unknown', region: self.region, chefNodeName: instanceData.server.id, diff --git a/server/app/model/blueprint/blueprint-types/instance-blueprint/vmware-blueprint/vmware-blueprint.js b/server/app/model/blueprint/blueprint-types/instance-blueprint/vmware-blueprint/vmware-blueprint.js index 98db8101c..969017ab2 100755 --- a/server/app/model/blueprint/blueprint-types/instance-blueprint/vmware-blueprint/vmware-blueprint.js +++ b/server/app/model/blueprint/blueprint-types/instance-blueprint/vmware-blueprint/vmware-blueprint.js @@ -212,6 +212,7 @@ vmwareInstanceBlueprintSchema.methods.launch = function(launchParams, callback) environmentName: launchParams.envName, providerId: self.cloudProviderId, providerType: self.cloudProviderType, + tagServer: launchParams.tagServer, keyPairId: 'unknown', region: self.region, chefNodeName: createserverdata["vm_name"], diff --git a/server/app/model/classes/instance/instance.js b/server/app/model/classes/instance/instance.js index de7e3b9c0..f536505f7 100755 --- a/server/app/model/classes/instance/instance.js +++ b/server/app/model/classes/instance/instance.js @@ -341,6 +341,11 @@ var InstanceSchema = new Schema({ type: Boolean, required: false, default: false + }, + tagServer:{ + type: String, + required: false, + trim: true } }); diff --git a/server/app/routes/v1.0/routes_chef.js b/server/app/routes/v1.0/routes_chef.js index 9b89407e2..6ba19b57c 100755 --- a/server/app/routes/v1.0/routes_chef.js +++ b/server/app/routes/v1.0/routes_chef.js @@ -319,6 +319,7 @@ module.exports.setRoutes = function(app, verificationFunc) { instanceState: 'running', bootStrapStatus: 'success', hardware: hardwareData, + tagServer: reqBody.tagServer, credentials: encryptedCredentials, users: users, chef: { diff --git a/server/app/routes/v1.0/routes_organizations.js b/server/app/routes/v1.0/routes_organizations.js index 625c37286..8a1f32f80 100755 --- a/server/app/routes/v1.0/routes_organizations.js +++ b/server/app/routes/v1.0/routes_organizations.js @@ -1739,6 +1739,7 @@ module.exports.setRoutes = function(app, sessionVerification) { instanceIP: req.body.fqdn, instanceState: nodeAlive, bootStrapStatus: 'waiting', + tagServer: req.body.tagServer, runlist: [], appUrls: appUrls, users: [req.session.user.cn], //need to change this diff --git a/server/app/routes/v1.0/routes_providercommon.js b/server/app/routes/v1.0/routes_providercommon.js index 1396ae901..5317034c1 100644 --- a/server/app/routes/v1.0/routes_providercommon.js +++ b/server/app/routes/v1.0/routes_providercommon.js @@ -413,6 +413,7 @@ module.exports.setRoutes = function(app, sessionVerificationFunc) { projectId: req.body.projectId, projectName: req.body.projectName, envId: req.body.envId, + tagServer: req.body.tagServer, providerId: provider._id, providerType: 'aws', providerData: {