Class: Plus4uCodebase::Hub
- Inherits:
-
Object
- Object
- Plus4uCodebase::Hub
- Defined in:
- lib/plus4u_codebase/hub.rb
Class Method Summary collapse
- .add_access_group(hub_uri, params = {}) ⇒ Object
-
.create(location_uri, params = {}) ⇒ Object
Static methods ===================.
- .delete(hub_uri) ⇒ Object
- .get_access_group_list(hub_uri) ⇒ Object
- .get_attributes(hub_uri) ⇒ Object
- .get_repository_list(hub_uri) ⇒ Object
- .modify_access_group_relation(hub_uri, params = {}) ⇒ Object
- .refresh_access_rights(hub_uri) ⇒ Object
- .remove_access_group(hub_uri, params = {}) ⇒ Object
- .set_attributes(hub_uri, params = {}) ⇒ Object
Instance Method Summary collapse
-
#add_access_group(hub_uri, params = {}) ⇒ Object
Adds an access group to the specified hub and users (casted in groups) get access to the hub.
-
#create(location_uri, params = {}) ⇒ String
Creates a new hub in the specified location.
-
#delete(hub_uri) ⇒ Object
Deletes the specified hub.
-
#get_access_group_list(hub_uri) ⇒ Array
Gets list of access groups related to the specified hub.
-
#get_attributes(hub_uri) ⇒ Hash
Returns basic attributes of the specified hub.
-
#get_repository_list(hub_uri) ⇒ Object
Returns list of repositories of specified hub.
-
#initialize(session, options = nil) ⇒ Hub
constructor
A new instance of Hub.
-
#modify_access_group_relation(hub_uri, params = {}) ⇒ Object
Modifies relation (access rights) of the specified access group and the specified hub.
-
#refresh_access_rights(hub_uri) ⇒ Object
Gets access groups related to the specified hub and sets access rights for casted user again.
-
#remove_access_group(hub_uri, params = {}) ⇒ Object
Removes an access group from the specified hub and users (casted in groups) loose access to the hub.
-
#set_attributes(hub_uri, params = {}) ⇒ String
Sets basic attributes of the specified hub.
Constructor Details
#initialize(session, options = nil) ⇒ Hub
Returns a new instance of Hub
5 6 7 |
# File 'lib/plus4u_codebase/hub.rb', line 5 def initialize(session, = nil) @cmd = UU::OS::CMD::CommandClient.new("plus4u-codebase", session, ) end |
Class Method Details
.add_access_group(hub_uri, params = {}) ⇒ Object
174 175 176 177 |
# File 'lib/plus4u_codebase/hub.rb', line 174 def self.add_access_group(hub_uri, params = {}) session = UU::OS::Security::Session.current_session self.new(session).add_access_group(hub_uri, params) end |
.create(location_uri, params = {}) ⇒ Object
Static methods ===================
154 155 156 157 |
# File 'lib/plus4u_codebase/hub.rb', line 154 def self.create(location_uri, params = {}) session = UU::OS::Security::Session.current_session self.new(session).create(location_uri, params) end |
.delete(hub_uri) ⇒ Object
169 170 171 172 |
# File 'lib/plus4u_codebase/hub.rb', line 169 def self.delete(hub_uri) session = UU::OS::Security::Session.current_session self.new(session).delete(hub_uri) end |
.get_access_group_list(hub_uri) ⇒ Object
189 190 191 192 |
# File 'lib/plus4u_codebase/hub.rb', line 189 def self.get_access_group_list(hub_uri) session = UU::OS::Security::Session.current_session self.new(session).get_access_group_list(hub_uri) end |
.get_attributes(hub_uri) ⇒ Object
159 160 161 162 |
# File 'lib/plus4u_codebase/hub.rb', line 159 def self.get_attributes(hub_uri) session = UU::OS::Security::Session.current_session self.new(session).get_attributes(hub_uri) end |
.get_repository_list(hub_uri) ⇒ Object
199 200 201 202 |
# File 'lib/plus4u_codebase/hub.rb', line 199 def self.get_repository_list(hub_uri) session = UU::OS::Security::Session.current_session self.new(session).get_repository_list(hub_uri) end |
.modify_access_group_relation(hub_uri, params = {}) ⇒ Object
184 185 186 187 |
# File 'lib/plus4u_codebase/hub.rb', line 184 def self.modify_access_group_relation(hub_uri, params = {}) session = UU::OS::Security::Session.current_session self.new(session).modify_access_group_relation(hub_uri, params) end |
.refresh_access_rights(hub_uri) ⇒ Object
194 195 196 197 |
# File 'lib/plus4u_codebase/hub.rb', line 194 def self.refresh_access_rights(hub_uri) session = UU::OS::Security::Session.current_session self.new(session).refresh_access_rights(hub_uri) end |
.remove_access_group(hub_uri, params = {}) ⇒ Object
179 180 181 182 |
# File 'lib/plus4u_codebase/hub.rb', line 179 def self.remove_access_group(hub_uri, params = {}) session = UU::OS::Security::Session.current_session self.new(session).remove_access_group(hub_uri, params) end |
.set_attributes(hub_uri, params = {}) ⇒ Object
164 165 166 167 |
# File 'lib/plus4u_codebase/hub.rb', line 164 def self.set_attributes(hub_uri, params = {}) session = UU::OS::Security::Session.current_session self.new(session).set_attributes(hub_uri, params) end |
Instance Method Details
#add_access_group(hub_uri, params = {}) ⇒ Object
Adds an access group to the specified hub and users (casted in groups) get access to the hub. @@param parameters [Hash] Access Group with rights.
96 97 98 |
# File 'lib/plus4u_codebase/hub.rb', line 96 def add_access_group(hub_uri, params = {}) @cmd.invoke('Hub/addAccessGroup', hub_uri, parameters: params.to_lower_camel_keys) end |
#create(location_uri, params = {}) ⇒ String
Creates a new hub in the specified location.
27 28 29 |
# File 'lib/plus4u_codebase/hub.rb', line 27 def create(location_uri, params = {}) @cmd.invoke('Hub/create', location_uri, parameters: params.to_lower_camel_keys) end |
#delete(hub_uri) ⇒ Object
Deletes the specified hub.
70 71 72 |
# File 'lib/plus4u_codebase/hub.rb', line 70 def delete(hub_uri) @cmd.invoke('Hub/delete', hub_uri) end |
#get_access_group_list(hub_uri) ⇒ Array
Gets list of access groups related to the specified hub. :access_group_uri [String, UU::OS::UESURI] - Canonical URI of access group. :authorization [String] - Type of access. Possible values: 'MANAGE', 'READWRITE' and 'READ'.
135 136 137 |
# File 'lib/plus4u_codebase/hub.rb', line 135 def get_access_group_list(hub_uri) @cmd.invoke('Hub/getAccessGroupList', hub_uri.to_lower_camel_keys).to_snake_keys end |
#get_attributes(hub_uri) ⇒ Hash
Returns basic attributes of the specified hub. :name [String] - Name of the hub artifact. :code [String] - Code of the hub artifact. :description [String] - Description of the hub artifact. :repository_limit [Fixnum] - Number of Repositories which can be created in the hub. :repository_count [Fixnum] - Number of repositories in the hub.
43 44 45 |
# File 'lib/plus4u_codebase/hub.rb', line 43 def get_attributes(hub_uri) @cmd.invoke('Hub/getAttributes', hub_uri).to_snake_keys end |
#get_repository_list(hub_uri) ⇒ Object
Returns list of repositories of specified hub.
80 81 82 |
# File 'lib/plus4u_codebase/hub.rb', line 80 def get_repository_list(hub_uri) @cmd.invoke('Hub/getRepositoryList', hub_uri).map{|item| item.to_snake_keys} || [] end |
#modify_access_group_relation(hub_uri, params = {}) ⇒ Object
Modifies relation (access rights) of the specified access group and the specified hub. @@param params [Hash] Attributes of the specified access group.
122 123 124 |
# File 'lib/plus4u_codebase/hub.rb', line 122 def modify_access_group_relation(hub_uri, params = {}) @cmd.invoke('Hub/modifyAccessGroupRelation', hub_uri, parameters: params.to_lower_camel_keys) end |
#refresh_access_rights(hub_uri) ⇒ Object
Gets access groups related to the specified hub and sets access rights for casted user again.
147 148 149 |
# File 'lib/plus4u_codebase/hub.rb', line 147 def refresh_access_rights(hub_uri) @cmd.invoke('Hub/refreshAccesses', hub_uri.to_lower_camel_keys) end |
#remove_access_group(hub_uri, params = {}) ⇒ Object
Removes an access group from the specified hub and users (casted in groups) loose access to the hub. @@param params [Hash] Access Group.
108 109 110 |
# File 'lib/plus4u_codebase/hub.rb', line 108 def remove_access_group(hub_uri, params = {}) @cmd.invoke('Hub/removeAccessGroup', hub_uri, parameters: params.to_lower_camel_keys) end |
#set_attributes(hub_uri, params = {}) ⇒ String
Sets basic attributes of the specified hub.
60 61 62 |
# File 'lib/plus4u_codebase/hub.rb', line 60 def set_attributes(hub_uri, params = {}) @cmd.invoke('Hub/setAttributes', hub_uri, parameters: params.to_lower_camel_keys) end |