diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/remote_store.restore/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/remote_store.restore/10_basic.yml deleted file mode 100644 index 462ad02051097..0000000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/remote_store.restore/10_basic.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -"Check if index exists and created with remote_store=true": - - skip: - version: " - 2.99.99" - reason: "remote store restore API only supported since 3.0.0" - - - do: - indices.create: - index: "index1" - body: - settings: - number_of_shards: 1 - number_of_replicas: 2 - - - do: - remote_store.restore: - body: - indices: "index1,index2" - - - match: { remote_store.indices: []} - - match: { remote_store.shards.total: 0 } - - match: { remote_store.shards.successful: 0 } - - match: { remote_store.shards.failed : 0 } ---- -"Error no indices": - - skip: - version: " - 2.99.99" - reason: "remote store restore API only supported since 3.0.0" - - - do: - catch: bad_request - remote_store.restore: - body: - indices: "" - - - match: { status: 400 } - - match: { error.type: action_request_validation_exception} - - match: { error.reason: "Validation Failed: 1: indices are missing;"} diff --git a/server/src/main/java/org/opensearch/action/ActionModule.java b/server/src/main/java/org/opensearch/action/ActionModule.java index a562e8bfc9cb9..c98a3179c13c0 100644 --- a/server/src/main/java/org/opensearch/action/ActionModule.java +++ b/server/src/main/java/org/opensearch/action/ActionModule.java @@ -267,6 +267,7 @@ import org.opensearch.common.settings.IndexScopedSettings; import org.opensearch.common.settings.Settings; import org.opensearch.common.settings.SettingsFilter; +import org.opensearch.common.util.FeatureFlags; import org.opensearch.index.seqno.RetentionLeaseActions; import org.opensearch.indices.SystemIndices; import org.opensearch.indices.breaker.CircuitBreakerService; @@ -858,7 +859,9 @@ public void initRestHandlers(Supplier nodesInCluster) { registerHandler.accept(new RestCatAction(catActions)); // Remote Store APIs - registerHandler.accept(new RestRestoreRemoteStoreAction()); + if (FeatureFlags.isEnabled(FeatureFlags.REMOTE_STORE)) { + registerHandler.accept(new RestRestoreRemoteStoreAction()); + } } @Override