Ejemplo n.º 1
0
        [U] public async Task Urls()
        {
            var hardcoded = "hardcoded";

            await UrlTester.POST("/hardcoded/doc/_search/template")
            .Request(c => c.SearchTemplate <Project>(new SearchTemplateRequest(hardcoded, "doc")))
            .Request(c => c.SearchTemplate <Project>(new SearchTemplateRequest <Project>(hardcoded, Type <Project>())))
            .FluentAsync(c => c.SearchTemplateAsync <Project>(s => s.Index(hardcoded).Type <Project>()))
            .RequestAsync(c => c.SearchTemplateAsync <Project>(new SearchTemplateRequest <Project>(hardcoded, Type <Project>())))
            .FluentAsync(c => c.SearchTemplateAsync <Project>(s => s.Index(hardcoded).Type <Project>()))
            ;

            await UrlTester.POST("/project/_search/template")
            .Request(c => c.SearchTemplate <Project>(new SearchTemplateRequest("project")))
            .Fluent(c => c.SearchTemplate <Project>(s => s.Index("project").AllTypes()))
            .Request(c => c.SearchTemplate <Project>(new SearchTemplateRequest <Project>(typeof(Project))))
            .FluentAsync(c => c.SearchTemplateAsync <Project>(s => s.Index("project").AllTypes()))
            .RequestAsync(c => c.SearchTemplateAsync <Project>(new SearchTemplateRequest <Project>(typeof(Project))));

            await UrlTester.POST("/_search/template")
            .Fluent(c => c.SearchTemplate <Project>(s => s.AllIndices().AllTypes()))
            .Request(c => c.SearchTemplate <Project>(new SearchTemplateRequest()))
            .Request(c => c.SearchTemplate <Project>(new SearchTemplateRequest <Project>(Nest.Indices.All, Types.All)))
            .FluentAsync(c => c.SearchTemplateAsync <Project>(s => s.AllIndices().AllTypes()))
            .RequestAsync(c => c.SearchTemplateAsync <Project>(new SearchTemplateRequest <Project>(Nest.Indices.All, Types.All)))
            .RequestAsync(c => c.SearchTemplateAsync <Project>(new SearchTemplateRequest()))
            ;
        }
Ejemplo n.º 2
0
 [U] public override async Task Urls()
 {
     var name = "x";
     await UrlTester.POST($"/_ccr/auto_follow/{name}/pause")
     .Fluent(c => c.CrossClusterReplication.PauseAutoFollowPattern(name))
     .Request(c => c.CrossClusterReplication.PauseAutoFollowPattern(new PauseAutoFollowPatternRequest(name)))
     .FluentAsync(c => c.CrossClusterReplication.PauseAutoFollowPatternAsync(name))
     .RequestAsync(c => c.CrossClusterReplication.PauseAutoFollowPatternAsync(new PauseAutoFollowPatternRequest(name)));
 }
Ejemplo n.º 3
0
 [U] public override async Task Urls()
 {
     var name = "x";
     await UrlTester.POST($"/{name}/_ccr/forget_follower")
     .Fluent(c => c.CrossClusterReplication.ForgetFollowerIndex(name, d => d))
     .Request(c => c.CrossClusterReplication.ForgetFollowerIndex(new ForgetFollowerIndexRequest(name)))
     .FluentAsync(c => c.CrossClusterReplication.ForgetFollowerIndexAsync(name, d => d))
     .RequestAsync(c => c.CrossClusterReplication.ForgetFollowerIndexAsync(new ForgetFollowerIndexRequest(name)));
 }
 [U] public override async Task Urls()
 {
     var name = "x";
     await UrlTester.POST($"/{name}/_ccr/pause_follow")
     .Fluent(c => c.CrossClusterReplication.PauseFollowIndex(name, d => d))
     .Request(c => c.CrossClusterReplication.PauseFollowIndex(new PauseFollowIndexRequest(name)))
     .FluentAsync(c => c.CrossClusterReplication.PauseFollowIndexAsync(name, d => d))
     .RequestAsync(c => c.CrossClusterReplication.PauseFollowIndexAsync(new PauseFollowIndexRequest(name)));
 }
 [U] public override async Task Urls()
 {
     var name = "x";
     await UrlTester.POST($"/{name}/_ccr/resume_follow")
     .Fluent(c => c.ResumeFollowIndex(name, d => d))
     .Request(c => c.ResumeFollowIndex(new ResumeFollowIndexRequest(name)))
     .FluentAsync(c => c.ResumeFollowIndexAsync(name, d => d))
     .RequestAsync(c => c.ResumeFollowIndexAsync(new ResumeFollowIndexRequest(name)));
 }
Ejemplo n.º 6
0
 [U] public async Task Urls()
 {
     var indices = Nest.Indices.Index <Project>().And <Developer>();
     var index   = "project%2Cdevs";
     await UrlTester.POST($"/{index}/_open")
     .Fluent(c => c.OpenIndex(indices, s => s))
     .Request(c => c.OpenIndex(new OpenIndexRequest(indices)))
     .FluentAsync(c => c.OpenIndexAsync(indices))
     .RequestAsync(c => c.OpenIndexAsync(new OpenIndexRequest(indices)))
     ;
 }
 [U] public override async Task Urls() => await UrlTester.POST("/_cluster/allocation/explain?include_yes_decisions=true")
 .Fluent(c => c.ClusterAllocationExplain(s => s.Index <Project>().Shard(0).Primary(true).IncludeYesDecisions()))
 .Request(c => c.ClusterAllocationExplain(new ClusterAllocationExplainRequest
 {
     Index = typeof(Project), Shard = 0, Primary = true, IncludeYesDecisions = true
 }))
 .FluentAsync(c => c.ClusterAllocationExplainAsync(s => s.Index <Project>().Shard(0).Primary(true).IncludeYesDecisions()))
 .RequestAsync(c => c.ClusterAllocationExplainAsync(new ClusterAllocationExplainRequest
 {
     Index = typeof(Project), Shard = 0, Primary = true, IncludeYesDecisions = true
 }));
Ejemplo n.º 8
0
        [U] public async Task Urls()
        {
            var repository = "repos";
            var snapshot   = "snap";

            await UrlTester.POST($"/_snapshot/{repository}/{snapshot}/_restore")
            .Fluent(c => c.Snapshot.Restore(repository, snapshot))
            .Request(c => c.Snapshot.Restore(new RestoreRequest(repository, snapshot)))
            .FluentAsync(c => c.Snapshot.RestoreAsync(repository, snapshot))
            .RequestAsync(c => c.Snapshot.RestoreAsync(new RestoreRequest(repository, snapshot)))
            ;
        }
        [U] public override async Task Urls()
        {
            await UrlTester.POST("/_security/api_key/id1%2Cid2/_clear_cache")
            .Fluent(c => c.Security.ClearApiKeyCache(f => f.Ids("id1,id2")))
            .Request(c => c.Security.ClearApiKeyCache(new ClearApiKeyCacheRequest("id1,id2")))
            .FluentAsync(c => c.Security.ClearApiKeyCacheAsync(f => f.Ids("id1,id2")))
            .RequestAsync(c => c.Security.ClearApiKeyCacheAsync(new ClearApiKeyCacheRequest("id1,id2")));

            await UrlTester.POST("/_security/api_key/*/_clear_cache")
            .Fluent(c => c.Security.ClearApiKeyCache())
            .Request(c => c.Security.ClearApiKeyCache(new ClearApiKeyCacheRequest()))
            .FluentAsync(c => c.Security.ClearApiKeyCacheAsync())
            .RequestAsync(c => c.Security.ClearApiKeyCacheAsync(new ClearApiKeyCacheRequest()));
        }
        [U] public async Task Urls()
        {
            await UrlTester.POST("/project/_graph/explore")
            .Fluent(c => c.GraphExplore <Project>(d => d))
            .Request(c => c.GraphExplore(new GraphExploreRequest <Project>("project")))
            .FluentAsync(c => c.GraphExploreAsync <Project>(d => d))
            .RequestAsync(c => c.GraphExploreAsync(new GraphExploreRequest <Project>("project")))
            ;


            var index = "another-index";
            await UrlTester.POST($"/{index}/project/_graph/explore")
            .Fluent(c => c.GraphExplore <Project>(d => d.Type <Project>().Index(index)))
            .Request(c => c.GraphExplore(new GraphExploreRequest <Project>(index, Type <Project>())))
            .FluentAsync(c => c.GraphExploreAsync <Project>(d => d.Type <Project>().Index(index)))
            .RequestAsync(c => c.GraphExploreAsync(new GraphExploreRequest <Project>(index, Type <Project>())))
            ;
        }
 [U] public override async Task Urls() => await UrlTester.POST("_sql/close")
 .Fluent(c => c.Sql.ClearCursor(d => d))
 .Request(c => c.Sql.ClearCursor(new ClearSqlCursorRequest()))
 .FluentAsync(c => c.Sql.ClearCursorAsync(d => d))
 .RequestAsync(c => c.Sql.ClearCursorAsync(new ClearSqlCursorRequest()));
 [U] public override async Task Urls() => await UrlTester.POST("/_ml/calendars/calendar_id/events")
 .Fluent(c => c.MachineLearning.PostCalendarEvents("calendar_id", p => p))
 .Request(c => c.MachineLearning.PostCalendarEvents(new PostCalendarEventsRequest("calendar_id")))
 .FluentAsync(c => c.MachineLearning.PostCalendarEventsAsync("calendar_id", p => p))
 .RequestAsync(c => c.MachineLearning.PostCalendarEventsAsync(new PostCalendarEventsRequest("calendar_id")));
 [U] public override async Task Urls() => await UrlTester.POST("_sql/translate")
 .Fluent(c => c.Sql.Translate(d => d))
 .Request(c => c.Sql.Translate(new TranslateSqlRequest()))
 .FluentAsync(c => c.Sql.TranslateAsync(d => d))
 .RequestAsync(c => c.Sql.TranslateAsync(new TranslateSqlRequest()));
Ejemplo n.º 14
0
 [U] public override async Task Urls() =>
 await UrlTester.POST($"/_update_by_query/{UrlTester.EscapeUriString(_taskId.ToString())}/_rethrottle")
 .Fluent(c => c.UpdateByQueryRethrottle(_taskId))
 .Request(c => c.UpdateByQueryRethrottle(new UpdateByQueryRethrottleRequest(_taskId)))
 .FluentAsync(c => c.UpdateByQueryRethrottleAsync(_taskId))
 .RequestAsync(c => c.UpdateByQueryRethrottleAsync(new UpdateByQueryRethrottleRequest(_taskId)));
Ejemplo n.º 15
0
 [U] public override async Task Urls() => await UrlTester.POST("_sql")
 .Fluent(c => c.Sql.Query(d => d))
 .Request(c => c.Sql.Query(new QuerySqlRequest()))
 .FluentAsync(c => c.Sql.QueryAsync(d => d))
 .RequestAsync(c => c.Sql.QueryAsync(new QuerySqlRequest()));
Ejemplo n.º 16
0
 [U] public override async Task Urls() => await UrlTester.POST("/_security/api_key/grant")
 .Fluent(c => c.Security.GrantApiKey(p => p))
 .Request(c => c.Security.GrantApiKey(new GrantApiKeyRequest()))
 .FluentAsync(c => c.Security.GrantApiKeyAsync(p => p))
 .RequestAsync(c => c.Security.GrantApiKeyAsync(new GrantApiKeyRequest()));