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

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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.0
    • None
    • KnoxShell
    • 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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            pzampino Philip Zampino
            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

                Slack

                  Issue deployment