from metadata.sdk import configurefrom metadata.sdk.entities import StorageServicesconfigure( host="https://your-company.open-metadata.org/api", jwt_token="your-jwt-token")# Retrieve, modify, and updatesvc = StorageServices.retrieve("d1589e1d-2ab0-431c-a383-15e4be20a106")svc.description = "Updated: Production S3 data lake with new region configuration"updated = StorageServices.update(svc)print(f"Updated to version {updated.version.root}")
import org.openmetadata.schema.entity.services.StorageService;import org.openmetadata.sdk.fluent.StorageServices;// Retrieve, modify, and updateStorageService service = StorageServices.retrieve("d1589e1d-2ab0-431c-a383-15e4be20a106");service.setDescription("Updated: Production S3 data lake with new region configuration");StorageService updated = StorageServices.update(service);
# Update by IDcurl -X PATCH "{base_url}/api/v1/services/storageServices/d1589e1d-2ab0-431c-a383-15e4be20a106" \ -H "Authorization: Bearer {access_token}" \ -H "Content-Type: application/json-patch+json" \ -d '[ {"op": "replace", "path": "/description", "value": "Updated: Production S3 data lake with new region configuration"} ]'# Update by namecurl -X PATCH "{base_url}/api/v1/services/storageServices/name/s3_datalake" \ -H "Authorization: Bearer {access_token}" \ -H "Content-Type: application/json-patch+json" \ -d '[ {"op": "replace", "path": "/description", "value": "Updated: Production S3 data lake with new region configuration"} ]'
{ "id": "d1589e1d-2ab0-431c-a383-15e4be20a106", "name": "s3_datalake", "fullyQualifiedName": "s3_datalake", "serviceType": "S3", "description": "Updated: Production S3 data lake with new region configuration", "connection": { "config": { "type": "S3", "awsConfig": { "enabled": false, "awsAccessKeyId": "AKIA...", "awsSecretAccessKey": "*********", "awsRegion": "us-east-1", "endPointURL": "https://s3.amazonaws.com/" } } }, "version": 0.2, "updatedAt": 1769982621820, "updatedBy": "admin", "href": "http://localhost:8585/api/v1/services/storageServices/d1589e1d-2ab0-431c-a383-15e4be20a106", "owners": [], "tags": [], "deleted": false, "domains": []}
Update a Storage Service
Create or update a storage service with a full request body
from metadata.sdk import configurefrom metadata.sdk.entities import StorageServicesconfigure( host="https://your-company.open-metadata.org/api", jwt_token="your-jwt-token")# Retrieve, modify, and updatesvc = StorageServices.retrieve("d1589e1d-2ab0-431c-a383-15e4be20a106")svc.description = "Updated: Production S3 data lake with new region configuration"updated = StorageServices.update(svc)print(f"Updated to version {updated.version.root}")
import org.openmetadata.schema.entity.services.StorageService;import org.openmetadata.sdk.fluent.StorageServices;// Retrieve, modify, and updateStorageService service = StorageServices.retrieve("d1589e1d-2ab0-431c-a383-15e4be20a106");service.setDescription("Updated: Production S3 data lake with new region configuration");StorageService updated = StorageServices.update(service);
# Update by IDcurl -X PATCH "{base_url}/api/v1/services/storageServices/d1589e1d-2ab0-431c-a383-15e4be20a106" \ -H "Authorization: Bearer {access_token}" \ -H "Content-Type: application/json-patch+json" \ -d '[ {"op": "replace", "path": "/description", "value": "Updated: Production S3 data lake with new region configuration"} ]'# Update by namecurl -X PATCH "{base_url}/api/v1/services/storageServices/name/s3_datalake" \ -H "Authorization: Bearer {access_token}" \ -H "Content-Type: application/json-patch+json" \ -d '[ {"op": "replace", "path": "/description", "value": "Updated: Production S3 data lake with new region configuration"} ]'
{ "id": "d1589e1d-2ab0-431c-a383-15e4be20a106", "name": "s3_datalake", "fullyQualifiedName": "s3_datalake", "serviceType": "S3", "description": "Updated: Production S3 data lake with new region configuration", "connection": { "config": { "type": "S3", "awsConfig": { "enabled": false, "awsAccessKeyId": "AKIA...", "awsSecretAccessKey": "*********", "awsRegion": "us-east-1", "endPointURL": "https://s3.amazonaws.com/" } } }, "version": 0.2, "updatedAt": 1769982621820, "updatedBy": "admin", "href": "http://localhost:8585/api/v1/services/storageServices/d1589e1d-2ab0-431c-a383-15e4be20a106", "owners": [], "tags": [], "deleted": false, "domains": []}
Create a storage service or update it if it already exists, using PUT /v1/services/storageServices with the full request body. Send the complete definition, not just the fields you want to change. To change only some fields, use PATCH with a JSON Patch array and the application/json-patch+json content type, as shown in the PATCH examples below.
from metadata.sdk import configurefrom metadata.sdk.entities import StorageServicesconfigure( host="https://your-company.open-metadata.org/api", jwt_token="your-jwt-token")# Retrieve, modify, and updatesvc = StorageServices.retrieve("d1589e1d-2ab0-431c-a383-15e4be20a106")svc.description = "Updated: Production S3 data lake with new region configuration"updated = StorageServices.update(svc)print(f"Updated to version {updated.version.root}")
import org.openmetadata.schema.entity.services.StorageService;import org.openmetadata.sdk.fluent.StorageServices;// Retrieve, modify, and updateStorageService service = StorageServices.retrieve("d1589e1d-2ab0-431c-a383-15e4be20a106");service.setDescription("Updated: Production S3 data lake with new region configuration");StorageService updated = StorageServices.update(service);
# Update by IDcurl -X PATCH "{base_url}/api/v1/services/storageServices/d1589e1d-2ab0-431c-a383-15e4be20a106" \ -H "Authorization: Bearer {access_token}" \ -H "Content-Type: application/json-patch+json" \ -d '[ {"op": "replace", "path": "/description", "value": "Updated: Production S3 data lake with new region configuration"} ]'# Update by namecurl -X PATCH "{base_url}/api/v1/services/storageServices/name/s3_datalake" \ -H "Authorization: Bearer {access_token}" \ -H "Content-Type: application/json-patch+json" \ -d '[ {"op": "replace", "path": "/description", "value": "Updated: Production S3 data lake with new region configuration"} ]'
{ "id": "d1589e1d-2ab0-431c-a383-15e4be20a106", "name": "s3_datalake", "fullyQualifiedName": "s3_datalake", "serviceType": "S3", "description": "Updated: Production S3 data lake with new region configuration", "connection": { "config": { "type": "S3", "awsConfig": { "enabled": false, "awsAccessKeyId": "AKIA...", "awsSecretAccessKey": "*********", "awsRegion": "us-east-1", "endPointURL": "https://s3.amazonaws.com/" } } }, "version": 0.2, "updatedAt": 1769982621820, "updatedBy": "admin", "href": "http://localhost:8585/api/v1/services/storageServices/d1589e1d-2ab0-431c-a383-15e4be20a106", "owners": [], "tags": [], "deleted": false, "domains": []}