ByKeyApi
Data Client ByKeyApi
The ByKeyApi mirrors the Blob Rest Api v2.
It supports the upload and retrieval of large volumes of data from an
objectstore layer.
For the full ByKeyApi specification, see ByKeyApi.
The following pages describe the per-request configuration and metrics.
Example
val client = BaseClient()
val byKeyApi = client.of[ByKeyApi]
val someHrn = "hrn:here:data::olp-here-test:whatever"
val someLayer = "whateverLayer"
val someKey = "whateverKey"
val result: Future[Array[Byte]] =
byKeyApi.getBlobByKey(someHrn, someLayer, someKey).executeToBytes()
result
.andThen {
case Success(response) =>
// do something with the byte array
println(s"received ${response.length} bytes")
case Failure(ex) =>
ex.printStackTrace()
}
Await.result(result, Duration.Inf)BaseClient client = BaseClientJava.instance();
ByKeyApi byKeyApi = new ByKeyApi(client);
String someHrn = "hrn:here:data::olp-here-test:whatever";
String someLayer = "whateverLayer";
String someKey = "whateverKey";
byte[] result =
byKeyApi
.getBlobByKey(someHrn, someLayer, someKey, Collections.emptyList(), Optional.empty())
.executeToBytes()
.toCompletableFuture()
.join();
// do something with the byte array
System.out.printf("received %d bytes\n", result.length);Updated 22 days ago