Skip to content

Commit

Permalink
rest: add max inactivity period for interactive sessions to info endp…
Browse files Browse the repository at this point in the history
…oint

Adds the `maximum_interactive_session_inactivity_period` value to the ones returned by `/api/info`.

Addresses reanahub/reana-client#657
  • Loading branch information
giuseppe-steduto committed Jun 6, 2023
1 parent f3bc632 commit 28caa5b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,17 @@
},
"type": "object"
},
"maximum_interactive_session_inactivity_period": {
"properties": {
"title": {
"type": "string"
},
"value": {
"type": "string"
}
},
"type": "object"
},
"maximum_kubernetes_jobs_timeout": {
"properties": {
"title": {
Expand Down
8 changes: 7 additions & 1 deletion reana_server/rest/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from flask import Blueprint, jsonify
from marshmallow import Schema, fields

from reana_commons.config import DEFAULT_WORKSPACE_PATH, WORKSPACE_PATHS
from reana_commons.config import DEFAULT_WORKSPACE_PATH, WORKSPACE_PATHS, REANAConfig

from reana_server.config import (
SUPPORTED_COMPUTE_BACKENDS,
Expand Down Expand Up @@ -108,6 +108,7 @@ def info(user, **kwargs): # noqa
}
"""
try:
ui_config = REANAConfig.load("ui")
cluster_information = dict(
workspaces_available=dict(
title="List of available workspaces",
Expand Down Expand Up @@ -140,6 +141,10 @@ def info(user, **kwargs): # noqa
title="Maximum timeout for Kubernetes jobs",
value=REANA_KUBERNETES_JOBS_MAX_USER_TIMEOUT_LIMIT,
),
maximum_interactive_session_inactivity_period=dict(
title="Maximum inactivity period in days before automatic closure of interactive sessions",
value=ui_config.get("maximum_interactive_session_inactivity_period"),
),
)
return InfoSchema().dump(cluster_information)

Expand Down Expand Up @@ -180,3 +185,4 @@ class InfoSchema(Schema):
maximum_workspace_retention_period = fields.Nested(StringNullableInfoValue)
default_kubernetes_jobs_timeout = fields.Nested(StringInfoValue)
maximum_kubernetes_jobs_timeout = fields.Nested(StringInfoValue)
maximum_interactive_session_inactivity_period = fields.Nested(StringInfoValue)

0 comments on commit 28caa5b

Please sign in to comment.