All Products
Search
Document Center

Data Management:ListColumns

Last Updated:Nov 28, 2024

Returns the column information of a table.

Operation description

You can call this operation only for database instances whose control mode is Security Collaboration.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dms:ListColumnslist
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
TidlongNo

The ID of the tenant. You can call the GetUserActiveTenant operation to obtain the tenant ID.

3***
TableIdstringYes

The ID of the table. You can call the ListTables operation to obtain the table ID.

39281****
LogicbooleanYes

Specifies whether the database is a logical database. Valid values:

  • true: The database is a logical database.
  • false: The database is a physical database.
false

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

0AD9AC55-5873-474A-9F33-4285806A3619
ErrorCodestring

The error code returned.

UnknownError
ColumnListarray<object>

The details about columns.

Columnobject

The details about fields in the table.

ColumnTypestring

The data type of the column.

varchar
AutoIncrementboolean

Indicates whether the column is an auto-increment column. Valid values:

  • true: The column is an auto-increment column.
  • false: The column is not an auto-increment column.
false
ColumnIdstring

The ID of the column.

62589****
DefaultValuestring

The default value of the column.

def_value
Sensitiveboolean

Indicates whether the column is a sensitive column. Valid values:

  • true: The column is a sensitive column.
  • false: The column is not a sensitive column.
false
ColumnNamestring

The name of the column.

name
SecurityLevelstring

The security level of the column. Valid values:

  • INNER: The column is an internal column but not sensitive.
  • SENSITIVE: The column is a sensitive column.
  • CONFIDENTIAL: The column is a confidential column.
Note For more information, see Sensitivity levels of fields.
INNER
Descriptionstring

The description of the column.

test
DataPrecisioninteger

The number of valid digits for the field.

0
DataScaleinteger

The number of decimal places for the field.

0
FunctionTypestring

The type of the masking algorithm that is used for the field. Valid values:

  • null: No masking algorithm is used.
  • DEFAULT: A full masking algorithm is used.
  • FIX_POS: The fixed position is masked.
  • FIX_CHAR: The fixed characters are replaced.
DEFAULT
Nullableboolean

Indicates whether the column can be empty. Valid values:

  • true: The column can be empty.
  • false: The column cannot be empty.
false
DataLengthlong

The length of the field.

4
ErrorMessagestring

The error message returned.

UnknownError
Successboolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.
true

Examples

Sample success responses

JSONformat

{
  "RequestId": "0AD9AC55-5873-474A-9F33-4285806A3619",
  "ErrorCode": "UnknownError",
  "ColumnList": {
    "Column": [
      {
        "ColumnType": "varchar",
        "AutoIncrement": false,
        "ColumnId": "62589****",
        "DefaultValue": "def_value",
        "Sensitive": false,
        "ColumnName": "name",
        "SecurityLevel": "INNER",
        "Description": "test",
        "DataPrecision": 0,
        "DataScale": 0,
        "FunctionType": "DEFAULT",
        "Nullable": false,
        "DataLength": 4
      }
    ]
  },
  "ErrorMessage": "UnknownError",
  "Success": true
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history