Skip to content

GetRepositoryResponse is unusable as it does not expose the actual response data #8266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cguedel opened this issue Jul 15, 2024 · 1 comment · Fixed by #8361
Closed

GetRepositoryResponse is unusable as it does not expose the actual response data #8266

cguedel opened this issue Jul 15, 2024 · 1 comment · Fixed by #8361
Labels
8.x Relates to a 8.x client version Area: Client Category: Bug

Comments

@cguedel
Copy link

cguedel commented Jul 15, 2024

Elastic.Clients.Elasticsearch version: 8.14.6

Elasticsearch version: 8

.NET runtime version: 8

Operating system version: Win11

Description of the problem including expected versus actual behavior:
Response type GetRepositoryResponse does not expose any useful properties. It's all in BackingDictionary, but this is internal:
image

Steps to reproduce:

var createRequest = new CreateRepositoryRequest(repoName)
{
    Repository = new SharedFileSystemRepository
    {
        Settings = new SharedFileSystemRepositorySettings
        {
            Location = $"/tmp/{repoName}",
            MaxSnapshotBytesPerSec = new ByteSize("40m"),
            Readonly = true
        }
    }
};

createResponse = await client.Snapshot.CreateRepositoryAsync(createRequest);

// Act
var searchResponse = await client.Snapshot.GetRepositoryAsync(new GetRepositoryRequest($"{repoName}*"));

// Assert
searchResponse.IsValidResponse.Should().BeTrue();
// TODO: assert more properties here

Expected behavior
Expect to get access to the actual response data.

Provide DebugInformation (if relevant):

Valid Elasticsearch response built from a successful (200) low level call on GET: /_snapshot/56a826a0d67443faa354dc7f9a8cefea%2A

# Audit trail of this API call:
 - [1] HealthyResponse: Node: https://elastic:[email protected]:62089/ Took: 00:00:00.0481153
# Request:
<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on TransportConfiguration to force it to be set on the response.>
# Response:
{"56a826a0d67443faa354dc7f9a8cefea":{"type":"fs","settings":{"readonly":"true","location":"/tmp/56a826a0d67443faa354dc7f9a8cefea","max_snapshot_bytes_per_sec":"40m"}}}
@cguedel cguedel added 8.x Relates to a 8.x client version Category: Bug labels Jul 15, 2024
@cguedel
Copy link
Author

cguedel commented Sep 26, 2024

@flobernd Any update here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Relates to a 8.x client version Area: Client Category: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants