deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Davis <...@us.ibm.com>
Subject Re: [PATCH 4/8] CIMI: toplevel collections must have a resourceURI attr in XML
Date Fri, 09 Nov 2012 16:16:36 GMT

Hi Marios,
  it can't hurt to add that sentence.  I actually ran into that recently
and was bugged that we needed a resourceURI at all for XML - I know that's
the price we pay for using the same root element for all collections, but
bleck!  :-)   Maybe for v2 we can convince folks (Gil) to use a
collection-specific root element name.

 I'd recommend opening a new issue since it is more than just a typo -
should be a quick 2 minute discussion/vote.

thanks
-Doug
________________________________________________________
STSM |  Standards Architect  |  IBM Software Group
(919) 254-6905  |  IBM 444-6905  |  dug@us.ibm.com
The more I'm around some people, the more I like my dog.



From:	"marios@redhat.com" <mandreou@redhat.com>
To:	dev@deltacloud.apache.org,
Cc:	lutter@redhat.com, Doug Davis/Raleigh/IBM@IBMUS
Date:	11/09/2012 11:11 AM
Subject:	Re: [PATCH 4/8] CIMI: toplevel collections must have a
            resourceURI attr in XML



cc'ing Doug Davis here - Doug should I open a Mantis for this? (seems
like minor editorial)

IMO, $subject isn't very clear in the spec...

section 4.1.4 Media Types : "In the JSON serialization of CIMI
representations sent by Providers there shall be an additional attribute
on the root object called "resourceURI" that will contain the unique URI
that is associated with the type of
CIMI resource being serialized. "

I think we can add a sentence here saying that the 'root' Collections
must have a resourceURI for the XML serialization too. It *is* defined
in the XML schema @ http://schemas.dmtf.org/cimi/1/dsp8009_1.0.1.xsd and
shown in the example serialization under 5.5.12 Collections but is that
clear enough?

marios


On 09/11/12 06:18, lutter@redhat.com wrote:
> From: David Lutterkort <lutter@redhat.com>
>
> ---
>  server/lib/cimi/models/base.rb   |    1 +
>  server/tests/cimi/spec_helper.rb |    5 ++++-
>  2 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/server/lib/cimi/models/base.rb
b/server/lib/cimi/models/base.rb
> index 63b24ae..6a73cf6 100644
> --- a/server/lib/cimi/models/base.rb
> +++ b/server/lib/cimi/models/base.rb
> @@ -235,6 +235,7 @@ class CIMI::Model::Resource
>    def self.to_xml(model)
>      xml = @schema.to_xml(model)
>      xml["xmlns"] = CMWG_NAMESPACE
> +    xml["resourceURI"] = resource_uri
>      XmlSimple.xml_out(xml, :root_name => xml_tag_name)
>    end
>
> diff --git a/server/tests/cimi/spec_helper.rb
b/server/tests/cimi/spec_helper.rb
> index e1f2ee4..e86eaee 100644
> --- a/server/tests/cimi/spec_helper.rb
> +++ b/server/tests/cimi/spec_helper.rb
> @@ -32,6 +32,9 @@ def parse_xml(xml, opts = {})
>  end
>
>  class HashCmp
> +
> +  IGNORED_KEYS = [ "resourceURI" ]
> +
>    def initialize(exp, act)
>      @exp = exp
>      @act = act
> @@ -77,7 +80,7 @@ class HashCmp
>        unless (missing = exp.keys - act.keys).empty?
>          error "Missing key(s) at /#{path.join("/")}: #{missing.inspect}"
>        end
> -      unless (excess = act.keys - exp.keys).empty?
> +      unless (excess = act.keys - exp.keys - IGNORED_KEYS).empty?
>          error "Excess key(s) at /#{path.join("/")}: #{excess.inspect}"
>        end
>        (exp.keys - missing - excess).each do |k|
>


Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message