Provided Methods
- Create a new data table pointing to a datatable of an existing connection
- Get all database tables within a database connection
Method documentation
All the examples expect that there is already a OneDataApi object initialized and assigned to a variable called "onedata_api".
### Creation of the ONE DATA Api ###
onedata_api = OneDataApi(base_url=base_url, username=user,
password=pw, verify=False, timeout=999)
createDataTable
Description
Creates a data table with the given name from a connection with the given ID and name.
Optional request options (request_transformers, response_transformers, timeout, verify, sleep_after_response_millis, deserializer) can be specified.
Returns: DataTable
Parameters
Property | Type | Required | Default | Description |
---|---|---|---|---|
connection_id | Union[str, uuid.UUID] | true | ID of the connection | |
connection_table_name | str | true | Name of the data table to be copied from the connection | |
dt_name | str | true | Name of the newly created data table | |
dt_tags | [str] | false | None | Tags for the new data table |
dt_description | str | false | None | Description for the new data table |
dt_notes | str | false | None | Notes for the new data table |
access | DatabaseTablePrivilege | false | None | Access rights of the user for the table of the data base connection |
connection_schema | str | false | None | Data base schema which holds the relevant table |
target_project_id | Union[str, uuid.UUID] | false | None | ID of the projet where the new data table should be created |
Usage
### Create new data table from connection ###
dt: DataTable = onedata_api.connections.create_data_table(connection_id="some_id_UUID", connection_table_name="someExistingTable", dt_name="New Table")
paginatedDatabaseTableInformation
Description
Returns all database tables within the database connection with the given ID.
Optional request options (request_transformers, response_transformers, timeout, verify, sleep_after_response_millis, deserializer) can be specified.
Returns: Paginated
Parameters
Property | Type | Required | Default | Description |
---|---|---|---|---|
connection_id | Union[str, uuid.UUID] | true | ID of the connection | |
page | int | false | None | Result page |
limit | int | false | None | Items per page |
ordering | SortOrder | false | None | Order direction |
sort_by | DatabaseConnectionTableSortType | false | None | Sort property |
project_id | Union[str, uuid.UUID] | false | None | Specifies the ID of the project for which existing datatables within the db connection will be listed. If None, the existing datatables for the user's preferred project will be returned. |
search | str | false | None | string to search for desired resources. Search is case insensitive. Name and tags are considered. |
tables_listing_mode | TablesListingMode | false | None | Specifies the listing mode for data tables from an Oracle database connection |
connection_schema | str | false | None | Data base schema which holds the relevant table |
target_project_id | Union[str, uuid.UUID] | false | None | ID of the projet where the new data table should be created |
Usage
### Get list of database tables ###
datatables: Paginated= onedata_api.connections.paginated_database_table_information(connection_id="some_id_UUID")