Introduction:
This article covers How to list all sessions count including terminated sessions.
Please bear in mind the examples provided below are illustrative. Scope ID or auth method should be used according to your environment.
Steps:
- Export the boundary address and authenticate to boundary.
boundary authenticate password -login-name=admin
- Export the generated token in the first step
export BOUNDARY_TOKEN=<tokenid>
- Using the below command, list all scope’s id.
boundary scopes list --recursive
Expected Output:
Scope information:
ID: p_3BdFvx4weA
Scope ID: o_pdpc2BQ8Ip
Version: 1
Name: Generated project scope
Description: Provides an initial project scope in Boundary
Authorized Actions:
update
delete
no-op
read
ID: o_pdpc2BQ8Ip
Scope ID: global
Version: 1
Name: Generated org scope
Description: Provides an initial org scope in Boundary
Authorized Actions:
delete
attach-storage-policy
detach-storage-policy
no-op
read
update
Session counts are related to targets, which are defined at the project level. So to get the count, first get the project ID. From the previous step, get the project ID and pass one additional parameter(-include-terminated) to the command.
boundary sessions list -scope-id=p_3BdFvx4weA -include-terminated
Expected Output:
Session information:
ID: s_G35BFGfS43
Status: active
Created Time: Wed, 10 Apr 2024 06:52:04 UTC
Expiration Time: Wed, 10 Apr 2024 14:52:04 UTC
Updated Time: Wed, 10 Apr 2024 06:52:04 UTC
User ID: u_RgMStCoTSk
Target ID: ttcp_yV7sAGJRA3
Authorized Actions:
cancel
cancel:self
no-op
read
read:self
ID: s_TObDmOhQB7
Status: terminated
Created Time: Wed, 10 Apr 2024 06:50:20 UTC
Expiration Time: Wed, 10 Apr 2024 14:50:20 UTC
Updated Time: Wed, 10 Apr 2024 06:51:08 UTC
User ID: u_RgMStCoTSk
Target ID: ttcp_yV7sAGJRA3
Authorized Actions:
no-op
read
read:self
cancel
cancel:self
Additional information: