runcible 0.4.12 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +42 -13
- data/Rakefile +1 -17
- data/lib/runcible/base.rb +26 -36
- data/lib/runcible/extensions/consumer.rb +22 -15
- data/lib/runcible/extensions/consumer_group.rb +12 -12
- data/lib/runcible/extensions/repository.rb +44 -38
- data/lib/runcible/extensions/rpm.rb +3 -3
- data/lib/runcible/extensions/unit.rb +21 -16
- data/lib/runcible/instance.rb +129 -0
- data/lib/runcible/{extensions → models}/distributor.rb +7 -3
- data/lib/runcible/{extensions → models}/export_distributor.rb +6 -3
- data/lib/runcible/{extensions → models}/importer.rb +2 -2
- data/lib/runcible/{extensions → models}/iso_distributor.rb +5 -2
- data/lib/runcible/{extensions → models}/iso_importer.rb +2 -2
- data/lib/runcible/models/nodes_http_distributor.rb +61 -0
- data/lib/runcible/{extensions → models}/yum_clone_distributor.rb +3 -1
- data/lib/runcible/{extensions → models}/yum_distributor.rb +2 -2
- data/lib/runcible/{extensions → models}/yum_importer.rb +2 -2
- data/lib/runcible/resources/consumer.rb +14 -14
- data/lib/runcible/resources/consumer_group.rb +9 -9
- data/lib/runcible/resources/event_notifier.rb +3 -3
- data/lib/runcible/resources/repository.rb +20 -20
- data/lib/runcible/resources/repository_group.rb +6 -6
- data/lib/runcible/resources/repository_schedule.rb +4 -4
- data/lib/runcible/resources/role.rb +2 -2
- data/lib/runcible/resources/task.rb +5 -5
- data/lib/runcible/resources/unit.rb +2 -2
- data/lib/runcible/resources/user.rb +4 -4
- data/lib/runcible/version.rb +1 -1
- data/lib/runcible.rb +6 -2
- metadata +84 -91
@@ -32,7 +32,7 @@ module Runcible
|
|
32
32
|
#
|
33
33
|
# @param [String] id the ID of the consumer group
|
34
34
|
# @return [String] the consumer group path, may contain the id if passed
|
35
|
-
def
|
35
|
+
def path(id=nil)
|
36
36
|
groups = "consumer_groups/"
|
37
37
|
id.nil? ? groups : groups + "#{id}/"
|
38
38
|
end
|
@@ -42,7 +42,7 @@ module Runcible
|
|
42
42
|
# @param [String] id the ID of the consumer
|
43
43
|
# @param [Hash] optional container for all optional parameters
|
44
44
|
# @return [RestClient::Response]
|
45
|
-
def
|
45
|
+
def create(id, optional={})
|
46
46
|
required = required_params(binding.send(:local_variables), binding)
|
47
47
|
call(:post, path, :payload => { :required => required, :optional => optional })
|
48
48
|
end
|
@@ -51,7 +51,7 @@ module Runcible
|
|
51
51
|
#
|
52
52
|
# @param [String] id the ID of the consumer group
|
53
53
|
# @return [RestClient::Response]
|
54
|
-
def
|
54
|
+
def retrieve(id)
|
55
55
|
call(:get, path(id))
|
56
56
|
end
|
57
57
|
|
@@ -59,7 +59,7 @@ module Runcible
|
|
59
59
|
#
|
60
60
|
# @param [String] id the ID of the consumer group
|
61
61
|
# @return [RestClient::Response]
|
62
|
-
def
|
62
|
+
def delete(id)
|
63
63
|
call(:delete, path(id))
|
64
64
|
end
|
65
65
|
|
@@ -68,7 +68,7 @@ module Runcible
|
|
68
68
|
# @param [String] id the ID of the consumer group
|
69
69
|
# @param [Hash] criteria criteria based on Mongo syntax representing consumers to associate
|
70
70
|
# @return [RestClient::Response]
|
71
|
-
def
|
71
|
+
def associate(id, criteria)
|
72
72
|
call(:post, path(id) + "actions/associate/", :payload => {:required => criteria})
|
73
73
|
end
|
74
74
|
|
@@ -77,7 +77,7 @@ module Runcible
|
|
77
77
|
# @param [String] id the ID of the consumer group
|
78
78
|
# @param [Hash] criteria criteria based on Mongo syntax representing consumers ta unassociate
|
79
79
|
# @return [RestClient::Response]
|
80
|
-
def
|
80
|
+
def unassociate(id, criteria)
|
81
81
|
call(:post, path(id) + "actions/unassociate/", :payload => {:required => criteria})
|
82
82
|
end
|
83
83
|
|
@@ -87,7 +87,7 @@ module Runcible
|
|
87
87
|
# @param [Array] units array of units to install
|
88
88
|
# @param [Hash] options hash of install options
|
89
89
|
# @return [RestClient::Response]
|
90
|
-
def
|
90
|
+
def install_units(id, units, options={})
|
91
91
|
required = required_params(binding.send(:local_variables), binding, ["id"])
|
92
92
|
call(:post, path("#{id}/actions/content/install"), :payload => { :required => required })
|
93
93
|
end
|
@@ -98,7 +98,7 @@ module Runcible
|
|
98
98
|
# @param [Array] units array of units to update
|
99
99
|
# @param [Hash] options hash of update options
|
100
100
|
# @return [RestClient::Response]
|
101
|
-
def
|
101
|
+
def update_units(id, units, options={})
|
102
102
|
required = required_params(binding.send(:local_variables), binding, ["id"])
|
103
103
|
call(:post, path("#{id}/actions/content/update"), :payload => { :required => required })
|
104
104
|
end
|
@@ -109,7 +109,7 @@ module Runcible
|
|
109
109
|
# @param [Array] units array of units to uninstall
|
110
110
|
# @param [Hash] options hash of uninstall options
|
111
111
|
# @return [RestClient::Response]
|
112
|
-
def
|
112
|
+
def uninstall_units(id, units, options={})
|
113
113
|
required = required_params(binding.send(:local_variables), binding, ["id"])
|
114
114
|
call(:post, path("#{id}/actions/content/uninstall"), :payload => { :required => required })
|
115
115
|
end
|
@@ -52,7 +52,7 @@ module Runcible
|
|
52
52
|
# @param [Hash] notifier_config configuration options for the notifier
|
53
53
|
# @param [Hash] event_types event types to include in the notifier
|
54
54
|
# @return [RestClient::Response]
|
55
|
-
def
|
55
|
+
def create(notifier_type_id, notifier_config, event_types)
|
56
56
|
required = required_params(binding.send(:local_variables), binding)
|
57
57
|
call(:post, path, :payload => {:required => required})
|
58
58
|
end
|
@@ -61,7 +61,7 @@ module Runcible
|
|
61
61
|
#
|
62
62
|
# @param [String] id the ID of the event notifier
|
63
63
|
# @return [RestClient::Response]
|
64
|
-
def
|
64
|
+
def delete(id)
|
65
65
|
call(:delete, path(id))
|
66
66
|
end
|
67
67
|
|
@@ -69,7 +69,7 @@ module Runcible
|
|
69
69
|
#
|
70
70
|
# @param [String] id the ID of the event notifier
|
71
71
|
# @return [RestClient::Response]
|
72
|
-
def
|
72
|
+
def list
|
73
73
|
call(:get, path)
|
74
74
|
end
|
75
75
|
|
@@ -30,7 +30,7 @@ module Runcible
|
|
30
30
|
# Generates the API path for Repositories
|
31
31
|
#
|
32
32
|
# @param [String] id the id of the repository
|
33
|
-
# @return [String] the repository path, may contain the id if passed
|
33
|
+
# @return [String] the repository path, may contain the id if passed
|
34
34
|
def self.path(id=nil)
|
35
35
|
(id == nil) ? "repositories/" : "repositories/#{id}/"
|
36
36
|
end
|
@@ -40,7 +40,7 @@ module Runcible
|
|
40
40
|
# @param [String] id the id of the repository
|
41
41
|
# @param [Hash] optional container for all optional parameters
|
42
42
|
# @return [RestClient::Response]
|
43
|
-
def
|
43
|
+
def create(id, optional={})
|
44
44
|
required = required_params(binding.send(:local_variables), binding)
|
45
45
|
call(:post, path, :payload => { :required => required, :optional => optional })
|
46
46
|
end
|
@@ -50,7 +50,7 @@ module Runcible
|
|
50
50
|
# @param [String] id the id of the repository
|
51
51
|
# @param [Hash] params container for optional query parameters
|
52
52
|
# @return [RestClient::Response]
|
53
|
-
def
|
53
|
+
def retrieve(id, params={})
|
54
54
|
call(:get, path(id), :params => params)
|
55
55
|
end
|
56
56
|
|
@@ -59,7 +59,7 @@ module Runcible
|
|
59
59
|
# @param [String] id the id of the repository
|
60
60
|
# @param [Hash] optional container for all optional parameters
|
61
61
|
# @return [RestClient::Response]
|
62
|
-
def
|
62
|
+
def update(id, optional={})
|
63
63
|
call(:put, path(id), :payload => { :delta => optional })
|
64
64
|
end
|
65
65
|
|
@@ -67,7 +67,7 @@ module Runcible
|
|
67
67
|
#
|
68
68
|
# @param [String] id the id of the repository
|
69
69
|
# @return [RestClient::Response]
|
70
|
-
def
|
70
|
+
def delete(id)
|
71
71
|
call(:delete, path(id))
|
72
72
|
end
|
73
73
|
|
@@ -75,7 +75,7 @@ module Runcible
|
|
75
75
|
#
|
76
76
|
# @param [Hash] optional container for all optional parameters
|
77
77
|
# @return [RestClient::Response]
|
78
|
-
def
|
78
|
+
def retrieve_all(optional={})
|
79
79
|
call(:get, path, :payload => { :optional => optional })
|
80
80
|
end
|
81
81
|
|
@@ -84,7 +84,7 @@ module Runcible
|
|
84
84
|
# @param [Hash] criteria criteria object containing Mongo syntax
|
85
85
|
# @param [Hash] optional container for all optional parameters
|
86
86
|
# @return [RestClient::Response]
|
87
|
-
def
|
87
|
+
def search(criteria, optional={})
|
88
88
|
required = required_params(binding.send(:local_variables), binding)
|
89
89
|
call(:post, path("search"), :payload => { :required => required, :optional => optional })
|
90
90
|
end
|
@@ -95,7 +95,7 @@ module Runcible
|
|
95
95
|
# @param [String] importer_type_id the type ID of the importer being associated
|
96
96
|
# @param [Hash] importer_config configuration options for the importer
|
97
97
|
# @return [RestClient::Response]
|
98
|
-
def
|
98
|
+
def associate_importer(id, importer_type_id, importer_config)
|
99
99
|
required = required_params(binding.send(:local_variables), binding)
|
100
100
|
call(:post, path("#{id}/importers"), :payload => { :required => required })
|
101
101
|
end
|
@@ -107,7 +107,7 @@ module Runcible
|
|
107
107
|
# @param [Hash] distributor_config configuration options for the distributor
|
108
108
|
# @param [Hash] optional container for all optional parameters
|
109
109
|
# @return [RestClient::Response]
|
110
|
-
def
|
110
|
+
def associate_distributor(id, distributor_type_id, distributor_config, optional={})
|
111
111
|
required = required_params(binding.send(:local_variables), binding, ["id"])
|
112
112
|
call(:post, path("#{id}/distributors"), :payload => { :required => required, :optional => optional })
|
113
113
|
end
|
@@ -117,7 +117,7 @@ module Runcible
|
|
117
117
|
# @param [String] id the id of the repository
|
118
118
|
# @param [Hash] optional container for all optional parameters
|
119
119
|
# @return [RestClient::Response]
|
120
|
-
def
|
120
|
+
def sync(id, optional={})
|
121
121
|
call(:post, "#{path(id)}actions/sync/", :payload => { :optional => optional })
|
122
122
|
end
|
123
123
|
|
@@ -125,7 +125,7 @@ module Runcible
|
|
125
125
|
#
|
126
126
|
# @param [String] id the id of the repository
|
127
127
|
# @return [RestClient::Response]
|
128
|
-
def
|
128
|
+
def sync_history(id)
|
129
129
|
call(:get, "#{path(id)}/history/sync/")
|
130
130
|
end
|
131
131
|
|
@@ -135,7 +135,7 @@ module Runcible
|
|
135
135
|
# @param [String] source_repo_id the id of the source repository
|
136
136
|
# @param [Hash] optional container for all optional parameters
|
137
137
|
# @return [RestClient::Response]
|
138
|
-
def
|
138
|
+
def unit_copy(destination_repo_id, source_repo_id, optional={})
|
139
139
|
required = required_params(binding.send(:local_variables), binding, ["destination_repo_id"])
|
140
140
|
call(:post, "#{path(destination_repo_id)}actions/associate/",
|
141
141
|
:payload => { :required => required, :optional => optional })
|
@@ -146,7 +146,7 @@ module Runcible
|
|
146
146
|
# @param [String] source_repo_id the id of the source repository
|
147
147
|
# @param [Hash] criteria criteria object containing Mongo syntax
|
148
148
|
# @return [RestClient::Response]
|
149
|
-
def
|
149
|
+
def unassociate_units(source_repo_id, criteria={})
|
150
150
|
required = required_params(binding.send(:local_variables), binding, ["source_repo_id"])
|
151
151
|
call(:post, "#{path(source_repo_id)}actions/unassociate/",
|
152
152
|
:payload => { :required => required })
|
@@ -157,7 +157,7 @@ module Runcible
|
|
157
157
|
# @param [String] id the id of the repository
|
158
158
|
# @param [Hash] criteria criteria object containing Mongo syntax
|
159
159
|
# @return [RestClient::Response]
|
160
|
-
def
|
160
|
+
def unit_search(id, criteria={})
|
161
161
|
call(:post, "#{path(id)}search/units/", :payload=>{:required=>{:criteria=>criteria}})
|
162
162
|
end
|
163
163
|
|
@@ -166,8 +166,8 @@ module Runcible
|
|
166
166
|
# @param [String] id the id of the repository
|
167
167
|
# @param [String] distributor_id the id of the distributor
|
168
168
|
# @param [Hash] optional optional params
|
169
|
-
# @return [RestClient::Response]
|
170
|
-
def
|
169
|
+
# @return [RestClient::Response]
|
170
|
+
def publish(id, distributor_id, optional={})
|
171
171
|
call(:post, "#{path(id)}actions/publish/", :payload=>{:required=>{:id=>distributor_id}, :optional=>optional})
|
172
172
|
end
|
173
173
|
|
@@ -176,7 +176,7 @@ module Runcible
|
|
176
176
|
# @param [String] id the id of the repository
|
177
177
|
# @param [String] distributor_id the id of the distributor
|
178
178
|
# @return [RestClient::Response]
|
179
|
-
def
|
179
|
+
def delete_distributor(id, distributor_id)
|
180
180
|
call(:delete, "#{path(id)}/distributors/#{distributor_id}/")
|
181
181
|
end
|
182
182
|
|
@@ -186,7 +186,7 @@ module Runcible
|
|
186
186
|
# @param [String] distributor_id the id of the distributor
|
187
187
|
# @param [Hash] distributor_config attributes to change
|
188
188
|
# @return [RestClient::Response]
|
189
|
-
def
|
189
|
+
def update_distributor(id, distributor_id, distributor_config)
|
190
190
|
required = required_params(binding.send(:local_variables), binding, ["id", "distributor_id"])
|
191
191
|
call(:put, path("#{id}/distributors/#{distributor_id}/"), :payload => { :required => required})
|
192
192
|
end
|
@@ -196,7 +196,7 @@ module Runcible
|
|
196
196
|
# @param [String] id the id of the repository
|
197
197
|
# @param [String] importer_id the id of the importer
|
198
198
|
# @return [RestClient::Response]
|
199
|
-
def
|
199
|
+
def delete_importer(id, importer_id)
|
200
200
|
call(:delete, "#{path(id)}/importers/#{importer_id}/")
|
201
201
|
end
|
202
202
|
|
@@ -206,7 +206,7 @@ module Runcible
|
|
206
206
|
# @param [String] importer_id the id of the importer
|
207
207
|
# @param [Hash] importer_config attributes to change
|
208
208
|
# @return [RestClient::Response]
|
209
|
-
def
|
209
|
+
def update_importer(id, importer_id, importer_config)
|
210
210
|
required = required_params(binding.send(:local_variables), binding, ["id", "importer_id"])
|
211
211
|
call(:put, path("#{id}/importers/#{importer_id}/"), :payload => { :required => required})
|
212
212
|
end
|
@@ -42,7 +42,7 @@ module Runcible
|
|
42
42
|
# @param [String] id the ID of the group
|
43
43
|
# @param [Hash] optional container for all optional parameters
|
44
44
|
# @return [RestClient::Response]
|
45
|
-
def
|
45
|
+
def create(id, optional={})
|
46
46
|
required = required_params(binding.send(:local_variables), binding)
|
47
47
|
call(:post, path, :payload => { :required => required, :optional => optional })
|
48
48
|
end
|
@@ -51,14 +51,14 @@ module Runcible
|
|
51
51
|
#
|
52
52
|
# @param [String] id the ID of the Repository group
|
53
53
|
# @return [RestClient::Response]
|
54
|
-
def
|
54
|
+
def retrieve(id)
|
55
55
|
call(:get, path(id))
|
56
56
|
end
|
57
57
|
|
58
58
|
# Retrieves all Repository Group
|
59
59
|
#
|
60
60
|
# @return [RestClient::Response]
|
61
|
-
def
|
61
|
+
def retrieve_all
|
62
62
|
call(:get, path)
|
63
63
|
end
|
64
64
|
|
@@ -66,7 +66,7 @@ module Runcible
|
|
66
66
|
#
|
67
67
|
# @param [String] id the ID of the Repository group
|
68
68
|
# @return [RestClient::Response]
|
69
|
-
def
|
69
|
+
def delete(id)
|
70
70
|
call(:delete, path(id))
|
71
71
|
end
|
72
72
|
|
@@ -75,7 +75,7 @@ module Runcible
|
|
75
75
|
# @param [String] id the ID of the Repository group
|
76
76
|
# @param [Hash] criteria criteria based on Mongo syntax representing repos to associate
|
77
77
|
# @return [RestClient::Response]
|
78
|
-
def
|
78
|
+
def associate(id, criteria)
|
79
79
|
call(:post, path(id) + "actions/associate/", :payload => {:required => criteria})
|
80
80
|
end
|
81
81
|
|
@@ -84,7 +84,7 @@ module Runcible
|
|
84
84
|
# @param [String] id the ID of the Repository group
|
85
85
|
# @param [Hash] criteria criteria based on Mongo syntax representing repos ta unassociate
|
86
86
|
# @return [RestClient::Response]
|
87
|
-
def
|
87
|
+
def unassociate(id, criteria)
|
88
88
|
call(:post, path(id) + "actions/unassociate/", :payload => {:required => criteria})
|
89
89
|
end
|
90
90
|
|
@@ -45,7 +45,7 @@ module Runcible
|
|
45
45
|
# @param [String] repo_id the ID of the repository
|
46
46
|
# @param [String] importer_type the importer type
|
47
47
|
# @return [RestClient::Response]
|
48
|
-
def
|
48
|
+
def list(repo_id, importer_type)
|
49
49
|
call(:get, path(repo_id, importer_type))
|
50
50
|
end
|
51
51
|
|
@@ -56,7 +56,7 @@ module Runcible
|
|
56
56
|
# @param [Hash] schedule a hash representing a schedule
|
57
57
|
# @param [Hash] optional container for all optional parameters
|
58
58
|
# @return [RestClient::Response]
|
59
|
-
def
|
59
|
+
def create(repo_id, importer_type, schedule, optional={})
|
60
60
|
call(:post, path(repo_id, importer_type),
|
61
61
|
:payload => { :required => {:schedule=>schedule}, :optional => optional })
|
62
62
|
end
|
@@ -68,7 +68,7 @@ module Runcible
|
|
68
68
|
# @param [String] schedule_id the ID of the schedule
|
69
69
|
# @param [Hash] optional container for all optional parameters
|
70
70
|
# @return [RestClient::Response]
|
71
|
-
def
|
71
|
+
def update(repo_id, importer_type, schedule_id, optional={})
|
72
72
|
call(:put, path(repo_id, importer_type, schedule_id),
|
73
73
|
:payload => {:optional => optional })
|
74
74
|
end
|
@@ -79,7 +79,7 @@ module Runcible
|
|
79
79
|
# @param [String] importer_type the importer type
|
80
80
|
# @param [String] schedule_id the ID of the schedule
|
81
81
|
# @return [RestClient::Response]
|
82
|
-
def
|
82
|
+
def delete(repo_id, importer_type, schedule_id)
|
83
83
|
call(:delete, path(repo_id, importer_type, schedule_id))
|
84
84
|
end
|
85
85
|
|
@@ -40,7 +40,7 @@ module Runcible
|
|
40
40
|
# @param [String] id the ID of the role
|
41
41
|
# @param [String] login the login of the user being added
|
42
42
|
# @return [RestClient::Response]
|
43
|
-
def
|
43
|
+
def add(id, login)
|
44
44
|
required = required_params(binding.send(:local_variables), binding, ["id"])
|
45
45
|
call(:post, "#{path(id)}users/", :payload => { :required => required })
|
46
46
|
end
|
@@ -50,7 +50,7 @@ module Runcible
|
|
50
50
|
# @param [String] id the ID of the role
|
51
51
|
# @param [String] login the login of the user being removed
|
52
52
|
# @return [RestClient::Response]
|
53
|
-
def
|
53
|
+
def remove(id, login)
|
54
54
|
call(:delete, "#{path(id)}users/#{login}/")
|
55
55
|
end
|
56
56
|
|
@@ -39,7 +39,7 @@ module Runcible
|
|
39
39
|
#
|
40
40
|
# @param [String] id the id of the task
|
41
41
|
# @return [RestClient::Response]
|
42
|
-
def
|
42
|
+
def poll(id)
|
43
43
|
call(:get, path(id))
|
44
44
|
end
|
45
45
|
|
@@ -47,7 +47,7 @@ module Runcible
|
|
47
47
|
#
|
48
48
|
# @param [String] id the id of the task
|
49
49
|
# @return [RestClient::Response]
|
50
|
-
def
|
50
|
+
def cancel(id)
|
51
51
|
#cancelling a task may require cancelling some higher level
|
52
52
|
# task, so query the tasks _href field to make sure
|
53
53
|
call(:delete, poll(id)['_href'])
|
@@ -57,7 +57,7 @@ module Runcible
|
|
57
57
|
#
|
58
58
|
# @param [Array] tags array of tags to scope the list on
|
59
59
|
# @return [RestClient::Response]
|
60
|
-
def
|
60
|
+
def list(tags=[])
|
61
61
|
call(:get, path, :params=>{:tag=>tags})
|
62
62
|
end
|
63
63
|
|
@@ -66,8 +66,8 @@ module Runcible
|
|
66
66
|
#
|
67
67
|
# @param [Array] ids array of ids to poll the status of
|
68
68
|
# @return [Array] array of RestClient::Response task poll objects
|
69
|
-
def
|
70
|
-
return ids.collect{|id|
|
69
|
+
def poll_all(ids)
|
70
|
+
return ids.collect{|id| poll(id)}
|
71
71
|
end
|
72
72
|
|
73
73
|
end
|
@@ -31,7 +31,7 @@ module Runcible
|
|
31
31
|
#
|
32
32
|
# @param [String] type the unit type
|
33
33
|
# @return [String] the unit search path
|
34
|
-
def
|
34
|
+
def path(type)
|
35
35
|
"content/units/#{type}/search/"
|
36
36
|
end
|
37
37
|
|
@@ -41,7 +41,7 @@ module Runcible
|
|
41
41
|
# @param [Hash] criteria criteria object containing Mongo syntax
|
42
42
|
# @param [Hash] optional container for all optional parameters
|
43
43
|
# @return [RestClient::Response]
|
44
|
-
def
|
44
|
+
def search(type, criteria, optional={})
|
45
45
|
call(:post, path(type), :payload=>{:required=>{:criteria=>criteria}, :optional=>optional})
|
46
46
|
end
|
47
47
|
end
|
@@ -38,7 +38,7 @@ module Runcible
|
|
38
38
|
# Retrieves all users
|
39
39
|
#
|
40
40
|
# @return [RestClient::Response]
|
41
|
-
def
|
41
|
+
def retrieve_all
|
42
42
|
call(:get, path)
|
43
43
|
end
|
44
44
|
|
@@ -47,7 +47,7 @@ module Runcible
|
|
47
47
|
# @param [String] login the login requested for the user
|
48
48
|
# @param [Hash] optional container for all optional parameters
|
49
49
|
# @return [RestClient::Response]
|
50
|
-
def
|
50
|
+
def create(login, optional={})
|
51
51
|
required = required_params(binding.send(:local_variables), binding)
|
52
52
|
call(:post, path, :payload => { :required => required, :optional => optional })
|
53
53
|
end
|
@@ -56,7 +56,7 @@ module Runcible
|
|
56
56
|
#
|
57
57
|
# @param [String] login the login of the user being retrieved
|
58
58
|
# @return [RestClient::Response]
|
59
|
-
def
|
59
|
+
def retrieve(login)
|
60
60
|
call(:get, path(login))
|
61
61
|
end
|
62
62
|
|
@@ -64,7 +64,7 @@ module Runcible
|
|
64
64
|
#
|
65
65
|
# @param [String] login the login of the user being deleted
|
66
66
|
# @return [RestClient::Response]
|
67
|
-
def
|
67
|
+
def delete(login)
|
68
68
|
call(:delete, path(login))
|
69
69
|
end
|
70
70
|
|
data/lib/runcible/version.rb
CHANGED
data/lib/runcible.rb
CHANGED
@@ -26,10 +26,14 @@
|
|
26
26
|
|
27
27
|
resources = Dir[File.dirname(__FILE__) + '/runcible/version.rb']
|
28
28
|
resources += Dir[File.dirname(__FILE__) + '/runcible/base.rb']
|
29
|
+
resources += Dir[File.dirname(__FILE__) + '/runcible/instance.rb']
|
29
30
|
resources += Dir[File.dirname(__FILE__) + '/runcible/resources/*.rb']
|
30
|
-
|
31
|
-
resources += Dir[File.dirname(__FILE__) + '/runcible/extensions/distributor.rb']
|
31
|
+
|
32
32
|
resources += Dir[File.dirname(__FILE__) + '/runcible/extensions/unit.rb']
|
33
33
|
resources += Dir[File.dirname(__FILE__) + '/runcible/extensions/*.rb']
|
34
34
|
|
35
|
+
resources += Dir[File.dirname(__FILE__) + '/runcible/models/importer.rb']
|
36
|
+
resources += Dir[File.dirname(__FILE__) + '/runcible/models/distributor.rb']
|
37
|
+
resources += Dir[File.dirname(__FILE__) + '/runcible/models/*.rb']
|
38
|
+
|
35
39
|
resources.uniq.each{ |f| require f }
|