Class: Harbor2Client::PreheatApi

Inherits:
Object
  • Object
show all
Defined in:
lib/harbor2_client/api/preheat_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PreheatApi

Returns a new instance of PreheatApi.



19
20
21
# File 'lib/harbor2_client/api/preheat_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/harbor2_client/api/preheat_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_instance(instance, opts = {}) ⇒ nil

Create p2p provider instances Create p2p provider instances

Parameters:

  • instance

    The JSON object of instance.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


28
29
30
31
# File 'lib/harbor2_client/api/preheat_api.rb', line 28

def create_instance(instance, opts = {})
  create_instance_with_http_info(instance, opts)
  nil
end

#create_instance_with_http_info(instance, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Create p2p provider instances Create p2p provider instances

Parameters:

  • instance

    The JSON object of instance.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/harbor2_client/api/preheat_api.rb', line 39

def create_instance_with_http_info(instance, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.create_instance ...'
  end
  # verify the required parameter 'instance' is set
  if @api_client.config.client_side_validation && instance.nil?
    fail ArgumentError, "Missing the required parameter 'instance' when calling PreheatApi.create_instance"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.create_instance, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/p2p/preheat/instances'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(instance)
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#create_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_policy(project_name, policy, opts = {}) ⇒ nil

Create a preheat policy under a project Create a preheat policy under a project

Parameters:

  • project_name

    The name of the project

  • policy

    The policy schema info

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


89
90
91
92
# File 'lib/harbor2_client/api/preheat_api.rb', line 89

def create_policy(project_name, policy, opts = {})
  create_policy_with_http_info(project_name, policy, opts)
  nil
end

#create_policy_with_http_info(project_name, policy, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Create a preheat policy under a project Create a preheat policy under a project

Parameters:

  • project_name

    The name of the project

  • policy

    The policy schema info

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/harbor2_client/api/preheat_api.rb', line 101

def create_policy_with_http_info(project_name, policy, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.create_policy ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.create_policy"
  end
  # verify the required parameter 'policy' is set
  if @api_client.config.client_side_validation && policy.nil?
    fail ArgumentError, "Missing the required parameter 'policy' when calling PreheatApi.create_policy"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.create_policy, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/preheat/policies'.sub('{' + 'project_name' + '}', project_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(policy)
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#create_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_instance(preheat_instance_name, opts = {}) ⇒ nil

Delete the specified P2P provider instance Delete the specified P2P provider instance

Parameters:

  • preheat_instance_name

    Instance Name

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


154
155
156
157
# File 'lib/harbor2_client/api/preheat_api.rb', line 154

def delete_instance(preheat_instance_name, opts = {})
  delete_instance_with_http_info(preheat_instance_name, opts)
  nil
end

#delete_instance_with_http_info(preheat_instance_name, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete the specified P2P provider instance Delete the specified P2P provider instance

Parameters:

  • preheat_instance_name

    Instance Name

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/harbor2_client/api/preheat_api.rb', line 165

def delete_instance_with_http_info(preheat_instance_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.delete_instance ...'
  end
  # verify the required parameter 'preheat_instance_name' is set
  if @api_client.config.client_side_validation && preheat_instance_name.nil?
    fail ArgumentError, "Missing the required parameter 'preheat_instance_name' when calling PreheatApi.delete_instance"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.delete_instance, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/p2p/preheat/instances/{preheat_instance_name}'.sub('{' + 'preheat_instance_name' + '}', preheat_instance_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#delete_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_policy(project_name, preheat_policy_name, opts = {}) ⇒ nil

Delete a preheat policy Delete a preheat policy

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


215
216
217
218
# File 'lib/harbor2_client/api/preheat_api.rb', line 215

def delete_policy(project_name, preheat_policy_name, opts = {})
  delete_policy_with_http_info(project_name, preheat_policy_name, opts)
  nil
end

#delete_policy_with_http_info(project_name, preheat_policy_name, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a preheat policy Delete a preheat policy

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/harbor2_client/api/preheat_api.rb', line 227

def delete_policy_with_http_info(project_name, preheat_policy_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.delete_policy ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.delete_policy"
  end
  # verify the required parameter 'preheat_policy_name' is set
  if @api_client.config.client_side_validation && preheat_policy_name.nil?
    fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.delete_policy"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.delete_policy, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#delete_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_execution(project_name, preheat_policy_name, execution_id, opts = {}) ⇒ Execution

Get a execution detail by id Get a execution detail by id

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • execution_id

    Execution ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:



282
283
284
285
# File 'lib/harbor2_client/api/preheat_api.rb', line 282

def get_execution(project_name, preheat_policy_name, execution_id, opts = {})
  data, _status_code, _headers = get_execution_with_http_info(project_name, preheat_policy_name, execution_id, opts)
  data
end

#get_execution_with_http_info(project_name, preheat_policy_name, execution_id, opts = {}) ⇒ Array<(Execution, Fixnum, Hash)>

Get a execution detail by id Get a execution detail by id

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • execution_id

    Execution ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(Execution, Fixnum, Hash)>)

    Execution data, response status code and response headers



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/harbor2_client/api/preheat_api.rb', line 295

def get_execution_with_http_info(project_name, preheat_policy_name, execution_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.get_execution ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.get_execution"
  end
  # verify the required parameter 'preheat_policy_name' is set
  if @api_client.config.client_side_validation && preheat_policy_name.nil?
    fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.get_execution"
  end
  # verify the required parameter 'execution_id' is set
  if @api_client.config.client_side_validation && execution_id.nil?
    fail ArgumentError, "Missing the required parameter 'execution_id' when calling PreheatApi.get_execution"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.get_execution, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s).sub('{' + 'execution_id' + '}', execution_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Execution')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#get_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_instance(preheat_instance_name, opts = {}) ⇒ Instance

Get a P2P provider instance Get a P2P provider instance

Parameters:

  • preheat_instance_name

    Instance Name

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:



353
354
355
356
# File 'lib/harbor2_client/api/preheat_api.rb', line 353

def get_instance(preheat_instance_name, opts = {})
  data, _status_code, _headers = get_instance_with_http_info(preheat_instance_name, opts)
  data
end

#get_instance_with_http_info(preheat_instance_name, opts = {}) ⇒ Array<(Instance, Fixnum, Hash)>

Get a P2P provider instance Get a P2P provider instance

Parameters:

  • preheat_instance_name

    Instance Name

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(Instance, Fixnum, Hash)>)

    Instance data, response status code and response headers



364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
# File 'lib/harbor2_client/api/preheat_api.rb', line 364

def get_instance_with_http_info(preheat_instance_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.get_instance ...'
  end
  # verify the required parameter 'preheat_instance_name' is set
  if @api_client.config.client_side_validation && preheat_instance_name.nil?
    fail ArgumentError, "Missing the required parameter 'preheat_instance_name' when calling PreheatApi.get_instance"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.get_instance, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/p2p/preheat/instances/{preheat_instance_name}'.sub('{' + 'preheat_instance_name' + '}', preheat_instance_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Instance')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#get_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_policy(project_name, preheat_policy_name, opts = {}) ⇒ PreheatPolicy

Get a preheat policy Get a preheat policy

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:



415
416
417
418
# File 'lib/harbor2_client/api/preheat_api.rb', line 415

def get_policy(project_name, preheat_policy_name, opts = {})
  data, _status_code, _headers = get_policy_with_http_info(project_name, preheat_policy_name, opts)
  data
end

#get_policy_with_http_info(project_name, preheat_policy_name, opts = {}) ⇒ Array<(PreheatPolicy, Fixnum, Hash)>

Get a preheat policy Get a preheat policy

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(PreheatPolicy, Fixnum, Hash)>)

    PreheatPolicy data, response status code and response headers



427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/harbor2_client/api/preheat_api.rb', line 427

def get_policy_with_http_info(project_name, preheat_policy_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.get_policy ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.get_policy"
  end
  # verify the required parameter 'preheat_policy_name' is set
  if @api_client.config.client_side_validation && preheat_policy_name.nil?
    fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.get_policy"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.get_policy, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PreheatPolicy')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#get_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_preheat_log(project_name, preheat_policy_name, execution_id, task_id, opts = {}) ⇒ String

Get the log text stream of the specified task for the given execution Get the log text stream of the specified task for the given execution

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • execution_id

    Execution ID

  • task_id

    Task ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (String)


484
485
486
487
# File 'lib/harbor2_client/api/preheat_api.rb', line 484

def get_preheat_log(project_name, preheat_policy_name, execution_id, task_id, opts = {})
  data, _status_code, _headers = get_preheat_log_with_http_info(project_name, preheat_policy_name, execution_id, task_id, opts)
  data
end

#get_preheat_log_with_http_info(project_name, preheat_policy_name, execution_id, task_id, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Get the log text stream of the specified task for the given execution Get the log text stream of the specified task for the given execution

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • execution_id

    Execution ID

  • task_id

    Task ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
# File 'lib/harbor2_client/api/preheat_api.rb', line 498

def get_preheat_log_with_http_info(project_name, preheat_policy_name, execution_id, task_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.get_preheat_log ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.get_preheat_log"
  end
  # verify the required parameter 'preheat_policy_name' is set
  if @api_client.config.client_side_validation && preheat_policy_name.nil?
    fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.get_preheat_log"
  end
  # verify the required parameter 'execution_id' is set
  if @api_client.config.client_side_validation && execution_id.nil?
    fail ArgumentError, "Missing the required parameter 'execution_id' when calling PreheatApi.get_preheat_log"
  end
  # verify the required parameter 'task_id' is set
  if @api_client.config.client_side_validation && task_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_id' when calling PreheatApi.get_preheat_log"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.get_preheat_log, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasks/{task_id}/logs'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s).sub('{' + 'execution_id' + '}', execution_id.to_s).sub('{' + 'task_id' + '}', task_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#get_preheat_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_executions(project_name, preheat_policy_name, opts = {}) ⇒ Array<Execution>

List executions for the given policy List executions for the given policy

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :page (Integer)

    The page number (default to 1)

  • :page_size (Integer)

    The size of per page (default to 10)

  • :q (String)

    Query string to query resources. Supported query patterns are &quot;exact match(k&#x3D;v)&quot;, &quot;fuzzy match(k&#x3D;~v)&quot;, &quot;range(k&#x3D;)&quot;, &quot;list with union releationship(k&#x3D;v2 v3)&quot; and &quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))&quot;. The value of range and list can be string(enclosed by &quot; or &#39;), integer or time(in format &quot;2020-04-09 02:36:00&quot;). All of these query patterns should be put in the query string &quot;q&#x3D;xxx&quot; and splitted by &quot;,&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;

  • :sort (String)

    Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with &quot;sort&#x3D;field1,-field2&quot;

Returns:



565
566
567
568
# File 'lib/harbor2_client/api/preheat_api.rb', line 565

def list_executions(project_name, preheat_policy_name, opts = {})
  data, _status_code, _headers = list_executions_with_http_info(project_name, preheat_policy_name, opts)
  data
end

#list_executions_with_http_info(project_name, preheat_policy_name, opts = {}) ⇒ Array<(Array<Execution>, Fixnum, Hash)>

List executions for the given policy List executions for the given policy

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :page (Integer)

    The page number

  • :page_size (Integer)

    The size of per page

  • :q (String)

    Query string to query resources. Supported query patterns are &quot;exact match(k&#x3D;v)&quot;, &quot;fuzzy match(k&#x3D;~v)&quot;, &quot;range(k&#x3D;)&quot;, &quot;list with union releationship(k&#x3D;v2 v3)&quot; and &quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))&quot;. The value of range and list can be string(enclosed by &quot; or &#39;), integer or time(in format &quot;2020-04-09 02:36:00&quot;). All of these query patterns should be put in the query string &quot;q&#x3D;xxx&quot; and splitted by &quot;,&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;

  • :sort (String)

    Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with &quot;sort&#x3D;field1,-field2&quot;

Returns:

  • (Array<(Array<Execution>, Fixnum, Hash)>)

    Array<Execution> data, response status code and response headers



581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
# File 'lib/harbor2_client/api/preheat_api.rb', line 581

def list_executions_with_http_info(project_name, preheat_policy_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.list_executions ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.list_executions"
  end
  # verify the required parameter 'preheat_policy_name' is set
  if @api_client.config.client_side_validation && preheat_policy_name.nil?
    fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.list_executions"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.list_executions, the character length must be great than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PreheatApi.list_executions, must be smaller than or equal to 100.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s)

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Execution>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#list_executions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_instances(opts = {}) ⇒ Array<Instance>

List P2P provider instances List P2P provider instances

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :page (Integer)

    The page number (default to 1)

  • :page_size (Integer)

    The size of per page (default to 10)

  • :q (String)

    Query string to query resources. Supported query patterns are &quot;exact match(k&#x3D;v)&quot;, &quot;fuzzy match(k&#x3D;~v)&quot;, &quot;range(k&#x3D;)&quot;, &quot;list with union releationship(k&#x3D;v2 v3)&quot; and &quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))&quot;. The value of range and list can be string(enclosed by &quot; or &#39;), integer or time(in format &quot;2020-04-09 02:36:00&quot;). All of these query patterns should be put in the query string &quot;q&#x3D;xxx&quot; and splitted by &quot;,&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;

  • :sort (String)

    Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with &quot;sort&#x3D;field1,-field2&quot;

Returns:



646
647
648
649
# File 'lib/harbor2_client/api/preheat_api.rb', line 646

def list_instances(opts = {})
  data, _status_code, _headers = list_instances_with_http_info(opts)
  data
end

#list_instances_with_http_info(opts = {}) ⇒ Array<(Array<Instance>, Fixnum, Hash)>

List P2P provider instances List P2P provider instances

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :page (Integer)

    The page number

  • :page_size (Integer)

    The size of per page

  • :q (String)

    Query string to query resources. Supported query patterns are &quot;exact match(k&#x3D;v)&quot;, &quot;fuzzy match(k&#x3D;~v)&quot;, &quot;range(k&#x3D;)&quot;, &quot;list with union releationship(k&#x3D;v2 v3)&quot; and &quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))&quot;. The value of range and list can be string(enclosed by &quot; or &#39;), integer or time(in format &quot;2020-04-09 02:36:00&quot;). All of these query patterns should be put in the query string &quot;q&#x3D;xxx&quot; and splitted by &quot;,&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;

  • :sort (String)

    Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with &quot;sort&#x3D;field1,-field2&quot;

Returns:

  • (Array<(Array<Instance>, Fixnum, Hash)>)

    Array<Instance> data, response status code and response headers



660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
# File 'lib/harbor2_client/api/preheat_api.rb', line 660

def list_instances_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.list_instances ...'
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.list_instances, the character length must be great than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PreheatApi.list_instances, must be smaller than or equal to 100.'
  end

  # resource path
  local_var_path = '/p2p/preheat/instances'

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Instance>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#list_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_policies(project_name, opts = {}) ⇒ Array<PreheatPolicy>

List preheat policies List preheat policies

Parameters:

  • project_name

    The name of the project

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :page (Integer)

    The page number (default to 1)

  • :page_size (Integer)

    The size of per page (default to 10)

  • :q (String)

    Query string to query resources. Supported query patterns are &quot;exact match(k&#x3D;v)&quot;, &quot;fuzzy match(k&#x3D;~v)&quot;, &quot;range(k&#x3D;)&quot;, &quot;list with union releationship(k&#x3D;v2 v3)&quot; and &quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))&quot;. The value of range and list can be string(enclosed by &quot; or &#39;), integer or time(in format &quot;2020-04-09 02:36:00&quot;). All of these query patterns should be put in the query string &quot;q&#x3D;xxx&quot; and splitted by &quot;,&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;

  • :sort (String)

    Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with &quot;sort&#x3D;field1,-field2&quot;

Returns:



718
719
720
721
# File 'lib/harbor2_client/api/preheat_api.rb', line 718

def list_policies(project_name, opts = {})
  data, _status_code, _headers = list_policies_with_http_info(project_name, opts)
  data
end

#list_policies_with_http_info(project_name, opts = {}) ⇒ Array<(Array<PreheatPolicy>, Fixnum, Hash)>

List preheat policies List preheat policies

Parameters:

  • project_name

    The name of the project

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :page (Integer)

    The page number

  • :page_size (Integer)

    The size of per page

  • :q (String)

    Query string to query resources. Supported query patterns are &quot;exact match(k&#x3D;v)&quot;, &quot;fuzzy match(k&#x3D;~v)&quot;, &quot;range(k&#x3D;)&quot;, &quot;list with union releationship(k&#x3D;v2 v3)&quot; and &quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))&quot;. The value of range and list can be string(enclosed by &quot; or &#39;), integer or time(in format &quot;2020-04-09 02:36:00&quot;). All of these query patterns should be put in the query string &quot;q&#x3D;xxx&quot; and splitted by &quot;,&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;

  • :sort (String)

    Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with &quot;sort&#x3D;field1,-field2&quot;

Returns:

  • (Array<(Array<PreheatPolicy>, Fixnum, Hash)>)

    Array<PreheatPolicy> data, response status code and response headers



733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
# File 'lib/harbor2_client/api/preheat_api.rb', line 733

def list_policies_with_http_info(project_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.list_policies ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.list_policies"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.list_policies, the character length must be great than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PreheatApi.list_policies, must be smaller than or equal to 100.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/preheat/policies'.sub('{' + 'project_name' + '}', project_name.to_s)

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<PreheatPolicy>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#list_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_providers(opts = {}) ⇒ Array<Metadata>

List P2P providers List P2P providers

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:



790
791
792
793
# File 'lib/harbor2_client/api/preheat_api.rb', line 790

def list_providers(opts = {})
  data, _status_code, _headers = list_providers_with_http_info(opts)
  data
end

#list_providers_under_project(project_name, opts = {}) ⇒ Array<ProviderUnderProject>

Get all providers at project level Get all providers at project level

Parameters:

  • project_name

    The name of the project

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:



846
847
848
849
# File 'lib/harbor2_client/api/preheat_api.rb', line 846

def list_providers_under_project(project_name, opts = {})
  data, _status_code, _headers = list_providers_under_project_with_http_info(project_name, opts)
  data
end

#list_providers_under_project_with_http_info(project_name, opts = {}) ⇒ Array<(Array<ProviderUnderProject>, Fixnum, Hash)>

Get all providers at project level Get all providers at project level

Parameters:

  • project_name

    The name of the project

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(Array<ProviderUnderProject>, Fixnum, Hash)>)

    Array<ProviderUnderProject> data, response status code and response headers



857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
# File 'lib/harbor2_client/api/preheat_api.rb', line 857

def list_providers_under_project_with_http_info(project_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.list_providers_under_project ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.list_providers_under_project"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.list_providers_under_project, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/preheat/providers'.sub('{' + 'project_name' + '}', project_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<ProviderUnderProject>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#list_providers_under_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_providers_with_http_info(opts = {}) ⇒ Array<(Array<Metadata>, Fixnum, Hash)>

List P2P providers List P2P providers

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(Array<Metadata>, Fixnum, Hash)>)

    Array<Metadata> data, response status code and response headers



800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
# File 'lib/harbor2_client/api/preheat_api.rb', line 800

def list_providers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.list_providers ...'
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.list_providers, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/p2p/preheat/providers'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Metadata>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#list_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_tasks(project_name, preheat_policy_name, execution_id, opts = {}) ⇒ Array<Task>

List all the related tasks for the given execution List all the related tasks for the given execution

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • execution_id

    Execution ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :page (Integer)

    The page number (default to 1)

  • :page_size (Integer)

    The size of per page (default to 10)

  • :q (String)

    Query string to query resources. Supported query patterns are &quot;exact match(k&#x3D;v)&quot;, &quot;fuzzy match(k&#x3D;~v)&quot;, &quot;range(k&#x3D;)&quot;, &quot;list with union releationship(k&#x3D;v2 v3)&quot; and &quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))&quot;. The value of range and list can be string(enclosed by &quot; or &#39;), integer or time(in format &quot;2020-04-09 02:36:00&quot;). All of these query patterns should be put in the query string &quot;q&#x3D;xxx&quot; and splitted by &quot;,&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;

  • :sort (String)

    Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with &quot;sort&#x3D;field1,-field2&quot;

Returns:



913
914
915
916
# File 'lib/harbor2_client/api/preheat_api.rb', line 913

def list_tasks(project_name, preheat_policy_name, execution_id, opts = {})
  data, _status_code, _headers = list_tasks_with_http_info(project_name, preheat_policy_name, execution_id, opts)
  data
end

#list_tasks_with_http_info(project_name, preheat_policy_name, execution_id, opts = {}) ⇒ Array<(Array<Task>, Fixnum, Hash)>

List all the related tasks for the given execution List all the related tasks for the given execution

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • execution_id

    Execution ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

  • :page (Integer)

    The page number

  • :page_size (Integer)

    The size of per page

  • :q (String)

    Query string to query resources. Supported query patterns are &quot;exact match(k&#x3D;v)&quot;, &quot;fuzzy match(k&#x3D;~v)&quot;, &quot;range(k&#x3D;)&quot;, &quot;list with union releationship(k&#x3D;v2 v3)&quot; and &quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))&quot;. The value of range and list can be string(enclosed by &quot; or &#39;), integer or time(in format &quot;2020-04-09 02:36:00&quot;). All of these query patterns should be put in the query string &quot;q&#x3D;xxx&quot; and splitted by &quot;,&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;

  • :sort (String)

    Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with &quot;sort&#x3D;field1,-field2&quot;

Returns:

  • (Array<(Array<Task>, Fixnum, Hash)>)

    Array<Task> data, response status code and response headers



930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
# File 'lib/harbor2_client/api/preheat_api.rb', line 930

def list_tasks_with_http_info(project_name, preheat_policy_name, execution_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.list_tasks ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.list_tasks"
  end
  # verify the required parameter 'preheat_policy_name' is set
  if @api_client.config.client_side_validation && preheat_policy_name.nil?
    fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.list_tasks"
  end
  # verify the required parameter 'execution_id' is set
  if @api_client.config.client_side_validation && execution_id.nil?
    fail ArgumentError, "Missing the required parameter 'execution_id' when calling PreheatApi.list_tasks"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.list_tasks, the character length must be great than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PreheatApi.list_tasks, must be smaller than or equal to 100.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasks'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s).sub('{' + 'execution_id' + '}', execution_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Task>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#list_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#manual_preheat(project_name, preheat_policy_name, policy, opts = {}) ⇒ nil

Manual preheat Manual preheat

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • policy

    The policy schema info

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


998
999
1000
1001
# File 'lib/harbor2_client/api/preheat_api.rb', line 998

def manual_preheat(project_name, preheat_policy_name, policy, opts = {})
  manual_preheat_with_http_info(project_name, preheat_policy_name, policy, opts)
  nil
end

#manual_preheat_with_http_info(project_name, preheat_policy_name, policy, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Manual preheat Manual preheat

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • policy

    The policy schema info

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
# File 'lib/harbor2_client/api/preheat_api.rb', line 1011

def manual_preheat_with_http_info(project_name, preheat_policy_name, policy, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.manual_preheat ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.manual_preheat"
  end
  # verify the required parameter 'preheat_policy_name' is set
  if @api_client.config.client_side_validation && preheat_policy_name.nil?
    fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.manual_preheat"
  end
  # verify the required parameter 'policy' is set
  if @api_client.config.client_side_validation && policy.nil?
    fail ArgumentError, "Missing the required parameter 'policy' when calling PreheatApi.manual_preheat"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.manual_preheat, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(policy)
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#manual_preheat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ping_instances(instance, opts = {}) ⇒ nil

Ping status of a instance. This endpoint checks status of a instance, the instance can be given by ID or Endpoint URL (together with credential)

Parameters:

  • instance

    The JSON object of instance.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


1068
1069
1070
1071
# File 'lib/harbor2_client/api/preheat_api.rb', line 1068

def ping_instances(instance, opts = {})
  ping_instances_with_http_info(instance, opts)
  nil
end

#ping_instances_with_http_info(instance, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Ping status of a instance. This endpoint checks status of a instance, the instance can be given by ID or Endpoint URL (together with credential)

Parameters:

  • instance

    The JSON object of instance.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
# File 'lib/harbor2_client/api/preheat_api.rb', line 1079

def ping_instances_with_http_info(instance, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.ping_instances ...'
  end
  # verify the required parameter 'instance' is set
  if @api_client.config.client_side_validation && instance.nil?
    fail ArgumentError, "Missing the required parameter 'instance' when calling PreheatApi.ping_instances"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.ping_instances, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/p2p/preheat/instances/ping'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(instance)
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#ping_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stop_execution(project_name, preheat_policy_name, execution_id, execution, opts = {}) ⇒ nil

Stop a execution Stop a execution

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • execution_id

    Execution ID

  • execution

    The data of execution

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


1131
1132
1133
1134
# File 'lib/harbor2_client/api/preheat_api.rb', line 1131

def stop_execution(project_name, preheat_policy_name, execution_id, execution, opts = {})
  stop_execution_with_http_info(project_name, preheat_policy_name, execution_id, execution, opts)
  nil
end

#stop_execution_with_http_info(project_name, preheat_policy_name, execution_id, execution, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Stop a execution Stop a execution

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • execution_id

    Execution ID

  • execution

    The data of execution

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
# File 'lib/harbor2_client/api/preheat_api.rb', line 1145

def stop_execution_with_http_info(project_name, preheat_policy_name, execution_id, execution, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.stop_execution ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.stop_execution"
  end
  # verify the required parameter 'preheat_policy_name' is set
  if @api_client.config.client_side_validation && preheat_policy_name.nil?
    fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.stop_execution"
  end
  # verify the required parameter 'execution_id' is set
  if @api_client.config.client_side_validation && execution_id.nil?
    fail ArgumentError, "Missing the required parameter 'execution_id' when calling PreheatApi.stop_execution"
  end
  # verify the required parameter 'execution' is set
  if @api_client.config.client_side_validation && execution.nil?
    fail ArgumentError, "Missing the required parameter 'execution' when calling PreheatApi.stop_execution"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.stop_execution, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s).sub('{' + 'execution_id' + '}', execution_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(execution)
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#stop_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_instance(preheat_instance_name, instance, opts = {}) ⇒ nil

Update the specified P2P provider instance Update the specified P2P provider instance

Parameters:

  • preheat_instance_name

    Instance Name

  • instance

    The instance to update

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


1207
1208
1209
1210
# File 'lib/harbor2_client/api/preheat_api.rb', line 1207

def update_instance(preheat_instance_name, instance, opts = {})
  update_instance_with_http_info(preheat_instance_name, instance, opts)
  nil
end

#update_instance_with_http_info(preheat_instance_name, instance, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update the specified P2P provider instance Update the specified P2P provider instance

Parameters:

  • preheat_instance_name

    Instance Name

  • instance

    The instance to update

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
# File 'lib/harbor2_client/api/preheat_api.rb', line 1219

def update_instance_with_http_info(preheat_instance_name, instance, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.update_instance ...'
  end
  # verify the required parameter 'preheat_instance_name' is set
  if @api_client.config.client_side_validation && preheat_instance_name.nil?
    fail ArgumentError, "Missing the required parameter 'preheat_instance_name' when calling PreheatApi.update_instance"
  end
  # verify the required parameter 'instance' is set
  if @api_client.config.client_side_validation && instance.nil?
    fail ArgumentError, "Missing the required parameter 'instance' when calling PreheatApi.update_instance"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.update_instance, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/p2p/preheat/instances/{preheat_instance_name}'.sub('{' + 'preheat_instance_name' + '}', preheat_instance_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(instance)
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#update_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_policy(project_name, preheat_policy_name, policy, opts = {}) ⇒ nil

Update preheat policy Update preheat policy

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • policy

    The policy schema info

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (nil)


1274
1275
1276
1277
# File 'lib/harbor2_client/api/preheat_api.rb', line 1274

def update_policy(project_name, preheat_policy_name, policy, opts = {})
  update_policy_with_http_info(project_name, preheat_policy_name, policy, opts)
  nil
end

#update_policy_with_http_info(project_name, preheat_policy_name, policy, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update preheat policy Update preheat policy

Parameters:

  • project_name

    The name of the project

  • preheat_policy_name

    Preheat Policy Name

  • policy

    The policy schema info

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_request_id (String)

    An unique ID for the request

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
# File 'lib/harbor2_client/api/preheat_api.rb', line 1287

def update_policy_with_http_info(project_name, preheat_policy_name, policy, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PreheatApi.update_policy ...'
  end
  # verify the required parameter 'project_name' is set
  if @api_client.config.client_side_validation && project_name.nil?
    fail ArgumentError, "Missing the required parameter 'project_name' when calling PreheatApi.update_policy"
  end
  # verify the required parameter 'preheat_policy_name' is set
  if @api_client.config.client_side_validation && preheat_policy_name.nil?
    fail ArgumentError, "Missing the required parameter 'preheat_policy_name' when calling PreheatApi.update_policy"
  end
  # verify the required parameter 'policy' is set
  if @api_client.config.client_side_validation && policy.nil?
    fail ArgumentError, "Missing the required parameter 'policy' when calling PreheatApi.update_policy"
  end
  if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling PreheatApi.update_policy, the character length must be great than or equal to 1.'
  end

  # resource path
  local_var_path = '/projects/{project_name}/preheat/policies/{preheat_policy_name}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'preheat_policy_name' + '}', preheat_policy_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(policy)
  auth_names = ['basic']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PreheatApi#update_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end