Get learning datasets

Gets a list of learning datasets that match the search criteria.

Required Permissions

Requires the MEMBER role or higher.

HTTP Request

GET /api/sonar/machine-learning/inputs
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     https://HOSTNAME/api/sonar/machine-learning/inputs
Request Parameters
KeyRequiredTypeDescriptionNotes
offsetNo32-bit integerNumber of records to skipDefault: 0
limitNo32-bit integerMaximum number of records to loadDefault: unlimited
keywordsNoStringSearch keywordSearches dataset name, description

Success Response

{
  "total_count": 1,
  "inputs": [
    {
      "id": 1,
      "guid": "99999999-8888-7777-6666-555555555555",
      "user_guid": "11111111-2222-3333-4444-555555555555",
      "user_name": "admin",
      "name": "Traffic Learning Dataset",
      "description": "Dataset for learning network traffic",
      "size": 12000,
      "fields": [
        {
          "name": "src_ip",
          "type": "string"
        },
        {
          "name": "label",
          "type": "string",
          "target": true,
          "values": ["normal", "anomaly"],
          "cardinality": 2
        }
      ],
      "configs": {
        "query": "table traffic | fields src_ip, dst_ip, label"
      },
      "created": "2024-06-18 09:30:25+0900",
      "updated": "2024-06-18 09:30:25+0900"
    }
  ]
}
  • total_count (32-bit integer): Total number of records that match the search criteria
  • inputs (Array): Learning dataset list
    • id (32-bit integer): Dataset serial number
    • guid (String): Dataset identifier
    • user_guid (String): Identifier of the account that created the dataset
    • user_name (String): Name of the account that created the dataset
    • name (String): Dataset name
    • description (String): Dataset description
    • size (64-bit integer): Record count
    • fields (Array): Dataset field list
      • name (String): Field name
      • type (String): Field data type
      • target (Boolean, optional): Whether this is the target field. Present only when true
      • values (String array, optional): List of category values. Present only when set
      • cardinality (32-bit integer, optional): Number of category values. Present only when values is set
      • importance (64-bit float, optional): Field importance. Present only when greater than 0
    • configs (Map): Data source configuration key/value
    • created (String): Creation time in yyyy-MM-dd HH:mm:ssZ format
    • updated (String): Last update time in yyyy-MM-dd HH:mm:ssZ format

Error Responses

offset or limit value is not an integer

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'offset' parameter should be int type"
}
Permission denied

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}