# Controller api and db table structure

**URL:** <https://openziti.discourse.group/t/controller-api-and-db-table-structure/2529>\
**Category:** sdk-golang\
**Created:** [May 9, 2024, 9:11am UTC](https://openziti.discourse.group/t/controller-api-and-db-table-structure/2529 "2024-05-09T09:11:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhaojun1217](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/zhaojun1217/32/1556_2.png) [@zhaojun1217](https://openziti.discourse.group/u/zhaojun1217)\
**Post date:** [May 9, 2024, 9:11am UTC](https://openziti.discourse.group/t/controller-api-and-db-table-structure/2529/1 "2024-05-09T09:11:09Z")

</div>

I want to customize ZAC and need to modify the API. Is there a provided controller's BoltDB table structure and API documentation? Thank you.

---

<div class="post-metadata">

**Author:** ![plorenz](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/plorenz/32/54_2.png) [@plorenz](https://openziti.discourse.group/u/plorenz)\
**Post date:** [May 9, 2024, 4:38pm UTC](https://openziti.discourse.group/t/controller-api-and-db-table-structure/2529/2 "2024-05-09T16:38:50Z")

</div>

Hi @zhaojun1217

We don't have doc for the boltdb table structure. All the bolt stores are here: [ziti/controller/db at release-next · openziti/ziti · GitHub](https://github.com/openziti/ziti/tree/release-next/controller/db)  
If you just want to browse, you could use `ziti ops db explore` to look at a ziti bolt db. The structure is pretty straightforward. If you have specific questions, we'll do our best to answer them.

The REST apis have swagger specs.

- Fabric: [ziti/controller/specs/swagger.yml at release-next · openziti/ziti · GitHub](https://github.com/openziti/ziti/blob/release-next/controller/specs/swagger.yml)
- Edge Management: [edge-api/management.yml at main · openziti/edge-api · GitHub](https://github.com/openziti/edge-api/blob/main/management.yml)
- Edge Client: [edge-api/client.yml at main · openziti/edge-api · GitHub](https://github.com/openziti/edge-api/blob/main/client.yml)

When we move to OpenAPI 3.0, we'll likely combine the fabric and edge management apis into a single endpoint.

Cheers,  
Paul

---

<div class="post-metadata">

**Author:** ![zhaojun1217](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/zhaojun1217/32/1556_2.png) [@zhaojun1217](https://openziti.discourse.group/u/zhaojun1217)\
**Post date:** [May 10, 2024, 1:04am UTC](https://openziti.discourse.group/t/controller-api-and-db-table-structure/2529/4 "2024-05-10T01:04:52Z")

</div>

This is also helpful, thanks 😃 😃 😃

---

<div class="post-metadata">

**Author:** ![zhaojun1217](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/zhaojun1217/32/1556_2.png) [@zhaojun1217](https://openziti.discourse.group/u/zhaojun1217)\
**Post date:** [May 10, 2024, 2:15am UTC](https://openziti.discourse.group/t/controller-api-and-db-table-structure/2529/5 "2024-05-10T02:15:45Z")

</div>

I want to modify the identityType section to differentiate between various types such as mac, android, ios, and router. Currently, I see only two types: router and default. This may require modifying the identityTypes bucket, new version, 'user', 'service', and 'device' are replaced. If it's not easily modifiable, I might consider adding a new field in the identities bucket

---

<div class="post-metadata">

**Author:** ![plorenz](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/plorenz/32/54_2.png) [@plorenz](https://openziti.discourse.group/u/plorenz)\
**Post date:** [May 10, 2024, 12:39pm UTC](https://openziti.discourse.group/t/controller-api-and-db-table-structure/2529/6 "2024-05-10T12:39:00Z")

</div>

Have you considered using tags on identities?

```sh
$ ziti edge create identity android-user --tags type=android
New identity android-user created with id: dPqmD8Qne
$ ziti edge create identity android-user2 --tags type=android
New identity android-user2 created with id: NWpKD5QCDq
$ ziti edge create identity ios-user --tags type=ios
New identity ios-user created with id: dQGme8xnDq
$ ziti edge list identities 'tags.type="android"'
╭────────────┬───────────────┬─────────┬────────────┬─────────────╮
│ ID │ NAME │ TYPE │ ATTRIBUTES │ AUTH-POLICY │
├────────────┼───────────────┼─────────┼────────────┼─────────────┤
│ NWpKD5QCDq │ android-user2 │ Default │ │ Default │
│ dPqmD8Qne │ android-user │ Default │ │ Default │
╰────────────┴───────────────┴─────────┴────────────┴─────────────╯
results: 1-2 of 2
$

```

---

<div class="post-metadata">

**Author:** ![zhaojun1217](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/zhaojun1217/32/1556_2.png) [@zhaojun1217](https://openziti.discourse.group/u/zhaojun1217)\
**Post date:** [May 11, 2024, 1:49am UTC](https://openziti.discourse.group/t/controller-api-and-db-table-structure/2529/7 "2024-05-11T01:49:56Z")

</div>

I overlooked the tag! I think this should be more convenient. Let me try. 👍
