class VSphereAutomation::VCenter::ServicesServiceApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/vsphere-automation-vcenter/api/services_service_api.rb, line 16
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

get(service, opts = {}) click to toggle source

Returns the state of a service. @param service identifier of the service whose state is being queried. @param [Hash] opts the optional parameters @return [VcenterServicesServiceResult|VapiStdErrorsErrorError|VapiStdErrorsNotFoundError|]

# File lib/vsphere-automation-vcenter/api/services_service_api.rb, line 23
def get(service, opts = {})
  data, _status_code, _headers = get_with_http_info(service, opts)
  data
end
get_with_http_info(service, opts = {}) click to toggle source

Returns the state of a service. @api private @param service identifier of the service whose state is being queried. @param [Hash] opts the optional parameters @return [Array<(VcenterServicesServiceResult|VapiStdErrorsErrorError|VapiStdErrorsNotFoundError|, Fixnum, Hash)>] data, response status code and response headers

# File lib/vsphere-automation-vcenter/api/services_service_api.rb, line 33
def get_with_http_info(service, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServicesServiceApi.get ...'
  end
  # verify the required parameter 'service' is set
  if @api_client.config.client_side_validation && service.nil?
    fail ArgumentError, "Missing the required parameter 'service' when calling ServicesServiceApi.get"
  end
  # resource path
  local_var_path = '/vcenter/services/{service}'.sub('{' + 'service' + '}', service.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'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  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 => {
      '200' => 'VCenter::VcenterServicesServiceResult',
      '400' => 'VCenter::VapiStdErrorsErrorError',
      '404' => 'VCenter::VapiStdErrorsNotFoundError',
    })
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServicesServiceApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_details(opts = {}) click to toggle source

Lists details of vCenter services. @param [Hash] opts the optional parameters @return [VcenterServicesServiceListDetailsResult|VapiStdErrorsErrorError|]

# File lib/vsphere-automation-vcenter/api/services_service_api.rb, line 77
def list_details(opts = {})
  data, _status_code, _headers = list_details_with_http_info(opts)
  data
end
list_details_with_http_info(opts = {}) click to toggle source

Lists details of vCenter services. @api private @param [Hash] opts the optional parameters @return [Array<(VcenterServicesServiceListDetailsResult|VapiStdErrorsErrorError|, Fixnum, Hash)>] data, response status code and response headers

# File lib/vsphere-automation-vcenter/api/services_service_api.rb, line 86
def list_details_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServicesServiceApi.list_details ...'
  end
  # resource path
  local_var_path = '/vcenter/services'

  # 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 = ['api_key']
  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 => {
      '200' => 'VCenter::VcenterServicesServiceListDetailsResult',
      '400' => 'VCenter::VapiStdErrorsErrorError',
    })
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServicesServiceApi#list_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
restart(service, opts = {}) click to toggle source

Restarts a service @param service identifier of the service to restart @param [Hash] opts the optional parameters @return [|VapiStdErrorsErrorError|VapiStdErrorsNotFoundError|VapiStdErrorsTimedOutError|nil]

# File lib/vsphere-automation-vcenter/api/services_service_api.rb, line 126
def restart(service, opts = {})
  restart_with_http_info(service, opts)
  nil
end
restart_with_http_info(service, opts = {}) click to toggle source

Restarts a service @api private @param service identifier of the service to restart @param [Hash] opts the optional parameters @return [Array<(|VapiStdErrorsErrorError|VapiStdErrorsNotFoundError|VapiStdErrorsTimedOutError|nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/vsphere-automation-vcenter/api/services_service_api.rb, line 136
def restart_with_http_info(service, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServicesServiceApi.restart ...'
  end
  # verify the required parameter 'service' is set
  if @api_client.config.client_side_validation && service.nil?
    fail ArgumentError, "Missing the required parameter 'service' when calling ServicesServiceApi.restart"
  end
  # resource path
  local_var_path = '/vcenter/services/{service}/restart'.sub('{' + 'service' + '}', service.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'])

  # form parameters
  form_params = {}

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

Starts a service @param service identifier of the service to start @param [Hash] opts the optional parameters @return [|VapiStdErrorsErrorError|VapiStdErrorsNotFoundError|VapiStdErrorsTimedOutError|nil]

# File lib/vsphere-automation-vcenter/api/services_service_api.rb, line 176
def start(service, opts = {})
  start_with_http_info(service, opts)
  nil
end
start_with_http_info(service, opts = {}) click to toggle source

Starts a service @api private @param service identifier of the service to start @param [Hash] opts the optional parameters @return [Array<(|VapiStdErrorsErrorError|VapiStdErrorsNotFoundError|VapiStdErrorsTimedOutError|nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/vsphere-automation-vcenter/api/services_service_api.rb, line 186
def start_with_http_info(service, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServicesServiceApi.start ...'
  end
  # verify the required parameter 'service' is set
  if @api_client.config.client_side_validation && service.nil?
    fail ArgumentError, "Missing the required parameter 'service' when calling ServicesServiceApi.start"
  end
  # resource path
  local_var_path = '/vcenter/services/{service}/start'.sub('{' + 'service' + '}', service.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'])

  # form parameters
  form_params = {}

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

Stops a service @param service identifier of the service to stop @param [Hash] opts the optional parameters @return [|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsNotFoundError|nil]

# File lib/vsphere-automation-vcenter/api/services_service_api.rb, line 226
def stop(service, opts = {})
  stop_with_http_info(service, opts)
  nil
end
stop_with_http_info(service, opts = {}) click to toggle source

Stops a service @api private @param service identifier of the service to stop @param [Hash] opts the optional parameters @return [Array<(|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/vsphere-automation-vcenter/api/services_service_api.rb, line 236
def stop_with_http_info(service, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServicesServiceApi.stop ...'
  end
  # verify the required parameter 'service' is set
  if @api_client.config.client_side_validation && service.nil?
    fail ArgumentError, "Missing the required parameter 'service' when calling ServicesServiceApi.stop"
  end
  # resource path
  local_var_path = '/vcenter/services/{service}/stop'.sub('{' + 'service' + '}', service.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'])

  # form parameters
  form_params = {}

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

Updates the properties of a service. @param service identifier of the service whose properties are being updated. @param request_body @param [Hash] opts the optional parameters @return [|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsNotFoundError|nil]

# File lib/vsphere-automation-vcenter/api/services_service_api.rb, line 277
def update(service, request_body, opts = {})
  update_with_http_info(service, request_body, opts)
  nil
end
update_with_http_info(service, request_body, opts = {}) click to toggle source

Updates the properties of a service. @api private @param service identifier of the service whose properties are being updated. @param request_body @param [Hash] opts the optional parameters @return [Array<(|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/vsphere-automation-vcenter/api/services_service_api.rb, line 288
def update_with_http_info(service, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServicesServiceApi.update ...'
  end
  # verify the required parameter 'service' is set
  if @api_client.config.client_side_validation && service.nil?
    fail ArgumentError, "Missing the required parameter 'service' when calling ServicesServiceApi.update"
  end
  # verify the required parameter 'request_body' is set
  if @api_client.config.client_side_validation && request_body.nil?
    fail ArgumentError, "Missing the required parameter 'request_body' when calling ServicesServiceApi.update"
  end
  # resource path
  local_var_path = '/vcenter/services/{service}'.sub('{' + 'service' + '}', service.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'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request_body)
  auth_names = ['api_key']
  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: ServicesServiceApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end