mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
4.2 KiB
4.2 KiB
\AuditAPI
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| GetAudit | Get /v1/audit | Reads the caller's OWN org audit trail, newest first, with the total the filter matched so a console can page it. |
GetAudit
AuditTrailPage GetAudit(ctx).Sub(sub).Action(action).Resource(resource).ResourceId(resourceId).Result(result).Since(since).Until(until).PageSize(pageSize).P(p).Execute()
Reads the caller's OWN org audit trail, newest first, with the total the filter matched so a console can page it.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
sub := "sub_example" // string | Sub narrows the trail to one actor — the validated subject that made the request. Blank means every actor in the org. (optional)
action := "machine.create" // string | Action narrows it to one action name, e.g. \"machine.create\". (optional)
resource := "resource_example" // string | Resource narrows it to one resource TYPE, e.g. \"apikey\". (optional)
resourceId := "resourceId_example" // string | ResourceID narrows it to one resource instance. (optional)
result := "success" // string | Result narrows it to one outcome: \"success\", \"deny\" or \"error\". (optional)
since := "2026-07-01T00:00:00Z" // string | Since is the inclusive lower time bound, RFC3339. An unparseable value is ignored rather than refused — one malformed filter must not hide the trail. (optional)
until := "until_example" // string | Until is the upper time bound, RFC3339, with the same tolerance. (optional)
pageSize := "50" // string | PageSize is rows per page, default 100. A value that is not a positive integer falls back to the default. (optional)
p := "p_example" // string | Page is the 1-based page number, driving the offset. Anything below 2 reads the first page. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AuditAPI.GetAudit(context.Background()).Sub(sub).Action(action).Resource(resource).ResourceId(resourceId).Result(result).Since(since).Until(until).PageSize(pageSize).P(p).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AuditAPI.GetAudit``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAudit`: AuditTrailPage
fmt.Fprintf(os.Stdout, "Response from `AuditAPI.GetAudit`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiGetAuditRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| sub | string | Sub narrows the trail to one actor — the validated subject that made the request. Blank means every actor in the org. | |
| action | string | Action narrows it to one action name, e.g. "machine.create". | |
| resource | string | Resource narrows it to one resource TYPE, e.g. "apikey". | |
| resourceId | string | ResourceID narrows it to one resource instance. | |
| result | string | Result narrows it to one outcome: "success", "deny" or "error". | |
| since | string | Since is the inclusive lower time bound, RFC3339. An unparseable value is ignored rather than refused — one malformed filter must not hide the trail. | |
| until | string | Until is the upper time bound, RFC3339, with the same tolerance. | |
| pageSize | string | PageSize is rows per page, default 100. A value that is not a positive integer falls back to the default. | |
| p | string | Page is the 1-based page number, driving the offset. Anything below 2 reads the first page. |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]