class VSphereAutomation::VCenter::VchaClusterApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

deploytask(request_body, opts = {}) click to toggle source

Prepares, clones, and configures a VCHA cluster. @param request_body @param [Hash] opts the optional parameters @return [VcenterVchaClusterDeployTaskResult|VapiStdErrorsErrorError|VapiStdErrorsUnauthorizedError|]

# File lib/vsphere-automation-vcenter/api/vcha_cluster_api.rb, line 23
def deploytask(request_body, opts = {})
  data, _status_code, _headers = deploytask_with_http_info(request_body, opts)
  data
end
deploytask_with_http_info(request_body, opts = {}) click to toggle source

Prepares, clones, and configures a VCHA cluster. @api private @param request_body @param [Hash] opts the optional parameters @return [Array<(VcenterVchaClusterDeployTaskResult|VapiStdErrorsErrorError|VapiStdErrorsUnauthorizedError|, Fixnum, Hash)>] data, response status code and response headers

# File lib/vsphere-automation-vcenter/api/vcha_cluster_api.rb, line 33
def deploytask_with_http_info(request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VchaClusterApi.deploytask ...'
  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 VchaClusterApi.deploytask"
  end
  # resource path
  local_var_path = '/vcenter/vcha/cluster?action=deploy&vmw-task=true'

  # 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(: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::VcenterVchaClusterDeployTaskResult',
      '400' => 'VCenter::VapiStdErrorsErrorError',
      '403' => 'VCenter::VapiStdErrorsUnauthorizedError',
    })
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VchaClusterApi#deploytask\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
failovertask(request_body, opts = {}) click to toggle source

Initiates failover from the active vCenter node to the passive node. For forced failover, Active node immediately initiates a failover. This may result into a data loss after failover. For planned failover, Active node flushes all the state to the Passive node, waits for the flush to complete before causing a failover. After the failover, Passive node starts without any data loss. A failover is allowed only in the following cases: 1. Cluster's mode is enabled and all cluster members are present. 2. Cluster's mode is maintenance and all cluster members are present. @param request_body @param [Hash] opts the optional parameters @return [VcenterVchaClusterFailoverTaskResult|VapiStdErrorsErrorError|VapiStdErrorsUnauthorizedError|]

# File lib/vsphere-automation-vcenter/api/vcha_cluster_api.rb, line 80
def failovertask(request_body, opts = {})
  data, _status_code, _headers = failovertask_with_http_info(request_body, opts)
  data
end
failovertask_with_http_info(request_body, opts = {}) click to toggle source

Initiates failover from the active vCenter node to the passive node. For forced failover, Active node immediately initiates a failover. This may result into a data loss after failover. For planned failover, Active node flushes all the state to the Passive node, waits for the flush to complete before causing a failover. After the failover, Passive node starts without any data loss. A failover is allowed only in the following cases: 1. Cluster&#39;s mode is enabled and all cluster members are present. 2. Cluster&#39;s mode is maintenance and all cluster members are present. @api private @param request_body @param [Hash] opts the optional parameters @return [Array<(VcenterVchaClusterFailoverTaskResult|VapiStdErrorsErrorError|VapiStdErrorsUnauthorizedError|, Fixnum, Hash)>] data, response status code and response headers

# File lib/vsphere-automation-vcenter/api/vcha_cluster_api.rb, line 90
def failovertask_with_http_info(request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VchaClusterApi.failovertask ...'
  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 VchaClusterApi.failovertask"
  end
  # resource path
  local_var_path = '/vcenter/vcha/cluster?action=failover&vmw-task=true'

  # 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(: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::VcenterVchaClusterFailoverTaskResult',
      '400' => 'VCenter::VapiStdErrorsErrorError',
      '403' => 'VCenter::VapiStdErrorsUnauthorizedError',
    })
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VchaClusterApi#failovertask\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get(opts = {}) click to toggle source

Retrieves the status of a VCHA cluster. @param [Hash] opts the optional parameters @option opts [VcenterVchaClusterGet] :request_body @return [VcenterVchaClusterResult|VapiStdErrorsErrorError|VapiStdErrorsUnauthorizedError|]

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

Retrieves the status of a VCHA cluster. @api private @param [Hash] opts the optional parameters @option opts [VcenterVchaClusterGet] :request_body @return [Array<(VcenterVchaClusterResult|VapiStdErrorsErrorError|VapiStdErrorsUnauthorizedError|, Fixnum, Hash)>] data, response status code and response headers

# File lib/vsphere-automation-vcenter/api/vcha_cluster_api.rb, line 147
def get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VchaClusterApi.get ...'
  end
  # resource path
  local_var_path = '/vcenter/vcha/cluster?action=get'

  # 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::VcenterVchaClusterResult',
      '400' => 'VCenter::VapiStdErrorsErrorError',
      '403' => 'VCenter::VapiStdErrorsUnauthorizedError',
    })
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VchaClusterApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
undeploytask(request_body, opts = {}) click to toggle source

Destroys the VCHA cluster and removes all VCHA specific information from the VCVA appliance. Optionally, the passive and witness node virtual machines will be deleted only if VCHA was deployed using automatic deployment. The active node in the cluster continues to run as a standalone VCVA appliance after the destroy operation has been performed. If the VCHA cluster is in a transition state and not configured, then the VCHA cluster specific information is removed. @param request_body @param [Hash] opts the optional parameters @return [VcenterVchaClusterUndeployTaskResult|VapiStdErrorsErrorError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|]

# File lib/vsphere-automation-vcenter/api/vcha_cluster_api.rb, line 190
def undeploytask(request_body, opts = {})
  data, _status_code, _headers = undeploytask_with_http_info(request_body, opts)
  data
end
undeploytask_with_http_info(request_body, opts = {}) click to toggle source

Destroys the VCHA cluster and removes all VCHA specific information from the VCVA appliance. Optionally, the passive and witness node virtual machines will be deleted only if VCHA was deployed using automatic deployment. The active node in the cluster continues to run as a standalone VCVA appliance after the destroy operation has been performed. If the VCHA cluster is in a transition state and not configured, then the VCHA cluster specific information is removed. @api private @param request_body @param [Hash] opts the optional parameters @return [Array<(VcenterVchaClusterUndeployTaskResult|VapiStdErrorsErrorError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|, Fixnum, Hash)>] data, response status code and response headers

# File lib/vsphere-automation-vcenter/api/vcha_cluster_api.rb, line 200
def undeploytask_with_http_info(request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VchaClusterApi.undeploytask ...'
  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 VchaClusterApi.undeploytask"
  end
  # resource path
  local_var_path = '/vcenter/vcha/cluster?action=undeploy&vmw-task=true'

  # 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(: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::VcenterVchaClusterUndeployTaskResult',
      '400' => 'VCenter::VapiStdErrorsErrorError',
      '403' => 'VCenter::VapiStdErrorsUnauthorizedError',
      '404' => 'VCenter::VapiStdErrorsNotFoundError',
    })
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VchaClusterApi#undeploytask\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end