Child pages
  • UAPI Functions - KnownHosts::delete
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Description

This function removes a host from the /home/user/.ssh/known_hosts file.

Examples  


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/KnownHosts/delete?host_name=host.example.com

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// delete the host
$delete = $cpanel->uapi(
    'KnownHosts', 'delete',
     array(
        'host_name'    => 'host.example.com';
     )
);

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# delete the host
my $delete = $cpliveapi->uapi(
    'KnownHosts', 'delete',    {
        'host_name'    => 'host.example.com',
    }
);

 cPanel Template Toolkit
<!-- delete the host. -->
[% data = execute( 
   'KnownHosts', 'delete', {
        'host_name'    => 'host.example.com',
   } 
); %]

 Command Line
uapi --user=username KnownHosts delete host_name=host.example.com

 Output (JSON)
{  
   "errors":null,
   "data":{

   },
   "status":1,
   "metadata":{
  
   },
   "messages":null
}

Parameters

ParameterTypeDescriptionPossible valuesExample
host_namestring

Required

The host to delete.

A valid hostname.

host.example.com

 

Returns

This function only returns metadata.

  • No labels