All URIs are relative to /
Method | HTTP request | Description |
---|---|---|
create_branch | PUT /db/{db_branch_name} | Create Database branch |
delete_branch | DELETE /db/{db_branch_name} | Delete Database branch |
execute_branch_migration_plan | POST /db/{db_branch_name}/migrations/execute | Migrate branch |
get_branch_details | GET /db/{db_branch_name} | Get branch schema and metadata |
get_branch_list | GET /dbs/{db_name} | List branches |
get_branch_metadata | GET /db/{db_branch_name}/metadata | Get Branch Metadata |
get_branch_migration_history | GET /db/{db_branch_name}/migrations | Get branch migration history |
get_branch_migration_plan | POST /db/{db_branch_name}/migrations/plan | Compute migration plan |
get_branch_stats | GET /db/{db_branch_name}/stats | Branch stats |
update_branch_metadata | PUT /db/{db_branch_name}/metadata | Update branch metadata |
create_branch(db_branch_name, body=body, _from=_from)
Create Database branch
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.BranchApi(XataClient.ApiClient(configuration))
db_branch_name = XataClient.DBBranchName() # DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`.
body = XataClient.DbDbBranchNameBody() # DbDbBranchNameBody | (optional)
_from = '_from_example' # str | Name of source branch to branch the new schema from (optional)
try:
# Create Database branch
api_instance.create_branch(db_branch_name, body=body, _from=_from)
except ApiException as e:
print("Exception when calling BranchApi->create_branch: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
db_branch_name | DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`. | |
body | DbDbBranchNameBody | [optional] | |
_from | str | Name of source branch to branch the new schema from | [optional] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_branch(db_branch_name)
Delete Database branch
Delete the branch in the database and all its resources
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.BranchApi(XataClient.ApiClient(configuration))
db_branch_name = XataClient.DBBranchName() # DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`.
try:
# Delete Database branch
api_instance.delete_branch(db_branch_name)
except ApiException as e:
print("Exception when calling BranchApi->delete_branch: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
db_branch_name | DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`. |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
execute_branch_migration_plan(db_branch_name, body=body)
Migrate branch
Apply a migration plan to the branch
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.BranchApi(XataClient.ApiClient(configuration))
db_branch_name = XataClient.DBBranchName() # DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`.
body = XataClient.MigrationsExecuteBody() # MigrationsExecuteBody | (optional)
try:
# Migrate branch
api_instance.execute_branch_migration_plan(db_branch_name, body=body)
except ApiException as e:
print("Exception when calling BranchApi->execute_branch_migration_plan: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
db_branch_name | DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`. | |
body | MigrationsExecuteBody | [optional] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DBBranch get_branch_details(db_branch_name)
Get branch schema and metadata
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.BranchApi(XataClient.ApiClient(configuration))
db_branch_name = XataClient.DBBranchName() # DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`.
try:
# Get branch schema and metadata
api_response = api_instance.get_branch_details(db_branch_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling BranchApi->get_branch_details: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
db_branch_name | DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListBranchesResponse get_branch_list(db_name)
List branches
List all available Branches
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.BranchApi(XataClient.ApiClient(configuration))
db_name = XataClient.DBName() # DBName | The Database Name
try:
# List branches
api_response = api_instance.get_branch_list(db_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling BranchApi->get_branch_list: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
db_name | DBName | The Database Name |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BranchMetadata get_branch_metadata(db_branch_name)
Get Branch Metadata
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.BranchApi(XataClient.ApiClient(configuration))
db_branch_name = XataClient.DBBranchName() # DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`.
try:
# Get Branch Metadata
api_response = api_instance.get_branch_metadata(db_branch_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling BranchApi->get_branch_metadata: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
db_branch_name | DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse2002 get_branch_migration_history(db_branch_name)
Get branch migration history
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.BranchApi(XataClient.ApiClient(configuration))
db_branch_name = XataClient.DBBranchName() # DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`.
try:
# Get branch migration history
api_response = api_instance.get_branch_migration_history(db_branch_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling BranchApi->get_branch_migration_history: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
db_branch_name | DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MigrationsExecuteBody get_branch_migration_plan(db_branch_name, body=body)
Compute migration plan
Compute a migration plan from a target schema the branch should be migrated too.
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.BranchApi(XataClient.ApiClient(configuration))
db_branch_name = XataClient.DBBranchName() # DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`.
body = XataClient.Schema() # Schema | (optional)
try:
# Compute migration plan
api_response = api_instance.get_branch_migration_plan(db_branch_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling BranchApi->get_branch_migration_plan: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
db_branch_name | DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`. | |
body | Schema | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse2003 get_branch_stats(db_branch_name)
Branch stats
Get branch usage metrics.
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.BranchApi(XataClient.ApiClient(configuration))
db_branch_name = XataClient.DBBranchName() # DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`.
try:
# Branch stats
api_response = api_instance.get_branch_stats(db_branch_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling BranchApi->get_branch_stats: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
db_branch_name | DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_branch_metadata(db_branch_name, body=body)
Update branch metadata
Update the branch metadata
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.BranchApi(XataClient.ApiClient(configuration))
db_branch_name = XataClient.DBBranchName() # DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`.
body = XataClient.BranchMetadata() # BranchMetadata | (optional)
try:
# Update branch metadata
api_instance.update_branch_metadata(db_branch_name, body=body)
except ApiException as e:
print("Exception when calling BranchApi->update_branch_metadata: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
db_branch_name | DBBranchName | The DBBranchName matches the pattern `{db_name}:{branch_name}`. | |
body | BranchMetadata | [optional] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]