On 12/10/14, 9:05 AM, Tomaž Cerar wrote:
On Wed, Dec 10, 2014 at 3:45 PM, Brian Stansberry
<brian.stansberry(a)redhat.com <mailto:brian.stansberry@redhat.com>> wrote:
This sounds more like a complex attribute or a child resource. The
attributes control a discrete piece of functionality and
you need to be able to turn that on/off as a unit. The attributes
are required if that functionality is turned on.
Agreed, but how do you handle scenario where you just add resource that
has 30 attributes all in attribute groups.
You call :add() without any parameters as you plan to add/edit
attributes that are part of attribute group in next step.
you than call
:write-attribute(name=non-require-attribute-that-is-part-of-group-that-has-few-required,
value="some-value")
and this should fail, as attribute is part of attribute group.
You use a batch if it's important to you to format your request into
separate lines. Or you just include all the params and use the line
separator to break your add up into multiple lines and save a lot of typing.
(I'm not really arguing against you ^^^, just pointing out ways to do
things in case readers are not aware.)
It is a tricky thing to address, as we have not atomic way to
write/update more than one attribute at ones.
maybe have extra operation to do
write-attribute-group(name="first-attribute-group",
attr1=value,attr2=value) similar to :add semantics.
otherwise I don't see any good way to do atomic updates of whole
attribute group.
Ok, I'll add this to the "Other possible things to do" bit. Thanks for
the input. :)
I think "write-attributes(attr1=value,attr2=value)" makes more sense
though. This is really syntactic sugar around updating multiple
attribute in one op, not requiring client-side creation of a composite.
There's no need to tie the concept to the attribute-group notion.
--
Brian Stansberry
Senior Principal Software Engineer
JBoss by Red Hat