diff --git a/spec/namespaces/rollups.yaml b/spec/namespaces/rollups.yaml new file mode 100644 index 000000000..c9ce1071a --- /dev/null +++ b/spec/namespaces/rollups.yaml @@ -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 diff --git a/spec/schemas/rollups._common.yaml b/spec/schemas/rollups._common.yaml new file mode 100644 index 000000000..e847affe4 --- /dev/null +++ b/spec/schemas/rollups._common.yaml @@ -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 +