Op Functions Introduction
Op is a powerful interactive CLI based upon an operations oriented language for gathering information about your infrastructure and proactively managing issues in order to maintain a stable operational environment. Op has five types of objects that you will be working with:
- Resources - the infrastructure objects in your environment. Resources can be hosts, pods, containers, virtual machines, database instances etc. On different platforms, you can have different resources e.g. pods and containers for Kubernetes and virtual machines for AWS, GCP, or Azure.
- Metrics - time series data associated with your resources such as CPU utilization, latency, throughput, or error rate. You can query the metrics gathered to monitor the environment. You also use metrics to determine if a condition or threshold has been met which requires an Action to be taken.
- Alarms - indicators that tell you when something has gone wrong and/or needs attention. Alarms are defined on metrics, resources, and system state and are triggered when a condition is met.
- Actions - shell commands and shell scripts that help you mitigate and remediate the problem that an Alarm has identified. The Op CLI comes with a basic set of actions. You can define custom actions and encode an entire operational workflow into a runbook using Actions.
- Bots - bind Alarms and Actions together using IF-THEN-ELSE constructs. Bots specify the action or set of actions to take when the alarm triggers.
Op has five types of functions that you will be performing on objects:
- Define - creates new objects.
- Get - returns the value of a specified field inside of an object.
- List - returns all instances of the object type specified.
- Update - modifies the description, value, arguments, approvers, and enabled state of existing objects.
- Delete - erases existing objects.
Op objects support symbolic manipulation. The Op functions bind the symbol to the underlying query or action. This Glossary provides the syntax and examples for each function.