class VSphereAutomation::Appliance::NetworkingDnsServersApi
Attributes
Public Class Methods
# File lib/vsphere-automation-appliance/api/networking_dns_servers_api.rb, line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Add a DNS server. This method fails if mode argument is "dhcp" @param request_body @param [Hash] opts the optional parameters @return [|VapiStdErrorsErrorError|nil]
# File lib/vsphere-automation-appliance/api/networking_dns_servers_api.rb, line 23 def add(request_body, opts = {}) add_with_http_info(request_body, opts) nil end
Add a DNS server. This method fails if mode argument is "dhcp" @api private @param request_body @param [Hash] opts the optional parameters @return [Array<(|VapiStdErrorsErrorError|nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/vsphere-automation-appliance/api/networking_dns_servers_api.rb, line 33 def add_with_http_info(request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NetworkingDnsServersApi.add ...' 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 NetworkingDnsServersApi.add" end # resource path local_var_path = '/appliance/networking/dns/servers' # 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: NetworkingDnsServersApi#add\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get DNS server configuration. @param [Hash] opts the optional parameters @return [ApplianceNetworkingDnsServersResult|VapiStdErrorsErrorError|]
# File lib/vsphere-automation-appliance/api/networking_dns_servers_api.rb, line 74 def get(opts = {}) data, _status_code, _headers = get_with_http_info(opts) data end
Get DNS server configuration. @api private @param [Hash] opts the optional parameters @return [Array<(ApplianceNetworkingDnsServersResult|VapiStdErrorsErrorError|, Fixnum, Hash)>] data, response status code and response headers
# File lib/vsphere-automation-appliance/api/networking_dns_servers_api.rb, line 83 def get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NetworkingDnsServersApi.get ...' end # resource path local_var_path = '/appliance/networking/dns/servers' # 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' => 'Appliance::ApplianceNetworkingDnsServersResult', '400' => 'Appliance::VapiStdErrorsErrorError', }) if @api_client.config.debugging @api_client.config.logger.debug "API called: NetworkingDnsServersApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Set the DNS server configuration. If you set the mode argument to "DHCP", a DHCP refresh is forced. @param request_body @param [Hash] opts the optional parameters @return [|VapiStdErrorsErrorError|nil]
# File lib/vsphere-automation-appliance/api/networking_dns_servers_api.rb, line 123 def set(request_body, opts = {}) set_with_http_info(request_body, opts) nil end
Set the DNS server configuration. If you set the mode argument to "DHCP", a DHCP refresh is forced. @api private @param request_body @param [Hash] opts the optional parameters @return [Array<(|VapiStdErrorsErrorError|nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/vsphere-automation-appliance/api/networking_dns_servers_api.rb, line 133 def set_with_http_info(request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NetworkingDnsServersApi.set ...' 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 NetworkingDnsServersApi.set" end # resource path local_var_path = '/appliance/networking/dns/servers' # 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(: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: NetworkingDnsServersApi#set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Test if dns servers are reachable. @param request_body @param [Hash] opts the optional parameters @return [ApplianceNetworkingDnsServersTestResult|VapiStdErrorsErrorError|]
# File lib/vsphere-automation-appliance/api/networking_dns_servers_api.rb, line 175 def test(request_body, opts = {}) data, _status_code, _headers = test_with_http_info(request_body, opts) data end
Test if dns servers are reachable. @api private @param request_body @param [Hash] opts the optional parameters @return [Array<(ApplianceNetworkingDnsServersTestResult|VapiStdErrorsErrorError|, Fixnum, Hash)>] data, response status code and response headers
# File lib/vsphere-automation-appliance/api/networking_dns_servers_api.rb, line 185 def test_with_http_info(request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: NetworkingDnsServersApi.test ...' 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 NetworkingDnsServersApi.test" end # resource path local_var_path = '/appliance/networking/dns/servers/test' # 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' => 'Appliance::ApplianceNetworkingDnsServersTestResult', '400' => 'Appliance::VapiStdErrorsErrorError', }) if @api_client.config.debugging @api_client.config.logger.debug "API called: NetworkingDnsServersApi#test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end