Class: Plus4uCodebase::Repository
- Inherits:
-
Object
- Object
- Plus4uCodebase::Repository
- Defined in:
- lib/plus4u_codebase/repository.rb
Class Method Summary collapse
- .add_access_group(repository_uri, params = {}) ⇒ Object
-
.create(hub_uri, params = nil) ⇒ Object
Static methods ===================.
- .delete(repository_uri) ⇒ Object
- .get_access_group_list(repository_uri) ⇒ Object
- .get_attributes(repository_uri) ⇒ Object
- .modify_access_group_relation(repository_uri, params = {}) ⇒ Object
- .refresh_accesses(repository_uri) ⇒ Object
- .remove_access_group(repository_uri, params = {}) ⇒ Object
- .set_attributes(repository_uri, params = nil) ⇒ Object
Instance Method Summary collapse
-
#add_access_group(repository_uri, params = {}) ⇒ Object
Adds an access group to the specified repository and users (casted in groups) get access to the repository.
-
#create(hub_uri, params = nil) ⇒ String
Creates a new repository related to the specified hub (and to the specified location).
-
#delete(repository_uri) ⇒ Object
Deletes the specified repository.
-
#get_access_group_list(repository_uri) ⇒ Array of Hashes
Gets list of access groups related to the specified repository.
-
#get_attributes(repository_uri) ⇒ Hash
Gets basic attributes of the specified repository.
-
#initialize(session, options = nil) ⇒ Repository
constructor
A new instance of Repository.
-
#modify_access_group_relation(repository_uri, params = {}) ⇒ Object
Modifies relation (access rights) of the specified access group and the specified repository.
-
#refresh_accesses(repository_uri) ⇒ Object
Gets access groups related to the specified repository and sets access rights for casted user again.
-
#remove_access_group(repository_uri, params = {}) ⇒ Object
Removes an access group from the specified repository and users (casted in groups) lost access to the repository.
-
#set_attributes(repository_uri, params = nil) ⇒ String
Sets basic attributes of the specified repository.
Constructor Details
#initialize(session, options = nil) ⇒ Repository
Returns a new instance of Repository
5 6 7 |
# File 'lib/plus4u_codebase/repository.rb', line 5 def initialize(session, = nil) @cmd = UU::OS::CMD::CommandClient.new("plus4u-codebase", session, ) end |
Class Method Details
.add_access_group(repository_uri, params = {}) ⇒ Object
175 176 177 178 |
# File 'lib/plus4u_codebase/repository.rb', line 175 def self.add_access_group(repository_uri, params = {}) session = UU::OS::Security::Session.current_session self.new(session).add_access_group(repository_uri, params) end |
.create(hub_uri, params = nil) ⇒ Object
Static methods ===================
155 156 157 158 |
# File 'lib/plus4u_codebase/repository.rb', line 155 def self.create(hub_uri, params = nil) session = UU::OS::Security::Session.current_session self.new(session).create(hub_uri, params) end |
.delete(repository_uri) ⇒ Object
170 171 172 173 |
# File 'lib/plus4u_codebase/repository.rb', line 170 def self.delete(repository_uri) session = UU::OS::Security::Session.current_session self.new(session).delete(repository_uri) end |
.get_access_group_list(repository_uri) ⇒ Object
190 191 192 193 |
# File 'lib/plus4u_codebase/repository.rb', line 190 def self.get_access_group_list(repository_uri) session = UU::OS::Security::Session.current_session self.new(session).get_access_group_list(repository_uri) end |
.get_attributes(repository_uri) ⇒ Object
160 161 162 163 |
# File 'lib/plus4u_codebase/repository.rb', line 160 def self.get_attributes(repository_uri) session = UU::OS::Security::Session.current_session self.new(session).get_attributes(repository_uri) end |
.modify_access_group_relation(repository_uri, params = {}) ⇒ Object
185 186 187 188 |
# File 'lib/plus4u_codebase/repository.rb', line 185 def self.modify_access_group_relation(repository_uri, params = {}) session = UU::OS::Security::Session.current_session self.new(session).modify_access_group_relation(repository_uri, params) end |
.refresh_accesses(repository_uri) ⇒ Object
195 196 197 198 |
# File 'lib/plus4u_codebase/repository.rb', line 195 def self.refresh_accesses(repository_uri) session = UU::OS::Security::Session.current_session self.new(session).refresh_accesses(repository_uri) end |
.remove_access_group(repository_uri, params = {}) ⇒ Object
180 181 182 183 |
# File 'lib/plus4u_codebase/repository.rb', line 180 def self.remove_access_group(repository_uri, params = {}) session = UU::OS::Security::Session.current_session self.new(session).remove_access_group(repository_uri, params) end |
.set_attributes(repository_uri, params = nil) ⇒ Object
165 166 167 168 |
# File 'lib/plus4u_codebase/repository.rb', line 165 def self.set_attributes(repository_uri, params = nil) session = UU::OS::Security::Session.current_session self.new(session).set_attributes(repository_uri, params) end |
Instance Method Details
#add_access_group(repository_uri, params = {}) ⇒ Object
Adds an access group to the specified repository and users (casted in groups) get access to the repository. @@param params [Hash] Attributes of the specified access group.
90 91 92 |
# File 'lib/plus4u_codebase/repository.rb', line 90 def add_access_group(repository_uri, params = {}) @cmd.invoke('Repository/addAccessGroup', repository_uri, parameters: params) end |
#create(hub_uri, params = nil) ⇒ String
Creates a new repository related to the specified hub (and to the specified location).
28 29 30 |
# File 'lib/plus4u_codebase/repository.rb', line 28 def create(hub_uri, params = nil) @cmd.invoke('Repository/create', hub_uri, parameters: params) end |
#delete(repository_uri) ⇒ Object
Deletes the specified repository.
74 75 76 |
# File 'lib/plus4u_codebase/repository.rb', line 74 def delete(repository_uri) @cmd.invoke('Repository/delete', repository_uri) end |
#get_access_group_list(repository_uri) ⇒ Array of Hashes
Gets list of access groups related to the specified repository. :access_group_uri [String, UU::OS::UESURI] - Canonical URI of access group. :authorization [String] - Type of access. Possible values: 'MANAGE', 'READWRITE' and 'READ'.
133 134 135 136 137 138 139 140 |
# File 'lib/plus4u_codebase/repository.rb', line 133 def get_access_group_list(repository_uri) groups = @cmd.invoke('Repository/getAccessGroupList', repository_uri) rslt = Array.new groups.each do |g| rslt << g.to_snake_keys end return rslt end |
#get_attributes(repository_uri) ⇒ Hash
Gets basic attributes of the specified repository. :name [String] - Name of the repository (the artifact representing repository). :code [String] - Code of the repository. :description [String] - Description of the repository. :uri [UU::OS::UESURI] - URI of the repository. :hub_uri [UU::OS::UESURI] - URI of the hub. :git_name [String] - Name of the repository name in a version control system. :vcs_url [String] - URL of the repository to a version control system.
46 47 48 49 |
# File 'lib/plus4u_codebase/repository.rb', line 46 def get_attributes(repository_uri) attrs = @cmd.invoke('Repository/getAttributes', repository_uri) return attrs.nil? ? nil : attrs.to_snake_keys end |
#modify_access_group_relation(repository_uri, params = {}) ⇒ Object
Modifies relation (access rights) of the specified access group and the specified repository. @@param params [Hash] Attributes of the specified access group.
116 117 118 |
# File 'lib/plus4u_codebase/repository.rb', line 116 def modify_access_group_relation(repository_uri, params = {}) @cmd.invoke('Repository/modifyAccessGroupRelation', repository_uri, parameters: params) end |
#refresh_accesses(repository_uri) ⇒ Object
Gets access groups related to the specified repository and sets access rights for casted user again.
148 149 150 |
# File 'lib/plus4u_codebase/repository.rb', line 148 def refresh_accesses(repository_uri) @cmd.invoke('Repository/refreshAccesses', repository_uri) end |
#remove_access_group(repository_uri, params = {}) ⇒ Object
Removes an access group from the specified repository and users (casted in groups) lost access to the repository. @@param params [Hash] Attributes of the specified access group.
102 103 104 |
# File 'lib/plus4u_codebase/repository.rb', line 102 def remove_access_group(repository_uri, params = {}) @cmd.invoke('Repository/removeAccessGroup', repository_uri, parameters: params) end |
#set_attributes(repository_uri, params = nil) ⇒ String
Sets basic attributes of the specified repository.
64 65 66 |
# File 'lib/plus4u_codebase/repository.rb', line 64 def set_attributes(repository_uri, params = nil) @cmd.invoke('Repository/setAttributes', repository_uri, parameters: params) end |