atmos.profile
The atmos.profile function runs atmos profile through the current Atmos executable. Use it to discover the
configuration profiles available to a project and to read the details of one profile.
Usage
atmos.profile(
*positionals,
flags = {},
args = [],
working_directory = ...,
env = ...,
output = "stream",
check = True,
)
Subcommands
Pass the subcommand and its positional arguments as strings before the keyword arguments. The call
atmos.profile("show", "developer") runs atmos profile show developer.
| Subcommand | Purpose |
|---|---|
list | List available configuration profiles. |
show | Show detailed information about a profile. |
See the atmos profile command reference for the complete list of subcommands and
flags.
Arguments
*positionals(Optional) Strings placed on the command line right after
profile, in order: the subcommand and its positional arguments, such as the profile name forshow. Every value must be a string.flags(Optional) A dictionary of command-line options; see flag translation. The key
"format"becomes--format, and the registered shorthand"f"resolves to the same flag. Thelistsubcommand acceptstable,json, oryaml, andshowacceptstext,json, oryaml.args- (Optional) A list or tuple of strings appended after the flags.
working_directory,env,output,check(Optional) See
atmos.runfor process options and defaults.
Options other than the positionals are keyword-only.
Returns
A result with stdout, stderr, and exit_code. See atmos.run for output and error behavior.
Examples
List the profiles as data
profiles = json.decode(atmos.profile("list", flags = {"format": "json"}, output = "capture").stdout)
for profile in profiles:
print(profile["Name"], profile["Files"])
The JSON output is a list of objects with keys such as Name, Path, and Files.
Show one profile
details = atmos.profile("show", "developer", flags = {"format": "yaml"}, output = "capture")
print(details.stdout)
Check that a profile exists
probe = atmos.profile("show", "ci", output = "capture", check = False)
if probe.exit_code != 0:
fail("The ci profile is not available:\n" + probe.stderr)
Related
atmos.runruns any Atmos command from an argument list.atmos profiledocuments every subcommand and flag.- Atmos Automation Language and the script step