All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.weaviate.client.v1.backup.api.BackupGetter Maven / Gradle / Ivy

There is a newer version: 4.9.0
Show newest version
package io.weaviate.client.v1.backup.api;

import io.weaviate.client.v1.backup.model.BackupCreateResponse;
import io.weaviate.client.Config;
import io.weaviate.client.base.BaseClient;
import io.weaviate.client.base.ClientResult;
import io.weaviate.client.base.Response;
import io.weaviate.client.base.Result;
import io.weaviate.client.base.http.HttpClient;

public class BackupGetter extends BaseClient implements ClientResult {

  private String backend;

  public BackupGetter(HttpClient httpClient, Config config) {
    super(httpClient, config);
  }

  public BackupGetter withBackend(String backend) {
    this.backend = backend;
    return this;
  }

  @Override
  public Result run() {
    Response response = this.sendGetRequest(path(), BackupCreateResponse[].class);
    return new Result<>(response);
  }

  private String path() {
    return String.format("/backups/%s", backend);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy