mchades commented on code in PR #5218:
URL: https://github.com/apache/gravitino/pull/5218#discussion_r1816120878
##########
docs/manage-relational-metadata-using-gravitino.md:
##########
@@ -180,8 +180,88 @@ Therefore, do not change the catalog's URI unless you
fully understand the conse
:::
+### Enable a catalog
+
+Catalog has a reserved property - `in-use`, which indicates whether the
catalog is available for use. By default, the `in-use` property is set to
`true`.
+To enable a disabled catalog, you can send a `PATCH` request to the
`/api/metalakes/{metalake_name}/catalogs/{catalog_name}` endpoint or use the
Gravitino Java client.
+
+The following is an example of enabling a catalog:
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X PATCH -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{"in-use": true}' \
+http://localhost:8090/api/metalakes/metalake/catalogs\catalog
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+// ...
+// Assuming you have created a metalake named `metalake` and a catalog named
`catalog`
+gravitinoClient.enableCatalog("catalog");
+// ...
+```
+
+</TabItem>
+</Tabs>
+
+:::info
+If the catalog is already enabled, the operation will do nothing.
+:::
+
+### Disable a catalog
+
+Once a catalog is disabled:
+- It can only be [listed](#list-all-catalogs-in-a-metalake),
[loaded](#load-a-catalog), [dropped](#drop-a-catalog), or
[enabled](#enable-a-catalog).
+- Any other operation on the catalog or its sub-entities will result in an
error.
+
+To disable a catalog, you can send a `PATCH` request to the
`/api/metalakes/{metalake_name}/catalogs/{catalog_name}` endpoint or use the
Gravitino Java client.
+
+The following is an example of disabling a catalog:
+
+<Tabs groupId='language' queryString>
+<TabItem value="shell" label="Shell">
+
+```shell
+curl -X PATCH -H "Accept: application/vnd.gravitino.v1+json" \
+-H "Content-Type: application/json" -d '{"in-use": false}' \
+http://localhost:8090/api/metalakes/metalake/catalogs\catalog
+```
+
+</TabItem>
+<TabItem value="java" label="Java">
+
+```java
+// ...
+// Assuming you have created a metalake named `metalake` and a catalog named
`catalog`
+gravitinoClient.disableCatalog("catalog");
+// ...
+```
+
+</TabItem>
+</Tabs>
Review Comment:
added
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]