@@ -222,7 +222,11 @@ def initialize(page_name)
222
222
}
223
223
224
224
#Existing properties that won't be documented
225
- @@ignored_properties = [ "maintenance" , "state" , "ip_virtual" ]
225
+ @@ignored_properties = [
226
+ "maintenance" , "state" , "ip_virtual" , "api_timestamp" , "available_upto" , "chunks" , "desktop_computing" ,
227
+ "drain" , "finaud_decision" , "grub" , "id" , "last_available_upto" , "last_job_date" , "links" , "next_finaud_decision" ,
228
+ "next_state" , "rconsole" , "scheduler_priority" , "state_num" , "suspended_jobs"
229
+ ]
226
230
227
231
def get_value_type ( prop , values )
228
232
if ( @@properties [ prop ] [ "value_type" ] )
@@ -243,20 +247,18 @@ def generate_content
243
247
refapi = load_data_hierarchy
244
248
#Properties generated from oar-properties generator
245
249
props = { }
246
- oar_data_properties = [ ]
250
+ oarapi_properties = [ ]
251
+
247
252
G5K ::SITES . each_with_index { |site_uid , index |
248
253
props [ site_uid ] = { }
249
254
props [ site_uid ] [ "default" ] = get_ref_default_properties ( site_uid , refapi [ "sites" ] [ site_uid ] )
250
255
props [ site_uid ] [ "disk" ] = get_ref_disk_properties ( site_uid , refapi [ "sites" ] [ site_uid ] )
256
+ }
251
257
252
- # Retrieve all oar fields from the first site
253
- if index == 0
254
- get_oar_data ( site_uid , { :api => { } , :verbose => false } ) . each { |oar_node_data , _ |
255
- oar_node_data . each { |key , _ |
256
- oar_data_properties << key unless oar_data_properties . include? key
257
- }
258
- }
259
- end
258
+ RefRepo ::Utils ::get_api ( "sites/#{ G5K ::SITES . first } /internal/oarapi/resources/details.json?limit=999999" ) [ 'items' ] . each { |oarapi_details |
259
+ oarapi_details . keys . each { |property |
260
+ oarapi_properties << property unless oarapi_properties . include? property
261
+ }
260
262
}
261
263
262
264
#Compiled properties used to generate page
@@ -288,13 +290,13 @@ def generate_content
288
290
@@properties [ prop ] [ "possible_values" ] ||= prop_hash [ "values" ] . join ( ", " ) unless @@properties [ prop ] . nil?
289
291
}
290
292
291
- # Compare properties with fields from oar db
292
- oar_data_properties . reject! { |x | ( @@properties . keys . include? x or @@ignored_properties . include? x ) }
293
+ # If there are undocumented and not ignored properties, we raise an error
294
+ oarapi_properties . reject! { |x | ( @@properties . keys . include? x or @@ignored_properties . include? x ) }
295
+ if not oarapi_properties . empty?
296
+ raise ( "Following properties are not documented : #{ oarapi_properties . sort . join ( ', ' ) } " )
297
+ end
293
298
294
299
@generated_content = "{{Portal|User}}\n Properties on resources managed by OAR allow users to select them according to their experiment's characteristics." + MW ::LINE_FEED
295
- if not oar_data_properties . empty?
296
- @generated_content += "{{Warning|text=Following properties are not documented : " + oar_data_properties . sort . join ( ', ' ) + "}}" + MW ::LINE_FEED
297
- end
298
300
@generated_content += MW ::heading ( "OAR Properties" , 1 ) + MW ::LINE_FEED
299
301
300
302
@@categories . sort . to_h . each { |cat , cat_properties |
0 commit comments