On Mar 9, 2012, at 6:42 PM, [email protected] wrote:

ACK.

 -- Michal


> From: marios <[email protected]>
> 
> 
> Signed-off-by: marios <[email protected]>
> ---
> clients/cimi/app.rb                                |    2 +
> clients/cimi/lib/entities.rb                       |    2 +
> clients/cimi/lib/entities/network.rb               |   30 ++++++++++++++++++++
> clients/cimi/lib/entities/network_configuration.rb |   30 ++++++++++++++++++++
> 4 files changed, 64 insertions(+), 0 deletions(-)
> create mode 100644 clients/cimi/lib/entities/network.rb
> create mode 100644 clients/cimi/lib/entities/network_configuration.rb
> 
> diff --git a/clients/cimi/app.rb b/clients/cimi/app.rb
> index 510fd33..505aaa7 100644
> --- a/clients/cimi/app.rb
> +++ b/clients/cimi/app.rb
> @@ -28,6 +28,8 @@ module CIMI::Frontend
>     use CIMI::Frontend::VolumeConfiguration
>     use CIMI::Frontend::VolumeImage
>     use CIMI::Frontend::Volume
> +    use CIMI::Frontend::Network
> +    use CIMI::Frontend::NetworkConfiguration
>     use Rack::Session::Cookie
> 
>     helpers CIMI::Frontend::Helper
> diff --git a/clients/cimi/lib/entities.rb b/clients/cimi/lib/entities.rb
> index ddb8f91..d6f566b 100644
> --- a/clients/cimi/lib/entities.rb
> +++ b/clients/cimi/lib/entities.rb
> @@ -28,3 +28,5 @@ require 'entities/machine_template'
> require 'entities/volume_configuration'
> require 'entities/volume_image'
> require 'entities/volume'
> +require 'entities/network'
> +require 'entities/network_configuration'
> diff --git a/clients/cimi/lib/entities/network.rb 
> b/clients/cimi/lib/entities/network.rb
> new file mode 100644
> index 0000000..8ce9942
> --- /dev/null
> +++ b/clients/cimi/lib/entities/network.rb
> @@ -0,0 +1,30 @@
> +# Licensed to the Apache Software Foundation (ASF) under one or more
> +# contributor license agreements.  See the NOTICE file distributed with
> +# this work for additional information regarding copyright ownership.  The
> +# ASF licenses this file to you under the Apache License, Version 2.0 (the
> +# "License"); you may not use this file except in compliance with the
> +# License.  You may obtain a copy of the License at
> +#
> +#       http://www.apache.org/licenses/LICENSE-2.0
> +#
> +# 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::Frontend::Network < CIMI::Frontend::Entity
> +
> +  get '/cimi/networks/:id' do
> +    network_xml = get_entity('networks', params[:id], credentials)
> +    @network = CIMI::Model::Network.from_xml(network_xml)
> +    haml :'networks/show'
> +  end
> +
> +  get '/cimi/networks' do
> +    networks_xml = get_entity_collection('networks', credentials)
> +    @networks = CIMI::Model::NetworkCollection.from_xml(networks_xml)
> +    haml :'networks/index'
> +  end
> +
> +end
> diff --git a/clients/cimi/lib/entities/network_configuration.rb 
> b/clients/cimi/lib/entities/network_configuration.rb
> new file mode 100644
> index 0000000..2180126
> --- /dev/null
> +++ b/clients/cimi/lib/entities/network_configuration.rb
> @@ -0,0 +1,30 @@
> +# Licensed to the Apache Software Foundation (ASF) under one or more
> +# contributor license agreements.  See the NOTICE file distributed with
> +# this work for additional information regarding copyright ownership.  The
> +# ASF licenses this file to you under the Apache License, Version 2.0 (the
> +# "License"); you may not use this file except in compliance with the
> +# License.  You may obtain a copy of the License at
> +#
> +#       http://www.apache.org/licenses/LICENSE-2.0
> +#
> +# 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::Frontend::NetworkConfiguration < CIMI::Frontend::Entity
> +
> +  get '/cimi/network_configurations/:id' do
> +    network_config_xml = get_entity('network_configurations', params[:id], 
> credentials)
> +    @network_config = 
> CIMI::Model::NetworkConfiguration.from_xml(network_config_xml)
> +    haml :'network_configurations/show'
> +  end
> +
> +  get '/cimi/network_configurations' do
> +    network_configs_xml = get_entity_collection('network_configurations', 
> credentials)
> +    @network_configs = 
> CIMI::Model::NetworkConfigurationCollection.from_xml(network_configs_xml)
> +    haml :'network_configurations/index'
> +  end
> +
> +end
> -- 
> 1.7.6.5
> 

Reply via email to