Replace an export schedule
Changed onReplaces an export schedule's name, status, dataset, focus, format, compression, and filters, and returns the result. The schedule keeps its identifier.
- The request carries the full schedule, so an omitted filters clears the filters, an omitted status resumes a paused schedule, and an omitted managed_by resets to {}.
- Setting status to paused pauses the schedule, and setting it to active resumes it.
- The replacement applies to the periods that end after it. Exports that the schedule already created don't change. If runs are late, the replacement first creates the missed exports with the earlier settings, within the schedule's limit of 31 periods.
- cadence and time_zone can't change, so the body repeats their stored values. If either differs, the request fails with 400 naming the field. Redefining a schedule's periods takes a delete and a create.
- An omitted time_zone counts as UTC, so a replacement of a schedule in another time zone that omits it fails with 400.
- If the organization has no export schedule with this identifier, or the identifier isn't a valid UUID, the request fails with 404. The request never creates a schedule.
Request
- Base URLhttps://global.api.konghq.com
- Auth
- HTTP bearer
- or HTTP bearer
- or HTTP bearer
- or HTTP bearer
Path parameters
The id of the export schedule.
Request body
The body of a request that creates or replaces an export schedule. It carries the full schedule without id, next_run_at, created_at, and updated_at, which the server sets.
A human-readable name for the schedule.
1 to 100 characters after the server removes leading and trailing whitespace.
The length of each period, which sets the range of each export.
A replacement can't change it.
The IANA time zone in which the periods start. Each export that the schedule creates has this time_zone.
An IANA time zone name as the time zone database spells it, such as Europe/Budapest. Offsets such as +02:00 aren't accepted. A replacement can't change it, so a replacement of a schedule whose time_zone isn't UTC must repeat it. Defaults to UTC.
Whether the schedule creates exports.
Defaults to active, so a replacement that omits status resumes a paused schedule.
The data that each export holds.
The schema version of each export's data files within the dataset, which fixes their columns and values. Each export that the schedule creates copies it, so a newer schema version doesn't change the schedule's exports.
Defaults to 1, also once newer schema versions exist, so a replacement that omits schema_version sets 1.
The FOCUS options of each export.
Required when dataset is focus, and isn't accepted for any other dataset.
The file format of each export's data files.
How each export's data files are compressed.
none or gzip for csv, and zstd for parquet.
Filters that select the events to export, with the same fields, operators, shape, and nesting limit as the filters of POST /v1/ai-cost-management/events/query. Every filter must match.
Defaults to {}.
Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.
Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
Identifies the tool that manages this resource, such as {"tool": "terraform-provider-konnect"}. The service stores the value and never acts on it. An omitted value on replacement resets to {}.
Example request
{
"format": "csv",
"compression": "gzip",
"labels": {
"env": "test"
},
"managed_by": {
"owner": "terraform"
}
}Response
The export schedule after the replacement.
An export schedule exports the organization's usage period by period, such as month by month. An active schedule creates one export of each period as the period ends. Each export is an ordinary export whose schedule names the schedule: it's listed, downloaded, and expires like a one-time export. Its files follow the dataset's rule: one for each day for usage_events, and one for each calendar month for focus. Each export of a daily usage_events schedule or a monthly focus schedule therefore has one file.
- The export of a period has the period's start as starts_at and its end as ends_at, and the schedule's other settings as they are when the export is created.
- When a schedule becomes active, by creation or by resuming, its first period is the one in progress. That period's export covers the whole period, including the time before the schedule became active.
- A schedule exports each period once and never refreshes it, even when events of the period arrive later. A scheduled export that fails stays failed, and the schedule doesn't create it again. To include later events or to fill a failed period, a client creates a one-time export of the same range.
- When runs are late, for example after an outage, the schedule catches up on at most the 31 most recent periods that ended while it was active, and skips older ones.
Contains a unique identifier used for this resource.
A human-readable name for the schedule.
1 to 100 characters after the server removes leading and trailing whitespace.
The length of each period, which sets the range of each export.
A replacement can't change it.
The IANA time zone in which the periods start. Each export that the schedule creates has this time_zone.
A replacement can't change it.
Whether the schedule creates exports.
The data that each export holds.
The schema version of each export's data files within the dataset, which fixes their columns and values.
The FOCUS options of each export, with defaults applied.
null unless dataset is focus.
The file format of each export's data files.
How each export's data files are compressed.
The filters of each export. {} for none.
Key-value metadata on the schedule. The schedule list can filter by label. Each export that the schedule creates copies the labels as they are at that moment.
Identifies the tool that manages this resource, such as {"tool": "terraform-provider-konnect"}. The service stores the value and never acts on it.
When the period in progress ends and the schedule creates its export, as an RFC 3339 timestamp in UTC. That export starts 6 hours later, so that events that arrive late can be stored first.
null while the schedule is paused. It's in the past while a run is late.
An ISO-8601 timestamp representation of entity creation date.
An ISO-8601 timestamp representation of entity update date.
Example response
{
"id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
"format": "csv",
"compression": "gzip",
"labels": {
"env": "test"
},
"managed_by": {
"owner": "terraform"
},
"created_at": "2022-11-04T20:10:06.927Z",
"updated_at": "2022-11-04T20:10:06.927Z"
}Changes
- warning
added the new
2.00enum value to theallOf[subschema #1]/schema_version/allOf[#/components/schemas/AICostExportSchemaVersion]response property for the response status - info
added the new
2.00enum value to the request propertyallOf[subschema #1]/schema_version/allOf[#/components/schemas/AICostExportSchemaVersion]
- warning
- info
added the new optional request property
allOf[subschema #1]/managed_by
1 more change in this revision
- info