diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-06-10 14:44:16 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-06-10 15:06:09 +0200 |
commit | e0f58988817a64aa549e36bff2b4c89f191e20ee (patch) | |
tree | 3273e6f23866911ee8e2492b06fd02b9db6ca7c0 /container-disc/src/main | |
parent | 3d1b445b10f70771cf7a4bce1ba2d285c553f930 (diff) |
Move Zone API to separate bundle
Diffstat (limited to 'container-disc/src/main')
-rw-r--r-- | container-disc/src/main/java/com/yahoo/container/jdisc/SystemInfoProvider.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/SystemInfoProvider.java b/container-disc/src/main/java/com/yahoo/container/jdisc/SystemInfoProvider.java new file mode 100644 index 00000000000..0bb3832ddf5 --- /dev/null +++ b/container-disc/src/main/java/com/yahoo/container/jdisc/SystemInfoProvider.java @@ -0,0 +1,27 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.container.jdisc; + +import ai.vespa.cloud.Environment; +import ai.vespa.cloud.SystemInfo; +import ai.vespa.cloud.Zone; +import com.google.inject.Inject; +import com.yahoo.cloud.config.ConfigserverConfig; +import com.yahoo.component.AbstractComponent; +import com.yahoo.container.di.componentgraph.Provider; + +/** + * Provides information about the system in which this container is running. + * This is available and can be injected when running in a cloud environment. + * + * @author bratseth + */ +public class SystemInfoProvider extends AbstractComponent implements Provider<SystemInfo> { + + private final SystemInfo instance; + + @Inject public SystemInfoProvider(ConfigserverConfig config) { + this.instance = new SystemInfo(new Zone(Environment.valueOf(config.environment()), config.region())); + } + + @Override public SystemInfo get() { return instance; } +} |