> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Go SDK - API Methods

# 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**

```go theme={null}
func (rest Rest) Get(
	path string,
	header http.Header,
	extraHeader map[string][]string,
	queryParams map[string]string) (map[string]any, error)
```

**Example**

```go theme={null}
// main.go
...
func main() {
    ...
    path := "tables"
	body, err := rest.Get(path, nil, nil, nil)
}
```

### `Post` method

**Method signature**

```go theme={null}
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**

```go theme={null}
// 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**

```go theme={null}
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**

```go theme={null}
// 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**

```go theme={null}
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**

```go theme={null}
// 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**

```go theme={null}
func (rest Rest) Delete(
	path string,
	header http.Header,
	extraHeader map[string][]string,
	queryParams map[string]string) (map[string]any, error)
```

**Example**

```go theme={null}
// main.go
...
func main() {
    ...
	path := fmt.Sprintf("tables/%s", id)
	queryParams := map[string]string{
		"hardDelete": "true",
		"recursive":  "true",
	}
	rest.Delete(path, nil, nil, queryParams)
}
```
