Skip to content

MngAddGateway

Creates a gateway and starts it asynchronously when enabled is true. Requires SESSION_ADMIN.

HTTP: POST /gateway

{
  "command":"MngAddGateway",
  "name":"Mock LP",
  "description":"Gateway transport test",
  "type":"MOCK",
  "binary":"mock/mock_gateway",
  "enabled":true,
  "bind_host":"127.0.0.1",
  "port":0,
  "provider_config":{
    "host":"127.0.0.1",
    "port":8090,
    "login":12323,
    "password":"Adcsew3#3"
  },
  "startup_timeout_ms":10000,
  "heartbeat_interval_ms":1000,
  "heartbeat_timeout_ms":5000,
  "restart_enabled":true,
  "restart_initial_delay_ms":500,
  "restart_max_delay_ms":10000
}

The response contains the created gateway object with its assigned id and timestamps. name, type, binary, and the provider_config object are required. The server does not impose an LP-specific schema on provider_config; its contract belongs to the selected adapter. port is optional and defaults to 0, which selects a free loopback port whenever the process starts. A non-zero fixed port must be unique. bind_host defaults to 127.0.0.1.

type and binary must identify an entry returned by MngGetAvailableGateways. Binary and type are intentionally not unique across configurations: create separate configurations with unique names to connect the same adapter to multiple LP accounts. Auto-port instances receive independent runtime ports.

An HTTP success means that the configuration was accepted. Use MngGetGatewayRuntime to confirm that the asynchronous startup reached READY.

For the MOCK adapter, host and password must be non-empty strings and login must be a positive integer. Provider port is optional and may be omitted, null, or 0; a positive value must not exceed 65535. Optional simulate_failure: true makes the mock report MOCK_CONNECT_FAILED.