PROXY:shared_table_create(table_name,[entry_size],[memory_limit])
Creates a shared table if there is no existing shared table with the specified name. Multiple shared tables can be created with different names. Each table operation must specify a table name.
Before creating the table, FortiADC will check whether there is already a table with the same name. If a table with the same name already exists, it will either be attached or will return an error. Typically, the first calling process creates the table, then all the other processes will attach to it with the same API call.
For any table, this API must be called first before other operations can be performed.
Returns Boolean true if successful, otherwise, returns Boolean false.
Syntax
PROXY:shared_table_create(table_name, [entry_size], [memory_limit]);
Arguments
| Name | Description |
|---|---|
| table_name |
A Lua string as the name of the shared table. This is the unique identification of a shared table. This parameter is mandatory. The maximum length of this table name is 255. |
|
entry_size |
The maximum number of entries this table can hold. This parameter is optional. The default value is 2048. Must not exceed 2048. |
|
memory_limit |
The maximum amount of memory that can be allocated for a shared table and its data entries. This parameter is optional. The default value is 4 G. |
Events
All events except: PERSISTENCE, POST_PERSIST, CLIENTSSL_HANDSHAKE
Example
when HTTP_REQUEST {
table_name = "TableDemo1"
ret = PROXY:shared_table_create(table_name, 2048, 20971520)
if ret then
debug("===>>shared_table_create success: [%s]\n", table_name)
else
debug("===>>shared_table_create failed: [%s]\n", table_name)
end
}
Supported Version
FortiADC version 7.4.2 and later.