Statistics
| Branch: | Tag: | Revision:

one / src / oca / ruby / OpenNebula / GroupPool.rb @ ae53d437

History | View | Annotate | Download (2.35 KB)

1
# -------------------------------------------------------------------------- #
2
# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org)             #
3
#                                                                            #
4
# Licensed under the Apache License, Version 2.0 (the "License"); you may    #
5
# not use this file except in compliance with the License. You may obtain    #
6
# a copy of the License at                                                   #
7
#                                                                            #
8
# http://www.apache.org/licenses/LICENSE-2.0                                 #
9
#                                                                            #
10
# Unless required by applicable law or agreed to in writing, software        #
11
# distributed under the License is distributed on an "AS IS" BASIS,          #
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
13
# See the License for the specific language governing permissions and        #
14
# limitations under the License.                                             #
15
#--------------------------------------------------------------------------- #
16

    
17
require 'OpenNebula/Pool'
18

    
19
module OpenNebula
20
    class GroupPool < Pool
21
        # ---------------------------------------------------------------------
22
        # Constants and Class attribute accessors
23
        # ---------------------------------------------------------------------
24

    
25
        GROUP_POOL_METHODS = {
26
            :info => "grouppool.info"
27
        }
28

    
29
        # ---------------------------------------------------------------------
30
        # Class constructor & Pool Methods
31
        # ---------------------------------------------------------------------
32

    
33
        # +client+ a Client object that represents a XML-RPC connection
34
        def initialize(client)
35
            super('GROUP_POOL','GROUP',client)
36
        end
37

    
38
        # Factory method to create User objects
39
        def factory(element_xml)
40
            OpenNebula::Group.new(element_xml,@client)
41
        end
42

    
43
        # ---------------------------------------------------------------------
44
        # XML-RPC Methods for the User Object
45
        # ---------------------------------------------------------------------
46

    
47
        # Retrieves all the Groups in the pool.
48
        def info()
49
            super(GROUP_POOL_METHODS[:info])
50
        end
51
    end
52
end