Options
Model
- class pytm4srv.models.Option
- AUTO_INCREASE_INV_MIN_ON_HAND = 'auto_increase_inv_min_on_hand'
Automatically increase the minimum on-hand quantity of inventory items to cover the machines using each one.
- Type:
boolean
- Default:
false
- CHECK_UNUSED_TOOLS_PARTS = 'check_unused_tools_parts'
Number of recent parts to check for tools before considering them unused.
- Type:
boolean
- Default:
5
- CURRENCY = 'currency'
Currency to use when displaying monetary quantities.
The list of supported values can be fetched using GET /api/options/currencies.
- Type:
string, admin-only
- Format:
ISO 4217 code
- Default:
USD
- DEFAULT_TOOL_LEAD_TIME = 'default_tool_lead_time'
Default lead time (in days) for ordering.
- Type:
integer
- Default:
0
- DEFAULT_TOOL_SAFETY_STOCK = 'default_tool_safety_stock'
Default safety stock for ordering.
- Type:
integer
- Default:
0
- DISABLE_PRODUCTION_STOPPED_CHECK = 'disable_production_stopped_check'
Disable the “production stopped” machine state.
- Type:
boolean
- Default:
false
- DISPLAY_RAW_NC_STATES = 'display_raw_nc_states'
Show machine states as reported by the NC instead of the mapped state definition name.
- Type:
boolean
- Default:
false
- EXTREME_ALARM_VALUE = 'extreme_alarm_value'
Monetary value of a TMAC EXTREME alarm.
- Type:
number
- Default:
0
- GLOBAL_SHIFT_NOTES_NOTIFY_CHANNEL = 'global_shift_notes_notify_channel'
Notification channel ID for shift notes messages from all machines.
- Type:
number
- Default:
null
- INSPECTION_INSTALLED = 'inspection_installed'
Whether Inspection is installed alongside OnTakt.
- Type:
boolean, read-only
- ISSUE_TAG_COLORS = 'issue_tag_colors'
Mapping of issue tag to custom color (#RRGGBB).
- Type:
map of string to string
- LANGUAGE = 'language'
Language to use for server-side actions that do not take an
Accept-Language
header from the client, such as sending scheduled reports and notifications triggered by machines.The list of supported values can be fetched using GET /api/options/languages.
- Type:
string, admin-only
- Format:
ISO 639 Set 1 code
- Default:
en
- LICENSE_EXPIRES = 'license_expires'
The license expiration date (UNIX timestamp).
- Type:
number
- LICENSE_INSTANCE = 'license_instance'
The unique license ID.
- Type:
string, read-only
- LICENSE_MACHINES = 'license_machines'
The number of machines allowed by the current license.
- Type:
integer, read-only
- LICENSE_TMAC_KEYS = 'license_tmac_keys'
The number of TMAC API keys included with the current license.
- Type:
integer, read-only
- MACHINE_SORT = 'machine_sort'
The custom sort order of all machines.
- Type:
list of machine IDs
- Default:
[]
- MACHINE_TAG_COLORS = 'machine_tag_colors'
Mapping of machine tag to custom color (#RRGGBB).
- Type:
map of string to string
- MAX_FEED_HOLD_TIME = 'max_feed_hold_time'
Duration (in seconds) after which the color of a machine in feed hold will be fully saturated.
- Type:
number
- Default:
300
- MAX_IDLE_TIME = 'max_idle_time'
Duration (in seconds) after which the color of an idle machine will be fully saturated.
- Type:
number
- Default:
1200
- OFFLINE_NC_DELAY = 'offline_nc_delay'
How long a machine can go without reporting the NC state before it appears offline and a notification is sent.
Setting to zero will disable offline machine detection.
- Type:
number (minutes)
- Default:
60
- OFFLINE_NOTIFY_CHANNEL = 'offline_notify_channel'
If set to the ID of a notification channel, a message will be sent when a machine has not reported in
offline_notify_tmac_delay
.- Type:
integer (notification channel ID)
- Default:
null
- OFFLINE_PREFLIGHT_DELAY = 'offline_preflight_delay'
How long a machine can go without running Preflight before it appears offline and a notification is sent.
Setting to zero will disable offline Preflight detection.
- Type:
number (minutes)
- Default:
60
- OFFLINE_TMAC_DELAY = 'offline_tmac_delay'
How long a machine can go without reporting the TMAC state before a notification is sent.
Setting to zero will disable offline TCU detection.
- Type:
number (minutes)
- Default:
60
- PART_REPORT_LIMIT = 'part_report_limit'
Maximum number of parts to create at once.
- Type:
integer, admin-only
- Default:
100
- PREFLIGHT_DOWNTIME_CATEGORY = 'preflight_downtime_category'
If set, OnTakt will automatically create a downtime block in the given category ID when a machine fails Preflight.
- Type:
int
- PREFLIGHT_PROCESS_REQUIRED = 'preflight_process_required'
If set, machines without an active process will fail Preflight.
- Default:
false
- PREFLIGHT_SENDS_NOTIFICATION = 'preflight_sends_notification'
Whether to send a notification to a machine’s configured notification channel (if any) when it fails Preflight.
- Type:
boolean
- Default:
false
- PROXY_VERSION = 'proxy_version'
The version of the proxy that last established a connection.
- Type:
string, read-only
- SAVINGS_CALCULATOR = 'savings_calculator'
State of the savings calculator stored by the client.
- Type:
object
- SERVER_NAME = 'server_name'
The server’s accessible hostname or IP address. Used to generate external links.
- Type:
string, read-only
- SHOP_USERS_CAN_TEST_TOOLS = 'shop_users_can_test_tools'
Whether shop users can replace tools in test mode.
- Type:
boolean
- Default:
false
- SMTP_FROM = 'smtp_from'
“From” address for emails sent by OnTakt.
- Type:
string, admin-only
- SMTP_HOST = 'smtp_host'
Hostname or address of the SMTP server to use for sending emails.
- Type:
string, admin-only
- SMTP_PASSWORD = 'smtp_password'
Password to use when logging into the SMTP server.
- Type:
string, admin-only, write-only
- SMTP_PORT = 'smtp_port'
Port to use when connecting to the SMTP server.
- Type:
integer, admin-only
- SMTP_TLS = 'smtp_tls'
Whether TLS is required for connecting to the SMTP server.
- Type:
boolean, admin-only
- SMTP_USERNAME = 'smtp_username'
Username or email address to use when logging into the SMTP server.
- Type:
string, admin-only
- TIMEZONE = 'timezone'
Time zone for server-side events.
The list of supported values can be fetched using GET /api/options/timezones.
- Type:
string, admin-only
- Format:
tz data identifier
- Default:
UTC
- TOOL_LIFE_CHANGED_NOTIFY = 'tool_life_changed_notify'
ID of a notification channel to notify when a tool’s expected life is changed.
- Type:
integer
- TOOL_REORDER_NOTIFY_CHANNEL = 'tool_reorder_notify_channel'
Notification channel ID to notify when tools need reordering.
- Type:
integer
- TOOL_REPLACED_CHECKLIST = 'tool_replaced_checklist'
Default checklist to display after replacing a tool.
- Type:
list of strings
- Default:
[]
- TOOL_REPLACEMENT_MIN_USAGE = 'tool_replacement_min_usage'
Minimum tool usage to allow replacement without a note.
- Type:
number
- Default:
0
- TOOL_STOCK_OUT_NOTIFY = 'tool_stock_out_notify'
ID of a notification channel to notify when a tool is expected to run out.
- Type:
integer
- TOOL_TAG_COLORS = 'tool_tag_colors'
Mapping of tool tag to custom color (#RRGGBB).
- Type:
map of string to string
- UNDERCUT_ALARM_VALUE = 'undercut_alarm_value'
Monetary value of a TMAC UNDERCUT alarm.
- Type:
number
- Default:
0
- WEAR_ALARM_VALUE = 'wear_alarm_value'
Monetary value of a TMAC WEAR alarm.
- Type:
number
- Default:
0
Endpoints
- GET /api/options/
Get the current values of all options.
Some options are not listed if the current user is not an administrator.
- Returns:
a JSON object mapping option keys to values.
- PATCH /api/options/
Change the values of all provided options.
The request body should be a JSON object mapping option keys to values.
Note
Options that cannot be set due to the user’s permission level will be silently ignored. To ensure an option is set, use POST /api/options/<key> instead.
- Status Codes:
204 No Content – on success
400 Bad Request – if the data is invalid
- POST /api/options/(option)
Change a single option.
The POST body should be a single JSON value.
- Returns:
An option object containing the key and new value
- Status Codes:
200 OK – when the option was set
204 No Content – when the option was cleared
400 Bad Request – when the new value was invalid
403 Forbidden – when the current user cannot set this option
- GET /api/options/timezones
Get a list of all supported timezones.
- Returns:
JSON array of strings, each containing a tz data identifier
- GET /api/options/languages
Get all supported languages.
- Returns:
a JSON array of strings, each containing an ISO 639 Set 1 language code