forked from feedhenry/fh-fhc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
craig
committed
Mar 12, 2015
1 parent
bb7253f
commit 858a0e0
Showing
8 changed files
with
859 additions
and
3 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
module.exports = clusterprops; | ||
|
||
clusterprops.desc = "Manage clusterprops"; | ||
clusterprops.usage = "fhc admin clusterprops \n fhc admin clusterprops read <name> \n"; | ||
|
||
var common = require("../../../common"); | ||
var fhreq = require("../../../utils/request"); | ||
var ini = require('../../../utils/ini'); | ||
var _ = require('underscore'); | ||
var headers = ['Id', 'Environment', 'Connection Tag', 'Platform', 'Client App', 'Cloud App', 'Build Type', 'Status']; | ||
var fields = ['guid', 'environment', 'tag', 'destination', 'clientApp', 'cloudApp', 'build', 'status']; | ||
|
||
function unknown(message, cb) { | ||
return cb(message + "\n" + "Usage: \n" + clusterprops.usage); | ||
} | ||
|
||
function clusterprops(argv, cb) { | ||
var args = argv._; | ||
if (args.length === 1) return listclusterprops(argv, cb); | ||
|
||
var action = args[0]; | ||
if ("list" === action || undefined === action) { | ||
return listclusterprops(argv, cb); | ||
} if ("read" === action) { | ||
//return readConnection(argv, cb); | ||
} if ("update" === action) { | ||
//return updateConnection(argv, cb); | ||
} else { | ||
return unknown("Invalid action: " + action, cb); | ||
} | ||
} | ||
|
||
function listclusterprops(args, cb){ | ||
var url = "/box/api/clusters/properties"; | ||
common.doGetApiCall(fhreq.getFeedHenryUrl(), url, "Error reading Cluster Props: ", function(err, props){ | ||
if (err) return cb(err); | ||
if (ini.get('table') === true) { | ||
clusterprops.table = common.createTableForProperties("cluster",props); | ||
} | ||
|
||
return cb(err, props); | ||
}); | ||
} | ||
|
||
function readclusterprop(args, cb){ | ||
var url = "/box/api/clusters/properties"; | ||
common.doGetApiCall(fhreq.getFeedHenryUrl(), url, "Error reading Cluster Props: ", function(err, props){ | ||
if (err) return cb(err); | ||
if (ini.get('table') === true) { | ||
clusterprops.table = common.createTableForProperties("cluster",props); | ||
} | ||
|
||
return cb(err, props); | ||
}); | ||
} | ||
|
||
|
||
//module.exports = { | ||
// 'desc' : 'read a clusters properties.', | ||
// 'examples' : [{ cmd : 'fhc admin clusterprops ', desc : 'read a clusters props'}], | ||
// 'demand' : [], | ||
// 'alias' : {}, | ||
// 'describe' : { | ||
// }, | ||
// 'url' : function(params){ | ||
// return '/box/api/clusters/properties' | ||
// }, | ||
// 'method' : 'get' | ||
//}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"updatedBy": "[email protected]", | ||
"name": "sdsd", | ||
"description": "", | ||
"subscribers": [], | ||
"pageRules": [], | ||
"fieldRules": [], | ||
"pages": [ | ||
{ | ||
"fields": [] | ||
} | ||
], | ||
"lastUpdated": "2014-04-29T11:46:20.489Z", | ||
"dateCreated": "2014-04-29T11:46:20.489Z", | ||
"status": "ok", | ||
"statusCode": 200 | ||
} |
Oops, something went wrong.