Documentation Index
Fetch the complete documentation index at: https://openmetadata-feat-feat-2mbfixdeploy.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Go SDK - API Methods
Once you have instantiated a Rest object you can call any of the following methods to perform operations against the OpenMetadata API.
Get method
Method signature
func (rest Rest) Get(
path string,
header http.Header,
extraHeader map[string][]string,
queryParams map[string]string) (map[string]any, error)
Example
// main.go
...
func main() {
...
path := "tables"
body, err := rest.Get(path, nil, nil, nil)
}
Post method
Method signature
func (rest Rest) Post(
path string,
data map[string]interface{},
header http.Header,
extraHeader map[string][]string,
queryParams map[string]string) (map[string]any, error)
Example
// main.go
...
func main() {
...
path := "tables"
data := map[string]interface{}{
"name": "goClientTestTable",
"databaseSchema": "sample_data.ecommerce_db.shopify",
"columns": []map[string]interface{}{
{
"name": "columnOne",
"dataType": "NUMBER",
},
{
"name": "columnTwo",
"dataType": "NUMBER",
},
},
}
body, err := rest.Post(path, data, nil, nil, nil)
}
Put method
Method signature
func (rest Rest) Put(
path string,
data map[string]interface{},
header http.Header,
extraHeader map[string][]string,
queryParams map[string]string) (map[string]any, error)
Example
// main.go
...
func main() {
...
path := "tables"
data := map[string]interface{}{
"name": "goClientTestTable",
"databaseSchema": "sample_data.ecommerce_db.shopify",
"columns": []map[string]interface{}{
{
"name": "columnOne",
"dataType": "NUMBER",
},
{
"name": "columnTwo",
"dataType": "NUMBER",
},
{
"name": "columnThree",
"dataType": "NUMBER",
},
},
}
body, err := rest.Put(path, data, nil, nil, nil)
}
Patch method
Method signature
func (rest Rest) Patch(
path string,
data []map[string]interface{},
header http.Header,
extraHeader map[string][]string,
queryParams map[string]string) (map[string]any, error)
Example
// main.go
...
func main() {
...
path := "tables"
patchPath := fmt.Sprintf("tables/%s", id)
data := []map[string]interface{}{
{
"op": "add",
"path": "/description",
"value": "This is a test table",
},
}
body, err := rest.Patch(patchPath, data, nil, nil, nil)
}
Delete method
Method signature
func (rest Rest) Delete(
path string,
header http.Header,
extraHeader map[string][]string,
queryParams map[string]string) (map[string]any, error)
Example
// main.go
...
func main() {
...
path := fmt.Sprintf("tables/%s", id)
queryParams := map[string]string{
"hardDelete": "true",
"recursive": "true",
}
rest.Delete(path, nil, nil, queryParams)
}