Skip to content

Commit

Permalink
Replication namespace (#464)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tokesh authored Nov 18, 2024
1 parent bf35601 commit 4771bfd
Show file tree
Hide file tree
Showing 10 changed files with 849 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .cspell
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ authc
authinfo
authtoken
autocut
autofollow
backendroles
backpressure
beider
Expand Down Expand Up @@ -74,6 +75,7 @@ ignorecase
integ
internalusers
Intertransport
ipam
Jelinek
kibanainfo
kibanaserver
Expand All @@ -90,6 +92,7 @@ lucene
Lucene
lycheeverse
marvinpinto
memlock
metaphone
mget
millis
Expand Down Expand Up @@ -206,6 +209,7 @@ Translog
trbl
truststore
tubone
ulimits
Undeploys
unigrams
Unmanaged
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
tests: routing
- version: 2.18.0
tests: snapshot
- version: 2.18.0
tests: plugins/replication
url: http://localhost:9200
- version: 2.18.0
tests: plugins/streaming
- version: 2.18.0
Expand Down Expand Up @@ -89,6 +92,7 @@ jobs:
--opensearch-insecure \
--opensearch-version=${{ matrix.entry.version }} \
--coverage coverage/test-spec-coverage-${{ steps.tests.outputs.hash }}.json \
--opensearch-url=${{ matrix.entry.url || 'https://localhost:9200'}} \
--tests=tests/${{ matrix.entry.tests || 'default' }}
- name: Get Container Logs
Expand Down
1 change: 1 addition & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
https://localhost:*
http://localhost:*
http://webhook:8080
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added support for request headers in tests [#461](https://github.com/opensearch-project/opensearch-api-specification/pull/461)
- Added metadata additionalProperties to `ErrorCause` ([#462](https://github.com/opensearch-project/opensearch-api-specification/pull/462))
- Added `creation_date` field to `DanglingIndex` ([#462](https://github.com/opensearch-project/opensearch-api-specification/pull/462))
- Added `replication` namespace API specifications ([#464](https://github.com/opensearch-project/opensearch-api-specification/pull/464))
- Added doc on `cluster create-index blocked` workaround ([#465](https://github.com/opensearch-project/opensearch-api-specification/pull/465))
- Added `observability` namespace API specifications ([#474](https://github.com/opensearch-project/opensearch-api-specification/pull/474))
- Added support for reusing output variables as keys in payload expectations ([#471](https://github.com/opensearch-project/opensearch-api-specification/pull/471))
Expand Down
301 changes: 301 additions & 0 deletions spec/namespaces/replication.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,301 @@
openapi: 3.1.0
info:
title: OpenSearch Replication API
description: OpenSearch Replication API.
version: 1.0.0
paths:
/_plugins/_replication/{index}/_start:
put:
operationId: replication.start.0
x-operation-group: replication.start
x-version-added: '1.1'
description: Initiate replication of an index from the leader cluster to the follower cluster.
externalDocs:
url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#start-replication
parameters:
- $ref: '#/components/parameters/replication.start::path.index'
requestBody:
$ref: '#/components/requestBodies/replication.start'
responses:
'200':
$ref: '#/components/responses/replication.start@200'
/_plugins/_replication/{index}/_stop:
post:
operationId: replication.stop.0
x-operation-group: replication.stop
x-version-added: '1.1'
description: Terminates replication and converts the follower index to a standard index.
externalDocs:
url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#stop-replication
parameters:
- $ref: '#/components/parameters/replication.stop::path.index'
requestBody:
$ref: '#/components/requestBodies/replication.stop'
responses:
'200':
$ref: '#/components/responses/replication.stop@200'
/_plugins/_replication/{index}/_pause:
post:
operationId: replication.pause.0
x-operation-group: replication.pause
x-version-added: '1.1'
description: Pauses replication of the leader index.
externalDocs:
url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#pause-replication
parameters:
- $ref: '#/components/parameters/replication.pause::path.index'
requestBody:
$ref: '#/components/requestBodies/replication.pause'
responses:
'200':
$ref: '#/components/responses/replication.pause@200'
/_plugins/_replication/{index}/_resume:
post:
operationId: replication.resume.0
x-operation-group: replication.resume
x-version-added: '1.1'
description: Resumes replication of the leader index.
externalDocs:
url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#resume-replication
parameters:
- $ref: '#/components/parameters/replication.resume::path.index'
requestBody:
$ref: '#/components/requestBodies/replication.resume'
responses:
'200':
$ref: '#/components/responses/replication.resume@200'
/_plugins/_replication/{index}/_status:
get:
operationId: replication.status.0
x-operation-group: replication.status
x-version-added: '1.1'
description: Gets the status of index replication.
externalDocs:
url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-replication-status
parameters:
- $ref: '#/components/parameters/replication.status::path.index'
responses:
'200':
$ref: '#/components/responses/replication.status@200'
/_plugins/_replication/leader_stats:
get:
operationId: replication.leader_stats.0
x-operation-group: replication.leader_stats
x-version-added: '1.1'
description: Gets information about replicated leader indexes on a specified cluster.
externalDocs:
url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-leader-cluster-stats
responses:
'200':
$ref: '#/components/responses/replication.leader_stats@200'
/_plugins/_replication/follower_stats:
get:
operationId: replication.follower_stats.0
x-operation-group: replication.follower_stats
x-version-added: '1.1'
description: Gets information about follower (syncing) indexes on a specified cluster.
externalDocs:
url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-follower-cluster-stats
responses:
'200':
$ref: '#/components/responses/replication.follower_stats@200'
/_plugins/_replication/autofollow_stats:
get:
operationId: replication.autofollow_stats.0
x-operation-group: replication.autofollow_stats
x-version-added: '1.1'
description: Gets information about auto-follow activity and any replication rules configured on the specified cluster.
externalDocs:
url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-auto-follow-stats
responses:
'200':
$ref: '#/components/responses/replication.autofollow_stats@200'
/_plugins/_replication/{index}/_update:
put:
operationId: replication.update_settings.0
x-operation-group: replication.update_settings
x-version-added: '1.1'
description: Updates settings on the follower index.
externalDocs:
url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#update-settings
parameters:
- $ref: '#/components/parameters/replication.update_settings::path.index'
requestBody:
$ref: '#/components/requestBodies/replication.update_settings'
responses:
'200':
$ref: '#/components/responses/replication.update_settings@200'
/_plugins/_replication/_autofollow:
post:
operationId: replication.create_replication_rule.0
x-operation-group: replication.create_replication_rule
x-version-added: '1.1'
description: Automatically starts replication on indexes matching a specified pattern.
externalDocs:
url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#create-replication-rule
requestBody:
$ref: '#/components/requestBodies/replication.create_replication_rule'
responses:
'200':
$ref: '#/components/responses/replication.create_replication_rule@200'
delete:
operationId: replication.delete_replication_rule.0
x-operation-group: replication.delete_replication_rule
x-version-added: '1.1'
description: Deletes the specified replication rule.
externalDocs:
url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#delete-replication-rule
requestBody:
$ref: '#/components/requestBodies/replication.delete_replication_rule'
responses:
'200':
$ref: '#/components/responses/replication.delete_replication_rule@200'
components:
parameters:
replication.start::path.index:
in: path
name: index
description: Name of the data stream, index, or index alias to perform bulk actions on.
required: true
schema:
$ref: '../schemas/_common.yaml#/components/schemas/IndexName'
style: simple
replication.stop::path.index:
in: path
name: index
description: Name of the data stream, index, or index alias to perform bulk actions on.
required: true
schema:
$ref: '../schemas/_common.yaml#/components/schemas/IndexName'
style: simple
replication.pause::path.index:
in: path
name: index
description: Name of the data stream, index, or index alias to perform bulk actions on.
required: true
schema:
$ref: '../schemas/_common.yaml#/components/schemas/IndexName'
style: simple
replication.resume::path.index:
in: path
name: index
description: Name of the data stream, index, or index alias to perform bulk actions on.
required: true
schema:
$ref: '../schemas/_common.yaml#/components/schemas/IndexName'
style: simple
replication.status::path.index:
in: path
name: index
description: Name of the data stream, index, or index alias to perform bulk actions on.
required: true
schema:
$ref: '../schemas/_common.yaml#/components/schemas/IndexName'
style: simple
replication.update_settings::path.index:
in: path
name: index
description: Name of the data stream, index, or index alias to perform bulk actions on.
required: true
schema:
$ref: '../schemas/_common.yaml#/components/schemas/IndexName'
style: simple
requestBodies:
replication.start:
content:
application/json:
schema:
$ref: '../schemas/replication._common.yaml#/components/schemas/Replication'
required: true
replication.stop:
content:
application/json:
schema:
type: object
required: true
replication.pause:
content:
application/json:
schema:
type: object
required: true
replication.resume:
content:
application/json:
schema:
type: object
required: true
replication.update_settings:
content:
application/json:
schema:
$ref: '../schemas/replication._common.yaml#/components/schemas/UpdateSettings'
required: true
replication.create_replication_rule:
content:
application/json:
schema:
$ref: '../schemas/replication._common.yaml#/components/schemas/CreateReplicationRule'
required: true
replication.delete_replication_rule:
content:
application/json:
schema:
$ref: '../schemas/replication._common.yaml#/components/schemas/DeleteReplicationRule'
required: true
responses:
replication.start@200:
content:
application/json:
schema:
$ref: '../schemas/_common.yaml#/components/schemas/AcknowledgedResponseBase'
replication.stop@200:
content:
application/json:
schema:
$ref: '../schemas/_common.yaml#/components/schemas/AcknowledgedResponseBase'
replication.pause@200:
content:
application/json:
schema:
$ref: '../schemas/_common.yaml#/components/schemas/AcknowledgedResponseBase'
replication.resume@200:
content:
application/json:
schema:
$ref: '../schemas/_common.yaml#/components/schemas/AcknowledgedResponseBase'
replication.status@200:
content:
application/json:
schema:
$ref: '../schemas/replication._common.yaml#/components/schemas/Status'
replication.leader_stats@200:
content:
application/json:
schema:
$ref: '../schemas/replication._common.yaml#/components/schemas/LeaderStatus'
replication.follower_stats@200:
content:
application/json:
schema:
$ref: '../schemas/replication._common.yaml#/components/schemas/FollowerStatus'
replication.autofollow_stats@200:
content:
application/json:
schema:
$ref: '../schemas/replication._common.yaml#/components/schemas/AutoFollowStatus'
replication.update_settings@200:
content:
application/json:
schema:
$ref: '../schemas/_common.yaml#/components/schemas/AcknowledgedResponseBase'
replication.create_replication_rule@200:
content:
application/json:
schema:
$ref: '../schemas/_common.yaml#/components/schemas/AcknowledgedResponseBase'
replication.delete_replication_rule@200:
content:
application/json:
schema:
$ref: '../schemas/_common.yaml#/components/schemas/AcknowledgedResponseBase'
Loading

0 comments on commit 4771bfd

Please sign in to comment.