Config

The /api/v3/config endpoints allow you to inspect, modify, and reload the configuration of the datarhei Core.

Read

Retrieve the currently active Core configuration with additionally a list of all fields that have an override by an environment variable. Such fields can be changed, but it will have no effect because the enviroment variable will always override the value.

Example:

curl http://127.0.0.1:8080/api/v3/config \
   -H 'accept: application/json' \
   -H 'Content-Type: application/json' \
   -X GET

Description:

Retrieve the currently active Restreamer configuration

get

Retrieve the currently active Restreamer configuration

Authorizations
Responses
200
OK
application/json
get
GET /v3/config HTTP/1.1
Host: api
Authorization: YOUR_API_KEY
Accept: */*
200

OK

{
  "config": {
    "address": "text",
    "api": {
      "access": {
        "http": {
          "allow": [
            "text"
          ],
          "block": [
            "text"
          ]
        },
        "https": {
          "allow": [
            "text"
          ],
          "block": [
            "text"
          ]
        }
      },
      "auth": {
        "auth0": {
          "enable": true,
          "tenants": [
            {
              "audience": "text",
              "clientid": "text",
              "domain": "text",
              "users": [
                "text"
              ]
            }
          ]
        },
        "disable_localhost": true,
        "enable": true,
        "jwt": {
          "secret": "text"
        },
        "password": "text",
        "username": "text"
      },
      "read_only": true
    },
    "created_at": "text",
    "db": {
      "dir": "text"
    },
    "debug": {
      "force_gc": 1,
      "profiling": true
    },
    "ffmpeg": {
      "access": {
        "input": {
          "allow": [
            "text"
          ],
          "block": [
            "text"
          ]
        },
        "output": {
          "allow": [
            "text"
          ],
          "block": [
            "text"
          ]
        }
      },
      "binary": "text",
      "log": {
        "max_history": 1,
        "max_lines": 1
      },
      "max_processes": 1
    },
    "host": {
      "auto": true,
      "name": [
        "text"
      ]
    },
    "id": "text",
    "log": {
      "level": "debug",
      "max_lines": 1,
      "topics": [
        "text"
      ]
    },
    "metrics": {
      "enable": true,
      "enable_prometheus": true,
      "interval_sec": 1,
      "range_sec": 1
    },
    "name": "text",
    "playout": {
      "enable": true,
      "max_port": 1,
      "min_port": 1
    },
    "router": {
      "blocked_prefixes": [
        "text"
      ],
      "routes": {
        "ANY_ADDITIONAL_PROPERTY": "text"
      },
      "ui_path": "text"
    },
    "rtmp": {
      "address": "text",
      "address_tls": "text",
      "app": "text",
      "enable": true,
      "enable_tls": true,
      "token": "text"
    },
    "service": {
      "enable": true,
      "token": "text",
      "url": "text"
    },
    "sessions": {
      "enable": true,
      "ip_ignorelist": [
        "text"
      ],
      "max_bitrate_mbit": 1,
      "max_sessions": 1,
      "persist": true,
      "persist_interval_sec": 1,
      "session_timeout_sec": 1
    },
    "srt": {
      "address": "text",
      "enable": true,
      "log": {
        "enable": true,
        "topics": [
          "text"
        ]
      },
      "passphrase": "text",
      "token": "text"
    },
    "storage": {
      "cors": {
        "origins": [
          "text"
        ]
      },
      "disk": {
        "cache": {
          "enable": true,
          "max_file_size_mbytes": 1,
          "max_size_mbytes": 1,
          "ttl_seconds": 1,
          "types": {
            "allow": [
              "text"
            ],
            "block": [
              "text"
            ]
          }
        },
        "dir": "text",
        "max_size_mbytes": 1
      },
      "memory": {
        "auth": {
          "enable": true,
          "password": "text",
          "username": "text"
        },
        "max_size_mbytes": 1,
        "purge": true
      },
      "mimetypes_file": "text"
    },
    "tls": {
      "address": "text",
      "auto": true,
      "cert_file": "text",
      "email": "text",
      "enable": true,
      "key_file": "text"
    },
    "update_check": true,
    "version": 1
  },
  "created_at": "text",
  "loaded_at": "text",
  "overrides": [
    "text"
  ],
  "updated_at": "text"
}

Update

Upload a modified configuration. You can provide a partial configuration with only the fields you want to change. The minimal valid configuration you have to provide contains the version number:

{
    "version": 3
}

Example:

curl http://127.0.0.1:8080/api/v3/config \
   -H 'accept: application/json' \
   -H 'Content-Type: application/json' \
   -X PUT \
   -d '{
         "version": 3,
         "name": "core-1",
         "log": {
            "level": "debug"
         }
      }'

Description:

Update the current Restreamer configuration

put

Update the current Restreamer configuration by providing a complete or partial configuration. Fields that are not provided will not be changed.

Authorizations
Body
addressstringOptional
created_atstringOptional
idstringOptional
namestringOptional
update_checkbooleanOptional
versionintegerOptional
Responses
200
OK
application/json
Responsestring
put
PUT /v3/config HTTP/1.1
Host: api
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 1874

{
  "address": "text",
  "api": {
    "access": {
      "http": {
        "allow": [
          "text"
        ],
        "block": [
          "text"
        ]
      },
      "https": {
        "allow": [
          "text"
        ],
        "block": [
          "text"
        ]
      }
    },
    "auth": {
      "auth0": {
        "enable": true,
        "tenants": [
          {
            "audience": "text",
            "clientid": "text",
            "domain": "text",
            "users": [
              "text"
            ]
          }
        ]
      },
      "disable_localhost": true,
      "enable": true,
      "jwt": {
        "secret": "text"
      },
      "password": "text",
      "username": "text"
    },
    "read_only": true
  },
  "created_at": "text",
  "db": {
    "dir": "text"
  },
  "debug": {
    "force_gc": 1,
    "profiling": true
  },
  "ffmpeg": {
    "access": {
      "input": {
        "allow": [
          "text"
        ],
        "block": [
          "text"
        ]
      },
      "output": {
        "allow": [
          "text"
        ],
        "block": [
          "text"
        ]
      }
    },
    "binary": "text",
    "log": {
      "max_history": 1,
      "max_lines": 1
    },
    "max_processes": 1
  },
  "host": {
    "auto": true,
    "name": [
      "text"
    ]
  },
  "id": "text",
  "log": {
    "level": "debug",
    "max_lines": 1,
    "topics": [
      "text"
    ]
  },
  "metrics": {
    "enable": true,
    "enable_prometheus": true,
    "interval_sec": 1,
    "range_sec": 1
  },
  "name": "text",
  "playout": {
    "enable": true,
    "max_port": 1,
    "min_port": 1
  },
  "router": {
    "blocked_prefixes": [
      "text"
    ],
    "routes": {
      "ANY_ADDITIONAL_PROPERTY": "text"
    },
    "ui_path": "text"
  },
  "rtmp": {
    "address": "text",
    "address_tls": "text",
    "app": "text",
    "enable": true,
    "enable_tls": true,
    "token": "text"
  },
  "service": {
    "enable": true,
    "token": "text",
    "url": "text"
  },
  "sessions": {
    "enable": true,
    "ip_ignorelist": [
      "text"
    ],
    "max_bitrate_mbit": 1,
    "max_sessions": 1,
    "persist": true,
    "persist_interval_sec": 1,
    "session_timeout_sec": 1
  },
  "srt": {
    "address": "text",
    "enable": true,
    "log": {
      "enable": true,
      "topics": [
        "text"
      ]
    },
    "passphrase": "text",
    "token": "text"
  },
  "storage": {
    "cors": {
      "origins": [
        "text"
      ]
    },
    "disk": {
      "cache": {
        "enable": true,
        "max_file_size_mbytes": 1,
        "max_size_mbytes": 1,
        "ttl_seconds": 1,
        "types": {
          "allow": [
            "text"
          ],
          "block": [
            "text"
          ]
        }
      },
      "dir": "text",
      "max_size_mbytes": 1
    },
    "memory": {
      "auth": {
        "enable": true,
        "password": "text",
        "username": "text"
      },
      "max_size_mbytes": 1,
      "purge": true
    },
    "mimetypes_file": "text"
  },
  "tls": {
    "address": "text",
    "auto": true,
    "cert_file": "text",
    "email": "text",
    "enable": true,
    "key_file": "text"
  },
  "update_check": true,
  "version": 1
}
text

Reload

After changing the configuration, the datarhei Core has to be restarted in order to reload the changed configuration.

Example:

curl http://127.0.0.1:8080/api/v3/config/reload \
   -H 'accept: application/json' \
   -H 'Content-Type: application/json' \
   -X GET

Description:

Reload the currently active configuration

get

Reload the currently active configuration. This will trigger a restart of the Core.

Authorizations
Responses
200
OK
application/json
Responsestring
get
GET /v3/config/reload HTTP/1.1
Host: api
Authorization: YOUR_API_KEY
Accept: */*
200

OK

text

Configuration

Complete config example:

{
    "version": 3,
    "id": "03a1d1af-b947-4a13-a169-d3f2238714ee",
    "name": "super-core-1337",
    "address": ":8080",
    "update_check": true,
    "log": {
        "level": "info",
        "topics": [],
        "max_lines": 1000
    },
    "db": {
        "dir": "/core/config"
    },
    "host": {
        "name": [
            "example.com"
        ],
        "auto": true
    },
    "api": {
        "read_only": false,
        "access": {
            "http": {
                "allow": [],
                "block": []
            },
            "https": {
                "allow": [],
                "block": []
            }
        },
        "auth": {
            "enable": true,
            "disable_localhost": false,
            "username": "admin",
            "password": "datarhei",
            "jwt": {
                "secret": "cz$L%a(d%%[lLh;Y8dahIjcQx+tBq(%5"
            },
            "auth0": {
                "enable": false,
                "tenants": []
            }
        }
    },
    "tls": {
        "address": ":8181",
        "enable": true,
        "auto": true,
        "email": "[email protected]",
        "cert_file": "",
        "key_file": ""
    },
    "storage": {
        "disk": {
            "dir": "/core/data",
            "max_size_mbytes": 50000,
            "cache": {
                "enable": true,
                "max_size_mbytes": 500,
                "ttl_seconds": 300,
                "max_file_size_mbytes": 1,
                "types": {
                    "allow": [],
                    "block": [
                        ".m3u8",
                        ".mpd"
                    ]
                }
            }
        },
        "memory": {
            "auth": {
                "enable": true,
                "username": "admin",
                "password": "WH8y3alD7pHGsuBGwb"
            },
            "max_size_mbytes": 2000,
            "purge": true
        },
        "s3": [],
        "cors": {
            "origins": [
                "*"
            ]
        },
        "mimetypes_file": "./mime.types"
    },
    "rtmp": {
        "enable": true,
        "enable_tls": true,
        "address": ":1935",
        "address_tls": ":1936",
        "app": "/",
        "token": "n4jk235nNJKN4k5n24k"
    },
    "srt": {
        "enable": true,
        "address": ":6000",
        "passphrase": "n23jk4DD5DOAn5jk4DSS",
        "token": "",
        "log": {
            "enable": false,
            "topics": []
        }
    },
    "ffmpeg": {
        "binary": "ffmpeg",
        "max_processes": 0,
        "access": {
            "input": {
                "allow": [],
                "block": []
            },
            "output": {
                "allow": [],
                "block": []
            }
        },
        "log": {
            "max_lines": 50,
            "max_history": 3
        }
    },
    "playout": {
        "enable": false,
        "min_port": 0,
        "max_port": 0
    },
    "debug": {
        "profiling": false,
        "force_gc": 0
    },
    "metrics": {
        "enable": false,
        "enable_prometheus": false,
        "range_sec": 300,
        "interval_sec": 2
    },
    "sessions": {
        "enable": true,
        "ip_ignorelist": [
            "127.0.0.1/32",
            "::1/128"
        ],
        "session_timeout_sec": 30,
        "persist": true,
        "persist_interval_sec": 300,
        "max_bitrate_mbit": 250,
        "max_sessions": 50
    },
    "service": {
        "enable": false,
        "token": "",
        "url": "https://service.datarhei.com"
    },
    "router": {
        "blocked_prefixes": [
            "/api"
        ],
        "routes": {},
        "ui_path": "/core/ui"
    }
}

Required fields: version

Descriptions

Configuration

Last updated

Was this helpful?