class SwaggerClient::PreheatApi
Attributes
Public Class Methods
# File lib/harbor_swagger_client/api/preheat_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Create p2p provider instances Create p2p provider instances @param instance The JSON object of instance. @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [nil]
# File lib/harbor_swagger_client/api/preheat_api.rb, line 28 def create_instance(instance, opts = {}) create_instance_with_http_info(instance, opts) nil end
Create p2p provider instances Create p2p provider instances @param instance The JSON object of instance. @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor_swagger_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 a preheat policy under a project Create a preheat policy under a project @param project_name The name of the project @param policy The policy schema info @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [nil]
# File lib/harbor_swagger_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 a preheat policy under a project Create a preheat policy under a project @param project_name The name of the project @param policy The policy schema info @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor_swagger_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 the specified P2P provider instance Delete the specified P2P provider instance @param preheat_instance_name Instance
Name @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [nil]
# File lib/harbor_swagger_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 the specified P2P provider instance Delete the specified P2P provider instance @param preheat_instance_name Instance
Name @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor_swagger_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 a preheat policy Delete a preheat policy @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [nil]
# File lib/harbor_swagger_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 a preheat policy Delete a preheat policy @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor_swagger_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 a execution detail by id Get a execution detail by id @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param execution_id Execution
ID @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Execution]
# File lib/harbor_swagger_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 a execution detail by id Get a execution detail by id @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param execution_id Execution
ID @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(Execution
, Fixnum, Hash)>] Execution
data, response status code and response headers
# File lib/harbor_swagger_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 a P2P provider instance Get a P2P provider instance @param preheat_instance_name Instance
Name @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Instance]
# File lib/harbor_swagger_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 a P2P provider instance Get a P2P provider instance @param preheat_instance_name Instance
Name @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(Instance
, Fixnum, Hash)>] Instance
data, response status code and response headers
# File lib/harbor_swagger_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 a preheat policy Get a preheat policy @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [PreheatPolicy]
# File lib/harbor_swagger_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 a preheat policy Get a preheat policy @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(PreheatPolicy
, Fixnum, Hash)>] PreheatPolicy
data, response status code and response headers
# File lib/harbor_swagger_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 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 @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param execution_id Execution
ID @param task_id Task
ID @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [String]
# File lib/harbor_swagger_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 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 @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param execution_id Execution
ID @param task_id Task
ID @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
# File lib/harbor_swagger_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 for the given policy List executions for the given policy @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @option opts [Integer] :page The page number (default to 1) @option opts [Integer] :page_size The size of per page (default to 10) @option opts [String] :q Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3= @return [Array<Execution>]
# File lib/harbor_swagger_client/api/preheat_api.rb, line 564 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 for the given policy List executions for the given policy @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @option opts [Integer] :page The page number @option opts [Integer] :page_size The size of per page @option opts [String] :q Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3= @return [Array<(Array<Execution>, Fixnum, Hash)>] Array<Execution> data, response status code and response headers
# File lib/harbor_swagger_client/api/preheat_api.rb, line 579 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? # 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 P2P provider instances List P2P provider instances @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @option opts [Integer] :page The page number (default to 1) @option opts [Integer] :page_size The size of per page (default to 10) @option opts [String] :q Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3= @return [Array<Instance>]
# File lib/harbor_swagger_client/api/preheat_api.rb, line 642 def list_instances(opts = {}) data, _status_code, _headers = list_instances_with_http_info(opts) data end
List P2P provider instances List P2P provider instances @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @option opts [Integer] :page The page number @option opts [Integer] :page_size The size of per page @option opts [String] :q Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3= @return [Array<(Array<Instance>, Fixnum, Hash)>] Array<Instance> data, response status code and response headers
# File lib/harbor_swagger_client/api/preheat_api.rb, line 655 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? # 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 preheat policies List preheat policies @param project_name The name of the project @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @option opts [Integer] :page The page number (default to 1) @option opts [Integer] :page_size The size of per page (default to 10) @option opts [String] :q Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3= @return [Array<PreheatPolicy>]
# File lib/harbor_swagger_client/api/preheat_api.rb, line 711 def list_policies(project_name, opts = {}) data, _status_code, _headers = list_policies_with_http_info(project_name, opts) data end
List preheat policies List preheat policies @param project_name The name of the project @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @option opts [Integer] :page The page number @option opts [Integer] :page_size The size of per page @option opts [String] :q Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3= @return [Array<(Array<PreheatPolicy>, Fixnum, Hash)>] Array<PreheatPolicy> data, response status code and response headers
# File lib/harbor_swagger_client/api/preheat_api.rb, line 725 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? # 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 P2P providers List P2P providers @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<Metadata>]
# File lib/harbor_swagger_client/api/preheat_api.rb, line 781 def list_providers(opts = {}) data, _status_code, _headers = list_providers_with_http_info(opts) data end
Get all providers at project level Get all providers at project level @param project_name The name of the project @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<ProviderUnderProject>]
# File lib/harbor_swagger_client/api/preheat_api.rb, line 837 def list_providers_under_project(project_name, opts = {}) data, _status_code, _headers = list_providers_under_project_with_http_info(project_name, opts) data end
Get all providers at project level Get all providers at project level @param project_name The name of the project @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(Array<ProviderUnderProject>, Fixnum, Hash)>] Array<ProviderUnderProject> data, response status code and response headers
# File lib/harbor_swagger_client/api/preheat_api.rb, line 848 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 P2P providers List P2P providers @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(Array<Metadata>, Fixnum, Hash)>] Array<Metadata> data, response status code and response headers
# File lib/harbor_swagger_client/api/preheat_api.rb, line 791 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 all the related tasks for the given execution List all the related tasks for the given execution @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param execution_id Execution
ID @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @option opts [Integer] :page The page number (default to 1) @option opts [Integer] :page_size The size of per page (default to 10) @option opts [String] :q Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3= @return [Array<Task>]
# File lib/harbor_swagger_client/api/preheat_api.rb, line 903 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 all the related tasks for the given execution List all the related tasks for the given execution @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param execution_id Execution
ID @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @option opts [Integer] :page The page number @option opts [Integer] :page_size The size of per page @option opts [String] :q Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3= @return [Array<(Array<Task>, Fixnum, Hash)>] Array<Task> data, response status code and response headers
# File lib/harbor_swagger_client/api/preheat_api.rb, line 919 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? # 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 Manual preheat @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param policy The policy schema info @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [nil]
# File lib/harbor_swagger_client/api/preheat_api.rb, line 986 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 Manual preheat @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param policy The policy schema info @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor_swagger_client/api/preheat_api.rb, line 999 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 status of a instance. This endpoint checks status of a instance, the instance can be given by ID or Endpoint URL (together with credential) @param instance The JSON object of instance. @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [nil]
# File lib/harbor_swagger_client/api/preheat_api.rb, line 1056 def ping_instances(instance, opts = {}) ping_instances_with_http_info(instance, opts) nil end
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) @param instance The JSON object of instance. @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor_swagger_client/api/preheat_api.rb, line 1067 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 a execution Stop a execution @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param execution_id Execution
ID @param execution The data of execution @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [nil]
# File lib/harbor_swagger_client/api/preheat_api.rb, line 1119 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 a execution Stop a execution @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param execution_id Execution
ID @param execution The data of execution @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor_swagger_client/api/preheat_api.rb, line 1133 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 the specified P2P provider instance Update the specified P2P provider instance @param preheat_instance_name Instance
Name @param instance The instance to update @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [nil]
# File lib/harbor_swagger_client/api/preheat_api.rb, line 1195 def update_instance(preheat_instance_name, instance, opts = {}) update_instance_with_http_info(preheat_instance_name, instance, opts) nil end
Update the specified P2P provider instance Update the specified P2P provider instance @param preheat_instance_name Instance
Name @param instance The instance to update @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor_swagger_client/api/preheat_api.rb, line 1207 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 preheat policy Update preheat policy @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param policy The policy schema info @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [nil]
# File lib/harbor_swagger_client/api/preheat_api.rb, line 1262 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 preheat policy Update preheat policy @param project_name The name of the project @param preheat_policy_name Preheat Policy Name @param policy The policy schema info @param [Hash] opts the optional parameters @option opts [String] :x_request_id An unique ID for the request @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/harbor_swagger_client/api/preheat_api.rb, line 1275 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