> ## Documentation Index
> Fetch the complete documentation index at: https://datum-4926dda5-mintlify-style-consistency-1774830500.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Activity

# activity.miloapis.com/v1alpha1

Package v1alpha1 contains API Schema definitions for the activity v1alpha1 API group

#### AuditLogFacetsQuerySpec

AuditLogFacetsQuerySpec defines which facets to retrieve from audit logs.

*Appears in:*

* [AuditLogFacetsQuery](#auditlogfacetsquery)

| Field                                                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Default | Validation |
| ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ---------- |
| `timeRange` <br />*[FacetTimeRange](#facettimerange)* | TimeRange limits the time window for facet aggregation.<br /><br />If not specified, defaults to the last 7 days.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |         |            |
| `filter` <br />*string*                               | Filter narrows the audit logs before computing facets using CEL.<br /><br />This allows you to get facet values for a subset of audit logs.<br /><br />Available Fields:<br />  verb               - API action: get, list, create, update, patch, delete, watch<br />  user.username      - who made the request (user or service account)<br />  user.uid           - unique user identifier<br />  responseStatus.code - HTTP response code (200, 201, 404, 500, etc.)<br />  objectRef.namespace - target resource namespace<br />  objectRef.resource  - resource type (pods, deployments, secrets, configmaps, etc.)<br />  objectRef.apiGroup  - API group of the resource<br />  objectRef.name     - specific resource name<br />Operators: ==, !=, \<, >, \<=, >=, &&, \|\|, !, in<br />String Functions: startsWith(), endsWith(), contains()<br />Examples:<br />  "verb in \['create', 'update', 'delete']"        - Facets for write operations only<br />  "!(verb in \['get', 'list', 'watch'])"           - Exclude read-only operations<br />  "!user.username.startsWith('system:')"          - Exclude system users<br />  "objectRef.namespace == 'production'"           - Facets for production namespace |         |            |
| `facets` <br />*[FacetSpec](#facetspec) array*        | Facets specifies which fields to get distinct values for.<br /><br />Each facet returns the top N values with counts.<br /><br />Supported fields:<br />  - verb: API action (get, list, create, update, patch, delete, watch)<br />  - user.username: Actor display names<br />  - user.uid: Unique user identifiers<br />  - responseStatus.code: HTTP response codes<br />  - objectRef.namespace: Namespaces<br />  - objectRef.resource: Resource types<br />  - objectRef.apiGroup: API groups                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |         |            |

#### AuditLogFacetsQueryStatus

AuditLogFacetsQueryStatus contains the facet results.

*Appears in:*

* [AuditLogFacetsQuery](#auditlogfacetsquery)

| Field                                              | Description                                           | Default | Validation |
| -------------------------------------------------- | ----------------------------------------------------- | ------- | ---------- |
| `facets` <br />*[FacetResult](#facetresult) array* | Facets contains the results for each requested facet. |         |            |

#### AuditLogQuery

AuditLogQuery searches your control plane's audit logs.

Use this to investigate incidents, track resource changes, generate compliance reports,
or analyze user activity. Results are returned in the Status field, ordered newest-first.

Quick Start:

apiVersion: activity.miloapis.com/v1alpha1
kind: AuditLogQuery
metadata:
name: recent-deletions
spec:
startTime: "now-30d"       # last 30 days
endTime: "now"
filter: "verb == 'delete'" # optional: narrow your search
limit: 100

Time Formats:

* Relative: "now-30d" (great for dashboards and recurring queries)
* Absolute: "2024-01-01T00:00:00Z" (great for historical analysis)

*Appears in:*

* [AuditLogQueryList](#auditlogquerylist)

| Field                                                                                                                | Description                                                     | Default | Validation |
| -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | ------- | ---------- |
| `metadata` <br />*[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v/#objectmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |         |            |
| `spec` <br />*[AuditLogQuerySpec](#auditlogqueryspec)*                                                               |                                                                 |         |            |
| `status` <br />*[AuditLogQueryStatus](#auditlogquerystatus)*                                                         |                                                                 |         |            |

#### AuditLogQuerySpec

AuditLogQuerySpec defines the search parameters.

Required: startTime and endTime define your search window.
Optional: filter (narrow results), limit (page size, default 100), continue (pagination).

Performance: Smaller time ranges and specific filters perform better. The maximum time window
is typically 30 days. If your range is too large, you'll get an error with guidance on splitting
your query into smaller chunks.

*Appears in:*

* [AuditLogQuery](#auditlogquery)

| Field                      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Default | Validation |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ---------- |
| `startTime` <br />*string* | StartTime is the beginning of your search window (inclusive).<br /><br />Format Options:<br />- Relative: "now-30d", "now-2h", "now-30m" (units: s, m, h, d, w)<br />  Use for dashboards and recurring queries - they adjust automatically.<br />- Absolute: "2024-01-01T00:00:00Z" (RFC3339 with timezone)<br />  Use for historical analysis of specific time periods.<br /><br />Examples:<br />  "now-30d"                     → 30 days ago<br />  "2024-06-15T14:30:00-05:00"   → specific time with timezone offset                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |         |            |
| `endTime` <br />*string*   | EndTime is the end of your search window (exclusive).<br /><br />Uses the same formats as StartTime. Commonly "now" for current moment.<br /><br />Must be greater than StartTime.<br /><br />Examples:<br />  "now"                  → current time<br />  "2024-01-02T00:00:00Z" → specific end point                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |         |            |
| `filter` <br />*string*    | Filter narrows results using CEL (Common Expression Language). Leave empty to get all events.<br /><br />Available Fields:<br />  verb               - API action: get, list, create, update, patch, delete, watch<br />  auditID            - unique event identifier<br />  requestReceivedTimestamp - when the API server received the request (RFC3339 timestamp)<br />  user.username      - who made the request (user or service account)<br />  user.uid           - unique user identifier (stable across username changes)<br />  responseStatus.code - HTTP response code (200, 201, 404, 500, etc.)<br />  objectRef.namespace - target resource namespace<br />  objectRef.resource  - resource type (pods, deployments, secrets, configmaps, etc.)<br />  objectRef.name     - specific resource name<br />Operators: ==, !=, \<, >, \<=, >=, &&, \|\|, !, in<br />String Functions: startsWith(), endsWith(), contains()<br />Common Patterns:<br />  "verb == 'delete'"                                    - All deletions<br />  "objectRef.namespace == 'production'"                 - Activity in production namespace<br />  "verb in \['create', 'update', 'delete', 'patch']"     - All write operations<br />  "!(verb in \['get', 'list', 'watch'])"                 - Exclude read-only operations<br />  "responseStatus.code >= 400"                          - Failed requests<br />  "user.username.startsWith('system:serviceaccount:')"  - Service account activity<br />  "!user.username.startsWith('system:')"                - Exclude system users<br />  "user.uid == '550e8400-e29b-41d4-a716-446655440000'"  - Specific user by UID<br />  "objectRef.resource == 'secrets'"                     - Secret access<br />  "verb == 'delete' && objectRef.namespace == 'production'" - Production deletions<br />Note: Use single quotes for strings. Field names are case-sensitive.<br /><br />CEL reference: [https://cel.dev](https://cel.dev) |         |            |
| `limit` <br />*integer*    | Limit sets the maximum number of results per page.<br /><br />Default: 100, Maximum: 1000.<br /><br />Use smaller values (10-50) for exploration, larger (500-1000) for data collection.<br /><br />Use continue to fetch additional pages.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |         |            |
| `continue` <br />*string*  | Continue is the pagination cursor for fetching additional pages.<br /><br />Leave empty for the first page. If status.continue is non-empty after a query,<br />copy that value here in a new query with identical parameters to get the next page.<br /><br />Repeat until status.continue is empty.<br /><br />Important: Keep all other parameters (startTime, endTime, filter, limit) identical<br />across paginated requests. The cursor is opaque - copy it exactly without modification.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |         |            |

#### AuditLogQueryStatus

AuditLogQueryStatus contains the query results and pagination state.

*Appears in:*

* [AuditLogQuery](#auditlogquery)

| Field                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Default | Validation |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- | ---------- |
| `results` <br />*Event array*       | Results contains matching audit events, sorted newest-first.<br /><br />Each event follows the Kubernetes audit.Event format with fields like:<br />  verb, user.username, objectRef.\{namespace,resource,name}, requestReceivedTimestamp,<br />  stageTimestamp, responseStatus.code, requestObject, responseObject<br />Empty results? Try broadening your filter or time range.<br /><br />Full documentation: [https://kubernetes.io/docs/reference/config-api/apiserver-audit.v1/](https://kubernetes.io/docs/reference/config-api/apiserver-audit.v1/) |         |            |
| `continue` <br />*string*           | Continue is the pagination cursor.<br /><br />Non-empty means more results are available - copy this to spec.continue for the next page.<br /><br />Empty means you have all results.                                                                                                                                                                                                                                                                                                                                                                        |         |            |
| `effectiveStartTime` <br />*string* | EffectiveStartTime is the actual start time used for this query (RFC3339 format).<br /><br />When you use relative times like "now-7d", this shows the exact timestamp that was<br />calculated. Useful for understanding exactly what time range was queried, especially<br />for auditing, debugging, or recreating queries with absolute timestamps.<br /><br />Example: If you query with startTime="now-7d" at 2025-12-17T12:00:00Z,<br />this will be "2025-12-10T12:00:00Z".                                                                          |         |            |
| `effectiveEndTime` <br />*string*   | EffectiveEndTime is the actual end time used for this query (RFC3339 format).<br /><br />When you use relative times like "now", this shows the exact timestamp that was<br />calculated. Useful for understanding exactly what time range was queried.<br /><br />Example: If you query with endTime="now" at 2025-12-17T12:00:00Z,<br />this will be "2025-12-17T12:00:00Z".                                                                                                                                                                               |         |            |

#### FacetResult

FacetResult contains the distinct values for a single facet.

*Appears in:*

* [AuditLogFacetsQueryStatus](#auditlogfacetsquerystatus)

| Field                                            | Description                                           | Default | Validation |
| ------------------------------------------------ | ----------------------------------------------------- | ------- | ---------- |
| `field` <br />*string*                           | Field is the field path that was queried.             |         |            |
| `values` <br />*[FacetValue](#facetvalue) array* | Values contains the distinct values and their counts. |         |            |

#### FacetSpec

FacetSpec defines a single facet to retrieve.

*Appears in:*

* [AuditLogFacetsQuerySpec](#auditlogfacetsqueryspec)

| Field                   | Description                                                                                                                                                                                                                                                                                                                                                                                                      | Default | Validation |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ---------- |
| `field` <br />*string*  | Field is the activity field path to get distinct values for.<br /><br />Supported fields:<br />  - spec.actor.name: Actor display names<br />  - spec.actor.type: Actor types (user, serviceaccount, controller)<br />  - spec.resource.apiGroup: API groups<br />  - spec.resource.kind: Resource kinds<br />  - spec.resource.namespace: Namespaces<br />  - spec.changeSource: Change sources (human, system) |         |            |
| `limit` <br />*integer* | Limit is the maximum number of distinct values to return.<br /><br />Default: 20, Maximum: 100.                                                                                                                                                                                                                                                                                                                  |         |            |

#### FacetTimeRange

FacetTimeRange specifies the time window for facet queries.

*Appears in:*

* [AuditLogFacetsQuerySpec](#auditlogfacetsqueryspec)

| Field                  | Description                                                                                                                        | Default | Validation |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------- | ---------- |
| `start` <br />*string* | Start is the beginning of the time window (inclusive).<br /><br />Supports RFC3339 timestamps and relative times (e.g., "now-7d"). |         |            |
| `end` <br />*string*   | End is the end of the time window (exclusive).<br /><br />Supports RFC3339 timestamps and relative times. Defaults to "now".       |         |            |

#### FacetValue

FacetValue represents a single distinct value with its occurrence count.

*Appears in:*

* [FacetResult](#facetresult)

| Field                   | Description                                        | Default | Validation |
| ----------------------- | -------------------------------------------------- | ------- | ---------- |
| `value` <br />*string*  | Value is the distinct field value.                 |         |            |
| `count` <br />*integer* | Count is the number of activities with this value. |         |            |
