/create/trigger/byarea

URL: http://<db.host>:<db.port>/create/trigger/byarea

Sets up an area trigger mechanism for two column_names for one or more tables. (This function is essentially the two-dimensional version of /create/trigger/byrange.) Once the trigger has been activated, any record added to the listed tables(s) via /insert/records with the chosen columns' values falling within the specified region will trip the trigger. All such records will be queued at the trigger port (by default '9001' but able to be retrieved via /show/system/status) for any listening client to collect. Active triggers can be cancelled by using the /clear/trigger endpoint or by clearing all relevant tables.

The output returns the trigger handle as well as indicating success or failure of the trigger activation.

Input Parameter Description

NameTypeDescription
request_idstringUser-created ID for the trigger. The ID can be alphanumeric, contain symbols, and must contain at least one character.
table_namesarray of stringsNames of the tables on which the trigger will be activated and maintained, each in [schema_name.]table_name format, using standard name resolution rules.
x_column_namestringName of a numeric column on which the trigger is activated. Usually 'x' for geospatial data points.
x_vectorarray of doublesThe respective coordinate values for the region on which the trigger is activated. This usually translates to the x-coordinates of a geospatial region.
y_column_namestringName of a second numeric column on which the trigger is activated. Usually 'y' for geospatial data points.
y_vectorarray of doublesThe respective coordinate values for the region on which the trigger is activated. This usually translates to the y-coordinates of a geospatial region. Must be the same length as xvals.
optionsmap of string to stringsOptional parameters. The default value is an empty map ( {} ).

Output Parameter Description

The GPUdb server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query. Here is a description of the various fields of the wrapper:

NameTypeDescription
statusString'OK' or 'ERROR'
messageStringEmpty if success or an error message
data_typeString'create_trigger_by_area_response' or 'none' in case of an error
dataStringEmpty string
data_strJSON or String

This embedded JSON represents the result of the /create/trigger/byarea endpoint:

NameTypeDescription
trigger_idstringValue of input parameter request_id.
infomap of string to stringsAdditional information.

Empty string in case of an error.