Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-5900

Improve create agents API handling of duplicate IDs

    XMLWordPrintableJSON

Details

    Description

      The distribution agent creation API has the wrong results in the following scenarios:

      • Scenario 1:
        • create agent with id Bob and type Forward
        • create agent with id Bob and type Reverse
        • the first agent is now replaced by the second one. I think this should be an error case (i.e. if there's already an agent with the same ID and a different type, the API should return an error).
      • Scenario 2
        • create agent with id Bob and type Forward
        • create agent with id Bob and type Forward
        • the properties of the first agent are overwritten by what we inputted at step 2

      I am using the API from a create / update UI context, so one solution would be to add an ":operation" parameter to distinguish between the two cases.

      So a "create" on an existing agent resource should fail, regardless of agent type, but an "update" should work.

      Attachments

        1. SLING-5900.patch
          5 kB
          Simone Tripodi

        Issue Links

          Activity

            People

              marett Timothee Maret
              ana.vinatoru Ana Vinatoru
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: