Skip to content

Commit

Permalink
Add support for Point In Time APIs (opensearch-project#405)
Browse files Browse the repository at this point in the history
* Add `CreatePit` & `DeletePit` methods

Signed-off-by: Thomas Farr <[email protected]>

* Add `DeleteAllPits` and `GetAllPits` methods

Signed-off-by: Thomas Farr <[email protected]>

* Add PIT search support

Signed-off-by: Thomas Farr <[email protected]>

* Add integration tests

Signed-off-by: Thomas Farr <[email protected]>

* Add docs

Signed-off-by: Thomas Farr <[email protected]>

* Add changelog entry

Signed-off-by: Thomas Farr <[email protected]>

* Correct

Signed-off-by: Thomas Farr <[email protected]>

* Fix changelog typo

Signed-off-by: Thomas Farr <[email protected]>

* Add tests for CreatePit

Signed-off-by: Thomas Farr <[email protected]>

* Add tests for DeletePit

Signed-off-by: Thomas Farr <[email protected]>

* Fixing tests

Signed-off-by: Thomas Farr <[email protected]>

* Cleanup

Signed-off-by: Thomas Farr <[email protected]>

* Add tests for GetAllPits & DeleteAllPits

Signed-off-by: Thomas Farr <[email protected]>

* PitSearch tests

Signed-off-by: Thomas Farr <[email protected]>

* call isolated

Signed-off-by: Thomas Farr <[email protected]>

* writable cluster

Signed-off-by: Thomas Farr <[email protected]>

---------

Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Dec 3, 2023
1 parent 2a6c5a6 commit 0657e84
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 27 deletions.
3 changes: 3 additions & 0 deletions src/ApiGenerator/Configuration/CodeConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public static class CodeConfiguration
{
private static readonly Glob[] OperationsToInclude =
{
new("{create,delete}_pit"),
new("{delete,get}_all_pits"),

new("cluster.allocation_explain"),
new("cluster.delete_component_template"),
new("cluster.delete_voting_config_exclusions"),
Expand Down
115 changes: 90 additions & 25 deletions src/ApiGenerator/OpenSearch.openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -5119,16 +5119,6 @@
"type": "string",
"description": "The awareness attribute for which the health is required."
}
},
{
"name": "ensure_node_commissioned",
"in": "query",
"description": "Checks whether local node is commissioned or not. If set to true on a local call it will throw exception if node is decommissioned.",
"schema": {
"type": "boolean",
"default": false,
"description": "Checks whether local node is commissioned or not. If set to true on a local call it will throw exception if node is decommissioned."
}
}
],
"responses": {
Expand Down Expand Up @@ -5280,16 +5270,6 @@
"type": "string",
"description": "The awareness attribute for which the health is required."
}
},
{
"name": "ensure_node_commissioned",
"in": "query",
"description": "Checks whether local node is commissioned or not. If set to true on a local call it will throw exception if node is decommissioned.",
"schema": {
"type": "boolean",
"default": false,
"description": "Checks whether local node is commissioned or not. If set to true on a local call it will throw exception if node is decommissioned."
}
}
],
"responses": {
Expand Down Expand Up @@ -6831,6 +6811,18 @@
"deprecated": true
}
},
{
"name": "cluster_manager_timeout",
"in": "query",
"description": "Operation timeout for connection to cluster-manager node.",
"schema": {
"type": "string",
"pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$",
"description": "Operation timeout for connection to cluster-manager node.",
"x-version-added": "2.0.0",
"x-data-type": "time"
}
},
{
"name": "local",
"in": "query",
Expand Down Expand Up @@ -8536,6 +8528,18 @@
"deprecated": true
}
},
{
"name": "cluster_manager_timeout",
"in": "query",
"description": "Operation timeout for connection to cluster-manager node.",
"schema": {
"type": "string",
"pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$",
"description": "Operation timeout for connection to cluster-manager node.",
"x-version-added": "2.0.0",
"x-data-type": "time"
}
},
{
"name": "local",
"in": "query",
Expand Down Expand Up @@ -18594,6 +18598,18 @@
"deprecated": true
}
},
{
"name": "cluster_manager_timeout",
"in": "query",
"description": "Operation timeout for connection to cluster-manager node.",
"schema": {
"type": "string",
"pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$",
"description": "Operation timeout for connection to cluster-manager node.",
"x-version-added": "2.0.0",
"x-data-type": "time"
}
},
{
"name": "local",
"in": "query",
Expand Down Expand Up @@ -19451,6 +19467,18 @@
"description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)."
}
},
{
"name": "cluster_manager_timeout",
"in": "query",
"description": "Operation timeout for connection to cluster-manager node.",
"schema": {
"type": "string",
"pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$",
"description": "Operation timeout for connection to cluster-manager node.",
"x-version-added": "2.0.0",
"x-data-type": "time"
}
},
{
"name": "expand_wildcards",
"in": "query",
Expand Down Expand Up @@ -25302,6 +25330,18 @@
"$ref": "#/components/schemas/ExpandWildcards"
}
},
{
"name": "cluster_manager_timeout",
"in": "query",
"description": "Operation timeout for connection to cluster-manager node.",
"schema": {
"type": "string",
"pattern": "^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$",
"description": "Operation timeout for connection to cluster-manager node.",
"x-version-added": "2.0.0",
"x-data-type": "time"
}
},
{
"name": "wait_for_active_shards",
"in": "query",
Expand Down Expand Up @@ -26631,7 +26671,8 @@
"description": "Specify the keep alive for point in time.",
"schema": {
"type": "string",
"description": "Specify the keep alive for point in time."
"description": "Specify the keep alive for point in time.",
"x-data-type": "time"
}
},
{
Expand Down Expand Up @@ -30868,6 +30909,7 @@
},
"DeletePit_BodyParams": {
"type": "object",
"description": "The point-in-time ids to be deleted",
"properties": {
"pit_id": {
"type": "array",
Expand Down Expand Up @@ -31170,6 +31212,9 @@
"type": "string"
}
},
"dls": {
"type": "string"
},
"fls": {
"type": "array",
"items": {
Expand Down Expand Up @@ -31885,19 +31930,22 @@
"description": {
"type": "string"
},
"cluster_permission": {
"cluster_permissions": {
"type": "array",
"items": {
"type": "string"
}
},
"index_permission": {
"$ref": "#/components/schemas/IndexPermission"
"index_permissions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/IndexPermission"
}
},
"tenant_permissions": {
"type": "array",
"items": {
"type": "string"
"$ref": "#/components/schemas/TenantPermission"
}
},
"static": {
Expand Down Expand Up @@ -32220,6 +32268,23 @@
}
}
},
"TenantPermission": {
"type": "object",
"properties": {
"tenant_patterns": {
"type": "array",
"items": {
"type": "string"
}
},
"allowed_actions": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"TenantsMap": {
"type": "object",
"additionalProperties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using System.Linq.Expressions;

using OpenSearch.Net;
using OpenSearch.Net.Utf8Json;
@if (ns != CsharpNames.RootNamespace)
@if (ns != null)
{
<text>using OpenSearch.Net@(ns);
</text>
Expand Down
2 changes: 1 addition & 1 deletion src/ApiGenerator/Views/HighLevel/Requests/Requests.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using System.Linq.Expressions;
using System.Runtime.Serialization;
using OpenSearch.Net;
using OpenSearch.Net.Utf8Json;
@if (ns != CsharpNames.RootNamespace)
@if (ns != null)
{
<text>using OpenSearch.Net@(ns);
</text>
Expand Down

0 comments on commit 0657e84

Please sign in to comment.