Class: Artifactory::Resource::Group
- Defined in:
- lib/artifactory/resources/group.rb
Class Method Summary collapse
-
.all(options = {}) ⇒ Array<Resource::Group>
Get a list of all groups in the system.
-
.find(name, options = {}) ⇒ Resource::Group?
Find (fetch) a group by its name.
Instance Method Summary collapse
-
#auto_join ⇒ Object
Return this object’s
auto_join
. -
#auto_join=(value) ⇒ Object
Set this object’s
auto_join
. -
#auto_join? ⇒ Boolean
Determines if the
auto_join
value exists and is truthy. -
#delete ⇒ Boolean
Delete this group from artifactory, suppressing any
ResourceNotFound
exceptions might occur. -
#description ⇒ Object
Return this object’s
description
. -
#description=(value) ⇒ Object
Set this object’s
description
. -
#description? ⇒ Boolean
Determines if the
description
value exists and is truthy. -
#name ⇒ Object
Return this object’s
name
. -
#name=(value) ⇒ Object
Set this object’s
name
. -
#name? ⇒ Boolean
Determines if the
name
value exists and is truthy. -
#realm ⇒ Object
Return this object’s
realm
. -
#realm=(value) ⇒ Object
Set this object’s
realm
. -
#realm? ⇒ Boolean
Determines if the
realm
value exists and is truthy. -
#realm_attributes ⇒ Object
Return this object’s
realm_attributes
. -
#realm_attributes=(value) ⇒ Object
Set this object’s
realm_attributes
. -
#realm_attributes? ⇒ Boolean
Determines if the
realm_attributes
value exists and is truthy. -
#save ⇒ Boolean
Save the group to the artifactory server.
Methods inherited from Base
attribute, attributes, #attributes, #client, #client=, #client?, #extract_client!, extract_client!, find_from_config, #format_repos!, format_repos!, from_hash, from_url, has_attribute?, #initialize, #inspect, list_from_config, #set, #to_hash, #to_json, #to_matrix_properties, #to_s, url_safe, #url_safe
Constructor Details
This class inherits a constructor from Artifactory::Resource::Base
Class Method Details
.all(options = {}) ⇒ Array<Resource::Group>
Get a list of all groups in the system.
16 17 18 19 20 21 |
# File 'lib/artifactory/resources/group.rb', line 16 def all( = {}) client = extract_client!() client.get('/api/security/groups').map do |hash| from_url(hash['uri'], client: client) end end |
.find(name, options = {}) ⇒ Resource::Group?
Find (fetch) a group by its name.
41 42 43 44 45 46 47 48 49 |
# File 'lib/artifactory/resources/group.rb', line 41 def find(name, = {}) client = extract_client!() response = client.get("/api/security/groups/#{url_safe(name)}") from_hash(response, client: client) rescue Error::HTTPError => e raise unless e.code == 404 nil end |
Instance Method Details
#auto_join ⇒ Object
Return this object’s auto_join
52 |
# File 'lib/artifactory/resources/group.rb', line 52 attribute :auto_join |
#auto_join=(value) ⇒ Object
Set this object’s auto_join
52 |
# File 'lib/artifactory/resources/group.rb', line 52 attribute :auto_join |
#auto_join? ⇒ Boolean
Determines if the auto_join
value exists and is truthy
52 |
# File 'lib/artifactory/resources/group.rb', line 52 attribute :auto_join |
#delete ⇒ Boolean
Delete this group from artifactory, suppressing any ResourceNotFound
exceptions might occur.
65 66 67 68 69 70 |
# File 'lib/artifactory/resources/group.rb', line 65 def delete client.delete(api_path) true rescue Error::HTTPError false end |
#description ⇒ Object
Return this object’s description
53 |
# File 'lib/artifactory/resources/group.rb', line 53 attribute :description |
#description=(value) ⇒ Object
Set this object’s description
53 |
# File 'lib/artifactory/resources/group.rb', line 53 attribute :description |
#description? ⇒ Boolean
Determines if the description
value exists and is truthy
53 |
# File 'lib/artifactory/resources/group.rb', line 53 attribute :description |
#name ⇒ Object
Return this object’s name
54 |
# File 'lib/artifactory/resources/group.rb', line 54 attribute :name, ->{ raise 'Name missing!' } |
#name=(value) ⇒ Object
Set this object’s name
54 |
# File 'lib/artifactory/resources/group.rb', line 54 attribute :name, ->{ raise 'Name missing!' } |
#name? ⇒ Boolean
Determines if the name
value exists and is truthy
54 |
# File 'lib/artifactory/resources/group.rb', line 54 attribute :name, ->{ raise 'Name missing!' } |
#realm ⇒ Object
Return this object’s realm
55 |
# File 'lib/artifactory/resources/group.rb', line 55 attribute :realm |
#realm=(value) ⇒ Object
Set this object’s realm
55 |
# File 'lib/artifactory/resources/group.rb', line 55 attribute :realm |
#realm? ⇒ Boolean
Determines if the realm
value exists and is truthy
55 |
# File 'lib/artifactory/resources/group.rb', line 55 attribute :realm |
#realm_attributes ⇒ Object
Return this object’s realm_attributes
56 |
# File 'lib/artifactory/resources/group.rb', line 56 attribute :realm_attributes |
#realm_attributes=(value) ⇒ Object
Set this object’s realm_attributes
56 |
# File 'lib/artifactory/resources/group.rb', line 56 attribute :realm_attributes |
#realm_attributes? ⇒ Boolean
Determines if the realm_attributes
value exists and is truthy
56 |
# File 'lib/artifactory/resources/group.rb', line 56 attribute :realm_attributes |
#save ⇒ Boolean
Save the group to the artifactory server.
77 78 79 80 |
# File 'lib/artifactory/resources/group.rb', line 77 def save client.put(api_path, to_json, headers) true end |