In the MAAS CLI, a profile represents a set of stored credentials and connection details for a specific MAAS server, that is, a user. Profiles enable users to manage multiple MAAS environments efficiently by maintaining separate authentication contexts.
Managing profiles in MAAS CLI
-
Logging in: To create a new profile and log in to a MAAS server, use the
login
command:maas login <profile_name> <MAAS_URL> <API_KEY>
Replace
<profile_name>
with your desired profile identifier,<MAAS_URL>
with the server’s API endpoint, and<API_KEY>
with your authentication key. -
Listing profiles: To view all stored profiles, use the
list
command:maas list
This will display all profiles along with their associated MAAS server URLs.
-
Switching profiles: MAAS CLI commands are executed in the context of a specific profile. To switch between profiles, specify the desired profile before the command:
maas <profile_name> <command>
For example, to list machines using the
admin
profile:maas admin machines list
-
Logging out: To remove a profile and its credentials, use the
logout
command:maas logout <profile_name>
This action purges the stored credentials for the specified profile.
By effectively managing profiles, administrators can seamlessly interact with multiple MAAS environments, ensuring organized and secure operations.
Last updated 11 hours ago.