Skip to main content

InfluxDBWriteAPI

This item only works when running on the server. Server

InfluxDB API to write to the server.

Types

InfluxDBRequestHandler

type InfluxDBRequestHandler = (requestHttpPromise.HTTPRequest) → Promise<HttpPromise.HTTPResponse>

Function used to actually send a request. Defaults to HttpPromise.request, but can be injected so tests can stand in a mock (see InfluxDBRequestHandlerMock) instead of making real HTTP calls.

Functions

new

InfluxDBWriteAPI.new(
orgstring,
bucketstring,
precisionstring?,
requestHandlerInfluxDBRequestHandler?--

Defaults to HttpPromise.request. Inject a mock to avoid real HTTP.

) → InfluxDBWriteAPI

Creates a new InfluxDB write API. Retrieve this from the InfluxDBClient.

SetDefaultTags

InfluxDBWriteAPI.SetDefaultTags(
tagsInfluxDBTags
) → ()

Sets the default tags to write with each point.

SetConvertTime

InfluxDBWriteAPI.SetConvertTime(
convertTime(number) → number
) → ()

Sets the conversion time

QueuePoint

InfluxDBWriteAPI.QueuePoint() → ()

Queues a new influx DB point to send to the server.

QueuePoints

InfluxDBWriteAPI.QueuePoints() → ()

Queues a new list of influx DB points to send to the server.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Creates a new InfluxDB write API. Retrieve this from the [InfluxDBClient].",
            "params": [
                {
                    "name": "org",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "bucket",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "precision",
                    "desc": "",
                    "lua_type": "string?"
                },
                {
                    "name": "requestHandler",
                    "desc": "Defaults to [HttpPromise.request]. Inject a mock to avoid real HTTP.",
                    "lua_type": "InfluxDBRequestHandler?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "InfluxDBWriteAPI"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 65,
                "path": "src/influxdbclient/src/Server/Write/InfluxDBWriteAPI.lua"
            }
        },
        {
            "name": "SetDefaultTags",
            "desc": "Sets the default tags to write with each point.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "InfluxDBWriteAPI"
                },
                {
                    "name": "tags",
                    "desc": "",
                    "lua_type": "InfluxDBTags"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 126,
                "path": "src/influxdbclient/src/Server/Write/InfluxDBWriteAPI.lua"
            }
        },
        {
            "name": "SetConvertTime",
            "desc": "Sets the conversion time",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "InfluxDBWriteAPI"
                },
                {
                    "name": "convertTime",
                    "desc": "",
                    "lua_type": "(number) -> number"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 135,
                "path": "src/influxdbclient/src/Server/Write/InfluxDBWriteAPI.lua"
            }
        },
        {
            "name": "QueuePoint",
            "desc": "Queues a new influx DB point to send to the server.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "InfluxDBWriteAPI"
                },
                {
                    "name": "point",
                    "desc": "",
                    "lua_type": "InfluxDBPoint"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 144,
                "path": "src/influxdbclient/src/Server/Write/InfluxDBWriteAPI.lua"
            }
        },
        {
            "name": "QueuePoints",
            "desc": "Queues a new list of influx DB points to send to the server.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "InfluxDBWriteAPI"
                },
                {
                    "name": "points",
                    "desc": "",
                    "lua_type": "{ InfluxDBPoint }"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 162,
                "path": "src/influxdbclient/src/Server/Write/InfluxDBWriteAPI.lua"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "InfluxDBRequestHandler",
            "desc": "Function used to actually send a request. Defaults to [HttpPromise.request], but can be injected so\ntests can stand in a mock (see [InfluxDBRequestHandlerMock]) instead of making real HTTP calls.",
            "lua_type": "(request: HttpPromise.HTTPRequest) -> Promise<HttpPromise.HTTPResponse>",
            "source": {
                "line": 34,
                "path": "src/influxdbclient/src/Server/Write/InfluxDBWriteAPI.lua"
            }
        }
    ],
    "name": "InfluxDBWriteAPI",
    "desc": "InfluxDB API to write to the server.",
    "realm": [
        "Server"
    ],
    "source": {
        "line": 8,
        "path": "src/influxdbclient/src/Server/Write/InfluxDBWriteAPI.lua"
    }
}