From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/vagrant/cli%2Fmachine-readable.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 devdocs/vagrant/cli%2Fmachine-readable.html (limited to 'devdocs/vagrant/cli%2Fmachine-readable.html') diff --git a/devdocs/vagrant/cli%2Fmachine-readable.html b/devdocs/vagrant/cli%2Fmachine-readable.html new file mode 100644 index 00000000..1af06e73 --- /dev/null +++ b/devdocs/vagrant/cli%2Fmachine-readable.html @@ -0,0 +1,22 @@ +

Machine Readable Output

Every Vagrant command accepts a --machine-readable flag which enables machine readable output mode. In this mode, the output to the terminal is replaced with machine-friendly output.

This mode makes it easy to programmatically execute Vagrant and read data out of it. This output format is protected by our backwards compatibility policy. Until Vagrant 2.0 is released, however, the machine readable output may change as we determine more use cases for it. But the backwards compatibility promise should make it safe to write client libraries to parse the output format.

Advanced topic! This is an advanced topic for use only if you want to programmatically execute Vagrant. If you are just getting started with Vagrant, you may safely skip this section.

+

Work-In-Progress

The machine-readable output is very new (released as part of Vagrant 1.4). We're still gathering use cases for it and building up the output for each of the commands. It is likely that what you may want to achieve with the machine-readable output is not possible due to missing information.

In this case, we ask that you please open an issue requesting that certain information become available. We will most likely add it!

Format

The machine readable format is a line-oriented, comma-delimited text format. This makes it extremely easy to parse using standard Unix tools such as awk or grep in addition to full programming languages like Ruby or Python.

The format is:

timestamp,target,type,data...
+
+

Each component is explained below:

Within the format, if data contains a comma, it is replaced with %!(VAGRANT_COMMA). This was preferred over an escape character such as \' because it is more friendly to tools like awk.

Newlines within the format are replaced with their respective standard escape sequence. Newlines become a literal \n within the output. Carriage returns become a literal \r.

Types

This section documents all the available types that may be outputted with the machine-readable output.

+ + + + + + + + +
Type Description
box-name Name of a box installed into Vagrant.
box-provider Provider for an installed box.
cli-command A subcommand of vagrant that is available.
error-exit An error occurred that caused Vagrant to exit. This contains that error. Contains two data elements: type of error, error message.
provider-name The provider name of the target machine. targeted
ssh-config The OpenSSH compatible SSH config for a machine. This is usually the result of the "ssh-config" command. targeted
state The state ID of the target machine. targeted
state-human-long Human-readable description of the state of the machine. This is the long version, and may be a paragraph or longer. targeted
state-human-short Human-readable description of the state of the machine. This is the short version, limited to at most a sentence. targeted
+

+ © 2010–2018 Mitchell Hashimoto
Licensed under the MPL 2.0 License.
+ https://www.vagrantup.com/docs/cli/machine-readable.html +

+
-- cgit v1.2.3