Class VmConfig

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
io.envoyproxy.envoy.extensions.wasm.v3.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:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    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<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, 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
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class com.google.protobuf.GeneratedMessageV3

    alwaysUseFieldBuilders, unknownFields

    Fields inherited from class com.google.protobuf.AbstractMessage

    memoizedSize

    Fields inherited from class com.google.protobuf.AbstractMessageLite

    memoizedHashCode
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    boolean
    Allow the wasm file to include pre-compiled code on VMs which support it. .. warning:: This should only be enabled for trusted sources as the precompiled code is not verified.
    The Wasm code that Envoy will execute.
    The Wasm code that Envoy will execute.
    com.google.protobuf.Any
    The Wasm configuration used in initialization of a new VM (``proxy_on_start``).
    com.google.protobuf.AnyOrBuilder
    The Wasm configuration used in initialization of a new VM (``proxy_on_start``).
    static VmConfig
     
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    Specifies environment variables to be injected to this VM which will be available through WASI's ``environ_get`` and ``environ_get_sizes`` system calls.
    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
    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>
     
    The Wasm runtime type, defaults to the first available Wasm engine used at Envoy build-time.
    com.google.protobuf.ByteString
    The Wasm runtime type, defaults to the first available Wasm engine used at Envoy build-time.
    int
     
    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
    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
    The Wasm code that Envoy will execute.
    boolean
    The Wasm configuration used in initialization of a new VM (``proxy_on_start``).
    boolean
    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
     
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
     
    final boolean
     
     
    newBuilder(VmConfig prototype)
     
     
    newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
     
    protected Object
    newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
     
    static VmConfig
     
    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
     
    static VmConfig
    parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static VmConfig
     
    static VmConfig
    parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static com.google.protobuf.Parser<VmConfig>
     
     
    void
    writeTo(com.google.protobuf.CodedOutputStream output)
     

    Methods inherited from class com.google.protobuf.GeneratedMessageV3

    canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, 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 class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    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, getUnknownFields, hasField, hasOneof
  • Field Details

    • VM_ID_FIELD_NUMBER

      public static final int VM_ID_FIELD_NUMBER
      See Also:
    • RUNTIME_FIELD_NUMBER

      public static final int RUNTIME_FIELD_NUMBER
      See Also:
    • CODE_FIELD_NUMBER

      public static final int CODE_FIELD_NUMBER
      See Also:
    • CONFIGURATION_FIELD_NUMBER

      public static final int CONFIGURATION_FIELD_NUMBER
      See Also:
    • ALLOW_PRECOMPILED_FIELD_NUMBER

      public static final int ALLOW_PRECOMPILED_FIELD_NUMBER
      See Also:
    • NACK_ON_CODE_CACHE_MISS_FIELD_NUMBER

      public static final int NACK_ON_CODE_CACHE_MISS_FIELD_NUMBER
      See Also:
    • ENVIRONMENT_VARIABLES_FIELD_NUMBER

      public static final int ENVIRONMENT_VARIABLES_FIELD_NUMBER
      See Also:
  • Method Details

    • newInstance

      protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
      Overrides:
      newInstance 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, defaults to the first available Wasm engine used at Envoy build-time.
       The priority to search for the available engine is: v8 -> wasmtime -> wamr.
       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.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;
      Specified by:
      getRuntime in interface VmConfigOrBuilder
      Returns:
      The runtime.
    • getRuntimeBytes

      public com.google.protobuf.ByteString getRuntimeBytes()
       The Wasm runtime type, defaults to the first available Wasm engine used at Envoy build-time.
       The priority to search for the available engine is: v8 -> wasmtime -> wamr.
       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.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;
      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.
    • getCodeOrBuilder

      public AsyncDataSourceOrBuilder getCodeOrBuilder()
       The Wasm code that Envoy will execute.
       
      .envoy.config.core.v3.AsyncDataSource code = 3;
      Specified by:
      getCodeOrBuilder in interface VmConfigOrBuilder
    • 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 enabled 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 generally called implicitly by your language's standard library. Therefore, you do not
       need to call them directly. You can access environment variables in the same way you would
       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 generally called implicitly by your language's standard library. Therefore, you do not
       need to call them directly. You can access environment variables in the same way you would
       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 generally called implicitly by your language's standard library. Therefore, you do not
       need to call them directly. You can access environment variables in the same way you would
       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(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static VmConfig parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static VmConfig parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static VmConfig parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static VmConfig parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • 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
    • newBuilder

      public static VmConfig.Builder newBuilder()
    • newBuilder

      public static VmConfig.Builder newBuilder(VmConfig prototype)
    • 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