Browse Source

HUE-8331 [metadata] Document how to update table or column properties

Romain Rigaux 7 years ago
parent
commit
f09edf3673
2 changed files with 21 additions and 0 deletions
  1. 7 0
      desktop/libs/metadata/src/metadata/catalog/base.py
  2. 14 0
      docs/sdk/sdk.md

+ 7 - 0
desktop/libs/metadata/src/metadata/catalog/base.py

@@ -76,10 +76,12 @@ class Api(object):
   # To implement
 
   def search_entities_interactive(self, query_s=None, limit=100, **filters):
+    """For the top search"""
     return {}
 
 
   def find_entity(self, source_type, type, name, **filters):
+    """e.g. From a database and table name, retrieve the enity id"""
     return {}
 
 
@@ -98,6 +100,11 @@ class Api(object):
   def delete_tags(self, entity_id, tags):
     return {}
 
+
+  def update_properties(self, entity_id, properties, modified_custom_metadata=None, deleted_custom_metadata_keys=None):
+    """For updating entity comments or other attributes"""
+    return {}
+
   # Common APIs
 
   def get_database(self, name):

+ 14 - 0
docs/sdk/sdk.md

@@ -1005,6 +1005,20 @@ The backends is pluggable by providing alternative [client interfaces](https://g
 </pre>
 
 
+### Finding an entity in order to get its id
+
+<pre>
+     $.get("/metadata/api/navigator/find_entity", {
+        type: "table",
+        database: "default",
+        name: "sample_07",
+        interface: "dummy"
+      }, function(data) {
+        console.log(ko.mapping.toJSON(data));
+      });
+</pre>
+
+
 ### Adding/updating a comment with the dummy backend
 
 <pre>