Exemple #1
0
def get_service_types():
    """Add or update ServiceType.
        ---
        get:
            tags:
            - ServiceType
            summary: Gets all object types id and description.
            responses:
                '200':
                  description: Success
                  content:
                    application/json:
                      schema:
                        $ref: IdDescList
    """

    ret = common.IdDescList()

    for srv_type in SERVICE_TYPES.values():
        ret.items.append(common.IdDesc(srv_type.id, "", srv_type.desc))

    return jsonify(ret.to_dict())
Exemple #2
0
def get_scenes():
    """Add or update scene.
        ---
        get:
            tags:
            - Scene
            summary: Gets all scenes id and description.
            responses:
                '200':
                  description: Success
                  content:
                    application/json:
                      schema:
                        $ref: IdDescList
    """

    ret = common.IdDescList()

    for scene in SCENES.values():
        ret.items.append(common.IdDesc(scene.id, scene.name, scene.desc))

    return jsonify(ret.to_dict())
Exemple #3
0
def get_object_types():
    """Add or update ObjectType.
        ---
        get:
            tags:
            - ObjectType
            summary: Gets all object types id and description.
            responses:
                '200':
                  description: Success
                  content:
                    application/json:
                      schema:
                        $ref: IdDescList
    """

    ret = common.IdDescList()

    for obj_type in OBJECT_TYPES.values():
        ret.items.append(common.IdDesc(obj_type.id, "", obj_type.desc))

    return jsonify(ret.to_dict())
Exemple #4
0
def get_projects():
    """Add or update project.
        ---
        get:
            tags:
            - Project
            summary: Gets all projects id and description.
            responses:
                '200':
                  description: Success
                  content:
                    application/json:
                      schema:
                        $ref: IdDescList
    """

    ret = common.IdDescList()

    for proj in PROJECTS.values():
        ret.items.append(common.IdDesc(proj.id, proj.name, proj.desc))

    return jsonify(ret.to_dict())