You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2013/04/26 17:47:05 UTC

[08/14] git commit: Network API rev 3 - Models (Network, Subnet, NetworkInterface, Instance)

Network API rev 3 - Models (Network, Subnet, NetworkInterface, Instance)


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/3aefaacf
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/3aefaacf
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/3aefaacf

Branch: refs/heads/master
Commit: 3aefaacf8175353e62e5af9f3dbabd48013d5498
Parents: 483be9a
Author: marios <ma...@redhat.com>
Authored: Fri Apr 12 12:14:17 2013 +0300
Committer: marios <ma...@redhat.com>
Committed: Fri Apr 26 18:01:55 2013 +0300

----------------------------------------------------------------------
 server/lib/deltacloud/models.rb                   |    3 ++
 server/lib/deltacloud/models/instance.rb          |    1 +
 server/lib/deltacloud/models/network.rb           |   30 ++++++++++++++++
 server/lib/deltacloud/models/network_interface.rb |   24 ++++++++++++
 server/lib/deltacloud/models/subnet.rb            |   27 ++++++++++++++
 5 files changed, 85 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3aefaacf/server/lib/deltacloud/models.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/models.rb b/server/lib/deltacloud/models.rb
index e6020e6..2edbf4a 100644
--- a/server/lib/deltacloud/models.rb
+++ b/server/lib/deltacloud/models.rb
@@ -32,3 +32,6 @@ require_relative 'models/realm'
 require_relative 'models/state_machine'
 require_relative 'models/storage_snapshot'
 require_relative 'models/storage_volume'
+require_relative 'models/network'
+require_relative 'models/subnet'
+require_relative 'models/network_interface'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3aefaacf/server/lib/deltacloud/models/instance.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/models/instance.rb b/server/lib/deltacloud/models/instance.rb
index 6c6b018..b435387 100644
--- a/server/lib/deltacloud/models/instance.rb
+++ b/server/lib/deltacloud/models/instance.rb
@@ -34,6 +34,7 @@ module Deltacloud
     attr_accessor :create_image
     attr_accessor :firewalls
     attr_accessor :storage_volumes
+    attr_accessor :network_interfaces
 
     def to_hash(context)
       r = {

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3aefaacf/server/lib/deltacloud/models/network.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/models/network.rb b/server/lib/deltacloud/models/network.rb
new file mode 100644
index 0000000..d46ac27
--- /dev/null
+++ b/server/lib/deltacloud/models/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.
+module Deltacloud
+class Network < BaseModel
+
+  attr_accessor :name
+  attr_accessor :subnets
+  attr_accessor :address_blocks
+  attr_accessor :state
+
+  def initialize(init=nil)
+    super(init)
+    self.subnets = [] unless self.subnets
+  end
+
+end
+end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3aefaacf/server/lib/deltacloud/models/network_interface.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/models/network_interface.rb b/server/lib/deltacloud/models/network_interface.rb
new file mode 100644
index 0000000..41d9816
--- /dev/null
+++ b/server/lib/deltacloud/models/network_interface.rb
@@ -0,0 +1,24 @@
+# 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.
+module Deltacloud
+class NetworkInterface < BaseModel
+
+  attr_accessor :name
+  attr_accessor :instance
+  attr_accessor :network
+  attr_accessor :ip_address
+
+end
+end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3aefaacf/server/lib/deltacloud/models/subnet.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/models/subnet.rb b/server/lib/deltacloud/models/subnet.rb
new file mode 100644
index 0000000..d91a7a9
--- /dev/null
+++ b/server/lib/deltacloud/models/subnet.rb
@@ -0,0 +1,27 @@
+#
+# 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.
+
+module Deltacloud
+class Subnet < BaseModel
+
+  attr_accessor :name
+  attr_accessor :network
+  attr_accessor :address_block
+  attr_accessor :state
+  attr_accessor :type
+
+end
+end