> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# alterEnvironment

<div className="kinetica-javadoc">
  <ul className="member-list">
    <li>
      <div className="section detail" id="alterEnvironment(com.gpudb.protocol.AlterEnvironmentRequest)">
        <h3>alterEnvironment</h3>
        <div className="member-signature"><span className="modifiers">public</span> <span className="return-type"><a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentResponse" title="class in com.gpudb.protocol">AlterEnvironmentResponse</a></span> <span className="element-name">alterEnvironment</span><wbr /><span className="parameters">(<a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentRequest" title="class in com.gpudb.protocol">AlterEnvironmentRequest</a> request)</span> throws <span className="exceptions"><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></span></div>
        <div className="block">Alters an existing environment which can be referenced by a <a href="/content/concepts/udf/" target="_top">user-defined function</a> (UDF).</div>

        <div className="dl notes">
          <div className="dt">Parameters:</div>
          <div className="dd"><code>request</code> - <a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentRequest" title="class in com.gpudb.protocol"><code>Request</code></a> object containing the parameters for the operation.</div>
          <div className="dt">Returns:</div>
          <div className="dd"><a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentResponse" title="class in com.gpudb.protocol"><code>Response</code></a> object containing the results of the operation.</div>
          <div className="dt">Throws:</div>
          <div className="dd"><code><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></code> - if an error occurs during the operation.</div>
        </div>
      </div>
    </li>

    <li>
      <div className="section detail" id="alterEnvironment(java.lang.String,java.lang.String,java.lang.String,java.util.Map)">
        <h3>alterEnvironment</h3>
        <div className="member-signature"><span className="modifiers">public</span> <span className="return-type"><a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentResponse" title="class in com.gpudb.protocol">AlterEnvironmentResponse</a></span> <span className="element-name">alterEnvironment</span><wbr /><span className="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a> environmentName, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a> action, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a> value, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" className="external-link">Map</a>\<<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a>,<wbr /><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" className="external-link">String</a>> options)</span> throws <span className="exceptions"><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></span></div>
        <div className="block">Alters an existing environment which can be referenced by a <a href="/content/concepts/udf/" target="_top">user-defined function</a> (UDF).</div>

        <div className="dl notes">
          <div className="dt">Parameters:</div>
          <div className="dd"><code>environmentName</code> - Name of the environment to be altered.</div>

          <div className="dd">
            <code>action</code> - Modification operation to be applied. Supported values:

            <ul>
              <li><a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentRequest.Action#INSTALL_PACKAGE"><code>INSTALL\_PACKAGE</code></a>: Install a python package from PyPI, an external data source or KiFS. </li>
              <li><a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentRequest.Action#INSTALL_REQUIREMENTS"><code>INSTALL\_REQUIREMENTS</code></a>: Install packages from a requirements file. </li>
              <li><a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentRequest.Action#UNINSTALL_PACKAGE"><code>UNINSTALL\_PACKAGE</code></a>: Uninstall a python package. </li>
              <li><a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentRequest.Action#UNINSTALL_REQUIREMENTS"><code>UNINSTALL\_REQUIREMENTS</code></a>: Uninstall packages from a requirements file. </li>
              <li><a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentRequest.Action#RESET"><code>RESET</code></a>: Uninstalls all packages in the environment and resets it to the original state at time of creation. </li>
              <li><a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentRequest.Action#REBUILD"><code>REBUILD</code></a>: Recreates the environment and re-installs all packages, upgrades the packages if necessary based on dependencies. </li>
            </ul>
          </div>

          <div className="dd"><code>value</code> - The value of the modification, depending on <code> action</code>. For example, if <code>action</code> is <a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentRequest.Action#INSTALL_PACKAGE"><code>INSTALL\_PACKAGE</code></a>, this would be the python package name. If <code>action</code> is <a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentRequest.Action#INSTALL_REQUIREMENTS"><code>INSTALL\_REQUIREMENTS</code></a>, this would be the path of a requirements file from which to install packages. If an external data source is specified in <a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentRequest.Options#DATASOURCE_NAME"><code>DATASOURCE\_NAME</code></a>, this can be the path to a wheel file or source archive. Alternatively, if installing from a file (wheel or source archive), the value may be a reference to a file in <a href="/content/tools/kifs/" target="_top">KiFS</a>.</div>

          <div className="dd">
            <code>options</code> - Optional parameters.

            <ul>
              <li><a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentRequest.Options#DATASOURCE_NAME"><code>DATASOURCE\_NAME</code></a>: Name of an existing external data source from which packages specified in <code>value</code> can be loaded. </li>
            </ul>

            The default value is an empty <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" className="external-link"><code>Map</code></a>.
          </div>

          <div className="dt">Returns:</div>
          <div className="dd"><a href="/content/api/java/com/gpudb/protocol/AlterEnvironmentResponse" title="class in com.gpudb.protocol"><code>Response</code></a> object containing the results of the operation.</div>
          <div className="dt">Throws:</div>
          <div className="dd"><code><a href="/content/api/java/com/gpudb/GPUdbException" title="class in com.gpudb">GPUdbException</a></code> - if an error occurs during the operation.</div>
        </div>
      </div>
    </li>
  </ul>
</div>
