Child pages
  • UAPI Functions - Ftp::add_ftp

Versions Compared

Key

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

Description

Excerpt
This function creates an FTP account.

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledFTPRole
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titlecPanel or Webmail Session URL


Code Block
languagetext
https://hostname.example.com:2083/cpsess##########/execute/Ftp/add_ftp?user=weeones&pass=12345luggage&quota=42

Include Page
LIB:_CallUAPIFromBrowserLink
LIB:_CallUAPIFromBrowserLink


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Create a new FTP user.
$new_ftp = $cpanel->uapi(
    'Ftp', 'add_ftp',
    array(
        'user'    => 'weeones',
        'pass'    => '12345luggage',
        'quota'   => '42',
    )
);

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.
 
# Create a new FTP user.
my $new_ftp = $cpliveapi->uapi(
    'Ftp', 'add_ftp',
    {
        'user'    => 'weeones',
        'pass'    => '12345luggage',
        'quota'   => '42',
    }
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink


Expand
titlecPanel Template Toolkit


Code Block
languagexml
linenumberstrue
<!-- Create a new FTP account. -->
[% execute( 'Ftp', 'add_ftp', { 'user' => 'weeones', 'pass' => '12345luggage', 'quota' => '42' } ); %]

Include Page
LIB:_TTLink
LIB:_TTLink


Expand
titleCommand Line


Code Block
languagexml
uapi --user=username Ftp add_ftp user=weeones pass=12345luggage quota=42


Include Page
LIB:_UAPICLINote
LIB:_UAPICLINote

 


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{  
   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{  

   },
   "data":null
}


Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The new FTP account username.

A valid FTP username.

weeones
passstring

Required

The new FTP account password.

A secure password.12345luggage
homedirstring

The path to the FTP account's root directory.

If you do not specify this parameter, the FTP account uses the cPanel account's home directory.

The path to the FTP account's root directory, relative to the cPanel account's home directory.weeoneftp
quotainteger

The FTP account's quota.

This parameter defaults to 0.

  • An integer that represents the FTP account's maximum disk usage, in Megabytes (MB).
  • A value of 0 grants the FTP account unlimited disk space.
42
disallowdotBoolean

Whether to strip dots (.) from the username.

This parameter defaults to 1.

  • 1 — Strip dots.
  • 0 — Do not strip dots.
1
domainstring

The user's associated domain.

Note
titleNote:

We introduced this parameter in cPanel & WHM version 54.

This parameter defaults to the cPanel account's primary domain.


A domain that the cPanel account owns.example.com
pass_hashstring

The account's password hash.

Note
titleNote:
  • You can use this parameter in place of the pass parameter. However, you cannot use both pass and pass_hash parameters in the same request.
  • We introduced this parameter in cPanel & WHM version 54.

This parameter defaults to a blank string.


A valid password hash that uses your server's cryptographic hash function.

Note
titleNote:

You can find your server's hash type in the /etc/sysconfig/authconfig file.



Expand
titleClick to view...

$6$1sOyHP5ZDYp3pGUz$R0TSgfPRHfDjT5PP5RJGv39FhiGTNNPvM7IFpCBjXijMmlMZk9yI8T3LqGuntc9fdKb5eX.lGL7wBS9e4DAWn/


Returns

This function only returns metadata.