Skip to content

feat: expand the serverstatus API surface - #440

Merged
NickJosevski merged 2 commits into
mainfrom
nj/serverstatus-endpoints
Aug 11, 2026
Merged

feat: expand the serverstatus API surface#440
NickJosevski merged 2 commits into
mainfrom
nj/serverstatus-endpoints

Conversation

@NickJosevski

@NickJosevski NickJosevski commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Refs #47.

ServerStatusService exposed only Get. Adds newclient functions for every endpoint on the ServerStatus resource:

Function Endpoint
GetServerStatus /api/serverstatus
GetHealthStatus /api/serverstatus/health
GetTimezones /api/serverstatus/timezones
GetDocumentCounts /api/serverstatus/counts
GetSystemInfo /api/serverstatus/system-info
GetRecentLogs /api/serverstatus/logs{?skip,take,includeDetail}
GetSystemReport /api/serverstatus/system-report

Also adds the missing IsPotentialClone field on ServerStatus.

Notes:

  • GetSystemReport returns an io.ReadCloser — the endpoint serves a zip archive, not JSON. The caller closes it.
  • GetSystemInfo, GetRecentLogs and GetSystemReport require the AdministerSystem permission.
  • SystemInfo.Uptime is left as the server's time span string; FromTimeSpan lives in machinepolicies/machines, so parsing it here would mean importing one of those.
  • /api/serverstatus/extensions is not included; it 404s and is not advertised on the resource.

All response shapes verified against a live server. e2e tests cover all seven, and unit tests pin the LogsQuery expansion.

@NickJosevski
NickJosevski marked this pull request as ready for review August 7, 2026 05:22
@NickJosevski
NickJosevski force-pushed the nj/serverstatus-endpoints branch from e5b3f5e to ec8c550 Compare August 10, 2026 06:51

@YuKitsune YuKitsune left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Server status stuff looks good, not sure about the action template stuff though. Is that an unrelated change that snuck in?

// input query parameter.
func GetByQuery(client newclient.Client, spaceID string, actionTemplatesQuery Query) (*resources.Resources[*ActionTemplate], error) {
return newclient.GetByQuery[ActionTemplate](client, template, spaceID, actionTemplatesQuery)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes don't seem related.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch removed now

NickJosevski and others added 2 commits August 11, 2026 11:38
Adds GetServerStatus, GetHealthStatus, GetTimezones and GetDocumentCounts
as newclient functions, and the missing IsPotentialClone field on
ServerStatus. Shapes verified against a live server.

Refs #47

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds GetSystemInfo, GetRecentLogs and GetSystemReport. The report is a zip
archive, so it returns an io.ReadCloser. All three require the
AdministerSystem permission. Shapes verified against a live server.

Refs #47

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@NickJosevski
NickJosevski force-pushed the nj/serverstatus-endpoints branch from ec8c550 to 375764f Compare August 11, 2026 01:39
@NickJosevski
NickJosevski merged commit 9020da2 into main Aug 11, 2026
6 checks passed
@NickJosevski
NickJosevski deleted the nj/serverstatus-endpoints branch August 11, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants