Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for --format=json flag to tctl bots add #10783

Closed
russjones opened this issue Mar 3, 2022 · 1 comment · Fixed by #10833
Closed

Add support for --format=json flag to tctl bots add #10783

russjones opened this issue Mar 3, 2022 · 1 comment · Fixed by #10833
Assignees
Labels
feature-request Used for new features in Teleport, improvements to current should be #enhancements machine-id

Comments

@russjones
Copy link
Contributor

russjones commented Mar 3, 2022

Adding support for the --format=json flag for tctl bots add would be really useful for automation allowing the user of tools like jq to extract join information.

For example, tctl users add already supports this.

$ tctl users add foo --roles=access --logins=root --format=json
{
  "kind": "user_token",
  "sub_kind": "invite",
  "version": "v3",
  "metadata": {
    "name": "00000000000000000000000000000000",
    "expires": "2022-03-03T05:38:07.971830993Z"
  },
  "spec": {
    "user": "foo",
    "url": "https://proxy.example.com:3080/web/invite/00000000000000000000000000000000",
    "created": "2022-03-03T04:38:07.971831423Z"
  }
}
@russjones russjones added feature-request Used for new features in Teleport, improvements to current should be #enhancements machine-id labels Mar 3, 2022
@timothyb89
Copy link
Contributor

I've added this in #10833:

$ tctl bots add test --roles=access --format=json
{
  "user_name": "bot-test",
  "role_name": "bot-test",
  "token_id": "2a7bdabdb9225e0fdf83df5de0bf94a0",
  "ttl": 3599998522147,
  "join_method": "token"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Used for new features in Teleport, improvements to current should be #enhancements machine-id
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants