Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions components/api-server/openapi/openapi.users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ paths:
$ref: 'openapi.yaml#/components/responses/ForbiddenError'
'500':
$ref: 'openapi.yaml#/components/responses/InternalServerError'
/api/hypershell/v1/users/stats:
get:
summary: Get registered user activity statistics
operationId: getUserActivityStats
responses:
'200':
description: Registered and active user statistics
content:
application/json:
schema:
$ref: '#/components/schemas/UserActivityStats'
'401':
$ref: 'openapi.yaml#/components/responses/UnauthorizedError'
'403':
$ref: 'openapi.yaml#/components/responses/ForbiddenError'
'500':
$ref: 'openapi.yaml#/components/responses/InternalServerError'
/api/hypershell/v1/users/{id}:
get:
summary: Get a registered user by ID
Expand Down Expand Up @@ -75,6 +92,65 @@ components:
items:
$ref: '#/components/schemas/User'
# NEW SCHEMA END
# NEW SCHEMA START
UserDailyCount:
type: object
required:
- date
- count
properties:
date:
type: string
format: date
description: UTC calendar day (YYYY-MM-DD)
count:
type: integer
format: int64
minimum: 0
# NEW SCHEMA END
# NEW SCHEMA START
UserActivityStats:
type: object
required:
- total_registered
- registered_last_7_days
- registered_last_30_days
- active_last_7_days
- active_last_30_days
- registration_daily
- active_daily
properties:
total_registered:
type: integer
format: int64
minimum: 0
registered_last_7_days:
type: integer
format: int64
minimum: 0
registered_last_30_days:
type: integer
format: int64
minimum: 0
active_last_7_days:
type: integer
format: int64
minimum: 0
active_last_30_days:
type: integer
format: int64
minimum: 0
registration_daily:
type: array
items:
$ref: '#/components/schemas/UserDailyCount'
description: New registrations per UTC day for the last 30 calendar days (inclusive)
active_daily:
type: array
items:
$ref: '#/components/schemas/UserDailyCount'
description: Distinct active users per UTC day for the last 30 calendar days (inclusive)
# NEW SCHEMA END
parameters:
id:
name: id
Expand Down
6 changes: 6 additions & 0 deletions components/api-server/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ paths:
$ref: 'openapi.roleBindings.yaml#/paths/~1api~1hypershell~1v1~1role_bindings~1{id}'
/api/hypershell/v1/users:
$ref: 'openapi.users.yaml#/paths/~1api~1hypershell~1v1~1users'
/api/hypershell/v1/users/stats:
$ref: 'openapi.users.yaml#/paths/~1api~1hypershell~1v1~1users~1stats'
/api/hypershell/v1/users/{id}:
$ref: 'openapi.users.yaml#/paths/~1api~1hypershell~1v1~1users~1{id}'
# AUTO-ADD NEW PATHS
Expand Down Expand Up @@ -170,6 +172,10 @@ components:
$ref: 'openapi.users.yaml#/components/schemas/User'
UserList:
$ref: 'openapi.users.yaml#/components/schemas/UserList'
UserActivityStats:
$ref: 'openapi.users.yaml#/components/schemas/UserActivityStats'
UserDailyCount:
$ref: 'openapi.users.yaml#/components/schemas/UserDailyCount'
# AUTO-ADD NEW SCHEMAS
parameters:
id:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ docs/RoleBinding.md
docs/RoleBindingList.md
docs/RoleList.md
docs/User.md
docs/UserActivityStats.md
docs/UserDailyCount.md
docs/UserList.md
git_push.sh
go.mod
Expand Down Expand Up @@ -81,6 +83,8 @@ model_role_binding.go
model_role_binding_list.go
model_role_list.go
model_user.go
model_user_activity_stats.go
model_user_daily_count.go
model_user_list.go
response.go
test/api_default_test.go
Expand Down
3 changes: 3 additions & 0 deletions components/api-server/pkg/api/openapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Class | Method | HTTP request | Description
*DefaultAPI* | [**GetRole**](docs/DefaultAPI.md#getrole) | **Get** /api/hypershell/v1/roles/{id} | Get a role by ID
*DefaultAPI* | [**GetRoleBinding**](docs/DefaultAPI.md#getrolebinding) | **Get** /api/hypershell/v1/role_bindings/{id} | Get a role binding by ID
*DefaultAPI* | [**GetUser**](docs/DefaultAPI.md#getuser) | **Get** /api/hypershell/v1/users/{id} | Get a registered user by ID
*DefaultAPI* | [**GetUserActivityStats**](docs/DefaultAPI.md#getuseractivitystats) | **Get** /api/hypershell/v1/users/stats | Get registered user activity statistics
*DefaultAPI* | [**ListGatewayNetworks**](docs/DefaultAPI.md#listgatewaynetworks) | **Get** /api/hypershell/v1/gateway_networks | Returns a list of gatewayNetworks
*DefaultAPI* | [**ListGatewayReleases**](docs/DefaultAPI.md#listgatewayreleases) | **Get** /api/hypershell/v1/gateway_releases | Returns a list of gatewayReleases
*DefaultAPI* | [**ListGatewayServiceAccounts**](docs/DefaultAPI.md#listgatewayserviceaccounts) | **Get** /api/hypershell/v1/gateways/{gateway_id}/service_accounts | List OpenShell gateway service accounts
Expand Down Expand Up @@ -156,6 +157,8 @@ Class | Method | HTTP request | Description
- [RoleBindingList](docs/RoleBindingList.md)
- [RoleList](docs/RoleList.md)
- [User](docs/User.md)
- [UserActivityStats](docs/UserActivityStats.md)
- [UserDailyCount](docs/UserDailyCount.md)
- [UserList](docs/UserList.md)


Expand Down
97 changes: 97 additions & 0 deletions components/api-server/pkg/api/openapi/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2040,6 +2040,27 @@ paths:
$ref: "#/components/schemas/Error"
description: Unexpected error occurred
summary: List registered users
/api/hypershell/v1/users/stats:
get:
operationId: getUserActivityStats
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/UserActivityStats"
description: Registered and active user statistics
"401":
description: Access token is missing or invalid
"403":
description: Access token does not have sufficient privileges
"500":
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
description: Unexpected error occurred
summary: Get registered user activity statistics
/api/hypershell/v1/users/{id}:
get:
operationId: getUser
Expand Down Expand Up @@ -3500,6 +3521,82 @@ components:
href: href
email: email
username: username
UserActivityStats:
example:
registration_daily:
- date: 2000-01-23
count: 0
- date: 2000-01-23
count: 0
registered_last_30_days: 0
active_daily:
- date: 2000-01-23
count: 0
- date: 2000-01-23
count: 0
total_registered: 0
registered_last_7_days: 0
active_last_30_days: 0
active_last_7_days: 0
properties:
total_registered:
format: int64
minimum: 0
type: integer
registered_last_7_days:
format: int64
minimum: 0
type: integer
registered_last_30_days:
format: int64
minimum: 0
type: integer
active_last_7_days:
format: int64
minimum: 0
type: integer
active_last_30_days:
format: int64
minimum: 0
type: integer
registration_daily:
description: New registrations per UTC day for the last 30 calendar days
(inclusive)
items:
$ref: "#/components/schemas/UserDailyCount"
type: array
active_daily:
description: Distinct active users per UTC day for the last 30 calendar
days (inclusive)
items:
$ref: "#/components/schemas/UserDailyCount"
type: array
required:
- active_daily
- active_last_30_days
- active_last_7_days
- registered_last_30_days
- registered_last_7_days
- registration_daily
- total_registered
type: object
UserDailyCount:
example:
date: 2000-01-23
count: 0
properties:
date:
description: UTC calendar day (YYYY-MM-DD)
format: date
type: string
count:
format: int64
minimum: 0
type: integer
required:
- count
- date
type: object
GatewayCreateRequest:
example:
phase: phase
Expand Down
108 changes: 108 additions & 0 deletions components/api-server/pkg/api/openapi/api_default.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading