本文整理匯總了Python中edge.Edge.query方法的典型用法代碼示例。如果您正苦於以下問題:Python Edge.query方法的具體用法?Python Edge.query怎麽用?Python Edge.query使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類edge.Edge
的用法示例。
在下文中一共展示了Edge.query方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: delete_all_edges
# 需要導入模塊: from edge import Edge [as 別名]
# 或者: from edge.Edge import query [as 別名]
def delete_all_edges(options):
""" Function to delete all edges on given VSM
@param options cli options to this script
@return None
"""
edge = Edge(vsm_obj)
edges = (edge.query())
edge_id = None
for item in edges.edgePage.list_schema:
edge.id = item.objectId
edge.delete()
示例2: get_edge
# 需要導入模塊: from edge import Edge [as 別名]
# 或者: from edge.Edge import query [as 別名]
def get_edge(vsm_obj):
""" function to get edge id for the current user
@param vsm_obj reference to vsm client object
@return edge_id edge id from vsm
"""
edge = Edge(vsm_obj, '4.0')
edges = (edge.query())
edge_id = None
for item in edges.edgePage.list_schema:
user = pwd.getpwuid(os.getuid())[0]
if item.name and re.search(user, item.name):
print "Got Edge VM %s for user %s" % (item.name, user)
edge_id = item.objectId
break
return edge_id