The "properties" are really meant to be used by clients as a spot to put
any random data that only it knows how to interpret.  So, asking a client
to put a piece of data in there that the server is to then use would go
against that pattern.   A better approach would be to define an extension
top-level attribute (sibling to "name", etc...) called "realm_id".  The
client can then fill this in knowing that the server will either fault it
if it doesn't understand it, or accept it and take the appropriate action.

> So if I understand this properly, we should not add 'machine_image' and
> 'credential' to the machine properties if client does not set them upon
> machine creation time or machine update.

Its not so much a question of whether the client sets them or not, its more
about whether the server should even look in there for them.  CIMI says
that the server should do nothing more than store them and return them back
on a GET.  If the server is looking for data from the client that it is
supposed to act upon then they need to be top-level attributes, not part of
"properties".

thanks
-Doug
________________________________________________________
STSM |  Standards Architect  |  IBM Software Group
(919) 254-6905  |  IBM 444-6905  |  [email protected]
The more I'm around some people, the more I like my dog.

Michal Fojtik <[email protected]> wrote on 12/11/2012 05:53:36 AM:

> From: Michal Fojtik <[email protected]>
> To: [email protected],
> Date: 12/11/2012 05:54 AM
> Subject: Re: DC's use of CIMI extensions
>
> On 12/10, Doug Davis wrote:
> >
> > All,
> >   CIMI says:  Each resource in the CIMI model has an attribute called
> > "properties." Consumers, when creating or updating a resource, may
store
> > any name/value pair in the "properties" attribute. CIMI Providers shall
> > store and return these values to the Consumer. There is no obligation
for
> > the Provider to understand or take any action based on these values;
they
> > are there for the Consumer's convenience. Providers shall not add
elements
> > to this "properties" attribute.
>
> So if I understand this properly, we should not add 'machine_image' and
> 'credential' to the machine properties if client does not set them upon
> machine creation time or machine update.
>
> I'm currently working on different scenario:
>
> 1. In Deltacloud API we have 'realms' that maps to 'Cluster' in oVirt or
>    'Datastore' in VSphere or the 'Zone' in EC2 (us-west1, etc..).
>    When creating Machine using CIMI, I was not able to find any
'matching'
>    entity that we can use.
>
> So we plan to use this 'workaround':
>
> 2. Consumer create a new MachineTemplate with:
>    <property key='realm_id'>us-west1</property>
>
> 3. Consumer then create new Machine using that MachineTemplate
>
> 4. Provider then parse 'realm_id' property and launch the Machine in
>    corrent zone/cluster/datastore.
>
> Is this correct, or there is a better way how to do it?
>
>   -- Michal
>
> >
> > DC returns for /machines:
> > <Machine><property key="credential">
> > http://api.deltacloud.org/cimi/credentials</property><property
> > key="machine_image">http://api.deltacloud.org/cimi/machine_images/img3
> > </property><cpu>4</cpu><operation rel="
> > http://schemas.dmtf.org/cimi/1/action/restart"; href="
> > http://api.deltacloud.org/cimi/machines/inst19/restart"/><operation
rel="
> > http://schemas.dmtf.org/cimi/1/action/stop"; href="
> > http://api.deltacloud.org/cimi/machines/inst19/stop"/><operation rel="
> > http://schemas.dmtf.org/cimi/1/action/capture"; href="
> > http://api.deltacloud.org/cimi/machine_images"/><volumes href="
> > http://api.deltacloud.org/cimi/machines/inst19/volumes"/><disks href="
> > http://api.deltacloud.org/cimi/machines/inst19/disks"/>
> > <state>STARTED</state><created>2012-12-07T17:53:19-05:00</created><id>
> > http://api.deltacloud.org/cimi/machines/inst19
> > </id><name>cimi_machine_from_templatejson</name><description> Created
> > machine from
templatejson</description><memory>12582912</memory></Machine>
> >
> >  I think these extensions need to be serialized as top-level attributes
on
> > resources instead of using "properties".
> >
> > thanks
> > -Doug
> > ________________________________________________________
> > STSM |  Standards Architect  |  IBM Software Group
> > (919) 254-6905  |  IBM 444-6905  |  [email protected]
> > The more I'm around some people, the more I like my dog.
>
> --
> Michal Fojtik <[email protected]>
> Deltacloud API, CloudForms
>

Reply via email to