Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-4938

Service Metric Read API endpoint returns parent metric id only in XML

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 2.9 GA
    • SaaS
    • System
    • None
    • 3
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • +
    • Hide

      Set up a method contributing to Hits in any service and call the mentioned endpoints for XML and JSON, and observe there is no entry for "metric_id" in the JSON output.

      Show
      Set up a method contributing to Hits in any service and call the mentioned endpoints for XML and JSON, and observe there is no entry for " metric_id " in the JSON output.
    • Invalid Sprint

      When retrieving information about a method "products" which contributes to "Hits" via the API, I can get the relation information from products to Hits, but that information is not returned if using the JSON format.

      Calling GET "https://istiodevel-admin.3scale.net/admin/api/services/2555417783508/metrics/2555418218054.xml?access_token=<redacted>" returns (note metric_id, which points to "Hits"):

      <?xml version="1.0" encoding="UTF-8"?>
      <method>
        <id>2555418218054</id>
        <name>products</name>
        <system_name>products</system_name>
        <friendly_name>products</friendly_name>
        <service_id>2555417783508</service_id>
        <description></description>
        <metric_id>2555418218053</metric_id>
      </method>
      

      ...but calling GET "https://istiodevel-admin.3scale.net/admin/api/services/2555417783508/metrics/2555418218054.json?access_token=<redacted>" returns (note there is no metric_id):

      {
        "metric": {
          "id": 2555418218054,
          "name": "products",
          "system_name": "products",
          "friendly_name": "products",
          "description": "",
          "unit": "hit",
          "created_at": "2019-03-31T01:35:15Z",
          "updated_at": "2019-03-31T01:35:15Z",
          "links": [
            {
              "rel": "service",
              "href": "https://istiodevel-admin.3scale.net/admin/api/services/2555417783508"
            },
            {
              "rel": "self",
              "href": "https://istiodevel-admin.3scale.net/admin/api/services/2555417783508/metrics/2555418218054"
            }
          ]
        }
      }
      

      Please also see https://3scale.slack.com/archives/C7MHAMAT0/p1587633824011600

            Unassigned Unassigned
            amartine@redhat.com Alejandro Martinez Ruiz (Inactive)
            Jakub Urban Jakub Urban
            Marta Noya Marta Noya (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: