Skip to content

Latest commit

 

History

History
157 lines (104 loc) · 4 KB

DatabaseApi.md

File metadata and controls

157 lines (104 loc) · 4 KB

swagger_client.DatabaseApi

All URIs are relative to /

Method HTTP request Description
create_database PUT /dbs/{db_name} Create Database
delete_database DELETE /dbs/{db_name} Delete Database
get_database_list GET /dbs List databases

create_database

InlineResponse2011 create_database(db_name, body=body)

Create Database

Create Database with identifier name

Example

from __future__ import print_function
import time
import XataClient
from XataClient.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = XataClient.DatabaseApi(XataClient.ApiClient(configuration))
db_name = XataClient.DBName() # DBName | The Database Name
body = XataClient.DbsDbNameBody() # DbsDbNameBody |  (optional)

try:
    # Create Database
    api_response = api_instance.create_database(db_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DatabaseApi->create_database: %s\n" % e)

Parameters

Name Type Description Notes
db_name DBName The Database Name
body DbsDbNameBody [optional]

Return type

InlineResponse2011

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_database

delete_database(db_name)

Delete Database

Delete a database and all of its branches and tables permanently.

Example

from __future__ import print_function
import time
import XataClient
from XataClient.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = XataClient.DatabaseApi(XataClient.ApiClient(configuration))
db_name = XataClient.DBName() # DBName | The Database Name

try:
    # Delete Database
    api_instance.delete_database(db_name)
except ApiException as e:
    print("Exception when calling DatabaseApi->delete_database: %s\n" % e)

Parameters

Name Type Description Notes
db_name DBName The Database Name

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_database_list

ListDatabasesResponse get_database_list()

List databases

List all databases available in your Workspace.

Example

from __future__ import print_function
import time
import XataClient
from XataClient.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = XataClient.DatabaseApi(XataClient.ApiClient(configuration))

try:
    # List databases
    api_response = api_instance.get_database_list()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DatabaseApi->get_database_list: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ListDatabasesResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]