def install(server, dbname, setupInfo): custom_opts = {} active = getInput("Enable Basic Publish?", "T", isBoolean) custom_opts["active"] = active.lower() in YES active = getInput("Maximum documents the node will accepts?", "1000", isInt) custom_opts["doc_limit"] = int(active) active = getInput( "Enter message size limit in octet. \n" + "This should the maximum data size the the node will accept", None, isInt) custom_opts["msg_size_limit"] = int(active) custom_opts["node_endpoint"] = setupInfo["nodeUrl"] custom_opts["service_id"] = uuid.uuid4().hex must = __BasicPublishServiceTemplate() config_doc = must.render(**custom_opts) print config_doc doc = json.loads(config_doc) PublishDoc(server, dbname, doc["service_type"] + ":Basic Publish service", doc) print("Configured Basic Publish service:\n{0}\n".format( json.dumps(doc, indent=4, sort_keys=True)))
def install(server, dbname, setupInfo): custom_opts = {} active = getInput("Enable Basic Obtain?", "T", isBoolean) custom_opts["active"] = active.lower() in YES active = getInput("Enable Basic Obtain Flow Control?", "F", isBoolean) custom_opts["flow_control"] = active.lower() in YES if custom_opts["flow_control"]: active = getInput("Maximum IDs to Return?", "100", isInt) custom_opts["id_limit"] = int(active) active = getInput("Maximum Docs to Return?", "100", isInt) custom_opts["doc_limit"] = int(active) custom_opts["node_endpoint"] = setupInfo["nodeUrl"] custom_opts["service_id"] = uuid.uuid4().hex must = __BasicObtainServiceTemplate() config_doc = must.render(**custom_opts) print config_doc doc = json.loads(config_doc) PublishDoc(server, dbname, doc["service_type"] + ":Basic Obtain service", doc) print("Configured Basic Obtain service:\n{0}\n".format( json.dumps(doc, indent=4, sort_keys=True)))
def install(self, server, dbname, customOpts): config_doc = self.render(**customOpts) doc = json.loads(config_doc) PublishDoc(server, dbname, self._getId(), doc) print("Configured {0} :\n{1}\n".format( self.opts['service_name'], json.dumps(doc, indent=4, sort_keys=True))) self._installCouchApps(_COUCHAPP_PATH, server) return self
def install(server, dbname, setupInfo): custom_opts = {} active = getInput("Enable Network Node Description?", "T", isBoolean) custom_opts["active"] = active.lower() in YES custom_opts["node_endpoint"] = setupInfo["nodeUrl"] custom_opts["service_id"] = uuid.uuid4().hex must = __NetworkNodeDescriptionServiceTemplate() config_doc = must.render(**custom_opts) print config_doc doc = json.loads(config_doc) PublishDoc(server, dbname, doc["service_type"] + ":Network Node Description service", doc) print("Configured Network Node Description service:\n{0}\n".format( json.dumps(doc, indent=4, sort_keys=True)))