Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-15150

Support response body for DELETE API

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.4.0
    • 2.4.0
    • ambari-server
    • None

    Description

      Currently DELETE API only returns status code and no body. This doesn't fit well in bulk delete scenario as user needs to know which keys were deleted and which one failed and why. For this, ResourceProvider needs to return metadata as part of RequestStatus object which can be translated to metadata for Result object at API layer.

      At API layer, for all failed keys, reason code (like 404) is required which will make scripting easy instead of just including error message as string.

      DELETE response json object should be

      {
        "deleteResult" : [
          {
            "deleted" : {
              "key" : "<resource-key>"
            }
          },
          {
            "deleted" : {
              "key" : "<resource-key>"
            }
          },
          ...
          {
            "error" : {
              "key" : "<resource-key>",
              "code" : 404,
              "message" : "Resource not found"
            }
          },
          {
            "error" : {
              "key" : "<resource-key>",
              "code" : 404,
              "message" : "Resource not found"
            }
          },
          ...
        ]
      }
      

      Attachments

        1. rb43926.patch
          47 kB
          Ajit Kumar

        Issue Links

          Activity

            People

              ajit.kumar Ajit Kumar
              ajit.kumar Ajit Kumar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: