Exemple #1
0
def get_label_nodes(team_id, label):
    """

    .. :quickref: GET; Lorem ipsum."""
    if not TeamPermission.is_user(team_id):
        abort(403)

    return jsonify(
        DependenciesController.get_label_nodes(
            team_id,
            label,
            request.args.get("name", None),
            request.args.get("limit", None),
            request.args.get("random", False),
        ))
Exemple #2
0
def get_label_nodes(team_id, label):
    """Get the nodes of a label.

    .. :quickref: GET; Get the nodes of a label.

    **Example request**:

    .. sourcecode:: http

      GET /v1/teams/66859c4a-3e0a-4968-a5a4-4c3b8662acb7/labels/Website/nodes HTTP/1.1
      Host: example.com
      Accept: application/json

    **Example response**:

    .. sourcecode:: http

      HTTP/1.1 200 OK

      [
        "example-one.com",
        "example-two.com"
      ]

    :param name: Filter the list by name
    :param limit: Limit the number of results
    :param random: Return random items
    :resheader Content-Type: application/json
    :status 200: the list of nodes
    """
    if not TeamPermission.is_user(team_id):
        abort(403)

    return jsonify(
        DependenciesController.get_label_nodes(
            team_id,
            label,
            request.args.get("name", None),
            request.args.get("limit", None),
            request.args.get("random", False),
        )
    )