Description

This function creates a PostgreSQL® database user.

Examples




https://hostname.example.com:2083/cpsess##########/execute/Postgresql/create_user?name=dbuser&password=12345luggage



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Create the PostgreSQL database user "dbuser" with the password "12345luggage"
$create_user = $cpanel->uapi(
    'Postgresql', 'create_user',
    array(
        'user'    => 'dbuser',
        'password'=> '12345luggage',
         )
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
#  Create the PostgreSQL database user "dbuser" with the password "12345luggage"
my $create_user = $cpliveapi->uapi(
    'Postgresql', 'create_user',
    {
        'name'    => 'dbuser',
        'password'=> '12345luggage',
    }
);

 



<!--  Create the PostgreSQL database user "dbuser" with the password "12345luggage" -->
[% data = execute( 'Postgresql', 'create_user', { name => 'database', password => '12345luggage'} ); %]

 



uapi --user=username Postgresql create_user name=dbuser password=12345luggage



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



Parameters

ParameterTypeDescriptionPossible valuesExample
name string

Required

The database user's name.

A valid string.

If database prefixing is enabled, this parameter must include the database prefix for the account.


dbuser
passwordstring

Required

The new user's password.

A secure password.12345luggage

Returns

This function only returns metadata.