katello_api 0.0.1

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.
Files changed (53) hide show
  1. data/Gemfile +8 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +53 -0
  4. data/Rakefile +2 -0
  5. data/katello_api.gemspec +25 -0
  6. data/lib/katello_api/base.rb +134 -0
  7. data/lib/katello_api/config.yml +6 -0
  8. data/lib/katello_api/resources/activation_key.rb +104 -0
  9. data/lib/katello_api/resources/architecture.rb +64 -0
  10. data/lib/katello_api/resources/changeset.rb +83 -0
  11. data/lib/katello_api/resources/changesets_content.rb +149 -0
  12. data/lib/katello_api/resources/compute_resource.rb +82 -0
  13. data/lib/katello_api/resources/config_template.rb +92 -0
  14. data/lib/katello_api/resources/content_view.rb +55 -0
  15. data/lib/katello_api/resources/content_view_definition.rb +107 -0
  16. data/lib/katello_api/resources/crl.rb +19 -0
  17. data/lib/katello_api/resources/distribution.rb +29 -0
  18. data/lib/katello_api/resources/distributor.rb +112 -0
  19. data/lib/katello_api/resources/domain.rb +71 -0
  20. data/lib/katello_api/resources/environment.rb +106 -0
  21. data/lib/katello_api/resources/erratum.rb +33 -0
  22. data/lib/katello_api/resources/gpg_key.rb +78 -0
  23. data/lib/katello_api/resources/hardware_model.rb +70 -0
  24. data/lib/katello_api/resources/organization.rb +64 -0
  25. data/lib/katello_api/resources/package.rb +42 -0
  26. data/lib/katello_api/resources/permission.rb +57 -0
  27. data/lib/katello_api/resources/ping.rb +37 -0
  28. data/lib/katello_api/resources/product.rb +119 -0
  29. data/lib/katello_api/resources/provider.rb +151 -0
  30. data/lib/katello_api/resources/repository.rb +128 -0
  31. data/lib/katello_api/resources/repository_set.rb +45 -0
  32. data/lib/katello_api/resources/role.rb +74 -0
  33. data/lib/katello_api/resources/role_ldap_group.rb +41 -0
  34. data/lib/katello_api/resources/smart_proxy.rb +67 -0
  35. data/lib/katello_api/resources/statu.rb +19 -0
  36. data/lib/katello_api/resources/subnet.rb +64 -0
  37. data/lib/katello_api/resources/subscription.rb +64 -0
  38. data/lib/katello_api/resources/sync.rb +49 -0
  39. data/lib/katello_api/resources/sync_plan.rb +78 -0
  40. data/lib/katello_api/resources/system.rb +226 -0
  41. data/lib/katello_api/resources/system_group.rb +136 -0
  42. data/lib/katello_api/resources/system_group_erratum.rb +34 -0
  43. data/lib/katello_api/resources/system_group_package.rb +49 -0
  44. data/lib/katello_api/resources/system_package.rb +45 -0
  45. data/lib/katello_api/resources/task.rb +30 -0
  46. data/lib/katello_api/resources/template.rb +107 -0
  47. data/lib/katello_api/resources/templates_content.rb +143 -0
  48. data/lib/katello_api/resources/uebercert.rb +20 -0
  49. data/lib/katello_api/resources/user.rb +113 -0
  50. data/lib/katello_api/rest_client_oauth.rb +19 -0
  51. data/lib/katello_api/version.rb +3 -0
  52. data/lib/katello_api.rb +23 -0
  53. metadata +160 -0
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source :rubygems
2
+
3
+ gemspec
4
+
5
+ group :generator do
6
+ gem 'activesupport'
7
+ gem 'thor'
8
+ end
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2012 Red Hat, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,53 @@
1
+ = Katello API bindings for Ruby
2
+
3
+ == Summary
4
+
5
+ require 'katello_api'
6
+ environments = KatelloApi::Resources::Environment.new(:base_url => 'http://localhost:3000',
7
+ :username => 'admin',
8
+ :password => 'changeme')
9
+
10
+ data, raw_response architectures.index(:organization_id => "ACME_Corporation")
11
+ pp data # parsed data of the response
12
+ pp raw_response # raw string of the response body
13
+
14
+ == Description
15
+
16
+ This gem contains Katello API bindings for the Ruby language. The
17
+ bindings are generated from API documentation using
18
+ {Apidoc}[https://github.com/Pajk/apipie-rails] tool.
19
+
20
+ The bindings brings support for new versioned API which is not
21
+ complete yet. The number of supported controllers is limited but more
22
+ are coming soon.
23
+
24
+ === Regenerating bindings
25
+
26
+ The code for generating the bindings is a part of this repo. The
27
+ generator needs a running Katello instance to load the apidoc.json.
28
+
29
+ Usage:
30
+
31
+ bin/generate.rb -h
32
+ Script for generating API bindings for Katello API from Apipie docs.
33
+ -u, --url KATELLO_APIDOC_URL By default http://localhost:3000/apidoc
34
+ -h, --help
35
+
36
+ Only files under +lib/katello_api/resources+ are touched by the generator.
37
+
38
+ === Authentication
39
+
40
+ Katello API supports authentication with username/password and OAuth.
41
+ For use of OAuth with the bindings you only have to change the params
42
+
43
+ environments = KatelloApi::Resources::Environment.new(:base_url => 'http://localhost:3000',
44
+ :oauth => { :consumer_key => 'mykey',
45
+ :consumer_secret => 'shhhh' })
46
+
47
+ == License
48
+
49
+ The bindings are released under MIT license
50
+
51
+
52
+
53
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/katello_api/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Katello"]
6
+ gem.email = ["katello-devel@redhat.com"]
7
+ gem.description = %q{Helps you to use Katello's API calls from your app}
8
+ gem.summary = %q{Ruby bindings for Katello's rest API}
9
+ gem.homepage = "http://github.com/katello/Katello"
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
+ gem.files.reject! do |fn|
14
+ fn.start_with?("lib/katello_api/generator") ||
15
+ fn == 'bin/generate.rb' ||
16
+ fn == 'rubygem-katello_api.spec'
17
+ end
18
+ gem.name = "katello_api"
19
+ gem.require_paths = ["lib"]
20
+ gem.version = KatelloApi::VERSION
21
+
22
+ gem.add_dependency 'json'
23
+ gem.add_dependency 'rest-client', '>= 1.6.1'
24
+ gem.add_dependency 'oauth'
25
+ end
@@ -0,0 +1,134 @@
1
+ require 'rest_client'
2
+ require 'oauth'
3
+ require 'json'
4
+ require 'katello_api/rest_client_oauth'
5
+
6
+ module KatelloApi
7
+ class Base
8
+ API_VERSION = "1.0"
9
+
10
+ attr_reader :client, :config
11
+
12
+ def initialize(config, options = { })
13
+ @client = RestClient::Resource.new(
14
+ config[:base_url],
15
+ { :user => config[:username],
16
+ :password => config[:password],
17
+ :oauth => config[:oauth],
18
+ :headers => { :content_type => 'application/json',
19
+ :accept => "application/json;version=#{API_VERSION}",
20
+ 'HTTP_KATELLO_USER' => 'admin' }
21
+ }.merge(options))
22
+ @config = config
23
+ end
24
+
25
+ def call(method, path, params = { }, headers = { })
26
+ headers ||= { }
27
+
28
+ args = [method]
29
+ if [:post, :put].include?(method)
30
+ args << params.to_json
31
+ else
32
+ headers[:params] = params if params
33
+ end
34
+
35
+ args << headers if headers
36
+ process_data client[path].send(*args)
37
+ end
38
+
39
+ def self.doc
40
+ raise NotImplementedError
41
+ end
42
+
43
+ def self.validation_hash(method)
44
+ validation_hashes[method.to_s]
45
+ end
46
+
47
+ def self.method_doc(method)
48
+ method_docs[method.to_s]
49
+ end
50
+
51
+ def validate_params!(params, rules)
52
+ return unless params.is_a?(Hash)
53
+
54
+ invalid_keys = params.keys.map(&:to_s) - (rules.is_a?(Hash) ? rules.keys : rules)
55
+ raise ArgumentError, "Invalid keys: #{invalid_keys.join(", ")}" unless invalid_keys.empty?
56
+
57
+ if rules.is_a? Hash
58
+ rules.each do |key, sub_keys|
59
+ validate_params!(params[key], sub_keys) if params[key]
60
+ end
61
+ end
62
+ end
63
+
64
+ protected
65
+
66
+ def process_data(response)
67
+ data = begin
68
+ JSON.parse(response.body)
69
+ rescue JSON::ParserError
70
+ response.body
71
+ end
72
+ return data, response
73
+ end
74
+
75
+ def check_params(params, options = { })
76
+ raise ArgumentError unless (method = options[:method])
77
+ return unless config[:enable_validations]
78
+
79
+ case options[:allowed]
80
+ when true
81
+ validate_params!(params, self.class.validation_hash(method))
82
+ when false
83
+ raise ArgumentError, "this method '#{method}' does not support params" if params && !params.empty?
84
+ else
85
+ raise ArgumentError, "options :allowed should be true or false, it was #{options[:allowed]}"
86
+ end
87
+ end
88
+
89
+ # @return url and rest of the params
90
+ def fill_params_in_url(url, params)
91
+ params ||= { }
92
+ # insert param values
93
+ url_param_names = params_in_path(url)
94
+ url = params_in_path(url).inject(url) do |url, param_name|
95
+ param_value = params[param_name] or
96
+ raise ArgumentError, "missing param '#{param_name}' in parameters"
97
+ url.sub(":#{param_name}", param_value.to_s)
98
+ end
99
+
100
+ return url, params.reject { |param_name, _| url_param_names.include? param_name }
101
+ end
102
+
103
+ private
104
+
105
+ def self.method_docs
106
+ @method_docs ||= doc['methods'].inject({ }) do |hash, method|
107
+ hash[method['name']] = method
108
+ hash
109
+ end
110
+ end
111
+
112
+ def self.validation_hashes
113
+ @validation_hashes ||= method_docs.inject({ }) do |hash, pair|
114
+ name, method_doc = pair
115
+ hash[name] = construct_validation_hash method_doc
116
+ hash
117
+ end
118
+ end
119
+
120
+ def self.construct_validation_hash(method)
121
+ if method['params'].any? { |p| p['params'] }
122
+ method['params'].reduce({ }) do |h, p|
123
+ h.update(p['name'] => (p['params'] ? p['params'].map { |pp| pp['name'] } : nil))
124
+ end
125
+ else
126
+ method['params'].map { |p| p['name'] }
127
+ end
128
+ end
129
+
130
+ def params_in_path(url)
131
+ url.scan(/:([^\/]*)/).map { |m| m.first }
132
+ end
133
+ end
134
+ end
@@ -0,0 +1,6 @@
1
+ ---
2
+ :base_url: http://localhost:3000
3
+ :enable_validations: false
4
+ :oauth:
5
+ :consumer_key: consumer
6
+ :consumer_secret: shhhh
@@ -0,0 +1,104 @@
1
+ module KatelloApi
2
+ module Resources
3
+ class ActivationKey < KatelloApi::Base
4
+ def self.doc
5
+ @doc ||= KatelloApi.doc['resources']["activation_keys"]
6
+ end
7
+
8
+ # @param [Hash] params a hash of params to be passed to the service
9
+ # @option params [String] name lists by activation key name
10
+ #
11
+ # @param [Hash] headers additional http headers
12
+ def index(params = { }, headers = { })
13
+ check_params params, :allowed => true, :method => __method__
14
+ # we don't use the default path here from apipie
15
+ url, params = fill_params_in_url "/api/environments/:environment_id/activation_keys", params
16
+ call(:"get", url, params, headers)
17
+ end
18
+
19
+ # @param [Hash] params a hash of params to be passed to the service
20
+ #
21
+ # @param [Hash] headers additional http headers
22
+ def show(params = { }, headers = { })
23
+ check_params params, :allowed => false, :method => __method__
24
+ url, params = fill_params_in_url "/api/activation_keys/:id", params
25
+ call(:"get", url, params, headers)
26
+ end
27
+
28
+ # @param [Hash] params a hash of params to be passed to the service
29
+ # @option params [Hash] activation_key
30
+ # allowed keys are:
31
+ # * content_view_id [String, nil] content view id ,
32
+ # * description [String, nil],
33
+ # * name [String] activation key identifier (alphanum characters, space, _ and -) ,
34
+ #
35
+ # @param [Hash] headers additional http headers
36
+ def create(params = { }, headers = { })
37
+ check_params params, :allowed => true, :method => __method__
38
+ url, params = fill_params_in_url "/api/activation_keys", params
39
+ call(:"post", url, params, headers)
40
+ end
41
+
42
+ # @param [Hash] params a hash of params to be passed to the service
43
+ # @option params [Hash] activation_key
44
+ # allowed keys are:
45
+ # * content_view_id [String, nil] content view id ,
46
+ # * description [String, nil],
47
+ # * environment_id [String, nil],
48
+ # * name [String] activation key identifier (alphanum characters, space, _ and -) ,
49
+ #
50
+ # @param [Hash] headers additional http headers
51
+ def update(params = { }, headers = { })
52
+ check_params params, :allowed => true, :method => __method__
53
+ url, params = fill_params_in_url "/api/activation_keys/:id", params
54
+ call(:"put", url, params, headers)
55
+ end
56
+
57
+ # @param [Hash] params a hash of params to be passed to the service
58
+ #
59
+ # @param [Hash] headers additional http headers
60
+ def add_pool(params = { }, headers = { })
61
+ check_params params, :allowed => false, :method => __method__
62
+ url, params = fill_params_in_url "/api/activation_keys/:id/pools", params
63
+ call(:"post", url, params, headers)
64
+ end
65
+
66
+ # @param [Hash] params a hash of params to be passed to the service
67
+ #
68
+ # @param [Hash] headers additional http headers
69
+ def remove_pool(params = { }, headers = { })
70
+ check_params params, :allowed => false, :method => __method__
71
+ url, params = fill_params_in_url "/api/activation_keys/:id/pools/:poolid", params
72
+ call(:"delete", url, params, headers)
73
+ end
74
+
75
+ # @param [Hash] params a hash of params to be passed to the service
76
+ #
77
+ # @param [Hash] headers additional http headers
78
+ def destroy(params = { }, headers = { })
79
+ check_params params, :allowed => false, :method => __method__
80
+ url, params = fill_params_in_url "/api/activation_keys/:id", params
81
+ call(:"delete", url, params, headers)
82
+ end
83
+
84
+ # @param [Hash] params a hash of params to be passed to the service
85
+ #
86
+ # @param [Hash] headers additional http headers
87
+ def add_system_groups(params = { }, headers = { })
88
+ check_params params, :allowed => false, :method => __method__
89
+ url, params = fill_params_in_url "/api/organizations/:organization_id/activation_keys/:id/system_groups", params
90
+ call(:"post", url, params, headers)
91
+ end
92
+
93
+ # @param [Hash] params a hash of params to be passed to the service
94
+ #
95
+ # @param [Hash] headers additional http headers
96
+ def remove_system_groups(params = { }, headers = { })
97
+ check_params params, :allowed => false, :method => __method__
98
+ url, params = fill_params_in_url "/api/organizations/:organization_id/activation_keys/:id/system_groups", params
99
+ call(:"delete", url, params, headers)
100
+ end
101
+
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,64 @@
1
+ module KatelloApi
2
+ module Resources
3
+ class Architecture < KatelloApi::Base
4
+ def self.doc
5
+ @doc ||= KatelloApi.doc['resources']["architectures"]
6
+ end
7
+
8
+ # @param [Hash] params a hash of params to be passed to the service
9
+ #
10
+ # @param [Hash] headers additional http headers
11
+ def index(params = { }, headers = { })
12
+ check_params params, :allowed => false, :method => __method__
13
+ url, params = fill_params_in_url "/api/architectures", params
14
+ call(:"get", url, params, headers)
15
+ end
16
+
17
+ # @param [Hash] params a hash of params to be passed to the service
18
+ # @option params [String] id architecture name
19
+ #
20
+ # @param [Hash] headers additional http headers
21
+ def show(params = { }, headers = { })
22
+ check_params params, :allowed => true, :method => __method__
23
+ url, params = fill_params_in_url "/api/architectures/:id", params
24
+ call(:"get", url, params, headers)
25
+ end
26
+
27
+ # @param [Hash] params a hash of params to be passed to the service
28
+ # @option params [Hash] architecture architecture info
29
+ # allowed keys are:
30
+ # * name [String] architecture name ,
31
+ #
32
+ # @param [Hash] headers additional http headers
33
+ def create(params = { }, headers = { })
34
+ check_params params, :allowed => true, :method => __method__
35
+ url, params = fill_params_in_url "/api/architecture", params
36
+ call(:"post", url, params, headers)
37
+ end
38
+
39
+ # @param [Hash] params a hash of params to be passed to the service
40
+ # @option params [String] id architecture name
41
+ # @option params [Hash] architecture architecture info
42
+ # allowed keys are:
43
+ # * name [String] architecture name ,
44
+ #
45
+ # @param [Hash] headers additional http headers
46
+ def update(params = { }, headers = { })
47
+ check_params params, :allowed => true, :method => __method__
48
+ url, params = fill_params_in_url "/api/architectures/:id", params
49
+ call(:"put", url, params, headers)
50
+ end
51
+
52
+ # @param [Hash] params a hash of params to be passed to the service
53
+ # @option params [String] id architecture name
54
+ #
55
+ # @param [Hash] headers additional http headers
56
+ def destroy(params = { }, headers = { })
57
+ check_params params, :allowed => true, :method => __method__
58
+ url, params = fill_params_in_url "/api/architectures/:id", params
59
+ call(:"delete", url, params, headers)
60
+ end
61
+
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,83 @@
1
+ module KatelloApi
2
+ module Resources
3
+ class Changeset < KatelloApi::Base
4
+ def self.doc
5
+ @doc ||= KatelloApi.doc['resources']["changesets"]
6
+ end
7
+
8
+ # @param [Hash] params a hash of params to be passed to the service
9
+ # @option params [String] name an optional changeset name to filter upon
10
+ #
11
+ # @param [Hash] headers additional http headers
12
+ def index(params = { }, headers = { })
13
+ check_params params, :allowed => true, :method => __method__
14
+ url, params = fill_params_in_url "/api/organizations/:organization_id/environments/:environment_id/changesets", params
15
+ call(:"get", url, params, headers)
16
+ end
17
+
18
+ # @param [Hash] params a hash of params to be passed to the service
19
+ #
20
+ # @param [Hash] headers additional http headers
21
+ def show(params = { }, headers = { })
22
+ check_params params, :allowed => false, :method => __method__
23
+ url, params = fill_params_in_url "/api/changesets/:id", params
24
+ call(:"get", url, params, headers)
25
+ end
26
+
27
+ # @param [Hash] params a hash of params to be passed to the service
28
+ # @option params [Hash] changeset
29
+ # allowed keys are:
30
+ # * description [String, nil] the description of the changeset ,
31
+ # * name [String] the name of the changeset ,
32
+ #
33
+ # @param [Hash] headers additional http headers
34
+ def update(params = { }, headers = { })
35
+ check_params params, :allowed => true, :method => __method__
36
+ url, params = fill_params_in_url "/api/changesets/:id", params
37
+ call(:"put", url, params, headers)
38
+ end
39
+
40
+ # @param [Hash] params a hash of params to be passed to the service
41
+ #
42
+ # @param [Hash] headers additional http headers
43
+ def dependencies(params = { }, headers = { })
44
+ check_params params, :allowed => false, :method => __method__
45
+ url, params = fill_params_in_url "/api/changesets/:id/dependencies", params
46
+ call(:"get", url, params, headers)
47
+ end
48
+
49
+ # @param [Hash] params a hash of params to be passed to the service
50
+ # @option params [Hash] changeset
51
+ # allowed keys are:
52
+ # * description [String, nil] the description of the changeset ,
53
+ # * name [String] the name of the changeset ,
54
+ # * type [String],
55
+ #
56
+ # @param [Hash] headers additional http headers
57
+ def create(params = { }, headers = { })
58
+ check_params params, :allowed => true, :method => __method__
59
+ url, params = fill_params_in_url "/api/organizations/:organization_id/environments/:environment_id/changesets", params
60
+ call(:"post", url, params, headers)
61
+ end
62
+
63
+ # @param [Hash] params a hash of params to be passed to the service
64
+ #
65
+ # @param [Hash] headers additional http headers
66
+ def promote(params = { }, headers = { })
67
+ check_params params, :allowed => false, :method => __method__
68
+ url, params = fill_params_in_url "/api/changesets/:id/promote", params
69
+ call(:"post", url, params, headers)
70
+ end
71
+
72
+ # @param [Hash] params a hash of params to be passed to the service
73
+ #
74
+ # @param [Hash] headers additional http headers
75
+ def destroy(params = { }, headers = { })
76
+ check_params params, :allowed => false, :method => __method__
77
+ url, params = fill_params_in_url "/api/changesets/:id", params
78
+ call(:"delete", url, params, headers)
79
+ end
80
+
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,149 @@
1
+ module KatelloApi
2
+ module Resources
3
+ class ChangesetsContent < KatelloApi::Base
4
+ def self.doc
5
+ @doc ||= KatelloApi.doc['resources']["changesets_content"]
6
+ end
7
+
8
+ # @param [Hash] params a hash of params to be passed to the service
9
+ # @option params [String] product_id the id of the product which should be added
10
+ #
11
+ # @param [Hash] headers additional http headers
12
+ def add_product(params = { }, headers = { })
13
+ check_params params, :allowed => true, :method => __method__
14
+ url, params = fill_params_in_url "/api/changesets/:changeset_id/products", params
15
+ call(:"post", url, params, headers)
16
+ end
17
+
18
+ # @param [Hash] params a hash of params to be passed to the service
19
+ # @option params [String] content_id the id of the product to remove
20
+ #
21
+ # @param [Hash] headers additional http headers
22
+ def remove_product(params = { }, headers = { })
23
+ check_params params, :allowed => true, :method => __method__
24
+ url, params = fill_params_in_url "/api/changesets/:changeset_id/products/:id", params
25
+ call(:"delete", url, params, headers)
26
+ end
27
+
28
+ # @param [Hash] params a hash of params to be passed to the service
29
+ # @option params [String] name the nvrea of the package to add
30
+ # @option params [String] product_id the id of the product which contains the package
31
+ #
32
+ # @param [Hash] headers additional http headers
33
+ def add_package(params = { }, headers = { })
34
+ check_params params, :allowed => true, :method => __method__
35
+ url, params = fill_params_in_url "/api/changesets/:changeset_id/packages", params
36
+ call(:"post", url, params, headers)
37
+ end
38
+
39
+ # @param [Hash] params a hash of params to be passed to the service
40
+ # @option params [String] product_id the id of the product which contains the package
41
+ #
42
+ # @param [Hash] headers additional http headers
43
+ def remove_package(params = { }, headers = { })
44
+ check_params params, :allowed => true, :method => __method__
45
+ url, params = fill_params_in_url "/api/changesets/:changeset_id/packages/:id", params
46
+ call(:"delete", url, params, headers)
47
+ end
48
+
49
+ # @param [Hash] params a hash of params to be passed to the service
50
+ # @option params [String] erratum_id the id of the errata to add
51
+ # @option params [String] product_id the product which contains the errata
52
+ #
53
+ # @param [Hash] headers additional http headers
54
+ def add_erratum(params = { }, headers = { })
55
+ check_params params, :allowed => true, :method => __method__
56
+ url, params = fill_params_in_url "/api/changesets/:changeset_id/errata", params
57
+ call(:"post", url, params, headers)
58
+ end
59
+
60
+ # @param [Hash] params a hash of params to be passed to the service
61
+ # @option params [String] product_id the product which contains the errata
62
+ #
63
+ # @param [Hash] headers additional http headers
64
+ def remove_erratum(params = { }, headers = { })
65
+ check_params params, :allowed => true, :method => __method__
66
+ url, params = fill_params_in_url "/api/changesets/:changeset_id/errata/:id", params
67
+ call(:"delete", url, params, headers)
68
+ end
69
+
70
+ # @param [Hash] params a hash of params to be passed to the service
71
+ # @option params [String] repository_id the id of the repository to add
72
+ #
73
+ # @param [Hash] headers additional http headers
74
+ def add_repo(params = { }, headers = { })
75
+ check_params params, :allowed => true, :method => __method__
76
+ url, params = fill_params_in_url "/api/changesets/:changeset_id/repositories", params
77
+ call(:"post", url, params, headers)
78
+ end
79
+
80
+ # @param [Hash] params a hash of params to be passed to the service
81
+ #
82
+ # @param [Hash] headers additional http headers
83
+ def remove_repo(params = { }, headers = { })
84
+ check_params params, :allowed => false, :method => __method__
85
+ url, params = fill_params_in_url "/api/changesets/:changeset_id/repositories/:id", params
86
+ call(:"delete", url, params, headers)
87
+ end
88
+
89
+ # @param [Hash] params a hash of params to be passed to the service
90
+ # @option params [String] template_id the id of the template to add
91
+ #
92
+ # @param [Hash] headers additional http headers
93
+ def add_template(params = { }, headers = { })
94
+ check_params params, :allowed => true, :method => __method__
95
+ url, params = fill_params_in_url "/api/changesets/:changeset_id/templates", params
96
+ call(:"post", url, params, headers)
97
+ end
98
+
99
+ # @param [Hash] params a hash of params to be passed to the service
100
+ #
101
+ # @param [Hash] headers additional http headers
102
+ def remove_template(params = { }, headers = { })
103
+ check_params params, :allowed => false, :method => __method__
104
+ url, params = fill_params_in_url "/api/changesets/:changeset_id/templates/:id", params
105
+ call(:"delete", url, params, headers)
106
+ end
107
+
108
+ # @param [Hash] params a hash of params to be passed to the service
109
+ # @option params [String] content_view_id the id of the content view to add
110
+ #
111
+ # @param [Hash] headers additional http headers
112
+ def add_content_view(params = { }, headers = { })
113
+ check_params params, :allowed => true, :method => __method__
114
+ url, params = fill_params_in_url "/api/changesets/:changeset_id/content_views", params
115
+ call(:"post", url, params, headers)
116
+ end
117
+
118
+ # @param [Hash] params a hash of params to be passed to the service
119
+ #
120
+ # @param [Hash] headers additional http headers
121
+ def remove_content_view(params = { }, headers = { })
122
+ check_params params, :allowed => false, :method => __method__
123
+ url, params = fill_params_in_url "/api/changesets/:changeset_id/content_views/:id", params
124
+ call(:"delete", url, params, headers)
125
+ end
126
+
127
+ # @param [Hash] params a hash of params to be passed to the service
128
+ # @option params [String] distribution_id the id of the distribution to add
129
+ # @option params [String] product_id the product which contains the distribution
130
+ #
131
+ # @param [Hash] headers additional http headers
132
+ def add_distribution(params = { }, headers = { })
133
+ check_params params, :allowed => true, :method => __method__
134
+ url, params = fill_params_in_url "/api/changesets/:changeset_id/distributions", params
135
+ call(:"post", url, params, headers)
136
+ end
137
+
138
+ # @param [Hash] params a hash of params to be passed to the service
139
+ #
140
+ # @param [Hash] headers additional http headers
141
+ def remove_distribution(params = { }, headers = { })
142
+ check_params params, :allowed => false, :method => __method__
143
+ url, params = fill_params_in_url "/api/changesets/:changeset_id/distributions/:id", params
144
+ call(:"delete", url, params, headers)
145
+ end
146
+
147
+ end
148
+ end
149
+ end