Uploaded image for project: 'Apache Knox'
  1. Apache Knox
  2. KNOX-2144

Alias API KnoxShell support should provide response types better than raw JSON

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.0
    • Fix Version/s: None
    • Component/s: KnoxShell
    • Labels:
      None

      Description

      Like many of the other KnoxShell classes, the responses are essentially JSON, which the client has to process itself. For the Alias API interactions, the responses could be processed by the KnoxShell classes themselves, especially since it's a Knox API.

      So, instead of 

      response = Alias.list(session, clusterName).now()
      json = (new JsonSlurper()).parseText( response.string )
      cluster = json.topology
      aliases = json.aliases
      

      the response type would provide methods for getting the response details

      response = Alias.list(session, clusterName).now()
      cluster = response.getCluster()
      aliases = response.getAliases()

        Attachments

        1. ExampleAliases.groovy
          4 kB
          Philip Zampino

          Issue Links

            Activity

              People

              • Assignee:
                pzampino Philip Zampino
                Reporter:
                pzampino Philip Zampino
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h