You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2013/01/21 17:57:22 UTC
[PATCH 1/3] Network API Models
From: marios <ma...@redhat.com>
Signed-off-by: marios <ma...@redhat.com>
---
server/lib/deltacloud/models.rb | 3 +++
server/lib/deltacloud/models/network.rb | 25 +++++++++++++++++++++++++
server/lib/deltacloud/models/port.rb | 27 +++++++++++++++++++++++++++
server/lib/deltacloud/models/subnet.rb | 26 ++++++++++++++++++++++++++
4 files changed, 81 insertions(+)
create mode 100644 server/lib/deltacloud/models/network.rb
create mode 100644 server/lib/deltacloud/models/port.rb
create mode 100644 server/lib/deltacloud/models/subnet.rb
diff --git a/server/lib/deltacloud/models.rb b/server/lib/deltacloud/models.rb
index e6020e6..1fb3b27 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/port'
diff --git a/server/lib/deltacloud/models/network.rb b/server/lib/deltacloud/models/network.rb
new file mode 100644
index 0000000..e5fdb6b
--- /dev/null
+++ b/server/lib/deltacloud/models/network.rb
@@ -0,0 +1,25 @@
+#
+# 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 Network < BaseModel
+
+ attr_accessor :name
+ attr_accessor :subnets
+ attr_accessor :address_block
+ attr_accessor :ports
+ attr_accessor :state
+
+end
diff --git a/server/lib/deltacloud/models/port.rb b/server/lib/deltacloud/models/port.rb
new file mode 100644
index 0000000..f6d2036
--- /dev/null
+++ b/server/lib/deltacloud/models/port.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.
+
+class Port < BaseModel
+
+ attr_accessor :name
+ attr_accessor :attachment
+ attr_accessor :network
+ attr_accessor :mac_address
+ attr_accessor :ip_address
+ attr_accessor :state
+ attr_accessor :type
+
+end
diff --git a/server/lib/deltacloud/models/subnet.rb b/server/lib/deltacloud/models/subnet.rb
new file mode 100644
index 0000000..fff80f4
--- /dev/null
+++ b/server/lib/deltacloud/models/subnet.rb
@@ -0,0 +1,26 @@
+#
+# 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 Subnet < BaseModel
+
+ attr_accessor :name
+ attr_accessor :network
+ attr_accessor :address_block
+ attr_accessor :ports
+ attr_accessor :state
+ attr_accessor :type
+
+end
--
1.7.11.7