def robots_get(capability=[]):
    """ method to get all robots """
    resultlist = []
    items=[]
    if capability:
       items = Robot.scan(capabilities__contains=capability)
    else:
       items = Robot.scan()
    for item in items:
        resultlist.append(item.attribute_values)
    return resultlist
def buildings_building_id_robots_get(buildingId, capability = None):
	resultList = []
	try:
		building = Building.get(buildingId)
	except Exception as e:
		return 'Building with id=%s does not exist.' % (buildingId)
    
	if capability is not None and capability != '':
		for item in Robot.scan(buildingId__eq=buildingId, capabilities__contains=capability, conditional_operator='AND'):
			resultList.append(item.attribute_values)
	else:
		for item in Robot.scan(buildingId__eq=buildingId):
			resultList.append(item.attribute_values)
	return resultList
示例#3
0
def buildings_building_id_robots_get(buildingId, capability=None):
    resultList = []
    try:
        building = Building.get(buildingId)
    except Exception as e:
        return 'Building with id=%s does not exist.' % (buildingId)

    if capability is not None and capability != '':
        for item in Robot.scan(buildingId__eq=buildingId,
                               capabilities__contains=capability,
                               conditional_operator='AND'):
            resultList.append(item.attribute_values)
    else:
        for item in Robot.scan(buildingId__eq=buildingId):
            resultList.append(item.attribute_values)
    return resultList
示例#4
0
def robots_delete() -> str:
    temp = []
    for item in Robot.scan():
        temp.append(item.delete())
    return "%s items deleted." % len(temp)
示例#5
0
def buildings_building_id_robots_get(buildingId) -> str:
    resultList = []
    for item in Robot.scan(buildingId__eq=buildingId):
        resultList.append(item.attribute_values)
    return ( resultList )
def buildings_building_id_robots_delete(buildingId):
    """ method to delete all robots inside a building """
    resultlist = []
    for item in Robot.scan(buildingId__eq=buildingId):
        resultlist.append(item.delete())
    return "%s items deleted." % len(resultlist)
def robots_delete():
    """ method to delete all robots """
    temp = []
    for item in Robot.scan():
        temp.append(item.delete())
    return "%s items deleted." % len(temp)
示例#8
0
def robots_delete() -> str:
    temp = []
    for item in Robot.scan():
        temp.append(item.delete())
    return "%s items deleted." % len(temp)
示例#9
0
def buildings_building_id_robots_delete(buildingId):
    """ method to delete all robots inside a building """
    resultlist = []
    for item in Robot.scan(buildingId__eq=buildingId):
        resultlist.append(item.delete())
    return "%s items deleted." % len(resultlist)
示例#10
0
def robots_get():
    """ method to get all robots """
    resultlist = []
    for item in Robot.scan():
        resultlist.append(item.attribute_values)
    return resultlist
示例#11
0
def robots_delete():
    """ method to delete all robots """
    temp = []
    for item in Robot.scan():
        temp.append(item.delete())
    return "%s items deleted." % len(temp)
示例#12
0
def buildings_building_id_robots_delete(buildingId) -> str:
    resultList = []
    for item in Robot.scan(buildingId__eq=buildingId):
        resultList.append(item.delete())
    return "%s items deleted." % len(resultList)
示例#13
0
def robots_get() -> str:
    resultList = []
    for item in Robot.scan():
        resultList.append(item.attribute_values)
    return resultList
示例#14
0
def robots_get() -> str:
    resultList = []
    for item in Robot.scan():
        resultList.append(item.attribute_values)
    return resultList
示例#15
0
def robots_get():
    """ method to get all robots """
    resultlist = []
    for item in Robot.scan():
        resultlist.append(item.attribute_values)
    return resultlist
示例#16
0
def buildings_building_id_robots_delete(buildingId) -> str:
    resultList = []
    for item in Robot.scan(buildingId__eq=buildingId):
        resultList.append(item.delete())
    return "%s items deleted." % len(resultList)
示例#17
0
def buildings_building_id_robots_get(buildingId) -> str:
    resultList = []
    for item in Robot.scan(buildingId__eq=buildingId):
        resultList.append(item.attribute_values)
    return (resultList)