Child pages
  • cPanel API 2 Functions - ZoneEdit::resetzone

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

This function resets a zone file to its original state.

Include Page
LIB:_cPanelAPI2NoEquivalent
LIB:_cPanelAPI2NoEquivalent


Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleWHM API (JSON)


Code Block
languagetext
https://hostname.example.com:2087/cpsess###########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=resetzone&domain=example.com

Include Page
LIB:_CallFromWHMAPILink
LIB:_CallFromWHMAPILink


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Add a type "A" zone record to "example.com"
$reset_zone = $cpanel->api2(
    'ZoneEdit', 'resetzone',
 array(
        'domain' => 'example.com',
  ) 
);

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink

 


Expand
titleLiveAPI Perl Module


Code Block
languageperl
linenumberstrue
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Add a type "A" Zone Record to "example.com"
my $reset_zone= $cpliveapi->api2(
    'ZoneEdit', 'resetzone',
{ 
        'domain' => 'example.com',
  }
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

 


Expand
titlecPanel Tag System (deprecated)

Include Page
LIB:_cPanelAPI2cPanelTagsWarning
LIB:_cPanelAPI2cPanelTagsWarning


Expand
titleCommand Line


Code Block
languagebash
cpapi2 --user=username ZoneEdit resetzone domain=example.com

Include Page
LIB:_cPanelAPI2CLINote
LIB:_cPanelAPI2CLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{
  "cpanelresult": {
    "apiversion": 2,
    "func": "resetzone",
    "data": [
      {
        "result": {
          "statusmsg": "",
          "status": 1,
          "checkmx": {
            "warnings": [
              
            ],
            "issecondary": 0,
            "local": 0,
            "detected": "remote",
            "remote": 1,
            "isprimary": 0,
            "changed": 1,
            "secondary": 0,
            "mxcheck": "auto"
          }
        }
      }
    ],
    "event": {
      "result": 1
    },
    "module": "ZoneEdit"
  }
}


Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote


Parameters

ParametersTypeDescriptionPossible valuesExample
domainstring

Required

The record's domain.

A valid domain name.example.com

Returns

Return TypeDescriptionPossible valuesExample
resulthashA hash of the function's results.A hash that contains the statusmsg and status returns. 

statusmsg

string

A status message from the DNS server.

The function returns this value in the result hash.

A string.


Expand
titleClick to view...
Bind reloading on hostname using rndc zone: [example.com]\n


checkmx

hash

A hash of the mail exchanger's returns.

The function returns this value in the result hash.

A hash that contains the issecondarylocal, detected, remote, isprimary, changed, secondary, and mxcheck return. 

issecondary

Boolean

Whether the domain's mail exchanger is the secondary exchanger.

The function returns this value in the checkmx hash.

  • 1 — Secondary exchanger.
  • 0Not a secondary exchanger.
0

local

Boolean

Whether the recently-deleted mail exchanger was a local exchanger.

The function returns this value in the checkmx hash.

  • 1 — Local exchanger.
  • 0Not a local exchanger.
0

detected

string

This return is identical to the mxcheck parameter.

The function returns this value in the checkmx hash.

A valid string.remote

remote

Boolean

Whether the recently-deleted mail exchanger was a remote exchanger.

The function returns this value in the checkmx hash.

  • 1 — Remote exchanger.
  • 0Not a remote exchanger.
1

isprimary

Boolean

Whether the domain is the account's primary domain.

The function returns this value in the checkmx hash.

  • 1 — Primary domain.
  • 0Not the primary domain.
0

changed

Boolean

Whether a change has occurred.

The function returns this value in the checkmx hash.

  • 1 — Changes.
  • 0No changes.
1

secondary

Boolean

Whether the recently-deleted mail exchanger was a secondary exchanger.

The function returns this value in the checkmx hash.

  • 1 — Secondary exchanger.
  • 0Not a secondary exchanger.
0

mxcheck

string

The type of mail exchanger that was recently deleted.

The function returns this value in the checkmx hash.

  • local
  • remote
  • secondary
  • auto
auto
reasonstring

A reason for failure.

Note
titleNote:

This function only returns a reason value if it failed.


A string that describes the error.

This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1