@@ -40,22 +40,22 @@ def organization_id_keys
40
40
end
41
41
42
42
def_param_group :system do
43
- param :facts , Hash , :desc => N_ ( "Key-value hash of system -specific facts" ) , :action_aware => true do
44
- param :fact , String , :desc => N_ ( "Any number of facts about this system " )
43
+ param :facts , Hash , :desc => N_ ( "Key-value hash of content host -specific facts" ) , :action_aware => true do
44
+ param :fact , String , :desc => N_ ( "Any number of facts about this content host " )
45
45
end
46
- param :installed_products , Array , :desc => N_ ( "List of products installed on the system " ) , :action_aware => true
47
- param :name , String , :desc => N_ ( "Name of the system " ) , :required => true , :action_aware => true
48
- param :type , String , :desc => N_ ( "Type of the system , it should always be 'system '" ) , :required => true , :action_aware => true
46
+ param :installed_products , Array , :desc => N_ ( "List of products installed on the content host " ) , :action_aware => true
47
+ param :name , String , :desc => N_ ( "Name of the content host " ) , :required => true , :action_aware => true
48
+ param :type , String , :desc => N_ ( "Type of the content host , it should always be 'content host '" ) , :required => true , :action_aware => true
49
49
param :service_level , String , :allow_nil => true , :desc => N_ ( "A service level for auto-healing process, e.g. SELF-SUPPORT" ) , :action_aware => true
50
- param :location , String , :desc => N_ ( "Physical location of the system " )
50
+ param :location , String , :desc => N_ ( "Physical location of the content host " )
51
51
param :content_view_id , :identifier
52
52
param :environment_id , :identifier
53
53
end
54
54
55
- api :GET , "/systems" , N_ ( "List systems " )
56
- api :GET , "/organizations/:organization_id/systems" , N_ ( "List systems in an organization" )
57
- api :GET , "/environments/:environment_id/systems" , N_ ( "List systems in environment" )
58
- api :GET , "/host_collections/:host_collection_id/systems" , N_ ( "List systems in a host collection" )
55
+ api :GET , "/systems" , N_ ( "List content hosts " )
56
+ api :GET , "/organizations/:organization_id/systems" , N_ ( "List content hosts in an organization" )
57
+ api :GET , "/environments/:environment_id/systems" , N_ ( "List content hosts in environment" )
58
+ api :GET , "/host_collections/:host_collection_id/systems" , N_ ( "List content hosts in a host collection" )
59
59
param :name , String , :desc => N_ ( "Filter content host by name" )
60
60
param :pool_id , String , :desc => N_ ( "Filter content host by subscribed pool" )
61
61
param :uuid , String , :desc => N_ ( "Filter content host by uuid" )
@@ -89,20 +89,20 @@ def index
89
89
end
90
90
91
91
api :POST , "/systems" , N_ ( "Register a content host" )
92
- api :POST , "/environments/:environment_id/systems" , N_ ( "Register a system in environment" )
93
- api :POST , "/host_collections/:host_collection_id/systems" , N_ ( "Register a system in environment" )
94
- param :name , String , :desc => N_ ( "Name of the system " ) , :required => true , :action_aware => true
95
- param :description , String , :desc => N_ ( "Description of the system " )
96
- param :location , String , :desc => N_ ( "Physical location of the system " )
97
- param :facts , Hash , :desc => N_ ( "Key-value hash of system -specific facts" ) , :action_aware => true , :required => true do
98
- param :fact , String , :desc => N_ ( "Any number of facts about this system " )
92
+ api :POST , "/environments/:environment_id/systems" , N_ ( "Register a content host in environment" )
93
+ api :POST , "/host_collections/:host_collection_id/systems" , N_ ( "Register a content host in environment" )
94
+ param :name , String , :desc => N_ ( "Name of the content host " ) , :required => true , :action_aware => true
95
+ param :description , String , :desc => N_ ( "Description of the content host " )
96
+ param :location , String , :desc => N_ ( "Physical location of the content host " )
97
+ param :facts , Hash , :desc => N_ ( "Key-value hash of content host -specific facts" ) , :action_aware => true , :required => true do
98
+ param :fact , String , :desc => N_ ( "Any number of facts about this content host " )
99
99
end
100
- param :type , String , :desc => N_ ( "Type of the system , it should always be 'system '" ) , :required => true , :action_aware => true
101
- param :guest_ids , Array , :desc => N_ ( "IDs of the guests running on this system " )
102
- param :installed_products , Array , :desc => N_ ( "List of products installed on the system " ) , :action_aware => true
103
- param :release_ver , String , :desc => N_ ( "Release version of the system " )
100
+ param :type , String , :desc => N_ ( "Type of the content host , it should always be 'content host '" ) , :required => true , :action_aware => true
101
+ param :guest_ids , Array , :desc => N_ ( "IDs of the guests running on this content host " )
102
+ param :installed_products , Array , :desc => N_ ( "List of products installed on the content host " ) , :action_aware => true
103
+ param :release_ver , String , :desc => N_ ( "Release version of the content host " )
104
104
param :service_level , String , :allow_nil => true , :desc => N_ ( "A service level for auto-healing process, e.g. SELF-SUPPORT" ) , :action_aware => true
105
- param :last_checkin , String , :desc => N_ ( "Last check-in time of this system " )
105
+ param :last_checkin , String , :desc => N_ ( "Last check-in time of this content host " )
106
106
param :organization_id , :number , :desc => N_ ( "Specify the organization" ) , :required => true
107
107
param :environment_id , String , :desc => N_ ( "Specify the environment" )
108
108
param :content_view_id , String , :desc => N_ ( "Specify the content view" )
@@ -116,19 +116,19 @@ def create
116
116
end
117
117
118
118
api :PUT , "/systems/:id" , N_ ( "Update content host information" )
119
- param :id , String , :desc => N_ ( "UUID of the Content Host " ) , :required => true
120
- param :name , String , :desc => N_ ( "Name of the system " ) , :required => true , :action_aware => true
121
- param :description , String , :desc => N_ ( "Description of the system " )
122
- param :location , String , :desc => N_ ( "Physical location of the system " )
123
- param :facts , Hash , :desc => N_ ( "Key-value hash of system -specific facts" ) , :action_aware => true , :required => true do
124
- param :fact , String , :desc => N_ ( "Any number of facts about this system " )
119
+ param :id , String , :desc => N_ ( "UUID of the content host " ) , :required => true
120
+ param :name , String , :desc => N_ ( "Name of the content host " ) , :required => true , :action_aware => true
121
+ param :description , String , :desc => N_ ( "Description of the content host " )
122
+ param :location , String , :desc => N_ ( "Physical location of the content host " )
123
+ param :facts , Hash , :desc => N_ ( "Key-value hash of content host -specific facts" ) , :action_aware => true , :required => true do
124
+ param :fact , String , :desc => N_ ( "Any number of facts about this content host " )
125
125
end
126
- param :type , String , :desc => N_ ( "Type of the system , it should always be 'system '" ) , :required => true , :action_aware => true
127
- param :guest_ids , Array , :desc => N_ ( "IDs of the guests running on this system " )
128
- param :installed_products , Array , :desc => N_ ( "List of products installed on the system " ) , :action_aware => true
129
- param :release_ver , String , :desc => N_ ( "Release version of the system " )
126
+ param :type , String , :desc => N_ ( "Type of the content host , it should always be 'content host '" ) , :required => true , :action_aware => true
127
+ param :guest_ids , Array , :desc => N_ ( "IDs of the guests running on this content host " )
128
+ param :installed_products , Array , :desc => N_ ( "List of products installed on the content host " ) , :action_aware => true
129
+ param :release_ver , String , :desc => N_ ( "Release version of the content host " )
130
130
param :service_level , String , :allow_nil => true , :desc => N_ ( "A service level for auto-healing process, e.g. SELF-SUPPORT" ) , :action_aware => true
131
- param :last_checkin , String , :desc => N_ ( "Last check-in time of this system " )
131
+ param :last_checkin , String , :desc => N_ ( "Last check-in time of this content host " )
132
132
param :environment_id , String , :desc => N_ ( "Specify the environment" )
133
133
param :content_view_id , String , :desc => N_ ( "Specify the content view" )
134
134
def update
@@ -137,15 +137,15 @@ def update
137
137
respond_for_update
138
138
end
139
139
140
- api :GET , "/systems/:id" , N_ ( "Show a system " )
141
- param :id , String , :desc => N_ ( "UUID of the Content Host " ) , :required => true
140
+ api :GET , "/systems/:id" , N_ ( "Show a content host " )
141
+ param :id , String , :desc => N_ ( "UUID of the content host " ) , :required => true
142
142
def show
143
143
@host_collections = @system . host_collections
144
144
@custom_info = @system . custom_info
145
145
respond
146
146
end
147
147
148
- api :GET , "/systems/:id/available_host_collections" , N_ ( "List host collections the system does not belong to" )
148
+ api :GET , "/systems/:id/available_host_collections" , N_ ( "List host collections the content host does not belong to" )
149
149
param_group :search , Api ::V2 ::ApiController
150
150
param :name , String , :desc => N_ ( "host collection name to filter by" )
151
151
def available_host_collections
@@ -161,15 +161,15 @@ def available_host_collections
161
161
respond_for_index ( :collection => host_collections )
162
162
end
163
163
164
- api :DELETE , "/systems/:id" , N_ ( "Unregister a system " )
165
- param :id , String , :desc => N_ ( "UUID of the Content Host " ) , :required => true
164
+ api :DELETE , "/systems/:id" , N_ ( "Unregister a content host " )
165
+ param :id , String , :desc => N_ ( "UUID of the content host " ) , :required => true
166
166
def destroy
167
167
@system . destroy
168
- respond :message => _ ( "Deleted system '%s'" ) % params [ :id ] , :status => 204
168
+ respond :message => _ ( "Deleted content host '%s'" ) % params [ :id ] , :status => 204
169
169
end
170
170
171
- api :GET , "/systems/:id/packages" , N_ ( "List packages installed on the system " )
172
- param :id , String , :desc => N_ ( "UUID of the Content Host " ) , :required => true
171
+ api :GET , "/systems/:id/packages" , N_ ( "List packages installed on the content host " )
172
+ param :id , String , :desc => N_ ( "UUID of the content host " ) , :required => true
173
173
def package_profile
174
174
packages = @system . simple_packages . sort { |a , b | a . name . downcase <=> b . name . downcase }
175
175
response = {
@@ -181,14 +181,14 @@ def package_profile
181
181
end
182
182
183
183
api :PUT , "/systems/:id/refresh_subscriptions" , N_ ( "Trigger a refresh of subscriptions, auto-attaching if enabled" )
184
- param :id , String , :desc => N_ ( "UUID of the Content Host " ) , :required => true
184
+ param :id , String , :desc => N_ ( "UUID of the content host " ) , :required => true
185
185
def refresh_subscriptions
186
186
@system . refresh_subscriptions
187
187
respond_for_show ( :resource => @system )
188
188
end
189
189
190
- api :GET , "/systems/:id/errata" , N_ ( "List errata available for the system " )
191
- param :id , String , :desc => N_ ( "UUID of the Content Host " ) , :required => true
190
+ api :GET , "/systems/:id/errata" , N_ ( "List errata available for the content host " )
191
+ param :id , String , :desc => N_ ( "UUID of the content host " ) , :required => true
192
192
def errata
193
193
errata = @system . errata
194
194
response = {
@@ -200,8 +200,8 @@ def errata
200
200
respond_for_index :collection => response
201
201
end
202
202
203
- api :GET , "/systems/:id/tasks" , N_ ( "List async tasks for the system " )
204
- param :id , String , :desc => N_ ( "UUID of the Content Host " ) , :required => true
203
+ api :GET , "/systems/:id/tasks" , N_ ( "List async tasks for the content host " )
204
+ param :id , String , :desc => N_ ( "UUID of the content host " ) , :required => true
205
205
def tasks
206
206
@system . refresh_tasks
207
207
@@ -215,8 +215,8 @@ def tasks
215
215
end
216
216
217
217
# TODO: break this mehtod up
218
- api :GET , "/environments/:environment_id/systems/report" , N_ ( "Get system reports for the environment" )
219
- api :GET , "/organizations/:organization_id/systems/report" , N_ ( "Get system reports for the organization" )
218
+ api :GET , "/environments/:environment_id/systems/report" , N_ ( "Get content host reports for the environment" )
219
+ api :GET , "/organizations/:organization_id/systems/report" , N_ ( "Get content host reports for the organization" )
220
220
def report # rubocop:disable MethodLength
221
221
data = @environment . nil? ? @organization . systems . readable : @environment . systems . readable
222
222
@@ -246,9 +246,9 @@ def report # rubocop:disable MethodLength
246
246
end
247
247
end
248
248
249
- api :GET , "/systems/:id/pools" , N_ ( "List pools a system is subscribed to" )
250
- param :id , String , :desc => N_ ( "UUID of the Content Host " ) , :required => true
251
- param :match_system , [ true , false ] , :desc => N_ ( "Match pools to system " )
249
+ api :GET , "/systems/:id/pools" , N_ ( "List pools a content host is subscribed to" )
250
+ param :id , String , :desc => N_ ( "UUID of the content host " ) , :required => true
251
+ param :match_system , [ true , false ] , :desc => N_ ( "Match pools to content host " )
252
252
param :match_installed , [ true , false ] , :desc => N_ ( "Match pools to installed" )
253
253
param :no_overlap , [ true , false ] , :desc => N_ ( "allow overlap" )
254
254
def pools
@@ -264,8 +264,8 @@ def pools
264
264
respond_for_index :collection => response
265
265
end
266
266
267
- api :GET , "/systems/:id/releases" , N_ ( "Show releases available for the system " )
268
- param :id , String , :desc => N_ ( "UUID of the Content Host " ) , :required => true
267
+ api :GET , "/systems/:id/releases" , N_ ( "Show releases available for the content host " )
268
+ param :id , String , :desc => N_ ( "UUID of the content host " ) , :required => true
269
269
desc <<-DESC
270
270
A hint for choosing the right value for the releaseVer param
271
271
DESC
@@ -282,7 +282,7 @@ def find_system
282
282
@system = System . first ( :conditions => { :uuid => params [ :id ] } )
283
283
if @system . nil?
284
284
Resources ::Candlepin ::Consumer . get params [ :id ] # check with candlepin if system is Gone, raises RestClient::Gone
285
- fail HttpErrors ::NotFound , _ ( "Couldn't find system '%s'" ) % params [ :id ]
285
+ fail HttpErrors ::NotFound , _ ( "Couldn't find content host '%s'" ) % params [ :id ]
286
286
end
287
287
end
288
288
@@ -304,7 +304,7 @@ def find_host_collection
304
304
def find_only_environment
305
305
if !@environment && @organization && !params . key? ( :environment_id )
306
306
if @organization . kt_environments . empty?
307
- fail HttpErrors ::BadRequest , _ ( "Organization %{org} has the '%{env}' environment only. Please create an environment for system registration." ) %
307
+ fail HttpErrors ::BadRequest , _ ( "Organization %{org} has the '%{env}' environment only. Please create an environment for content host registration." ) %
308
308
{ :org => @organization . name , :env => "Library" }
309
309
end
310
310
@@ -317,7 +317,7 @@ def find_only_environment
317
317
if current_user . default_environment && current_user . default_environment . organization == @organization
318
318
@environment = current_user . default_environment
319
319
else
320
- fail HttpErrors ::BadRequest , _ ( "Organization %s has more than one environment. Please specify target environment for system registration." ) % @organization . name
320
+ fail HttpErrors ::BadRequest , _ ( "Organization %s has more than one environment. Please specify target environment for content host registration." ) % @organization . name
321
321
end
322
322
else
323
323
if @environment = @organization . kt_environments . first
0 commit comments