class MockServer::ControlApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/mockserver-client/api/control_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

bind_put(ports, opts = {}) click to toggle source

bind additional listening ports only supported on Netty version @param ports list of ports to bind to, where 0 indicates dynamically bind to any available port @param [Hash] opts the optional parameters @return [Ports]

# File lib/mockserver-client/api/control_api.rb, line 27
def bind_put(ports, opts = {})
  data, _status_code, _headers = bind_put_with_http_info(ports, opts)
  data
end
bind_put_with_http_info(ports, opts = {}) click to toggle source

bind additional listening ports only supported on Netty version @param ports list of ports to bind to, where 0 indicates dynamically bind to any available port @param [Hash] opts the optional parameters @return [Array<(Ports, Fixnum, Hash)>] Ports data, response status code and response headers

# File lib/mockserver-client/api/control_api.rb, line 37
def bind_put_with_http_info(ports, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ControlApi.bind_put ...'
  end
  # verify the required parameter 'ports' is set
  if @api_client.config.client_side_validation && ports.nil?
    fail ArgumentError, "Missing the required parameter 'ports' when calling ControlApi.bind_put"
  end
  # resource path
  local_var_path = '/bind'

  # 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'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(ports)
  auth_names = []
  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,
    :return_type => 'Ports')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ControlApi#bind_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
clear_put(opts = {}) click to toggle source

clears expectations and recorded requests that match the request matcher @param [Hash] opts the optional parameters @option opts [HttpRequest] :http_request request used to match expectations and recored requests to clear @return [nil]

# File lib/mockserver-client/api/control_api.rb, line 81
def clear_put(opts = {})
  clear_put_with_http_info(opts)
  nil
end
clear_put_with_http_info(opts = {}) click to toggle source

clears expectations and recorded requests that match the request matcher @param [Hash] opts the optional parameters @option opts [HttpRequest] :http_request request used to match expectations and recored requests to clear @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/mockserver-client/api/control_api.rb, line 90
def clear_put_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ControlApi.clear_put ...'
  end
  # resource path
  local_var_path = '/clear'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'http_request'])
  auth_names = []
  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: ControlApi#clear_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
reset_put(opts = {}) click to toggle source

clears all expectations and recorded requests @param [Hash] opts the optional parameters @return [nil]

# File lib/mockserver-client/api/control_api.rb, line 126
def reset_put(opts = {})
  reset_put_with_http_info(opts)
  nil
end
reset_put_with_http_info(opts = {}) click to toggle source

clears all expectations and recorded requests @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/mockserver-client/api/control_api.rb, line 134
def reset_put_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ControlApi.reset_put ...'
  end
  # resource path
  local_var_path = '/reset'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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: ControlApi#reset_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
retrieve_put(opts = {}) click to toggle source

retrieve recorded requests, active expectations, recorded expectations or log messages @param [Hash] opts the optional parameters @option opts [String] :format changes response format, default if not specificed is "json&quot;, supported values are "java&quot;, "json&quot; @option opts [String] :type specifies the type of object that is retrieve, default if not specified is "requests&quot;, supported values are "logs&quot;, "requests&quot;, "recorded_expectations&quot;, "active_expectations&quot; @option opts [HttpRequest] :http_request request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages @return [Object]

# File lib/mockserver-client/api/control_api.rb, line 171
def retrieve_put(opts = {})
  data, _status_code, _headers = retrieve_put_with_http_info(opts)
  data
end
retrieve_put_with_http_info(opts = {}) click to toggle source

retrieve recorded requests, active expectations, recorded expectations or log messages @param [Hash] opts the optional parameters @option opts [String] :format changes response format, default if not specificed is "json&quot;, supported values are "java&quot;, "json&quot; @option opts [String] :type specifies the type of object that is retrieve, default if not specified is "requests&quot;, supported values are "logs&quot;, "requests&quot;, "recorded_expectations&quot;, "active_expectations&quot; @option opts [HttpRequest] :http_request request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/mockserver-client/api/control_api.rb, line 182
def retrieve_put_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ControlApi.retrieve_put ...'
  end
  if @api_client.config.client_side_validation && opts[:'format'] && !['java', 'json'].include?(opts[:'format'])
    fail ArgumentError, 'invalid value for "format", must be one of java, json'
  end
  if @api_client.config.client_side_validation && opts[:'type'] && !['logs', 'requests', 'recorded_expectations', 'active_expectations'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of logs, requests, recorded_expectations, active_expectations'
  end
  # resource path
  local_var_path = '/retrieve'

  # query parameters
  query_params = {}
  query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/java', 'text/plain'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'http_request'])
  auth_names = []
  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,
    :return_type => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ControlApi#retrieve_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
status_put(opts = {}) click to toggle source

return listening ports @param [Hash] opts the optional parameters @return [Ports]

# File lib/mockserver-client/api/control_api.rb, line 229
def status_put(opts = {})
  data, _status_code, _headers = status_put_with_http_info(opts)
  data
end
status_put_with_http_info(opts = {}) click to toggle source

return listening ports @param [Hash] opts the optional parameters @return [Array<(Ports, Fixnum, Hash)>] Ports data, response status code and response headers

# File lib/mockserver-client/api/control_api.rb, line 237
def status_put_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ControlApi.status_put ...'
  end
  # resource path
  local_var_path = '/status'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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,
    :return_type => 'Ports')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ControlApi#status_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
stop_put(opts = {}) click to toggle source

stop running process only supported on Netty version @param [Hash] opts the optional parameters @return [nil]

# File lib/mockserver-client/api/control_api.rb, line 275
def stop_put(opts = {})
  stop_put_with_http_info(opts)
  nil
end
stop_put_with_http_info(opts = {}) click to toggle source

stop running process only supported on Netty version @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/mockserver-client/api/control_api.rb, line 284
def stop_put_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ControlApi.stop_put ...'
  end
  # resource path
  local_var_path = '/stop'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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: ControlApi#stop_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end