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.

Scala
Java
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:

Scala
Java
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.

results matching ""

    No results matching ""