Skip to main content

Manage Metalakes

Introduction

This page covers the Gravitino API for metalakes. For what a metalake is, what it isolates, the in-use behavior, deletion semantics, and permissions, see Metalakes.

Metalakes sit above any single metalake, so these operations use the admin client rather than the client used for everything inside one. Creating a metalake is reserved for service admins, configured with gravitino.authorization.serviceAdmins.

Metalake Operations

Create a Metalake

curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" -d '{
"name": "production",
"comment": "Production estate",
"properties": {}
}' http://localhost:8090/api/metalakes

Load a Metalake

curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
http://localhost:8090/api/metalakes/production

Alter a Metalake

Changes are applied as a list in one request.

ChangeJSONJavaPython
Rename{"@type":"rename","newName":"metalake_renamed"}MetalakeChange.rename("metalake_renamed")MetalakeChange.rename("metalake_renamed")
Update the comment{"@type":"updateComment","newComment":"new_comment"}MetalakeChange.updateComment("new_comment")MetalakeChange.update_comment("new_comment")
Set a property{"@type":"setProperty","property":"key1","value":"value1"}MetalakeChange.setProperty("key1", "value1")MetalakeChange.set_property("key1", "value1")
Remove a property{"@type":"removeProperty","property":"key1"}MetalakeChange.removeProperty("key1")MetalakeChange.remove_property("key1")
curl -X PUT -H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" -d '{
"updates": [
{"@type": "updateComment", "newComment": "Production estate, EMEA"}
]
}' http://localhost:8090/api/metalakes/production

Enable or Disable a Metalake

A metalake that is not in use can only be listed, loaded, enabled, or dropped. Enabling one that is already in use does nothing, and the same is true of disabling one already out of use.

curl -X PATCH -H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" -d '{"inUse": false}' \
http://localhost:8090/api/metalakes/production

Drop a Metalake

Without force, the metalake must have no catalogs and must not be in use. With force, Gravitino removes the metalake and everything registered under it, whether or not it is in use. External systems are left alone; managed objects are removed with their data.

curl -X DELETE -H "Accept: application/vnd.gravitino.v1+json" \
"http://localhost:8090/api/metalakes/production?force=false"

List Metalakes

curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
http://localhost:8090/api/metalakes