Class VmConfig

  • All Implemented Interfaces:
    com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, VmConfigOrBuilder, Serializable

    public final class VmConfig
    extends com.google.protobuf.GeneratedMessageV3
    implements VmConfigOrBuilder
     Configuration for a Wasm VM.
     [#next-free-field: 8]
     
    Protobuf type envoy.extensions.wasm.v3.VmConfig
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  VmConfig.Builder
      Configuration for a Wasm VM.
      • Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3

        com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,​BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,​BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
      • Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

        com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(Object obj)  
      boolean getAllowPrecompiled()
      Allow the wasm file to include pre-compiled code on VMs which support it.
      AsyncDataSource getCode()
      The Wasm code that Envoy will execute.
      AsyncDataSourceOrBuilder getCodeOrBuilder()
      The Wasm code that Envoy will execute.
      com.google.protobuf.Any getConfiguration()
      The Wasm configuration used in initialization of a new VM (proxy_on_start).
      com.google.protobuf.AnyOrBuilder getConfigurationOrBuilder()
      The Wasm configuration used in initialization of a new VM (proxy_on_start).
      static VmConfig getDefaultInstance()  
      VmConfig getDefaultInstanceForType()  
      static com.google.protobuf.Descriptors.Descriptor getDescriptor()  
      EnvironmentVariables getEnvironmentVariables()
      Specifies environment variables to be injected to this VM which will be available through WASI's ``environ_get`` and ``environ_get_sizes`` system calls.
      EnvironmentVariablesOrBuilder getEnvironmentVariablesOrBuilder()
      Specifies environment variables to be injected to this VM which will be available through WASI's ``environ_get`` and ``environ_get_sizes`` system calls.
      boolean getNackOnCodeCacheMiss()
      If true and the code needs to be remotely fetched and it is not in the cache then NACK the configuration update and do a background fetch to fill the cache, otherwise fetch the code asynchronously and enter warming state.
      com.google.protobuf.Parser<VmConfig> getParserForType()  
      String getRuntime()
      The Wasm runtime type.
      com.google.protobuf.ByteString getRuntimeBytes()
      The Wasm runtime type.
      int getSerializedSize()  
      com.google.protobuf.UnknownFieldSet getUnknownFields()  
      String getVmId()
      An ID which will be used along with a hash of the wasm code (or the name of the registered Null VM plugin) to determine which VM will be used for the plugin.
      com.google.protobuf.ByteString getVmIdBytes()
      An ID which will be used along with a hash of the wasm code (or the name of the registered Null VM plugin) to determine which VM will be used for the plugin.
      boolean hasCode()
      The Wasm code that Envoy will execute.
      boolean hasConfiguration()
      The Wasm configuration used in initialization of a new VM (proxy_on_start).
      boolean hasEnvironmentVariables()
      Specifies environment variables to be injected to this VM which will be available through WASI's ``environ_get`` and ``environ_get_sizes`` system calls.
      int hashCode()  
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()  
      boolean isInitialized()  
      static VmConfig.Builder newBuilder()  
      static VmConfig.Builder newBuilder​(VmConfig prototype)  
      VmConfig.Builder newBuilderForType()  
      protected VmConfig.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)  
      protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)  
      static VmConfig parseDelimitedFrom​(InputStream input)  
      static VmConfig parseDelimitedFrom​(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static VmConfig parseFrom​(byte[] data)  
      static VmConfig parseFrom​(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static VmConfig parseFrom​(com.google.protobuf.ByteString data)  
      static VmConfig parseFrom​(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static VmConfig parseFrom​(com.google.protobuf.CodedInputStream input)  
      static VmConfig parseFrom​(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static VmConfig parseFrom​(InputStream input)  
      static VmConfig parseFrom​(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static VmConfig parseFrom​(ByteBuffer data)  
      static VmConfig parseFrom​(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static com.google.protobuf.Parser<VmConfig> parser()  
      VmConfig.Builder toBuilder()  
      void writeTo​(com.google.protobuf.CodedOutputStream output)  
      • Methods inherited from class com.google.protobuf.GeneratedMessageV3

        canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
      • Methods inherited from class com.google.protobuf.AbstractMessage

        findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
      • Methods inherited from class com.google.protobuf.AbstractMessageLite

        addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
      • Methods inherited from interface com.google.protobuf.MessageLite

        toByteArray, toByteString, writeDelimitedTo, writeTo
      • Methods inherited from interface com.google.protobuf.MessageOrBuilder

        findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof
    • Field Detail

      • CONFIGURATION_FIELD_NUMBER

        public static final int CONFIGURATION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ALLOW_PRECOMPILED_FIELD_NUMBER

        public static final int ALLOW_PRECOMPILED_FIELD_NUMBER
        See Also:
        Constant Field Values
      • NACK_ON_CODE_CACHE_MISS_FIELD_NUMBER

        public static final int NACK_ON_CODE_CACHE_MISS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ENVIRONMENT_VARIABLES_FIELD_NUMBER

        public static final int ENVIRONMENT_VARIABLES_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getUnknownFields

        public final com.google.protobuf.UnknownFieldSet getUnknownFields()
        Specified by:
        getUnknownFields in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getUnknownFields in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • getVmId

        public String getVmId()
         An ID which will be used along with a hash of the wasm code (or the name of the registered Null
         VM plugin) to determine which VM will be used for the plugin. All plugins which use the same
         ``vm_id`` and code will use the same VM. May be left blank. Sharing a VM between plugins can
         reduce memory utilization and make sharing of data easier which may have security implications.
         [#comment: TODO: add ref for details.]
         
        string vm_id = 1;
        Specified by:
        getVmId in interface VmConfigOrBuilder
        Returns:
        The vmId.
      • getVmIdBytes

        public com.google.protobuf.ByteString getVmIdBytes()
         An ID which will be used along with a hash of the wasm code (or the name of the registered Null
         VM plugin) to determine which VM will be used for the plugin. All plugins which use the same
         ``vm_id`` and code will use the same VM. May be left blank. Sharing a VM between plugins can
         reduce memory utilization and make sharing of data easier which may have security implications.
         [#comment: TODO: add ref for details.]
         
        string vm_id = 1;
        Specified by:
        getVmIdBytes in interface VmConfigOrBuilder
        Returns:
        The bytes for vmId.
      • getRuntime

        public String getRuntime()
         The Wasm runtime type.
         Available Wasm runtime types are registered as extensions. The following runtimes are included
         in Envoy code base:
         .. _extension_envoy.wasm.runtime.null:
         **envoy.wasm.runtime.null**: Null sandbox, the Wasm module must be compiled and linked into the
         Envoy binary. The registered name is given in the ``code`` field as ``inline_string``.
         .. _extension_envoy.wasm.runtime.v8:
         **envoy.wasm.runtime.v8**: `V8 <https://v8.dev/>`_-based WebAssembly runtime.
         .. _extension_envoy.wasm.runtime.wamr:
         **envoy.wasm.runtime.wamr**: `WAMR <https://github.com/bytecodealliance/wasm-micro-runtime/>`_-based WebAssembly runtime.
         This runtime is not enabled in the official build.
         .. _extension_envoy.wasm.runtime.wavm:
         **envoy.wasm.runtime.wavm**: `WAVM <https://wavm.github.io/>`_-based WebAssembly runtime.
         This runtime is not enabled in the official build.
         .. _extension_envoy.wasm.runtime.wasmtime:
         **envoy.wasm.runtime.wasmtime**: `Wasmtime <https://wasmtime.dev/>`_-based WebAssembly runtime.
         This runtime is not enabled in the official build.
         [#extension-category: envoy.wasm.runtime]
         
        string runtime = 2 [(.validate.rules) = { ... }
        Specified by:
        getRuntime in interface VmConfigOrBuilder
        Returns:
        The runtime.
      • getRuntimeBytes

        public com.google.protobuf.ByteString getRuntimeBytes()
         The Wasm runtime type.
         Available Wasm runtime types are registered as extensions. The following runtimes are included
         in Envoy code base:
         .. _extension_envoy.wasm.runtime.null:
         **envoy.wasm.runtime.null**: Null sandbox, the Wasm module must be compiled and linked into the
         Envoy binary. The registered name is given in the ``code`` field as ``inline_string``.
         .. _extension_envoy.wasm.runtime.v8:
         **envoy.wasm.runtime.v8**: `V8 <https://v8.dev/>`_-based WebAssembly runtime.
         .. _extension_envoy.wasm.runtime.wamr:
         **envoy.wasm.runtime.wamr**: `WAMR <https://github.com/bytecodealliance/wasm-micro-runtime/>`_-based WebAssembly runtime.
         This runtime is not enabled in the official build.
         .. _extension_envoy.wasm.runtime.wavm:
         **envoy.wasm.runtime.wavm**: `WAVM <https://wavm.github.io/>`_-based WebAssembly runtime.
         This runtime is not enabled in the official build.
         .. _extension_envoy.wasm.runtime.wasmtime:
         **envoy.wasm.runtime.wasmtime**: `Wasmtime <https://wasmtime.dev/>`_-based WebAssembly runtime.
         This runtime is not enabled in the official build.
         [#extension-category: envoy.wasm.runtime]
         
        string runtime = 2 [(.validate.rules) = { ... }
        Specified by:
        getRuntimeBytes in interface VmConfigOrBuilder
        Returns:
        The bytes for runtime.
      • hasCode

        public boolean hasCode()
         The Wasm code that Envoy will execute.
         
        .envoy.config.core.v3.AsyncDataSource code = 3;
        Specified by:
        hasCode in interface VmConfigOrBuilder
        Returns:
        Whether the code field is set.
      • getCode

        public AsyncDataSource getCode()
         The Wasm code that Envoy will execute.
         
        .envoy.config.core.v3.AsyncDataSource code = 3;
        Specified by:
        getCode in interface VmConfigOrBuilder
        Returns:
        The code.
      • hasConfiguration

        public boolean hasConfiguration()
         The Wasm configuration used in initialization of a new VM
         (proxy_on_start). ``google.protobuf.Struct`` is serialized as JSON before
         passing it to the plugin. ``google.protobuf.BytesValue`` and
         ``google.protobuf.StringValue`` are passed directly without the wrapper.
         
        .google.protobuf.Any configuration = 4;
        Specified by:
        hasConfiguration in interface VmConfigOrBuilder
        Returns:
        Whether the configuration field is set.
      • getConfiguration

        public com.google.protobuf.Any getConfiguration()
         The Wasm configuration used in initialization of a new VM
         (proxy_on_start). ``google.protobuf.Struct`` is serialized as JSON before
         passing it to the plugin. ``google.protobuf.BytesValue`` and
         ``google.protobuf.StringValue`` are passed directly without the wrapper.
         
        .google.protobuf.Any configuration = 4;
        Specified by:
        getConfiguration in interface VmConfigOrBuilder
        Returns:
        The configuration.
      • getConfigurationOrBuilder

        public com.google.protobuf.AnyOrBuilder getConfigurationOrBuilder()
         The Wasm configuration used in initialization of a new VM
         (proxy_on_start). ``google.protobuf.Struct`` is serialized as JSON before
         passing it to the plugin. ``google.protobuf.BytesValue`` and
         ``google.protobuf.StringValue`` are passed directly without the wrapper.
         
        .google.protobuf.Any configuration = 4;
        Specified by:
        getConfigurationOrBuilder in interface VmConfigOrBuilder
      • getAllowPrecompiled

        public boolean getAllowPrecompiled()
         Allow the wasm file to include pre-compiled code on VMs which support it.
         Warning: this should only be enable for trusted sources as the precompiled code is not
         verified.
         
        bool allow_precompiled = 5;
        Specified by:
        getAllowPrecompiled in interface VmConfigOrBuilder
        Returns:
        The allowPrecompiled.
      • getNackOnCodeCacheMiss

        public boolean getNackOnCodeCacheMiss()
         If true and the code needs to be remotely fetched and it is not in the cache then NACK the configuration
         update and do a background fetch to fill the cache, otherwise fetch the code asynchronously and enter
         warming state.
         
        bool nack_on_code_cache_miss = 6;
        Specified by:
        getNackOnCodeCacheMiss in interface VmConfigOrBuilder
        Returns:
        The nackOnCodeCacheMiss.
      • hasEnvironmentVariables

        public boolean hasEnvironmentVariables()
         Specifies environment variables to be injected to this VM which will be available through
         WASI's ``environ_get`` and ``environ_get_sizes`` system calls. Note that these functions are mostly implicitly
         called in your language's standard library, so you do not need to call them directly and you can access to env
         vars just like when you do on native platforms.
         Warning: Envoy rejects the configuration if there's conflict of key space.
         
        .envoy.extensions.wasm.v3.EnvironmentVariables environment_variables = 7;
        Specified by:
        hasEnvironmentVariables in interface VmConfigOrBuilder
        Returns:
        Whether the environmentVariables field is set.
      • getEnvironmentVariables

        public EnvironmentVariables getEnvironmentVariables()
         Specifies environment variables to be injected to this VM which will be available through
         WASI's ``environ_get`` and ``environ_get_sizes`` system calls. Note that these functions are mostly implicitly
         called in your language's standard library, so you do not need to call them directly and you can access to env
         vars just like when you do on native platforms.
         Warning: Envoy rejects the configuration if there's conflict of key space.
         
        .envoy.extensions.wasm.v3.EnvironmentVariables environment_variables = 7;
        Specified by:
        getEnvironmentVariables in interface VmConfigOrBuilder
        Returns:
        The environmentVariables.
      • getEnvironmentVariablesOrBuilder

        public EnvironmentVariablesOrBuilder getEnvironmentVariablesOrBuilder()
         Specifies environment variables to be injected to this VM which will be available through
         WASI's ``environ_get`` and ``environ_get_sizes`` system calls. Note that these functions are mostly implicitly
         called in your language's standard library, so you do not need to call them directly and you can access to env
         vars just like when you do on native platforms.
         Warning: Envoy rejects the configuration if there's conflict of key space.
         
        .envoy.extensions.wasm.v3.EnvironmentVariables environment_variables = 7;
        Specified by:
        getEnvironmentVariablesOrBuilder in interface VmConfigOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static VmConfig parseFrom​(ByteBuffer data)
                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static VmConfig parseFrom​(ByteBuffer data,
                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static VmConfig parseFrom​(com.google.protobuf.ByteString data)
                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static VmConfig parseFrom​(com.google.protobuf.ByteString data,
                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static VmConfig parseFrom​(byte[] data)
                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static VmConfig parseFrom​(byte[] data,
                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static VmConfig parseFrom​(com.google.protobuf.CodedInputStream input,
                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                  throws IOException
        Throws:
        IOException
      • newBuilderForType

        public VmConfig.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public VmConfig.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected VmConfig.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static VmConfig getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<VmConfig> parser()
      • getParserForType

        public com.google.protobuf.Parser<VmConfig> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public VmConfig getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder