List snapshots

You can list the snapshots created in your CDP environment against a COD database using the list-snapshots command. You can use different filters to list the snapshots, for example, table name, specific command ID, and time range.

Command syntax

cdp opdb list-snapshots --environment-name ENVIRONMENT_NAME --database-name DATABASE_NAME [--table-name TABLE_NAME] [--command-id COMMAND_ID] [--from-creation-time FROM_CREATION_TIME] [--to-creation-time TO_CREATION_TIME]

Parameters

--environment-name

The name of the CDP environment.

--database-name

The name of the operational database.

--table-name

The fully qualified name of the HBase table whose snapshots are to be listed.

--command-id

Command ID filter.

--from-creation-time

The starting snapshot creation time to search snapshots (inclusive).

--to-creation-time

The ending snapshot creation time to search snapshots (inclusive).

Without filters:
cdp opdb list-snapshots  --environment-name odx-wgel6j --database-name test

{
    "environmentName": "odx-wgel6j",
    "databaseName": "test",
    "snapshots": [
        {
            "tableName": "table_tob8vc",
            "snapshotName": "snapshot3_table_tob8vc",
            "creationTime": 1662014265011,
            "status": "SUCCESSFUL",
            "commandID": 1546336058,
            "snapshotLocation": "abfs://qedailynat-filesystem@q.dfs.core.windows.net/hbase"
        },
        {
            "tableName": "table_tob8vc",
            "snapshotName": "snapshot2_table_tob8vc",
            "creationTime": 1662014023725,
            "status": "SUCCESSFUL",
            "commandID": 1546336035,
            "snapshotLocation": "abfs://qedailynat-filesystem@q.dfs.core.windows.net/hbase"
        },
        {
            "tableName": "table_tob8vc",
            "snapshotName": "snapshot1_table_tob8vc",
            "creationTime": 1662013782370,
            "status": "DELETED",
            "commandID": 1546336077,
            "snapshotLocation": "abfs://qedailynat-filesystem@q.dfs.core.windows.net/hbase"
        },
        {
            "tableName": "table_lpirwy",
            "snapshotName": "snapshot_table_lpirwy",
            "creationTime": 1662013568312,
            "status": "DELETED",
            "commandID": 1546336004,
            "snapshotLocation": "abfs://qedailynat-filesystem@q.dfs.core.windows.net/hbase"
        }
]
}
With command ID filter:
cdp opdb list-snapshots  --environment-name odx-wgel6j --database-name test --command-id 1546336385
{
    "environmentName": "odx-wgel6j",
    "databaseName": "test",
    "snapshots": [
        {
            "tableName": "table_6uf7xt",
            "snapshotName": "s2",
            "creationTime": 1662035967244,
            "status": "SUCCESSFUL",
            "commandID": 1546336385,
            "snapshotLocation": "abfs://qedailynat-filesystem@qedailynatstorageaccount.dfs.core.windows.net/cod-rtzupxh843ua/hbase/"
        }
    ]
}
With table name filter:
cdp opdb list-snapshots  --environment-name odx-wgel6j --database-name test --table-name table_6uf7xt
{
    "environmentName": "odx-wgel6j",
    "databaseName": "test",
    "snapshots": [
        {
            "tableName": "table_6uf7xt",
            "snapshotName": "s2",
            "creationTime": 0,
            "status": "SUCCESSFUL",
            "commandID": 1546336385,
            "snapshotLocation": "abfs://qedailynat-filesystem@qedailynatstorageaccount.dfs.core.windows.net/cod-rtzupxh843ua/hbase/"
        }
    ]
}