---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
Test get missing model:
- do:
    catch: "missing"
    inference.get:
      inference_id: "inference_to_get"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - ".*rollup functionality will be removed in Elasticsearch.*"
    - "Index \\[\\.profiling-.*\\] name begins with a dot.* and will not be allowed\
      \ in a future Elasticsearch version."
    - "Parameter \\[default_metric\\] is deprecated and will be removed in a future\
      \ version"
- match:
    error.type: "resource_not_found_exception"
- match:
    error.reason: "Inference endpoint not found [inference_to_get]"
---
Test put inference with bad task type:
- do:
    catch: "bad_request"
    inference.put:
      inference_id: "elser_model"
      body: "{\n  \"task_type\": \"bad\",\n  \"service\": \"elser\",\n  \"service_settings\"\
        : {\n    \"num_allocations\": 1,\n    \"num_threads\": 1\n  },\n  \"task_settings\"\
        : {\n  }\n}\n"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - ".*rollup functionality will be removed in Elasticsearch.*"
    - "Index \\[\\.profiling-.*\\] name begins with a dot.* and will not be allowed\
      \ in a future Elasticsearch version."
    - "Parameter \\[default_metric\\] is deprecated and will be removed in a future\
      \ version"
- match:
    error.reason: "Unknown task_type [bad]"
