Child pages
  • UAPI Functions - Postgresql::get_restrictions

Versions Compared

Key

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

Description

Excerpt

This function retrieves the PostgreSQL® user and database name length restrictions.

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledPostgresRole
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/Postgresql/get_restrictions

Include Page
LIB:_CallUAPIFromBrowserLink
LIB:_CallUAPIFromBrowserLink


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Retrieve the PostgreSQL user and database name length restrictions.
$get_restrictions = $cpanel->uapi(
    'Postgresql', 'get_restrictions'
);

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.
 
#  Retrieve the PostgreSQL user and database name length restrictions.
my $get_restrictions = $cpliveapi->uapi(
    'Postgresql', 'get_restrictions',
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

 


Expand
titlecPanel Template Toolkit


Code Block
languagexml
<!--  Retrieve the PostgreSQL user and database name length restrictions. -->
[% data = execute( 'Postgresql', 'get_restrictions'); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %] 

Include Page
LIB:_TTLink
LIB:_TTLink

 


Expand
titleCommand Line


Code Block
languagebash
uapi --user=username Postgresql get_restrictions

Include Page
LIB:_UAPICLINote
LIB:_UAPICLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
     
  },
  "data": {
    "max_database_name_length": 63,
    "max_username_length": 63,
    "prefix": "example_"
  }
}


Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote


Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
prefixstringIf database prefixing is enabled, this return outputs the database prefix.A valid string up to eight characters and an underscore (_).
example_
max_database_name_lengthintegerThe maximum length of a database name.A positive integer.63
max_username_lengthintegerThe maximum length of a database username.A positive integer.63