PUT /v1/databases/{id}/followers
from metadata.sdk import configure, client
from metadata.sdk.entities import Databases
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
rest = client().ometa.client
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.root)}")
# Remove a follower
database = Databases.remove_followers(database_id, [user_id])
# Add a vote
rest.put(f"/databases/{database_id}/vote", json={"updatedVoteType": "votedUp"})
# Remove a vote
rest.put(f"/databases/{database_id}/vote", json={"updatedVoteType": "unVoted"})
# Get profiler config
database = Databases.retrieve(database_id, fields=["databaseProfilerConfig"])
print(database.databaseProfilerConfig)
# Set profiler config
rest.put(f"/databases/{database_id}/databaseProfilerConfig", json={
"profileSampleConfig": {
"sampleConfigType": "STATIC",
"config": {
"profileSample": 50,
"profileSampleType": "PERCENTAGE"
}
},
"sampleDataCount": 200
})
# Delete profiler config
rest.delete(f"/databases/{database_id}/databaseProfilerConfig")
import java.util.Map;
import java.util.UUID;
import org.openmetadata.schema.entity.data.Database;
import org.openmetadata.schema.type.DatabaseProfilerConfig;
import org.openmetadata.sdk.network.HttpMethod;
// client is an initialized OpenMetadataClient.
String databaseId = "550e8400-e29b-41d4-a716-446655440000";
String userId = "b6f7a1e2-3c4d-4e5f-8a9b-0c1d2e3f4a5b";
// Add a follower
client.getHttpClient().executeForString(
HttpMethod.PUT,
"/v1/databases/" + databaseId + "/followers",
UUID.fromString(userId)
);
// Remove a follower
client.getHttpClient().executeForString(
HttpMethod.DELETE,
"/v1/databases/" + databaseId + "/followers/" + userId,
null
);
// Add a vote
client.getHttpClient().executeForString(
HttpMethod.PUT,
"/v1/databases/" + databaseId + "/vote",
Map.of("updatedVoteType", "votedUp")
);
// Remove a vote
client.getHttpClient().executeForString(
HttpMethod.PUT,
"/v1/databases/" + databaseId + "/vote",
Map.of("updatedVoteType", "unVoted")
);
// Get profiler config
Database database = client.databases().get(databaseId, "databaseProfilerConfig");
DatabaseProfilerConfig profilerConfig = database.getDatabaseProfilerConfig();
// Set profiler config
client.getHttpClient().executeForString(
HttpMethod.PUT,
"/v1/databases/" + databaseId + "/databaseProfilerConfig",
Map.of(
"profileSampleConfig", Map.of(
"sampleConfigType", "STATIC",
"config", Map.of("profileSample", 50, "profileSampleType", "PERCENTAGE")
),
"sampleDataCount", 200
)
);
// Delete profiler config
client.getHttpClient().executeForString(
HttpMethod.DELETE,
"/v1/databases/" + databaseId + "/databaseProfilerConfig",
null
);
# 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/databaseProfilerConfig" \
-H "Authorization: Bearer {access_token}"
# Set profiler config
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/databaseProfilerConfig" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"profileSampleConfig": {
"sampleConfigType": "STATIC",
"config": {
"profileSample": 50,
"profileSampleType": "PERCENTAGE"
}
},
"sampleDataCount": 200
}'
# Delete profiler config
curl -X DELETE "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/databaseProfilerConfig" \
-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, client
from metadata.sdk.entities import Databases
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
rest = client().ometa.client
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.root)}")
# Remove a follower
database = Databases.remove_followers(database_id, [user_id])
# Add a vote
rest.put(f"/databases/{database_id}/vote", json={"updatedVoteType": "votedUp"})
# Remove a vote
rest.put(f"/databases/{database_id}/vote", json={"updatedVoteType": "unVoted"})
# Get profiler config
database = Databases.retrieve(database_id, fields=["databaseProfilerConfig"])
print(database.databaseProfilerConfig)
# Set profiler config
rest.put(f"/databases/{database_id}/databaseProfilerConfig", json={
"profileSampleConfig": {
"sampleConfigType": "STATIC",
"config": {
"profileSample": 50,
"profileSampleType": "PERCENTAGE"
}
},
"sampleDataCount": 200
})
# Delete profiler config
rest.delete(f"/databases/{database_id}/databaseProfilerConfig")
import java.util.Map;
import java.util.UUID;
import org.openmetadata.schema.entity.data.Database;
import org.openmetadata.schema.type.DatabaseProfilerConfig;
import org.openmetadata.sdk.network.HttpMethod;
// client is an initialized OpenMetadataClient.
String databaseId = "550e8400-e29b-41d4-a716-446655440000";
String userId = "b6f7a1e2-3c4d-4e5f-8a9b-0c1d2e3f4a5b";
// Add a follower
client.getHttpClient().executeForString(
HttpMethod.PUT,
"/v1/databases/" + databaseId + "/followers",
UUID.fromString(userId)
);
// Remove a follower
client.getHttpClient().executeForString(
HttpMethod.DELETE,
"/v1/databases/" + databaseId + "/followers/" + userId,
null
);
// Add a vote
client.getHttpClient().executeForString(
HttpMethod.PUT,
"/v1/databases/" + databaseId + "/vote",
Map.of("updatedVoteType", "votedUp")
);
// Remove a vote
client.getHttpClient().executeForString(
HttpMethod.PUT,
"/v1/databases/" + databaseId + "/vote",
Map.of("updatedVoteType", "unVoted")
);
// Get profiler config
Database database = client.databases().get(databaseId, "databaseProfilerConfig");
DatabaseProfilerConfig profilerConfig = database.getDatabaseProfilerConfig();
// Set profiler config
client.getHttpClient().executeForString(
HttpMethod.PUT,
"/v1/databases/" + databaseId + "/databaseProfilerConfig",
Map.of(
"profileSampleConfig", Map.of(
"sampleConfigType", "STATIC",
"config", Map.of("profileSample", 50, "profileSampleType", "PERCENTAGE")
),
"sampleDataCount", 200
)
);
// Delete profiler config
client.getHttpClient().executeForString(
HttpMethod.DELETE,
"/v1/databases/" + databaseId + "/databaseProfilerConfig",
null
);
# 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/databaseProfilerConfig" \
-H "Authorization: Bearer {access_token}"
# Set profiler config
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/databaseProfilerConfig" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"profileSampleConfig": {
"sampleConfigType": "STATIC",
"config": {
"profileSample": 50,
"profileSampleType": "PERCENTAGE"
}
},
"sampleDataCount": 200
}'
# Delete profiler config
curl -X DELETE "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/databaseProfilerConfig" \
-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
string
required
UUID of the database.
string
required
UUID of the user to add as a follower (sent as request body string).
Remove Follower
DELETE /v1/databases/{id}/followers/{userId}
string
required
UUID of the database.
string
required
UUID of the user to remove.
Votes
Add or Update Vote
PUT /v1/databases/{id}/vote
string
required
UUID of the database.
string
required
Vote type:
votedUp, votedDown, or unVoted.Profiler Configuration
Get Profiler Config
GET /v1/databases/{id}/databaseProfilerConfig
Set Profiler Config
PUT /v1/databases/{id}/databaseProfilerConfig
Delete Profiler Config
DELETE /v1/databases/{id}/databaseProfilerConfig
PUT /v1/databases/{id}/followers
from metadata.sdk import configure, client
from metadata.sdk.entities import Databases
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
rest = client().ometa.client
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.root)}")
# Remove a follower
database = Databases.remove_followers(database_id, [user_id])
# Add a vote
rest.put(f"/databases/{database_id}/vote", json={"updatedVoteType": "votedUp"})
# Remove a vote
rest.put(f"/databases/{database_id}/vote", json={"updatedVoteType": "unVoted"})
# Get profiler config
database = Databases.retrieve(database_id, fields=["databaseProfilerConfig"])
print(database.databaseProfilerConfig)
# Set profiler config
rest.put(f"/databases/{database_id}/databaseProfilerConfig", json={
"profileSampleConfig": {
"sampleConfigType": "STATIC",
"config": {
"profileSample": 50,
"profileSampleType": "PERCENTAGE"
}
},
"sampleDataCount": 200
})
# Delete profiler config
rest.delete(f"/databases/{database_id}/databaseProfilerConfig")
import java.util.Map;
import java.util.UUID;
import org.openmetadata.schema.entity.data.Database;
import org.openmetadata.schema.type.DatabaseProfilerConfig;
import org.openmetadata.sdk.network.HttpMethod;
// client is an initialized OpenMetadataClient.
String databaseId = "550e8400-e29b-41d4-a716-446655440000";
String userId = "b6f7a1e2-3c4d-4e5f-8a9b-0c1d2e3f4a5b";
// Add a follower
client.getHttpClient().executeForString(
HttpMethod.PUT,
"/v1/databases/" + databaseId + "/followers",
UUID.fromString(userId)
);
// Remove a follower
client.getHttpClient().executeForString(
HttpMethod.DELETE,
"/v1/databases/" + databaseId + "/followers/" + userId,
null
);
// Add a vote
client.getHttpClient().executeForString(
HttpMethod.PUT,
"/v1/databases/" + databaseId + "/vote",
Map.of("updatedVoteType", "votedUp")
);
// Remove a vote
client.getHttpClient().executeForString(
HttpMethod.PUT,
"/v1/databases/" + databaseId + "/vote",
Map.of("updatedVoteType", "unVoted")
);
// Get profiler config
Database database = client.databases().get(databaseId, "databaseProfilerConfig");
DatabaseProfilerConfig profilerConfig = database.getDatabaseProfilerConfig();
// Set profiler config
client.getHttpClient().executeForString(
HttpMethod.PUT,
"/v1/databases/" + databaseId + "/databaseProfilerConfig",
Map.of(
"profileSampleConfig", Map.of(
"sampleConfigType", "STATIC",
"config", Map.of("profileSample", 50, "profileSampleType", "PERCENTAGE")
),
"sampleDataCount", 200
)
);
// Delete profiler config
client.getHttpClient().executeForString(
HttpMethod.DELETE,
"/v1/databases/" + databaseId + "/databaseProfilerConfig",
null
);
# 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/databaseProfilerConfig" \
-H "Authorization: Bearer {access_token}"
# Set profiler config
curl -X PUT "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/databaseProfilerConfig" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"profileSampleConfig": {
"sampleConfigType": "STATIC",
"config": {
"profileSample": 50,
"profileSampleType": "PERCENTAGE"
}
},
"sampleDataCount": 200
}'
# Delete profiler config
curl -X DELETE "{base_url}/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721/databaseProfilerConfig" \
-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?