本文整理汇总了Python中webViews.dockletrequest.dockletRequest.post函数的典型用法代码示例。如果您正苦于以下问题:Python post函数的具体用法?Python post怎么用?Python post使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了post函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: get
def get(self):
data = {}
allclusters = dockletRequest.post_to_all('/cluster/list/')
for master in allclusters:
allclusters[master] = allclusters[master].get('clusters')
result = dockletRequest.post('/user/selfQuery/')
quotas = result['data']['groupinfo']
quotanames = quotas.keys()
'''result = dockletRequest.post('/monitor/user/quotainfo/', data)
quotainfo = result.get('quotainfo')
quotainfo['cpu'] = int(int(quotainfo['cpu']))
print(quotainfo)'''
allcontainers = {}
if (result):
containers = {}
for master in allclusters:
allcontainers[master] = {}
for cluster in allclusters[master]:
data["clustername"] = cluster
message = dockletRequest.post('/cluster/info/', data, master.split("@")[0])
if (message):
message = message.get('message')
else:
self.error()
allcontainers[master][cluster] = message
return self.render(self.template_path, quotas = quotas, quotanames = quotanames, allcontainers = allcontainers, user = session['username'])
else:
self.error()
开发者ID:PedroLiu,项目名称:docklet,代码行数:28,代码来源:monitor.py
示例2: get_by_id
def get_by_id(cls, notify_id):
notifies = []
if notify_id == 'all':
notifies.extend(dockletRequest.post('/notification/query/all/')['data'])
else:
notifies.append(dockletRequest.post('/notification/query/', data={'notify_id': notify_id})['data'])
return cls.render(cls.template_path, notifies=notifies)
开发者ID:DreamReaver,项目名称:docklet,代码行数:7,代码来源:notification.py
示例3: post
def post(self):
data = {
"src_host": self.hostip,
"dst_host_list": self.target
}
dockletRequest.post("/host/migrate/", data, self.masterip)
return redirect("/hosts/")
开发者ID:FirmlyReality,项目名称:docklet,代码行数:7,代码来源:admin.py
示例4: get
def get(self):
result = dockletRequest.post('/user/groupList/')
groups = result["groups"]
quotas = result["quotas"]
defaultgroup = result["default"]
parms = dockletRequest.post('/system/parmList/')
return self.render(self.template_path, groups = groups, quotas = quotas, defaultgroup = defaultgroup, parms = parms)
开发者ID:DreamReaver,项目名称:docklet,代码行数:7,代码来源:admin.py
示例5: get
def get(self):
result = dockletRequest.post('/user/groupList/')
groups = result["groups"]
quotas = result["quotas"]
defaultgroup = result["default"]
parms = dockletRequest.post('/system/parmList/')
rootimage = dockletRequest.post('/image/list/').get('images')
lxcsetting = dockletRequest.post('/user/lxcsettingList/')['data']
return self.render(self.template_path, groups = groups, quotas = quotas, defaultgroup = defaultgroup, parms = parms, lxcsetting = lxcsetting, root_image = rootimage['private'])
开发者ID:caodg,项目名称:docklet,代码行数:9,代码来源:admin.py
示例6: get
def get(self):
images = dockletRequest.post('/image/list/').get('images')
clusters = dockletRequest.post("/cluster/list/").get("clusters")
clusters_info = {}
data={}
for cluster in clusters:
data["clustername"] = cluster
result = dockletRequest.post("/cluster/info/",data).get("message")
clusters_info[cluster] = result
return self.render("config.html", images = images, clusters = clusters_info, mysession=dict(session))
开发者ID:Puppy95,项目名称:docklet,代码行数:10,代码来源:cluster.py
示例7: get
def get(self):
data = {
"user": session['username'],
}
result = dockletRequest.post('/monitor/listphynodes/', data)
userslist = [{'name':'root'},{'name':'libao'}]
for user in userslist:
result = dockletRequest.post('/monitor/user/%s/clustercnt/'%(user['name']), data)
user['clustercnt'] = result.get('monitor').get('clustercnt')
return self.render(self.template_path, userslist = userslist, user = session['username'])
开发者ID:FirmlyReality,项目名称:docklet,代码行数:10,代码来源:monitor.py
示例8: get
def get(self):
data = {
"user": session['username'],
}
result = dockletRequest.post('/monitor/hosts/%s/cpuconfig'%(self.com_ip), data)
proc = result.get('monitor').get('cpuconfig')
result = dockletRequest.post('/monitor/hosts/%s/osinfo'%(self.com_ip), data)
osinfo = result.get('monitor').get('osinfo')
result = dockletRequest.post('/monitor/hosts/%s/diskinfo'%(self.com_ip), data)
diskinfos = result.get('monitor').get('diskinfo')
return self.render(self.template_path, com_ip = self.com_ip, user = session['username'],processors = proc, OSinfo = osinfo, diskinfos = diskinfos)
开发者ID:K45V,项目名称:docklet,代码行数:12,代码来源:monitor.py
示例9: get
def get(self):
allimages = dockletRequest.post_to_all('/image/list/')
for master in allimages:
allimages[master] = allimages[master].get('images')
allclusters = dockletRequest.post_to_all("/cluster/list/")
for master in allclusters:
allclusters[master] = allclusters[master].get('clusters')
allclusters_info = {}
clusters_info = {}
data={}
for master in allclusters:
allclusters_info[master] = {}
for cluster in allclusters[master]:
data["clustername"] = cluster
result = dockletRequest.post("/cluster/info/", data, master.split("@")[0]).get("message")
allclusters_info[master][cluster] = result
result = dockletRequest.post("/user/usageQuery/")
quota = result.get("quota")
usage = result.get("usage")
default = result.get("default")
restcpu = int(quota['cpu']) - int(usage['cpu'])
restmemory = int(quota['memory']) - int(usage['memory'])
restdisk = int(quota['disk']) - int(usage['disk'])
if restcpu >= int(default['cpu']):
defaultcpu = default['cpu']
elif restcpu <= 0:
defaultcpu = "0"
else:
defaultcpu = str(restcpu)
if restmemory >= int(default['memory']):
defaultmemory = default['memory']
elif restmemory <= 0:
defaultmemory = "0"
else:
defaultmemory = str(restmemory)
if restdisk >= int(default['disk']):
defaultdisk = default['disk']
elif restdisk <= 0:
defaultdisk = "0"
else:
defaultdisk = str(restdisk)
defaultsetting = {
'cpu': defaultcpu,
'memory': defaultmemory,
'disk': defaultdisk
}
return self.render("config.html", allimages = allimages, allclusters = allclusters_info, mysession=dict(session), quota = quota, usage = usage, defaultsetting = defaultsetting)
开发者ID:caodg,项目名称:docklet,代码行数:50,代码来源:cluster.py
示例10: get
def get(self):
data = {
"user": session['username'],
}
result = dockletRequest.post('/monitor/vnodes/%s/history/'%(self.vnode_name), data)
history = result.get('monitor').get('history')
return self.render(self.template_path, vnode_name = self.vnode_name, user = session['username'], history = history)
开发者ID:leebaok,项目名称:docklet,代码行数:7,代码来源:monitor.py
示例11: render
def render(self, *args, **kwargs):
self.mysession = dict(session)
kwargs['mysession'] = self.mysession
kwargs['version'] = version
result = dockletRequest.post("/user/selfQuery/",{})
kwargs['beans'] = result.get("data").get("beans")
return render_template(*args, **kwargs)
开发者ID:FirmlyReality,项目名称:docklet,代码行数:7,代码来源:view.py
示例12: get
def get(self):
masterips = dockletRequest.post_to_all()
images = {}
for master in masterips:
images[master.split("@")[0]] = dockletRequest.post("/image/list/",{},master.split("@")[0]).get("images")
logger.info(images)
return self.render(self.template_path, masterips=masterips, images=images)
开发者ID:FirmlyReality,项目名称:docklet,代码行数:7,代码来源:batch.py
示例13: post
def post(self):
masterip = self.masterip
result = dockletRequest.post("/batch/job/add/", self.job_data, masterip)
if result.get('success', None) == "true":
return redirect('/batch_jobs/')
else:
return self.render(self.error_path, message = result.get('message'))
开发者ID:FirmlyReality,项目名称:docklet,代码行数:7,代码来源:batch.py
示例14: get
def get(self):
result = dockletRequest.post("/cluster/list/")
clusters = result.get("clusters")
if(result):
return self.render(self.template_path, user = session['username'], clusters = clusters)
else:
self.error()
开发者ID:monumentality,项目名称:docklet,代码行数:7,代码来源:cluster.py
示例15: post
def post(self):
data = {"number":request.form["number"],"reason":request.form["reason"]}
result = dockletRequest.post('/beans/apply/',data)
success = result.get("success")
if success == "true":
return redirect("/beans/application/")
else:
return self.render(self.template_path, message = result.get("message"))
开发者ID:PedroLiu,项目名称:docklet,代码行数:8,代码来源:beansapplication.py
示例16: logs_get
def logs_get(filename):
data = {
"filename": filename
}
result = dockletRequest.post('/logs/get/', data).get('result', '')
response = make_response(result)
response.headers["content-type"] = "text/plain"
return response
开发者ID:FirmlyReality,项目名称:docklet,代码行数:8,代码来源:web.py
示例17: get
def get(self):
data = {"msgid":self.msgid}
result = dockletRequest.post('/beans/admin/'+self.cmd+"/",data)
success = result.get("success")
if success == "true":
return redirect("/user/list/")
else:
return self.render(self.template_path, message = result.get("message"))
开发者ID:PedroLiu,项目名称:docklet,代码行数:8,代码来源:beansapplication.py
示例18: monitor_user_request
def monitor_user_request(issue,masterip):
data = {
"user": session['username']
}
path = "/monitor/user/" + str(issue) + "/"
logger.debug(path + "_____" + masterip)
result = dockletRequest.post(path, data, masterip)
logger.debug("monitor" + str(type(result)))
return json.dumps(result)
开发者ID:FirmlyReality,项目名称:docklet,代码行数:9,代码来源:web.py
注:本文中的webViews.dockletrequest.dockletRequest.post函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论