Python examples
Manage Time Series Databases
list all time series databases this code gets a list of time series databases for the factry historian organization ( my swagger ) get get https //historian mycompany com 18000/api/timeseries databases https //historian mycompany com 18000/api/timeseries databases def list ts databases() resp = session get(f"{base url}/timeseries databases", timeout=30) resp raise for status() return resp json() ts db list = list ts databases() print(json dumps(ts db list, indent=2)) successful response \[ { "uuid" "8bcc36ec 5c09 11f0 861a ba2c68c81159", "createdby" "6c8ef372 5c29 11ef 9e88 0242ac12000a", "createdat" "2025 07 08t14 40 51 834631z", "updatedby" "6c8ef372 5c29 11ef 9e88 0242ac12000a", "updatedat" "2025 07 08t14 40 51 964226z", "attributes" {}, "metadata" {}, "organizationuuid" "fbf184b2 5c29 11ef 8bf9 0242ac12000a", "settings" { "database" "database1", "host" "http //localhost 8086", "rousername" "grafana", "username" "factry" }, "securesettings" { "password" "4v3n5dz50pk6shuspfssscpj e6z6uzz1bh 3k4nkhlyxiyyqg==", "ropassword" "hhhuwxmp7mg9hftsrcrfyynsenuqsexkbcpzu3p qnoatiwd0w==" }, "timeseriesdatabasetype" { "uuid" "6c8e8982 5c29 11ef 9e88 0242ac12000a", "createdby" null, "createdat" "0001 01 01t00 00 00z", "updatedby" null, "updatedat" "0001 01 01t00 00 00z", "attributes" null, "metadata" {}, "name" "influx", "settingsschema" { "$id" "http //example com/example json", "$schema" "http //json schema org/draft 07/schema", "additionalproperties" true, "default" {}, "description" "the root schema comprises the entire json document ", "properties" { "database" { "$id" "#/properties/database", "default" "", "description" "the name of the database on the influx host", "examples" \[ "looms" ], "order" 3, "title" "database", "type" "string" }, "host" { "$id" "#/properties/host", "default" "http //127 0 0 1 8086", "description" "the host for the influx database", "examples" \[ "http //127 0 0 1 8086" ], "order" 2, "pattern" "https? \\\\/\\\\/ \[0 9]+", "title" "host", "type" "string" }, "password" { "$id" "#/properties/password", "default" "", "description" "the password used to authenticate on the influx host", "examples" \[ "password" ], "order" 1, "password" true, "secure" true, "title" "admin password", "type" "string" }, "ropassword" { "$id" "#/properties/ropassword", "default" "", "description" "the password used for read only access", "examples" \[ "password" ], "order" 5, "password" true, "secure" true, "title" "read only password", "type" "string" }, "rousername" { "$id" "#/properties/rousername", "default" "grafana", "description" "the username used for read only access, if create database is checked and the user does not exist, the user will be created automatically ", "examples" \[ "grafana" ], "order" 4, "title" "read only user", "type" "string" }, "username" { "$id" "#/properties/username", "default" "factry", "description" "the username used to log in to the influx host", "examples" \[ "username" ], "order" 0, "title" "admin user", "type" "string" } }, "required" \[ "username", "password", "host", "database", "rousername", "ropassword" ], "title" "the root schema", "type" "object" } }, "name" "database1", "description" "", "status" "active", "timeseriesdatabasetypeuuid" "6c8e8982 5c29 11ef 9e88 0242ac12000a", "required" false }, { "uuid" "19bdd45c 5c2d 11ef ae29 0242ac12000a", "createdby" "6c8ef372 5c29 11ef 9e88 0242ac12000a", "createdat" "2024 08 17t00 10 24 691858z", "updatedby" "6c8ef372 5c29 11ef 9e88 0242ac12000a", "updatedat" "2025 09 18t15 08 32 174027z", "attributes" {}, "metadata" {}, "organizationuuid" "fbf184b2 5c29 11ef 8bf9 0242ac12000a", "settings" { "database" "database2", "host" "http //localhost 8086", "rousername" "grafana", "username" "factry" }, "securesettings" { "password" "oti7ezlhgxhwrg3asikaci69 u0vw0 bg znqkzuxcc qvmqxw==", "ropassword" "ntbjlzf zfewsfgy6xq3zdsivstai8p 9mz3gmzbmhcm2xm3fg==" }, "timeseriesdatabasetype" { "uuid" "6c8e8982 5c29 11ef 9e88 0242ac12000a", "createdby" null, "createdat" "0001 01 01t00 00 00z", "updatedby" null, "updatedat" "0001 01 01t00 00 00z", "attributes" null, "metadata" {}, "name" "influx", "settingsschema" { "$id" "http //example com/example json", "$schema" "http //json schema org/draft 07/schema", "additionalproperties" true, "default" {}, "description" "the root schema comprises the entire json document ", "properties" { "database" { "$id" "#/properties/database", "default" "", "description" "the name of the database on the influx host", "examples" \[ "looms" ], "order" 3, "title" "database", "type" "string" }, "host" { "$id" "#/properties/host", "default" "http //127 0 0 1 8086", "description" "the host for the influx database", "examples" \[ "http //127 0 0 1 8086" ], "order" 2, "pattern" "https? \\\\/\\\\/ \[0 9]+", "title" "host", "type" "string" }, "password" { "$id" "#/properties/password", "default" "", "description" "the password used to authenticate on the influx host", "examples" \[ "password" ], "order" 1, "password" true, "secure" true, "title" "admin password", "type" "string" }, "ropassword" { "$id" "#/properties/ropassword", "default" "", "description" "the password used for read only access", "examples" \[ "password" ], "order" 5, "password" true, "secure" true, "title" "read only password", "type" "string" }, "rousername" { "$id" "#/properties/rousername", "default" "grafana", "description" "the username used for read only access, if create database is checked and the user does not exist, the user will be created automatically ", "examples" \[ "grafana" ], "order" 4, "title" "read only user", "type" "string" }, "username" { "$id" "#/properties/username", "default" "factry", "description" "the username used to log in to the influx host", "examples" \[ "username" ], "order" 0, "title" "admin user", "type" "string" } }, "required" \[ "username", "password", "host", "database", "rousername", "ropassword" ], "title" "the root schema", "type" "object" } }, "name" "database2", "description" "", "status" "active", "timeseriesdatabasetypeuuid" "6c8e8982 5c29 11ef 9e88 0242ac12000a", "required" false } ]