Exemple #1
0
def get_labels(team_id):
    """

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

    return jsonify(DependenciesController.get_labels(team_id))
Exemple #2
0
def get_labels(team_id):
    """Get the labels of a team.

    .. :quickref: GET; Get the labels of a team.

    **Example request**:

    .. sourcecode:: http

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

    **Example response**:

    .. sourcecode:: http

      HTTP/1.1 200 OK

      [
        {
          "name": "Filer",
          "nodes_count": 2,
          "qos_query": "rule.Servers"
        },
        {
          "name": "Website",
          "nodes_count": 2,
          "qos_query": "operation.AND[Filer, Apache]"
        },
        {
          "name": "Apache",
          "nodes_count": 2,
          "qos_query": "rule.Servers"
        },
        {
          "name": "Offer",
          "nodes_count": 1,
          "qos_query": "aggregation.AVERAGE[Website]"
        }
      ]

    :resheader Content-Type: application/json
    :status 200: the list of labels
    """
    if not TeamPermission.is_user(team_id):
        abort(403)

    return jsonify(DependenciesController.get_labels(team_id))