PUT /v1/databases/{id}/followers
from metadata.sdk import configure
from metadata.sdk.entities import Databases
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
database_id = "550e8400-e29b-41d4-a716-446655440000"
user_id = "user-uuid-here"
# Add a follower
database = Databases.add_followers(database_id, [user_id])
print(f"Followers: {len(database.followers)}")
# Remove a follower
database = Databases.remove_followers(database_id, [user_id])
# Add a vote
database = Databases.add_vote(database_id, vote_type="votedUp")
# Remove a vote
database = Databases.remove_vote(database_id)
# Get profiler config
config = Databases.get_profiler_config(database_id)
# Set profiler config
Databases.set_profiler_config(database_id, {
"profileSample": 50,
"profileSampleType": "PERCENTAGE",
"sampleDataCount": 200
})
# Delete profiler config
Databases.delete_profiler_config(database_id)
import static org.openmetadata.sdk.fluent.Databases.*;
String databaseId = "550e8400-e29b-41d4-a716-446655440000";
// Followers - use REST client directly
// Votes and profiler config - use REST client directly
// See curl examples for request format
# Add a follower
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/followers" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '"2e4b2c7a-f3d1-4e5b-a8c9-1b2d3e4f5a6b"'
# Remove a follower
curl -X DELETE "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/followers/2e4b2c7a-f3d1-4e5b-a8c9-1b2d3e4f5a6b" \
-H "Authorization: Bearer {access_token}"
# Add a vote
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/vote" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"updatedVoteType": "votedUp"}'
# Remove a vote
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/vote" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"updatedVoteType": "unVoted"}'
# Get profiler config
curl "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/profilerConfig" \
-H "Authorization: Bearer {access_token}"
# Set profiler config
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/profilerConfig" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"profileSample": 50,
"profileSampleType": "PERCENTAGE",
"sampleDataCount": 200
}'
# Delete profiler config
curl -X DELETE "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/profilerConfig" \
-H "Authorization: Bearer {access_token}"
{
"id": "1d08c2c6-cea7-4adf-9043-0f6a6aaf9721",
"name": "default",
"fullyQualifiedName": "mysql_sample.default",
"tags": [],
"version": 0.1,
"updatedAt": 1769982658682,
"updatedBy": "admin",
"href": "http://localhost:8585/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721",
"owners": [],
"service": {
"id": "4724c3cb-d4b8-4ac0-aa55-e8bb66f01ac3",
"type": "databaseService",
"name": "mysql_sample",
"fullyQualifiedName": "mysql_sample",
"displayName": "mysql_sample",
"deleted": false,
"href": "http://localhost:8585/api/v1/services/databaseServices/4724c3cb-d4b8-4ac0-aa55-e8bb66f01ac3"
},
"serviceType": "Mysql",
"followers": [
{
"id": "2e4b2c7a-f3d1-4e5b-a8c9-1b2d3e4f5a6b",
"type": "user",
"name": "admin",
"fullyQualifiedName": "admin",
"deleted": false,
"href": "http://localhost:8585/api/v1/users/2e4b2c7a-f3d1-4e5b-a8c9-1b2d3e4f5a6b"
}
],
"default": false,
"deleted": false,
"domains": [],
"entityStatus": "Unprocessed"
}
Advanced Database Operations
Manage followers, votes, and profiler configuration for databases
PUT
/
v1
/
databases
/
{id}
/
followers
PUT /v1/databases/{id}/followers
from metadata.sdk import configure
from metadata.sdk.entities import Databases
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
database_id = "550e8400-e29b-41d4-a716-446655440000"
user_id = "user-uuid-here"
# Add a follower
database = Databases.add_followers(database_id, [user_id])
print(f"Followers: {len(database.followers)}")
# Remove a follower
database = Databases.remove_followers(database_id, [user_id])
# Add a vote
database = Databases.add_vote(database_id, vote_type="votedUp")
# Remove a vote
database = Databases.remove_vote(database_id)
# Get profiler config
config = Databases.get_profiler_config(database_id)
# Set profiler config
Databases.set_profiler_config(database_id, {
"profileSample": 50,
"profileSampleType": "PERCENTAGE",
"sampleDataCount": 200
})
# Delete profiler config
Databases.delete_profiler_config(database_id)
import static org.openmetadata.sdk.fluent.Databases.*;
String databaseId = "550e8400-e29b-41d4-a716-446655440000";
// Followers - use REST client directly
// Votes and profiler config - use REST client directly
// See curl examples for request format
# Add a follower
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/followers" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '"2e4b2c7a-f3d1-4e5b-a8c9-1b2d3e4f5a6b"'
# Remove a follower
curl -X DELETE "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/followers/2e4b2c7a-f3d1-4e5b-a8c9-1b2d3e4f5a6b" \
-H "Authorization: Bearer {access_token}"
# Add a vote
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/vote" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"updatedVoteType": "votedUp"}'
# Remove a vote
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/vote" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"updatedVoteType": "unVoted"}'
# Get profiler config
curl "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/profilerConfig" \
-H "Authorization: Bearer {access_token}"
# Set profiler config
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/profilerConfig" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"profileSample": 50,
"profileSampleType": "PERCENTAGE",
"sampleDataCount": 200
}'
# Delete profiler config
curl -X DELETE "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/profilerConfig" \
-H "Authorization: Bearer {access_token}"
{
"id": "1d08c2c6-cea7-4adf-9043-0f6a6aaf9721",
"name": "default",
"fullyQualifiedName": "mysql_sample.default",
"tags": [],
"version": 0.1,
"updatedAt": 1769982658682,
"updatedBy": "admin",
"href": "http://localhost:8585/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721",
"owners": [],
"service": {
"id": "4724c3cb-d4b8-4ac0-aa55-e8bb66f01ac3",
"type": "databaseService",
"name": "mysql_sample",
"fullyQualifiedName": "mysql_sample",
"displayName": "mysql_sample",
"deleted": false,
"href": "http://localhost:8585/api/v1/services/databaseServices/4724c3cb-d4b8-4ac0-aa55-e8bb66f01ac3"
},
"serviceType": "Mysql",
"followers": [
{
"id": "2e4b2c7a-f3d1-4e5b-a8c9-1b2d3e4f5a6b",
"type": "user",
"name": "admin",
"fullyQualifiedName": "admin",
"deleted": false,
"href": "http://localhost:8585/api/v1/users/2e4b2c7a-f3d1-4e5b-a8c9-1b2d3e4f5a6b"
}
],
"default": false,
"deleted": false,
"domains": [],
"entityStatus": "Unprocessed"
}
Advanced Database Operations
Manage followers, votes, and profiler configuration for database entities.Followers
Add Followers
PUT /v1/databases/{id}/followers
UUID of the database.
UUID of the user to add as a follower (sent as request body string).
Remove Follower
DELETE /v1/databases/{id}/followers/{userId}
UUID of the database.
UUID of the user to remove.
Votes
Add or Update Vote
PUT /v1/databases/{id}/vote
UUID of the database.
Vote type:
votedUp, votedDown, or unVoted.Profiler Configuration
Get Profiler Config
GET /v1/databases/{id}/profilerConfig
Set Profiler Config
PUT /v1/databases/{id}/profilerConfig
Delete Profiler Config
DELETE /v1/databases/{id}/profilerConfig
PUT /v1/databases/{id}/followers
from metadata.sdk import configure
from metadata.sdk.entities import Databases
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
database_id = "550e8400-e29b-41d4-a716-446655440000"
user_id = "user-uuid-here"
# Add a follower
database = Databases.add_followers(database_id, [user_id])
print(f"Followers: {len(database.followers)}")
# Remove a follower
database = Databases.remove_followers(database_id, [user_id])
# Add a vote
database = Databases.add_vote(database_id, vote_type="votedUp")
# Remove a vote
database = Databases.remove_vote(database_id)
# Get profiler config
config = Databases.get_profiler_config(database_id)
# Set profiler config
Databases.set_profiler_config(database_id, {
"profileSample": 50,
"profileSampleType": "PERCENTAGE",
"sampleDataCount": 200
})
# Delete profiler config
Databases.delete_profiler_config(database_id)
import static org.openmetadata.sdk.fluent.Databases.*;
String databaseId = "550e8400-e29b-41d4-a716-446655440000";
// Followers - use REST client directly
// Votes and profiler config - use REST client directly
// See curl examples for request format
# Add a follower
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/followers" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '"2e4b2c7a-f3d1-4e5b-a8c9-1b2d3e4f5a6b"'
# Remove a follower
curl -X DELETE "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/followers/2e4b2c7a-f3d1-4e5b-a8c9-1b2d3e4f5a6b" \
-H "Authorization: Bearer {access_token}"
# Add a vote
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/vote" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"updatedVoteType": "votedUp"}'
# Remove a vote
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/vote" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"updatedVoteType": "unVoted"}'
# Get profiler config
curl "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/profilerConfig" \
-H "Authorization: Bearer {access_token}"
# Set profiler config
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/profilerConfig" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"profileSample": 50,
"profileSampleType": "PERCENTAGE",
"sampleDataCount": 200
}'
# Delete profiler config
curl -X DELETE "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/profilerConfig" \
-H "Authorization: Bearer {access_token}"
{
"id": "1d08c2c6-cea7-4adf-9043-0f6a6aaf9721",
"name": "default",
"fullyQualifiedName": "mysql_sample.default",
"tags": [],
"version": 0.1,
"updatedAt": 1769982658682,
"updatedBy": "admin",
"href": "http://localhost:8585/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721",
"owners": [],
"service": {
"id": "4724c3cb-d4b8-4ac0-aa55-e8bb66f01ac3",
"type": "databaseService",
"name": "mysql_sample",
"fullyQualifiedName": "mysql_sample",
"displayName": "mysql_sample",
"deleted": false,
"href": "http://localhost:8585/api/v1/services/databaseServices/4724c3cb-d4b8-4ac0-aa55-e8bb66f01ac3"
},
"serviceType": "Mysql",
"followers": [
{
"id": "2e4b2c7a-f3d1-4e5b-a8c9-1b2d3e4f5a6b",
"type": "user",
"name": "admin",
"fullyQualifiedName": "admin",
"deleted": false,
"href": "http://localhost:8585/api/v1/users/2e4b2c7a-f3d1-4e5b-a8c9-1b2d3e4f5a6b"
}
],
"default": false,
"deleted": false,
"domains": [],
"entityStatus": "Unprocessed"
}
Error Handling
| Code | Error Type | Description |
|---|---|---|
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission |
404 | NOT_FOUND | Database or user does not exist |
Was this page helpful?
⌘I