katello_api 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +3 -0
- data/Gemfile +1 -1
- data/README.rdoc +22 -13
- data/Rakefile +0 -1
- data/doc/KatelloApi/Base.html +102 -116
- data/doc/KatelloApi/Generator/Base.html +65 -80
- data/doc/KatelloApi/Generator.html +5 -5
- data/doc/KatelloApi/Resources/About.html +360 -0
- data/doc/KatelloApi/Resources/ActivationKey.html +190 -304
- data/doc/KatelloApi/Resources/Architecture.html +89 -129
- data/doc/KatelloApi/Resources/Changeset.html +156 -399
- data/doc/KatelloApi/Resources/ChangesetsContent.html +97 -2215
- data/doc/KatelloApi/Resources/ComputeResource.html +131 -189
- data/doc/KatelloApi/Resources/ConfigTemplate.html +143 -208
- data/doc/KatelloApi/Resources/ContentUpload.html +1046 -0
- data/doc/KatelloApi/Resources/ContentView.html +229 -117
- data/doc/KatelloApi/Resources/ContentViewDefinition.html +1190 -323
- data/doc/KatelloApi/Resources/Crl.html +21 -28
- data/doc/KatelloApi/Resources/CustomInfo.html +1110 -0
- data/doc/KatelloApi/Resources/Distribution.html +40 -56
- data/doc/KatelloApi/Resources/Distributor.html +406 -469
- data/doc/KatelloApi/Resources/Domain.html +107 -155
- data/doc/KatelloApi/Resources/Environment.html +211 -539
- data/doc/KatelloApi/Resources/Erratum.html +56 -90
- data/doc/KatelloApi/Resources/Filter.html +1533 -0
- data/doc/KatelloApi/Resources/FilterRule.html +591 -0
- data/doc/KatelloApi/Resources/GpgKey.html +230 -196
- data/doc/KatelloApi/Resources/HardwareModel.html +101 -147
- data/doc/KatelloApi/Resources/Organization.html +647 -158
- data/doc/KatelloApi/Resources/OrganizationDefaultInfo.html +803 -0
- data/doc/KatelloApi/Resources/Package.html +57 -81
- data/doc/KatelloApi/Resources/Permission.html +109 -197
- data/doc/KatelloApi/Resources/Ping.html +37 -179
- data/doc/KatelloApi/Resources/Product.html +289 -462
- data/doc/KatelloApi/Resources/Provider.html +397 -424
- data/doc/KatelloApi/Resources/PuppetModule.html +704 -0
- data/doc/KatelloApi/Resources/Repository.html +302 -958
- data/doc/KatelloApi/Resources/RepositorySet.html +64 -104
- data/doc/KatelloApi/Resources/Role.html +131 -250
- data/doc/KatelloApi/Resources/RoleLdapGroup.html +74 -95
- data/doc/KatelloApi/Resources/SmartProxy.html +97 -143
- data/doc/KatelloApi/Resources/Statu.html +21 -28
- data/doc/KatelloApi/Resources/Status.html +360 -0
- data/doc/KatelloApi/Resources/Subnet.html +89 -129
- data/doc/KatelloApi/Resources/Subscription.html +486 -162
- data/doc/KatelloApi/Resources/Sync.html +85 -155
- data/doc/KatelloApi/Resources/SyncPlan.html +127 -220
- data/doc/KatelloApi/Resources/System.html +913 -925
- data/doc/KatelloApi/Resources/SystemErratum.html +557 -0
- data/doc/KatelloApi/Resources/SystemGroup.html +634 -408
- data/doc/KatelloApi/Resources/SystemGroupErratum.html +47 -66
- data/doc/KatelloApi/Resources/SystemGroupPackage.html +77 -108
- data/doc/KatelloApi/Resources/SystemPackage.html +734 -108
- data/doc/KatelloApi/Resources/SystemsBulkAction.html +1706 -0
- data/doc/KatelloApi/Resources/Task.html +38 -53
- data/doc/KatelloApi/Resources/Template.html +159 -233
- data/doc/KatelloApi/Resources/TemplatesContent.html +214 -312
- data/doc/KatelloApi/Resources/Uebercert.html +25 -34
- data/doc/KatelloApi/Resources/User.html +204 -433
- data/doc/KatelloApi/Resources.html +7 -7
- data/doc/KatelloApi.html +21 -26
- data/doc/_index.html +87 -9
- data/doc/class_list.html +3 -2
- data/doc/css/style.css +1 -1
- data/doc/file.README.html +60 -54
- data/doc/file_list.html +2 -1
- data/doc/frames.html +5 -7
- data/doc/index.html +60 -54
- data/doc/js/app.js +7 -2
- data/doc/js/full_list.js +7 -2
- data/doc/method_list.html +854 -1225
- data/doc/top-level-namespace.html +5 -5
- data/katello_api.gemspec +7 -5
- data/lib/katello_api/base.rb +9 -8
- data/lib/katello_api/documentation.json +1 -1
- data/lib/katello_api/resources/about.rb +18 -0
- data/lib/katello_api/resources/activation_key.rb +11 -13
- data/lib/katello_api/resources/changeset.rb +4 -15
- data/lib/katello_api/resources/changesets_content.rb +6 -130
- data/lib/katello_api/resources/content_upload.rb +61 -0
- data/lib/katello_api/resources/content_view.rb +10 -1
- data/lib/katello_api/resources/content_view_definition.rb +65 -3
- data/lib/katello_api/resources/custom_info.rb +70 -0
- data/lib/katello_api/resources/distributor.rb +33 -18
- data/lib/katello_api/resources/environment.rb +20 -41
- data/lib/katello_api/resources/erratum.rb +3 -4
- data/lib/katello_api/resources/filter.rb +93 -0
- data/lib/katello_api/resources/filter_rule.rb +36 -0
- data/lib/katello_api/resources/gpg_key.rb +18 -14
- data/lib/katello_api/resources/organization.rb +43 -8
- data/lib/katello_api/resources/organization_default_info.rb +48 -0
- data/lib/katello_api/resources/permission.rb +10 -7
- data/lib/katello_api/resources/ping.rb +1 -9
- data/lib/katello_api/resources/product.rb +26 -30
- data/lib/katello_api/resources/provider.rb +21 -20
- data/lib/katello_api/resources/puppet_module.rb +39 -0
- data/lib/katello_api/resources/repository.rb +28 -62
- data/lib/katello_api/resources/repository_set.rb +1 -2
- data/lib/katello_api/resources/role.rb +0 -5
- data/lib/katello_api/resources/role_ldap_group.rb +3 -1
- data/lib/katello_api/resources/status.rb +18 -0
- data/lib/katello_api/resources/subscription.rb +33 -7
- data/lib/katello_api/resources/sync.rb +9 -12
- data/lib/katello_api/resources/sync_plan.rb +2 -5
- data/lib/katello_api/resources/system.rb +95 -73
- data/lib/katello_api/resources/system_erratum.rb +30 -0
- data/lib/katello_api/resources/system_group.rb +40 -27
- data/lib/katello_api/resources/system_group_erratum.rb +1 -1
- data/lib/katello_api/resources/system_group_package.rb +6 -6
- data/lib/katello_api/resources/system_package.rb +46 -5
- data/lib/katello_api/resources/systems_bulk_action.rb +140 -0
- data/lib/katello_api/resources/user.rb +14 -18
- data/lib/katello_api/version.rb +1 -1
- metadata +26 -14
@@ -6,13 +6,13 @@
|
|
6
6
|
<title>
|
7
7
|
Top Level Namespace
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.7.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
16
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
@@ -103,9 +103,9 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on
|
106
|
+
Generated on Wed Jan 15 20:45:13 2014 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
|
-
0.8.
|
108
|
+
0.8.7.3 (ruby-1.9.3).
|
109
109
|
</div>
|
110
110
|
|
111
111
|
</body>
|
data/katello_api.gemspec
CHANGED
@@ -5,21 +5,23 @@ Gem::Specification.new do |gem|
|
|
5
5
|
gem.authors = ["Katello"]
|
6
6
|
gem.email = ["katello-devel@redhat.com"]
|
7
7
|
gem.description = %q{Helps you to use Katello's API calls from your app}
|
8
|
-
gem.summary = %q{Ruby bindings for Katello's
|
8
|
+
gem.summary = %q{Ruby bindings for Katello's API}
|
9
9
|
gem.homepage = "http://github.com/katello/katello_api"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
12
|
+
#gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
13
|
+
|
13
14
|
gem.files.reject! do |fn|
|
14
15
|
fn.start_with?("lib/katello_api/generator") ||
|
15
16
|
fn == 'bin/generate.rb' ||
|
16
17
|
fn == 'rubygem-katello_api.spec'
|
17
18
|
end
|
19
|
+
|
18
20
|
gem.name = "katello_api"
|
19
21
|
gem.require_paths = ["lib"]
|
20
22
|
gem.version = KatelloApi::VERSION
|
21
23
|
|
22
|
-
gem.add_dependency
|
23
|
-
gem.add_dependency
|
24
|
-
gem.add_dependency
|
24
|
+
gem.add_dependency('json')
|
25
|
+
gem.add_dependency('rest-client', '>= 1.6.1')
|
26
|
+
gem.add_dependency('oauth')
|
25
27
|
end
|
data/lib/katello_api/base.rb
CHANGED
@@ -24,19 +24,20 @@ module KatelloApi
|
|
24
24
|
end
|
25
25
|
|
26
26
|
class Base
|
27
|
-
API_VERSION = "
|
27
|
+
API_VERSION = "2"
|
28
28
|
|
29
29
|
attr_reader :client, :config
|
30
30
|
|
31
|
-
def initialize(config, options = {
|
31
|
+
def initialize(config, options = {})
|
32
|
+
headers = { :content_type => 'application/json',
|
33
|
+
:accept => "application/json,version=#{API_VERSION}" }
|
34
|
+
|
32
35
|
@client = RestClient::Resource.new(
|
33
|
-
config[:base_url],
|
36
|
+
"#{config[:base_url]}/katello",
|
34
37
|
{ :user => config[:username],
|
35
38
|
:password => config[:password],
|
36
39
|
:oauth => config[:oauth],
|
37
|
-
:headers =>
|
38
|
-
:accept => "application/json;version=#{API_VERSION}",
|
39
|
-
'HTTP_KATELLO_USER' => 'admin' }
|
40
|
+
:headers => headers
|
40
41
|
}.merge(options))
|
41
42
|
@config = config
|
42
43
|
end
|
@@ -146,10 +147,10 @@ module KatelloApi
|
|
146
147
|
params ||= { }
|
147
148
|
# insert param values
|
148
149
|
url_param_names = self.class.params_in_path(url)
|
149
|
-
url = url_param_names.inject(url) do |
|
150
|
+
url = url_param_names.inject(url) do |urrl, param_name|
|
150
151
|
param_value = params[param_name] or
|
151
152
|
raise ArgumentError, "missing param '#{param_name}' in parameters"
|
152
|
-
|
153
|
+
urrl.sub(":#{param_name}", param_value.to_s)
|
153
154
|
end
|
154
155
|
|
155
156
|
return url, params.reject { |param_name, _| url_param_names.include? param_name }
|