Favorite Facets API Reference :: Kloudfuse Docs
Favorite Facets API Reference
Table of Contents
- List Favorite Facets
- List Favorite Facet Groups
- Add a Favorite Facet
- Edit a Favorite Facet
- Remove a Favorite Facet
- Remove a Favorite Facet Group
- Error Handling
- See Also
Favorite facets are managed through the GraphQL endpoint at /query.
All operations use POST with a JSON body containing a query key (for reads) or mutation key (for writes).
Replace <your-instance> with your Kloudfuse hostname and <sa-token> with a valid Service Account token.
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/query" \
-d '{"query": "..."}'
List Favorite Facets
Returns facets matching an optional search string, with optional group filter and pagination.
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/query" \
-d '{
"query": "query { getFavoriteFacets(contains: \"\", limit: 100) { name dataType group displayName source folderUid } }"
}'
Parameters (all optional):
| Parameter | Type | Description |
|---|---|---|
contains |
string | Filter by display name substring. Default: "" (all). |
group |
string | Filter to a specific facet group. |
cursor |
string | Pagination cursor from a previous response. |
limit |
int | Maximum results to return. |
Response
{
"data": {
"getFavoriteFacets": [
{
"name": "resource_name",
"dataType": "STRING",
"group": "Infrastructure",
"displayName": "resource_name",
"source": "",
"folderUid": "ffec62bbr7v28d"
}
]
}
}
List Favorite Facet Groups
Returns all group names that contain at least one favorite facet.
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/query" \
-d '{"query": "query { getFavoriteFacetGroups(limit: 1000) }"}'
Response
{
"data": {
"getFavoriteFacetGroups": [
"Infrastructure",
"Application",
"Recents"
]
}
}
Add a Favorite Facet
Creates a new favorite facet, optionally assigning it to a folder.
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/query" \
-d '{
"query": "mutation($datatype: String!, $displayName: String!, $facet: String!, $facetGroup: String!, $source: String, $folderUid: String) { addFavoriteFacet(source: $source, facet: $facet, facetGroup: $facetGroup, displayName: $displayName, datatype: $datatype, folderUid: $folderUid) }",
"variables": {
"datatype": "STRING",
"displayName": "service_name",
"facet": "service_name",
"facetGroup": "Infrastructure",
"source": "",
"folderUid": "ffec62bbr7v28d"
}
}'
Variables:
| Variable | Type | Required | Description |
|---|---|---|---|
facet |
string | Yes | The raw field name in the telemetry data. |
displayName |
string | Yes | Human-readable label shown in the UI. |
datatype |
string | Yes | Data type: STRING, NUMBER, or BOOLEAN. |
facetGroup |
string | Yes | Group the facet appears under in the UI. |
source |
string | No | Source identifier (leave empty for log facets). |
folderUid |
string | No | Folder to assign the facet to. Omit for root. |
Response
{
"data": {
"addFavoriteFacet": true
}
}
Edit a Favorite Facet
Renames a facet, moves it to a different group, or reassigns it to a different folder.
Identify the facet by its current displayName and facetGroup.
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/query" \
-d '{
"query": "mutation($displayName: String!, $facetGroup: String!, $newFacetGroup: String!, $newDisplayName: String!, $folderUid: String) { editFavoriteFacet(display_name: $displayName, facetGroup: $facetGroup, editInfo: {newGroup: $newFacetGroup, newDisplayName: $newDisplayName, newFolderUid: $folderUid}) }",
"variables": {
"displayName": "service_name",
"facetGroup": "Infrastructure",
"newFacetGroup": "Application",
"newDisplayName": "app_service_name",
"folderUid": "bfec62n4wfpq8e"
}
}'
Response
{
"data": {
"editFavoriteFacet": true
}
}
Remove a Favorite Facet
Deletes a specific facet identified by its display name and group.
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/query" \
-d '{
"query": "mutation { removeFavoriteFacet(display_name: \"app_service_name\", facetGroup: \"Application\") }"
}'
Response
{
"data": {
"removeFavoriteFacet": true
}
}
Remove a Favorite Facet Group
Deletes an entire facet group and all facets within it.
curl -H "Authorization: Bearer <sa-token>" \
-H "Content-Type: application/json" \
-X POST "https://<your-instance>/query" \
-d '{
"query": "mutation { removeFacetGroup(facetGroup: \"Application\") }"
}'
Response
{
"data": {
"removeFacetGroup": true
}
}
Error Handling
GraphQL errors are returned with HTTP 200 in an errors array:
{
"errors": [
{
"message": "facet group not found",
"path": ["removeFacetGroup"]
}
]
}