deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "marios@redhat.com" <mandr...@redhat.com>
Subject Re: [PATCH core 3/5] CIMI: Added MachineImage model
Date Wed, 16 Nov 2011 11:21:59 GMT
minor comments inline (otherwise ACK):

On 14/11/11 17:09, mfojtik@redhat.com wrote:
> From: Michal Fojtik <mfojtik@redhat.com>
> +# Unless required by applicable law or agreed to in writing, software
> +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
> +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
> +# License for the specific language governing permissions and limitations
> +# under the License.
> +
> +class CIMI::Model::MachineImage < CIMI::Model::Base
> +
> +  scalar :image_location

could also have :image_data instead of :image_location (either-or, but
not both)... :image_data is a byte array, but represented as string in
json and xml, so scalar?

JSON: "imageData": string, ?
XML: <imageData> xs:string </imageData> ?

> +
> +  array :operations do
> +    scalar :rel, :href
> +  end
> +end
> diff --git a/server/spec/cimi/data/machine_image.json b/server/spec/cimi/data/machine_image.json
> new file mode 100644
> index 0000000..e037144
> --- /dev/null
> +++ b/server/spec/cimi/data/machine_image.json
> @@ -0,0 +1,13 @@
> +{
> +  "uri": "http://cimi.example.org/machine_images/1",
> +  "name": "My First image",
> +  "description": "A image for testing",
> +  "created": "2011-11-14",
> +  "imageLocation": { "href": "nfs://cimi.example.com/images/1.img"}
> +  "properties": [ {"name": "status", "value": "build"}, { "name": "locked", "value":
"true" } ]

I think this is gonna be more like

 +  "properties": [ {"status": "build", "locked": "true" } ]

> +  "operations": [
> +    { "rel": "edit",
> +      "href": "http://cimi.example.org/machine_images/1/edit" },
> +    { "rel": "delete",
> +      "href": "http://cimi.example.org/machine_images/1/delete" }]
> +}
> diff --git a/server/spec/cimi/data/machine_image.xml b/server/spec/cimi/data/machine_image.xml
> new file mode 100644
> index 0000000..a02bc36
> --- /dev/null
> +++ b/server/spec/cimi/data/machine_image.xml
> @@ -0,0 +1,11 @@
> +<MachineImage xmlns="http://www.dmtf.org/cimi">
> +  <uri>http://cimi.example.org/machine_image/1</uri>
> +  <name>img1</name>
> +  <description>Machine Image One</description>
> +  <created>2011-11-14</created>
> +  <property name="status">BUILD</property>
> +  <property name="locked">true</property>

properties are (for now :) ) :key="status" instead of :name

<property key="xs:string"> xs:string </property> *

> +  <imageLocation href="nfs://cimi.example.com/images/1.img"/>
> +  <operation rel="edit" href="http://cimi.example.org/machine_image/1/edit"/>
> +  <operation rel="delete" href="http://cimi.example.org/machine_image/1/delete"/>
> +</MachineImage>

Mime
View raw message