Skip to content

Commit

Permalink
Rollups API spec (#283)
Browse files Browse the repository at this point in the history
* Add rollup API spec

Signed-off-by: djmadeira <djmadeira@me.com>
  • Loading branch information
djmadeira committed May 13, 2024
1 parent 6b36951 commit deeb400
Show file tree
Hide file tree
Showing 2 changed files with 373 additions and 0 deletions.
178 changes: 178 additions & 0 deletions spec/namespaces/rollups.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
openapi: 3.1.0
info:
title: OpenSearch Index Rollups API
description: OpenSearch Index Rollups API
version: 1.0.0
paths:
/_plugins/_rollup/jobs/{id}:
get:
operationId: rollups.get.0
x-operation-group: rollups.get
x-version-added: 1.0
description: Get an index rollup.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#get-an-index-rollup-job
parameters:
- $ref: '#/components/parameters/rollups.get::path.id'
responses:
'200':
$ref: '#/components/responses/rollups.get@200'
put:
operationId: rollups.put.0
x-operation-group: rollups.put
x-version-added: 1.0
description: Create or update index rollup.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#create-or-update-an-index-rollup-job
responses:
'200':
$ref: '#/components/responses/rollups.put@200'
parameters:
- $ref: '#/components/parameters/rollups.put::path.id'
- $ref: '#/components/parameters/rollups.put::query.if_seq_no'
- $ref: '#/components/parameters/rollups.put::query.if_primary_term'
requestBody:
$ref: '#/components/requestBodies/rollups.put'
delete:
operationId: rollups.delete.0
x-operation-group: rollups.delete
x-version-added: 1.0
description: Delete index rollup.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#delete-an-index-rollup-job
responses:
'200':
$ref: '#/components/responses/rollups.delete@200'
parameters:
- $ref: '#/components/parameters/rollups.delete::path.id'
/_plugins/_rollup/jobs/{id}/_start:
post:
operationId: rollups.start.0
x-operation-group: rollups.start
x-version-added: 1.0
description: Start rollup.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#start-or-stop-an-index-rollup-job
parameters:
- $ref: '#/components/parameters/rollups.start::path.id'
responses:
'200':
$ref: '#/components/responses/rollups.start@200'
/_plugins/_rollup/jobs/{id}/_stop:
post:
operationId: rollups.stop.0
x-operation-group: rollups.stop
x-version-added: 1.0
description: Stop rollup.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#start-or-stop-an-index-rollup-job
parameters:
- $ref: '#/components/parameters/rollups.stop::path.id'
responses:
'200':
$ref: '#/components/responses/rollups.stop@200'
/_plugins/_rollup/jobs/{id}/_explain:
get:
operationId: rollups.explain.0
x-operation-group: rollups.explain
x-version-added: 1.0
description: Get a rollup's current status.
externalDocs:
url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#explain-an-index-rollup-job
parameters:
- $ref: '#/components/parameters/rollups.explain::path.id'
responses:
'200':
$ref: '#/components/responses/rollups.explain@200'
components:
requestBodies:
rollups.put:
content:
application/json:
schema:
$ref: '../schemas/rollups._common.yaml#/components/schemas/RollupEntity'
responses:
rollups.get@200:
content:
application/json:
schema:
$ref: '../schemas/rollups._common.yaml#/components/schemas/RollupEntity'
rollups.put@200:
content:
application/json:
schema:
$ref: '../schemas/rollups._common.yaml#/components/schemas/RollupEntity'
rollups.delete@200:
description: ''
rollups.start@200:
description: ''
rollups.stop@200:
description: ''
rollups.explain@200:
content:
application/json:
schema:
$ref: '../schemas/rollups._common.yaml#/components/schemas/ExplainEntities'
parameters:
rollups.get::path.id:
name: id
in: path
description: Rollup to access
required: true
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Id'
style: simple
rollups.put::path.id:
name: id
in: path
description: Rollup to access
required: true
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Id'
style: simple
rollups.delete::path.id:
name: id
in: path
description: Rollup to access
required: true
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Id'
style: simple
rollups.start::path.id:
name: id
in: path
description: Rollup to access
required: true
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Id'
style: simple
rollups.stop::path.id:
name: id
in: path
description: Rollup to access
required: true
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Id'
style: simple
rollups.explain::path.id:
name: id
in: path
description: Rollup to access
required: true
schema:
$ref: '../schemas/_common.yaml#/components/schemas/Id'
style: simple
rollups.put::query.if_seq_no:
name: if_seq_no
in: query
description: Only perform the operation if the document has this sequence number.
schema:
$ref: '../schemas/_common.yaml#/components/schemas/SequenceNumber'
style: form
rollups.put::query.if_primary_term:
name: if_primary_term
in: query
description: Only perform the operation if the document has this primary term.
schema:
type: number
style: form
195 changes: 195 additions & 0 deletions spec/schemas/rollups._common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
openapi: 3.1.0
info:
title: Schemas of rollup._common category
description: Schemas of rollup._common category
version: 1.0.0
paths: {}
components:
schemas:
RollupEntity:
type: object
properties:
_id:
type: string
_seqNo:
type: number
_primaryTerm:
type: number
rollup:
$ref: '#/components/schemas/Rollup'
Rollup:
type: object
properties:
rollup_id:
type: string
enabled:
type: boolean
schedule:
$ref: '#/components/schemas/Schedule'
last_updated_time:
type: number
enabled_time:
type: number
description:
type: string
schema_version:
type: number
source_index:
type: string
target_index:
type: string
metadata_id:
type: string
page_size:
type: number
delay:
type: number
continuous:
type: boolean
dimensions:
type: array
items:
$ref: '#/components/schemas/DimensionsConfigItem'
metrics:
type: array
items:
$ref: '#/components/schemas/MetricsConfigItem'
error_notification:
type: string
description: 'Set up a Mustache message template for error notifications. For example, if an index rollup job fails, the system sends a message to a Slack channel.'
ExplainEntities:
type: object
properties:
item:
$ref: '#/components/schemas/Explain'
Explain:
type: object
properties:
rollup_id:
type: string
last_updated_time:
type: number
continuous:
$ref: '#/components/schemas/Continuous'
DimensionsConfigItem:
type: object
properties:
histogram:
$ref: '#/components/schemas/HistogramDimension'
date_histogram:
$ref: '#/components/schemas/DateHistogramDimension'
terms:
$ref: '#/components/schemas/TermsDimension'
minproperties: 1
maxproperties: 1
DateHistogramDimension:
type: object
properties:
fixed_interval:
type: string
calendar_interval:
type: string
timezone:
type: string
source_field:
type: string
target_field:
type: string
HistogramDimension:
type: object
properties:
source_field:
type: string
target_field:
type: string
interval:
type: string
TermsDimension:
type: object
properties:
source_field:
type: string
target_field:
type: string
MetricsConfigItem:
type: object
properties:
source_field:
type: string
target_field:
type: string
metrics:
type: array
items:
$ref: '#/components/schemas/MetricsConfigMetrics'
MetricsConfigMetrics:
type: object
properties:
avg:
type: object
sum:
type: object
max:
type: object
min:
type: object
value_count:
type: object
minproperties: 1
maxproperties: 1
Cron:
type: object
properties:
expression:
type: string
timezone:
type: string
Schedule:
type: object
properties:
interval:
$ref: '#/components/schemas/Interval'
Interval:
type: object
properties:
start_time:
type: number
period:
type: number
unit:
type: string
cron:
oneOf:
- type: array
items:
$ref: '#/components/schemas/Cron'
- $ref: '#/components/schemas/Cron'
schedule_delay:
type: number
Continuous:
type: object
properties:
next_window_start_time:
type: number
next_window_end_time:
type: number
status:
type: string
failure_reason:
type: string
stats:
$ref: '#/components/schemas/Stats'
Stats:
type: object
properties:
pages_processsed:
type: number
documents_processed:
type: number
rollups_indexed:
type: number
index_time_in_ms:
type: number
search_time_in_ms:
type: number

0 comments on commit deeb400

Please sign in to comment.