Skip to content

Latest commit

 

History

History
198 lines (141 loc) · 6.8 KB

DNSApi.md

File metadata and controls

198 lines (141 loc) · 6.8 KB

Onepanel.DNSApi

All URIs are relative to https://localhost/api/v3/onepanel

Method HTTP request Description
checkDns GET /dns_check Check correctness of DNS entries for the cluster's domain
getDnsCheckConfiguration GET /dns_check/configuration Return settings used when performing the DNS check
modifyDnsCheckConfiguration PATCH /dns_check/configuration Configure dns check

checkDns

DnsCheckSummary checkDns(opts)

Check correctness of DNS entries for the cluster's domain

Returns results of the last DNS check, verifying the validity of DNS configuration for cluster's domain. Unless 'forceCheck' flag is set, the results may be cached. Both Oneprovider and Onezone return field `domain` for checking if cluster's domain can be resolved. In Oneprovider there may be additional field `oneS3Subdomain` for checking if OneS3 domain can be resolved if said service is enabled. In Onezone there is additional field `dnsZone` for checking whether DNS zone management for the Onezone's domain has been delegated to Onezone server (SOA and NS records) allowing for subdomain delegation. If the cluster is configured with an IP instead of a domain no results are returned. Settings used for the check, ie. DNS servers used can be modified using the dns_check/configuration endpoint.

Example

var Onepanel = require('onepanel');
var defaultClient = Onepanel.ApiClient.instance;

// Configure API key authorization: api_key1
var api_key1 = defaultClient.authentications['api_key1'];
api_key1.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key1.apiKeyPrefix = 'Token';

// Configure API key authorization: api_key2
var api_key2 = defaultClient.authentications['api_key2'];
api_key2.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key2.apiKeyPrefix = 'Token';

// Configure HTTP basic authorization: basic
var basic = defaultClient.authentications['basic'];
basic.username = 'YOUR USERNAME';
basic.password = 'YOUR PASSWORD';

var apiInstance = new Onepanel.DNSApi();

var opts = { 
  'forceCheck': false // Boolean | If true the DNS check cache is overridden and check is performed during handling of the request.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.checkDns(opts, callback);

Parameters

Name Type Description Notes
forceCheck Boolean If true the DNS check cache is overridden and check is performed during handling of the request. [optional] [default to false]

Return type

DnsCheckSummary

Authorization

api_key1, api_key2, basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getDnsCheckConfiguration

DnsCheckConfiguration getDnsCheckConfiguration()

Return settings used when performing the DNS check

Returns servers queried to check DNS configuration correctness.

Example

var Onepanel = require('onepanel');
var defaultClient = Onepanel.ApiClient.instance;

// Configure API key authorization: api_key1
var api_key1 = defaultClient.authentications['api_key1'];
api_key1.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key1.apiKeyPrefix = 'Token';

// Configure API key authorization: api_key2
var api_key2 = defaultClient.authentications['api_key2'];
api_key2.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key2.apiKeyPrefix = 'Token';

// Configure HTTP basic authorization: basic
var basic = defaultClient.authentications['basic'];
basic.username = 'YOUR USERNAME';
basic.password = 'YOUR PASSWORD';

var apiInstance = new Onepanel.DNSApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getDnsCheckConfiguration(callback);

Parameters

This endpoint does not need any parameter.

Return type

DnsCheckConfiguration

Authorization

api_key1, api_key2, basic

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

modifyDnsCheckConfiguration

modifyDnsCheckConfiguration(dnsCheckConfiguration)

Configure dns check

Informs what DNS servers to use for checking external DNS records validity.

Example

var Onepanel = require('onepanel');
var defaultClient = Onepanel.ApiClient.instance;

// Configure API key authorization: api_key1
var api_key1 = defaultClient.authentications['api_key1'];
api_key1.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key1.apiKeyPrefix = 'Token';

// Configure API key authorization: api_key2
var api_key2 = defaultClient.authentications['api_key2'];
api_key2.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key2.apiKeyPrefix = 'Token';

// Configure HTTP basic authorization: basic
var basic = defaultClient.authentications['basic'];
basic.username = 'YOUR USERNAME';
basic.password = 'YOUR PASSWORD';

var apiInstance = new Onepanel.DNSApi();

var dnsCheckConfiguration = new Onepanel.DnsCheckConfiguration(); // DnsCheckConfiguration | The configuration changes.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.modifyDnsCheckConfiguration(dnsCheckConfiguration, callback);

Parameters

Name Type Description Notes
dnsCheckConfiguration DnsCheckConfiguration The configuration changes.

Return type

null (empty response body)

Authorization

api_key1, api_key2, basic

HTTP request headers

  • Content-Type: application/json, application/x-yaml
  • Accept: Not defined