class VSphereAutomation::VCenter::VmStoragePolicyComplianceApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

check(vm, opts = {}) click to toggle source

Returns the storage policy Compliance Compliance.Info of a virtual machine after explicitly re-computing compliance check. @param vm Virtual machine identifier. The parameter must be an identifier for the resource type: VirtualMachine. @param [Hash] opts the optional parameters @option opts [VcenterVmStoragePolicyComplianceCheck] :request_body @return [VcenterVmStoragePolicyComplianceCheckResult|VapiStdErrorsErrorError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsServiceUnavailableError|]

# File lib/vsphere-automation-vcenter/api/vm_storage_policy_compliance_api.rb, line 24
def check(vm, opts = {})
  data, _status_code, _headers = check_with_http_info(vm, opts)
  data
end
check_with_http_info(vm, opts = {}) click to toggle source

Returns the storage policy Compliance Compliance.Info of a virtual machine after explicitly re-computing compliance check. @api private @param vm Virtual machine identifier. The parameter must be an identifier for the resource type: VirtualMachine. @param [Hash] opts the optional parameters @option opts [VcenterVmStoragePolicyComplianceCheck] :request_body @return [Array<(VcenterVmStoragePolicyComplianceCheckResult|VapiStdErrorsErrorError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsServiceUnavailableError|, Fixnum, Hash)>] data, response status code and response headers

# File lib/vsphere-automation-vcenter/api/vm_storage_policy_compliance_api.rb, line 35
def check_with_http_info(vm, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VmStoragePolicyComplianceApi.check ...'
  end
  # verify the required parameter 'vm' is set
  if @api_client.config.client_side_validation && vm.nil?
    fail ArgumentError, "Missing the required parameter 'vm' when calling VmStoragePolicyComplianceApi.check"
  end
  # resource path
  local_var_path = '/vcenter/vm/{vm}/storage/policy/compliance?action=check'.sub('{' + 'vm' + '}', vm.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(opts[:'request_body'])
  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,
    :return_type => {
      '200' => 'VCenter::VcenterVmStoragePolicyComplianceCheckResult',
      '400' => 'VCenter::VapiStdErrorsErrorError',
      '401' => 'VCenter::VapiStdErrorsUnauthenticatedError',
      '403' => 'VCenter::VapiStdErrorsUnauthorizedError',
      '503' => 'VCenter::VapiStdErrorsServiceUnavailableError',
    })
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VmStoragePolicyComplianceApi#check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get(vm, opts = {}) click to toggle source

Returns the cached storage policy compliance information of a virtual machine. @param vm Virtual machine identifier. The parameter must be an identifier for the resource type: VirtualMachine. @param [Hash] opts the optional parameters @return [VcenterVmStoragePolicyComplianceResult|VapiStdErrorsErrorError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsServiceUnavailableError|]

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

Returns the cached storage policy compliance information of a virtual machine. @api private @param vm Virtual machine identifier. The parameter must be an identifier for the resource type: VirtualMachine. @param [Hash] opts the optional parameters @return [Array<(VcenterVmStoragePolicyComplianceResult|VapiStdErrorsErrorError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsServiceUnavailableError|, Fixnum, Hash)>] data, response status code and response headers

# File lib/vsphere-automation-vcenter/api/vm_storage_policy_compliance_api.rb, line 94
def get_with_http_info(vm, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VmStoragePolicyComplianceApi.get ...'
  end
  # verify the required parameter 'vm' is set
  if @api_client.config.client_side_validation && vm.nil?
    fail ArgumentError, "Missing the required parameter 'vm' when calling VmStoragePolicyComplianceApi.get"
  end
  # resource path
  local_var_path = '/vcenter/vm/{vm}/storage/policy/compliance'.sub('{' + 'vm' + '}', vm.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::VcenterVmStoragePolicyComplianceResult',
      '400' => 'VCenter::VapiStdErrorsErrorError',
      '401' => 'VCenter::VapiStdErrorsUnauthenticatedError',
      '403' => 'VCenter::VapiStdErrorsUnauthorizedError',
      '503' => 'VCenter::VapiStdErrorsServiceUnavailableError',
    })
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VmStoragePolicyComplianceApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end