Reusing Session ID and Authentication Tokens
DCLI preserves the session ID of a vCenter Server connection and the authentication tokens of VMware Cloud on AWS or NSX-T connections. Preservation works differently based on whether you run commands in interactive or non-interactive mode.
Interactive Mode
In interactive mode, the first command that requires authentication creates a session ID or authentication token. This information is saved in the memory. Subsequent command calls that require authentication reuse the saved session ID or authentication token.
After you close the interactive session by using the exit command with a vCenter Server connection, a logout request is sent to the server and the session ID is removed from the memory. With VMware Cloud on AWS or NSX-T connections, the authentication token is removed from the memory.
Non-Interactive Mode
In non-interactive mode, the first command that requires authentication prompts you for credentials. The command also prompts whether to store the credentials in the credential store. If you decide to preserve the credentials in the store, the session ID or authentication token are also saved in the credential store and are later reused by subsequent commands. If you decide not to preserve the credentials, a session ID or authentication token is created for each command.
If you want to remove a session ID or authentication token from the credential store and log out of a server, you must use the +logout option and provide the vCenter Server, VMware Cloud on AWS, or NSX-T connection. Using this option with a vCenter Server connection sends a logout request to the server and removes the session ID from the credential store. Using +logout with VMware Cloud on AWS or NSX-T connections only removes the authentication token from the credential store.