This applies too on 6.0.0-SNAPSHOT. For the realm-config/agents/*Agent (be it Web/J2EE and others), the create and create_put (ie: using PUT) behaviour is like this:
a) Case NEW entry: (PUT)
when the agent id is not present, the entry is created and it pull in some "template" values and create the entries. This is fine
b) Case entry exists: PUT
When a PUT (with the existing id), the entries are updated. Old existing values if not defined in the requested Payload will not be touched. Only new values in the requested payload will be updated.
c) If the Agent has inheritance set (done outside of the REST), updating the values will reset the inheritance of that attribute to OFF. for that agent id and the value updated
In short the experience seems good
1) NEW Entry (PUT)
The schema changed (see OPENAM-12229) and so the format of the payload to 5.5.1 is different. Now, on creeation missing values will take the template values. This looks ok.
2) Updating existing entry (PUT). Now updating the entries in 5.5.x and even 6.0-SNAPSHOT overwrites everything. (Does not use old values that's existing nor will there be template values). So a GET returns what is passed in essentially.
i) It is seen there is inherited values for the the AgentGroup but this itself does not work. (whatever values does not matter). 5.5.x seems does not work well for REST update (or at least it behaves like a create with all values passed in the PUT)
ii) There is also no field data validation (anything goes) [sure the API descriptor never say this but if the agent config lack certain key values it's a broken config]
iii) Using PUT on an existing id, will overwrite with things in the payload. The values in of the old one is not merged in. (so the point on data validation above also applies)
iv) The schema has inherited but the schema does not provide the way to associate the agentGroup. (OAuth2 in 5.5.x is the only one having it).
It seems the schema now for Webagent/J2EEAgent changes with the inherited AgentGroup. However the issue on update on an existing entry is still the same.
a) Case NEW entry: The entry created with template values for those items that's is not defined in request payload.
b) Case PUT with existing id.
For the request payload that's missing some entries for example like "advancedJ2EEAgentConfig" block, then the update UI will empty. (ie: showing that
it does not use any other values) and all values needs to be passed in.
- Setup the respective AM version
- Run API explorer for realm-config/agents/WebAgent/J2EEAgent
- Clear all agents
- Create a new Agent Agent1
- Observe and get the payload
- Modify some payload and and execute #create_put#update (existing)
where only the esssential payload (say agentDebugLogLevel)
- Now do a GET to get the payload.
(or check the UI). The extries may be all missing now
- It is desirable if we not have the template values set. (and maybe have data validation) and that user provided the required values.
- Desirable if it behaves like a patch. (but surely an update should not take the template values)
Due to the schema resource version for all these is 1.0, currently it seems for each specific AM version we have to define a FULL request payload and treat create(new entry) and create(update) as the same and pass all the settings again.
Seems like 5.5.x is in unstable mode (with the inherited schema).