Updated on 2024-08-28 GMT+08:00

Querying Extensions

Function

This API is used to obtain extension information of a specified database.

  • Before calling an API, you need to understand the API in Authentication.

Constraints

This operation cannot be performed when the DB instance is in any of the following statuses: creating, changing instance class, changing port, frozen, or abnormal.

URI

  • URI format

    GET /v3/{project_id}/instances/{instance_id}/extensions?database_name={database_name}&offset={offset}&limit={limit}

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Project ID of a tenant in a region.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    instance_id

    Yes

    Instance ID.

    database_name

    Yes

    Database name.

    offset

    No

    Index offset. If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, indicating that the query starts from the first piece of data. The value must be a number but cannot be a negative number.

    limit

    No

    Number of records to be queried. The default value is 100. The value must be a positive integer. The minimum value is 1 and the maximum value is 100.

Request

  • Request parameters

    None

  • URI example

    GET https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/f569f1358436479dbcba8603c32cc4aein03/extensions?database_name=db1

Response

  • Normal response
    Table 2 Parameters

    Parameter

    Type

    Description

    extensions

    Array of objects

    Extension list.

    For details, see Table 3.

    total_count

    Integer

    Total number of extensions.

    Table 3 extensions element structure description

    Parameter

    Type

    Description

    name

    String

    Extension name.

    database_name

    String

    Database name.

    version

    String

    Extension version.

    version_update

    String

    New version that the extension can be upgraded to. If the value of this parameter is different from that of version, the extension can be upgraded.

    shared_preload_libraries

    String

    Dependent preloaded library.

    created

    Boolean

    Whether the extension has been created.

    description

    String

    Extension description.

  • Example normal response
    { 
       "extensions" : [ { 
         "name" : "pg_cron", 
         "database_name" : "db1", 
         "version" : "1.0", 
         "version_update" : "1.0", 
         "shared_preload_libraries" : "pg_cron", 
         "created" : false, 
         "description" : "pg_cron access method - signature file based index" 
       }, { 
         "name" : "dblink", 
         "database_name" : "db1", 
         "version" : "1.2", 
         "version_update" : "1.2", 
         "shared_preload_libraries" : "", 
         "created" : false, 
         "description" : "connect to other PostgreSQL databases from within a database" 
       } ], 
       "total_count" : 2 
     }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.