create_engine()#

relationalai.api
#create_engine(name STRING, size STRING, engine_config OBJECT, headers OBJECT)

A procedure that creates a new RelationalAI (RAI) engine of the specified size. Requires the eng_admin application role.

Parameters#

NameTypeDescription
nameSTRINGThe name of the new engine (case-sensitive).
sizeSTRINGThe size of the new engine. This is the same as the host compute pool’s instance family. Must be one of:
  • HIGHMEM_X64_S
  • HIGHMEM_X64_M
engine_configOBJECT or NULLSpecifies the configuration for the new engine. Pass NULL to use the default configuration. See Engine Configuration Object for more information.
headersOBJECT or NULLSpecifies HTTP headers to include in the request. Pass NULL to use the default headers.

Engine Configuration Object#

The engine_config object is a JSON object that specifies the configuration for the new engine. The object can contain the following keys:

KeyTypeDescription
auto_suspend_minsINTThe number of minutes of inactivity before the engine is automatically suspended. Use 0 to never suspend the engine. (Default: 60)
await_storage_vacuumBOOLEANIf true, the engine will wait for garbage collection tasks to finish before suspending the engine. (Default: false)

Returns#

A table with the following columns:

ColumnTypeDescription
NAMESTRINGThe name of the engine. Must be between 3 and 50 characters long. Valid characters are: a-z, A-Z, 0-9, and _.
MESSAGESTRINGA message indicating the result of the operation.

Example#

Use the api.create_engine() procedure to create a new RAI engine:

#-- Create a new engine 'my_rai_engine' of size 'HIGHMEM_X64_S' configured to
-- suspend after 60 minutes of inactivity.
CALL relationalai.api.create_engine(
    'my_rai_engine',
    'HIGHMEM_X64_S',
    {'auto_suspend_mins': 60},
    null
);
/* +---------------+----------+
   | NAME          | MESSAGE  |
   +---------------+----------+
   | my_rai_engine | Success. |
   +---------------+----------+ */

If an engine with the same name already exists, an error is raised.

NOTE

create_engine() blocks until the engine is provisioned and ready for use. This may take several minutes.

See Compute Resources for more information on managing engines.

See Also#