GuidesChangelogData Inspector Library API Reference
Guides

How to update layers

How to update layers

Use the getConfiguration method of AdminApi to get modifiable model and update its fields for specific layer. Specify field value to modify it. Unspecified fields are ignored.

val layer: Layer =
  Await.result(
    adminApi
      .getConfiguration(catalogHrn)
      .map(_.layers.find(_.id == layerId).get),
    30.seconds
  )

val updatableStreamLayer: UpdatableStreamLayer =
  layer.asUpdatableLayer.asStream
    .updateContentType(LayerContentType.Json.toString)
    .updateTtl(100000L)
    .updateDataInThroughputKbps(5000D)
UpdatableLayer updatableLayer =
    adminApi
        .getConfiguration(catalogHrn)
        .toCompletableFuture()
        .get()
        .getLayersById()
        .get(layerId)
        .asUpdatableLayer()
        .asStream()
        .updateContentType(LayerContentType.Json.toString())
        .updateTtl(100000L)
        .updateDataInThroughputKbps(5000D);

To submit changes use updateLayer method:

adminApi.updateLayer(catalogHrn, layerId, updatableStreamLayer)
adminApi.updateLayer(catalogHrn, layerId, updatableLayer);

Note

TTL changes can take up to 24 hours to propogate so any data in the process of expiration per previous TTL will expire before the new TTL changes are applied.