You can find our user documentation at docs.cpanel.net.

Check out our new API beta site!

Child pages
  • UAPI Functions - DNSSEC::deactivate_zone_key
Skip to end of metadata
Go to start of metadata

Description

This function deactivates a DNSSEC security key.

Important:

In cPanel & WHM version 76 and later, when you disable the DNS role, the system disables this function.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/DNSSEC/deactivate_zone_key?domain=example.com&key_id=1


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.

// Activate a DNSSEC security key.
$sa_settings = $cpanel->uapi(
    'DNSSEC', 'deactivate_zone_key',
    array(
        'domain'     => 'example.com',
        'key_id'     => '1',
    )
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.

# Activate a DNSSEC security key.
my $vinz_clortho = $cpliveapi->uapi(
    'DNSSEC', 'deactivate_zone_key',
    {
        'domain'     => 'example.com',
        'key_id'     => '1',
    }
);


Note:

For more information, read our Guide to the LiveAPI System.

 Command Line
uapi --user=username DNSSEC deactivate_zone_key domain=example.com key_id=1


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
   "apiversion":3,
   "module":"DNSSEC",
   "func":"deactivate_zone_key",
   "result":{
      "metadata":{
      },
      "messages":null,
      "warnings":null,
      "data":{
         "key_id":"1",
         "domain":"example.com",
         "success":1
      },
      "errors":null,
      "status":1
   }
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required.

The security key's domain.

A valid domain.example.com
key_idinteger

Required.

The security key's ID. 

A valid integer.1

Returns

Notes:

  • We added the domain, key_id, success, and error returns in cPanel & WHM version 86.
  • We removed the domain, key_id, success, and error returns from the metadata in cPanel & WHM version 88.
ReturnTypeDescriptionPossible valuesExample
domainstringThe domain for which the system deactivated a security key.A valid domain.

example.com

key_idstringThe security key's ID.A valid ID.1
successBooleanWhether the system deactivated the security key.
  • 1 — Deactivated.
  • 0 — The system failed to deactivate the security key.
1
errorstring

An error message that describes why the system could not deactivate the security key.

Note:

The function  only  displays this return when the  success  return is a  0  value.

A valid string.Error: Invalid key_id or domain specified: No such key present for domain.