Uploaded image for project: 'Hawkular'
  1. Hawkular
  2. HAWKULAR-1340

Inventory is not accepting field "type"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • CF 5.0
    • Inventory
    • None
    • Hide
      • Create a Request with

      url: hawkular/inventory/import

      Headers:

      {'Content-Length': '498', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'User-Agent': 'python-requests/2.18.4', 'Connection': 'keep-alive', 'Cookie': '2216483786413f66053a9c225880f2a1=b04d210a21e4fd16c5fcbcb63aa90c70', 'Content-type': 'application/json', 'Authorization': 'Basic amRvZTpwYXNzd29yZA=='}

      Body: {"types": [], "resources": [{"typeId": "Application", "name": "New Application", "feedId": "feed-8b315061-d5aa-4ce9-ae56-4859ff5ace84", "id": "feed-8b315061-d5aa-4ce9-ae56-4859ff5ace84-NewApp.war", "metrics": [

      {"type": "TypeA", "name": "MetricA", "unit": "BYTES"}

      ,

      {"type": "TypeB", "name": "MetricB", "unit": "BYTES"}

      ], "config":

      {"confProp2": "confValue2", "confProp1": "confValue1"}

      , "properties": {"prop1": "val1", "prop2": "val2", "description": "This is a description for New Application"}}]}

      Show
      Create a Request with url: hawkular/inventory/import Headers: {'Content-Length': '498', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'User-Agent': 'python-requests/2.18.4', 'Connection': 'keep-alive', 'Cookie': '2216483786413f66053a9c225880f2a1=b04d210a21e4fd16c5fcbcb63aa90c70', 'Content-type': 'application/json', 'Authorization': 'Basic amRvZTpwYXNzd29yZA=='} Body: {"types": [], "resources": [{"typeId": "Application", "name": "New Application", "feedId": "feed-8b315061-d5aa-4ce9-ae56-4859ff5ace84", "id": "feed-8b315061-d5aa-4ce9-ae56-4859ff5ace84-NewApp.war", "metrics": [ {"type": "TypeA", "name": "MetricA", "unit": "BYTES"} , {"type": "TypeB", "name": "MetricB", "unit": "BYTES"} ], "config": {"confProp2": "confValue2", "confProp1": "confValue1"} , "properties": {"prop1": "val1", "prop2": "val2", "description": "This is a description for New Application"}}]}

    Description

      • Adding on /hawkular/inventory/import

      with

       {"types": [], "resources": [{"typeId": "Application", "name": "New Application", "feedId": "feed-8b315061-d5aa-4ce9-ae56-4859ff5ace84", "id": "feed-8b315061-d5aa-4ce9-ae56-4859ff5ace84-NewApp.war", "metrics": [{"type": "TypeA", "name": "MetricA", "unit": "BYTES"}, {"type": "TypeB", "name": "MetricB", "unit": "BYTES"}], "config": {"confProp2": "confValue2", "confProp1": "confValue1"}, "properties": {"prop1": "val1", "prop2": "val2", "description": "This is a description for New Application"}}]}
      

      results on

      com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "type" (class org.hawkular.inventory.api.model.Metric), not marked as ignorable (6 known properties: "properties", "family", "expression", "displayName", "labels", "unit"])\n at [Source: io.undertow.servlet.spec.ServletInputStreamImpl@3b330d4d; line: 1, column: 264] (through reference chain: org.hawkular.inventory.api.model.Inventory["resources"]->java.util.ArrayList[0]->org.hawkular.inventory.api.model.RawResource["metrics"]->java.util.ArrayList[0]->org.hawkular.inventory.api.model.Metric["type"])'
      

      Attachments

        Issue Links

          Activity

            People

              rh-ee-gbaufake Guilherme Baufaker Rego
              rh-ee-gbaufake Guilherme Baufaker Rego
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: