salt.modules.trafficserver

Apache Traffic Server execution module.

2015.8.0 新版功能.

traffic_line is used to execute individual Traffic Server commands and to script multiple commands in a shell.

salt.modules.trafficserver.alarms()

List all alarm events that have not been acknowledged (cleared).

salt '*' trafficserver.alarms
salt.modules.trafficserver.bounce_cluster()

Bounce all Traffic Server nodes in the cluster. Bouncing Traffic Server shuts down and immediately restarts Traffic Server, node-by-node.

salt '*' trafficserver.bounce_cluster
salt.modules.trafficserver.bounce_local(drain=False)

Bounce Traffic Server on the local node. Bouncing Traffic Server shuts down and immediately restarts the Traffic Server node.

This option modifies the behavior of traffic_line -b and traffic_line -L such that traffic_server is not shut down until the number of active client connections drops to the number given by the proxy.config.restart.active_client_threshold configuration variable.

salt '*' trafficserver.bounce_local
salt '*' trafficserver.bounce_local drain=True
salt.modules.trafficserver.clear_alarms(alarm)

Clear (acknowledge) an alarm event. The arguments are “all” for all current alarms, a specific alarm number (e.g. ‘‘1’‘), or an alarm string identifier (e.g. ‘’MGMT_ALARM_PROXY_CONFIG_ERROR’‘).

salt '*' trafficserver.clear_alarms [all | #event | name]
salt.modules.trafficserver.clear_cluster()

Clears accumulated statistics on all nodes in the cluster.

salt '*' trafficserver.clear_cluster
salt.modules.trafficserver.clear_node()

Clears accumulated statistics on the local node.

salt '*' trafficserver.clear_node
salt.modules.trafficserver.match_var(regex)

Display the current values of all performance statistics or configuration variables whose names match the given regular expression.

salt '*' trafficserver.match_var regex
salt.modules.trafficserver.offline(path)

Mark a cache storage device as offline. The storage is identified by a path which must match exactly a path specified in storage.config. This removes the storage from the cache and redirects requests that would have used this storage to other storage. This has exactly the same effect as a disk failure for that storage. This does not persist across restarts of the traffic_server process.

salt '*' trafficserver.offline /path/to/cache
salt.modules.trafficserver.read_var(*args)

Read variable definitions from the traffic_line command

This allows reading arbitrary key=value pairs from within trafficserver

salt '*' trafficserver.read_var proxy.process.http.tcp_hit_count_stat
salt.modules.trafficserver.refresh()

Initiate a Traffic Server configuration file reread. Use this command to update the running configuration after any configuration file modification.

The timestamp of the last reconfiguration event (in seconds since epoch) is published in the proxy.node.config.reconfigure_time metric.

salt '*' trafficserver.refresh
salt.modules.trafficserver.restart_cluster()

Restart the traffic_manager process and the traffic_server process on all the nodes in a cluster.

salt '*' trafficserver.restart_cluster
salt.modules.trafficserver.restart_local(drain=False)

Restart the traffic_manager and traffic_server processes on the local node.

This option modifies the behavior of traffic_line -b and traffic_line -L such that traffic_server is not shut down until the number of active client connections drops to the number given by the proxy.config.restart.active_client_threshold configuration variable.

salt '*' trafficserver.restart_local
salt '*' trafficserver.restart_local drain=True
salt.modules.trafficserver.set_var(variable, value)
salt '*' trafficserver.set_var proxy.config.http.server_ports
salt.modules.trafficserver.shutdown()

Shut down Traffic Server on the local node.

salt '*' trafficserver.shutdown
salt.modules.trafficserver.startup()

Start Traffic Server on the local node.

salt '*' trafficserver.start
salt.modules.trafficserver.status()

Show the current proxy server status, indicating if we’re running or not.

salt '*' trafficserver.status
salt.modules.trafficserver.zero_cluster()

Reset performance statistics to zero across the cluster.

salt '*' trafficserver.zero_cluster
salt.modules.trafficserver.zero_node()

Reset performance statistics to zero on the local node.

salt '*' trafficserver.zero_cluster