跳转至

工作空间菜单 v3 set


POST /api/v1/workspace/menu_v3/set

概述

以乐观版本校验保存完整工作空间菜单和角色配置。

鉴权请求头:DF-API-KEY。

接口权限:设置管理(workspace.setManage)。

调用前和使用步骤

查看调用说明

需workspace.setManage权限。先用菜单v3完整配置取得完整配置与revision,按页面动态字段修改后提交menus、roleConfigs、expectedRevision三项。此接口全量替换可编辑配置;遗漏角色会回默认权限模式,不能当成保留。系统节点不可删/换身份/改名/移动到别父级,隐藏请用isShow=false。

可新增根目录、资源、分隔线及符合身份规则的本地系统节点;目录不嵌套、资源不能重复。新目录openToAllRoles仅一次性创建行为,可能初始化所有当前可定制角色的目录选择;后续取消选择必须按完整roleConfigs保存,不重复传此键。自定义菜单不授予页面、资源或数据权限,系统及平台隐藏仍生效。

锁内重新校验角色和资源。陌生/跨空间UUID拒绝;同空间已删或旧引用失效资源可清理并在removedNodeIds返回。冲突409需重新GET、人工/程序合并后重试,不盲目提高expectedRevision。响应是保存配置、revision、changed、removedNodeIds,不附GET专有roles/隐藏/兼容信息;首次默认保存也可增加revision但changed=false。

保存提交后返回,changed=true才记录菜单审计;调用失败/超时时读回核对,GET或资源/角色删除后的清理结果不能仅靠revision判断。示例动态读取完整树再隐藏日志,避免把缩略样例当成整棵树。参数业务校验错误content可包含reason(原因)与path(节点/角色路径)。

使用Owner身份验收时需注意:有效菜单计算会忽略空间isShow隐藏(分隔线除外),但仍受平台隐藏和真实权限约束;普通角色与Owner的最终显示可能不同。

新本地system节点与自定义目录规则不同:key使用[A-Za-z0-9_.-]+,id必须为system:<根key>或system:<父key>:<子key>;不能把已知/保留身份重新注册为本地节点,系统子项只能挂在system父级。已有系统身份/名称/层级不可改,新增前应核对GET的localMenuFallback已知身份。

请求

请求头

参数名 类型 必选 说明
DF-API-KEY string Y 工作空间的 OpenAPI 鉴权凭据。
例子: <DF-API-KEY>
获取或填写方式: 从目标工作空间的 API Key 管理获取有该操作权限的 OpenAPI Key。

Body 请求参数

menus
参数名 类型 必选 说明
menus array Y 必填完整菜单树,最多两层;不能删除任何现有/已知系统节点,应以isShow隐藏。与roleConfigs整体保存,不是patch。最多2000节点,两者序列化JSON合计不超过2000000字符。
允许 null: False
例子: [{"id": "system:Scene", "type": "system", "key": "Scene", "name": "场景", "isShow": true, "children": [{"id": "system:Scene:DashboardList", "type": "system", "key": "DashboardList", "name": "仪表板", "isShow": true, "children": []}, {"id": "system:Scene:ViewerList", "type": "system", "key": "ViewerList", "name": "查看器", "isShow": true, "children": []}, {"id": "system:Scene:BuiltInViewList", "type": "system", "key": "BuiltInViewList", "name": "内置视图", "isShow": true, "children": []}, {"id": "system:Scene:LinkToTrackService", "type": "system", "key": "LinkToTrackService", "name": "服务管理", "isShow": true, "children": []}, {"id": "system:Scene:RegularReportList", "type": "system", "key": "RegularReportList", "name": "报告", "isShow": true, "children": []}]}, {"id": "system:Notebook", "type": "system", "key": "Notebook", "name": "知识库", "isShow": true, "children": []}, {"id": "system:Events", "type": "system", "key": "Events", "name": "事件中心", "isShow": true, "children": [{"id": "system:Events:KeyEventsMonitor", "type": "system", "key": "KeyEventsMonitor", "name": "事件中心", "isShow": true, "children": []}, {"id": "system:Events:KeyEventsMonitorChart", "type": "system", "key": "KeyEventsMonitorChart", "name": "未恢复事件", "isShow": true, "children": []}, {"id": "system:Events:LogBackupExplorer", "type": "system", "key": "LogBackupExplorer", "name": "数据转发", "isShow": true, "children": []}]}, {"id": "system:ExceptionsTracking", "type": "system", "key": "ExceptionsTracking", "name": "异常追踪", "isShow": true, "children": [{"id": "system:ExceptionsTracking:Exceptions", "type": "system", "key": "Exceptions", "name": "异常追踪", "isShow": true, "children": []}, {"id": "system:ExceptionsTracking:AnalysisDashboard", "type": "system", "key": "AnalysisDashboard", "name": "分析看板", "isShow": true, "children": []}, {"id": "system:ExceptionsTracking:ExceptionsSchedule", "type": "system", "key": "ExceptionsSchedule", "name": "日程", "isShow": true, "children": []}, {"id": "system:ExceptionsTracking:ExceptionsTrackingConf", "type": "system", "key": "ExceptionsTrackingConf", "name": "配置管理", "isShow": true, "children": []}, {"id": "system:ExceptionsTracking:CrossWorkspace", "type": "system", "key": "CrossWorkspace", "name": "异常追踪管理", "isShow": true, "children": []}]}, {"id": "system:Incident", "type": "system", "key": "Incident", "name": "故障中心", "isShow": true, "children": [{"id": "system:Incident:IncidentList", "type": "system", "key": "IncidentList", "name": "故障列表", "isShow": true, "children": []}, {"id": "system:Incident:IncidentDashboard", "type": "system", "key": "IncidentDashboard", "name": "分析看板", "isShow": true, "children": []}, {"id": "system:Incident:IncidentSchedule", "type": "system", "key": "IncidentSchedule", "name": "值班", "isShow": true, "children": []}, {"id": "system:Incident:IncidentConfig", "type": "system", "key": "IncidentConfig", "name": "配置管理", "isShow": true, "children": []}]}, {"id": "system:Error", "type": "system", "key": "Error", "name": "错误中心", "isShow": true, "children": [{"id": "system:Error:ErrorList", "type": "system", "key": "ErrorList", "name": "错误列表", "isShow": true, "children": []}, {"id": "system:Error:ErrorDashboard", "type": "system", "key": "ErrorDashboard", "name": "分析看板", "isShow": true, "children": []}]}, {"id": "system:Objectadmin", "type": "system", "key": "Objectadmin", "name": "基础设施", "isShow": true, "children": [{"id": "system:Objectadmin:ObjectadminHost", "type": "system", "key": "ObjectadminHost", "name": "主机", "isShow": true, "children": []}, {"id": "system:Objectadmin:ObjectadminDocker", "type": "system", "key": "ObjectadminDocker", "name": "容器", "isShow": true, "children": []}, {"id": "system:Objectadmin:ObjectadminProcesses", "type": "system", "key": "ObjectadminProcesses", "name": "进程", "isShow": true, "children": []}, {"id": "system:Objectadmin:ObjectadminDatabase", "type": "system", "key": "ObjectadminDatabase", "name": "数据库", "isShow": true, "children": []}, {"id": "system:Objectadmin:HostNetwork", "type": "system", "key": "HostNetwork", "name": "网络", "isShow": true, "children": []}, {"id": "system:Objectadmin:ObjectadminOther", "type": "system", "key": "ObjectadminOther", "name": "资源目录", "isShow": true, "children": []}, {"id": "system:Objectadmin:WorkspacePipelineList", "type": "system", "key": "WorkspacePipelineList", "name": "Pipelines", "isShow": true, "children": []}]}, {"id": "system:Entity", "type": "system", "key": "Entity", "name": "统一目录", "isShow": true, "children": [{"id": "system:Entity:EntityList", "type": "system", "key": "EntityList", "name": "实体列表", "isShow": true, "children": []}, {"id": "system:Entity:EntityTopology", "type": "system", "key": "EntityTopology", "name": "全景拓扑图", "isShow": true, "children": []}]}, {"id": "system:DataObservability", "type": "system", "key": "DataObservability", "name": "数据可观测", "isShow": true, "children": [{"id": "system:DataObservability:DataObservabilityOverview", "type": "system", "key": "DataObservabilityOverview", "name": "概览", "isShow": true, "children": []}, {"id": "system:DataObservability:DataObservabilityCatalog", "type": "system", "key": "DataObservabilityCatalog", "name": "数据目录", "isShow": true, "children": []}, {"id": "system:DataObservability:DataObservabilityJobs", "type": "system", "key": "DataObservabilityJobs", "name": "作业", "isShow": true, "children": []}, {"id": "system:DataObservability:DataObservabilityLineage", "type": "system", "key": "DataObservabilityLineage", "name": "数据血缘", "isShow": true, "children": []}]}, {"id": "system:MetricQuery", "type": "system", "key": "MetricQuery", "name": "指标", "isShow": true, "children": [{"id": "system:MetricQuery:MetricAnalysis", "type": "system", "key": "MetricAnalysis", "name": "指标分析", "isShow": true, "children": []}, {"id": "system:MetricQuery:MetricMap", "type": "system", "key": "MetricMap", "name": "指标管理", "isShow": true, "children": []}, {"id": "system:MetricQuery:MetricIndicator", "type": "system", "key": "MetricIndicator", "name": "生成指标", "isShow": true, "children": []}, {"id": "system:MetricQuery:WorkspacePipelineList", "type": "system", "key": "WorkspacePipelineList", "name": "Pipelines", "isShow": true, "children": []}, {"id": "system:MetricQuery:DataAccessRuleList", "type": "system", "key": "DataAccessRuleList", "name": "数据访问", "isShow": true, "children": []}]}, {"id": "system:LogIndi", "type": "system", "key": "LogIndi", "name": "日志", "isShow": false, "children": [{"id": "system:LogIndi:Log", "type": "system", "key": "Log", "name": "查看器", "isShow": true, "children": []}, {"id": "system:LogIndi:LogTrackError", "type": "system", "key": "LogTrackError", "name": "错误追踪", "isShow": true, "children": []}, {"id": "system:LogIndi:LogPipelineList", "type": "system", "key": "LogPipelineList", "name": "Pipelines", "isShow": true, "children": []}, {"id": "system:LogIndi:LogIndexList", "type": "system", "key": "LogIndexList", "name": "索引", "isShow": true, "children": []}, {"id": "system:LogIndi:LogFilterRuleList", "type": "system", "key": "LogFilterRuleList", "name": "黑名单", "isShow": true, "children": []}, {"id": "system:LogIndi:LogBackupExplorer", "type": "system", "key": "LogBackupExplorer", "name": "数据转发", "isShow": true, "children": []}, {"id": "system:LogIndi:LogQueryRuleList", "type": "system", "key": "LogQueryRuleList", "name": "数据访问", "isShow": true, "children": []}, {"id": "system:LogIndi:MetricIndicator", "type": "system", "key": "MetricIndicator", "name": "生成指标", "isShow": true, "children": []}]}, {"id": "system:Tracing", "type": "system", "key": "Tracing", "name": "应用性能监测", "isShow": true, "children": [{"id": "system:Tracing:LinkToTrackService", "type": "system", "key": "LinkToTrackService", "name": "服务", "isShow": true, "children": []}, {"id": "system:Tracing:LinkToTrackDashboard", "type": "system", "key": "LinkToTrackDashboard", "name": "分析看板", "isShow": true, "children": []}, {"id": "system:Tracing:LinkToTrackLink", "type": "system", "key": "LinkToTrackLink", "name": "链路", "isShow": true, "children": []}, {"id": "system:Tracing:LinkToTrackError", "type": "system", "key": "LinkToTrackError", "name": "错误追踪", "isShow": true, "children": []}, {"id": "system:Tracing:LinkToTrackProfile", "type": "system", "key": "LinkToTrackProfile", "name": "Profiling", "isShow": true, "children": []}, {"id": "system:Tracing:LogBackupExplorer", "type": "system", "key": "LogBackupExplorer", "name": "数据转发", "isShow": true, "children": []}, {"id": "system:Tracing:DataAccessRuleList", "type": "system", "key": "DataAccessRuleList", "name": "数据访问", "isShow": true, "children": []}, {"id": "system:Tracing:MetricIndicator", "type": "system", "key": "MetricIndicator", "name": "生成指标", "isShow": true, "children": []}, {"id": "system:Tracing:WorkspacePipelineList", "type": "system", "key": "WorkspacePipelineList", "name": "Pipelines", "isShow": true, "children": []}]}, {"id": "system:Rum", "type": "system", "key": "Rum", "name": "用户访问监测", "isShow": true, "children": [{"id": "system:Rum:RumList", "type": "system", "key": "RumList", "name": "应用列表", "isShow": true, "children": []}, {"id": "system:Rum:RumViewer", "type": "system", "key": "RumViewer", "name": "查看器", "isShow": true, "children": []}, {"id": "system:Rum:RumDashboard", "type": "system", "key": "RumDashboard", "name": "分析看板", "isShow": true, "children": []}, {"id": "system:Rum:RumHeatMap", "type": "system", "key": "RumHeatMap", "name": "用户洞察", "isShow": true, "children": []}, {"id": "system:Rum:RumTrack", "type": "system", "key": "RumTrack", "name": "追踪", "isShow": true, "children": []}, {"id": "system:Rum:LogBackupExplorer", "type": "system", "key": "LogBackupExplorer", "name": "数据转发", "isShow": true, "children": []}, {"id": "system:Rum:DataAccessRuleList", "type": "system", "key": "DataAccessRuleList", "name": "数据访问", "isShow": true, "children": []}, {"id": "system:Rum:MetricIndicator", "type": "system", "key": "MetricIndicator", "name": "生成指标", "isShow": true, "children": []}, {"id": "system:Rum:WorkspacePipelineList", "type": "system", "key": "WorkspacePipelineList", "name": "Pipelines", "isShow": true, "children": []}]}, {"id": "system:CloudBilling", "type": "system", "key": "CloudBilling", "name": "云账单", "isShow": true, "children": [{"id": "system:CloudBilling:ColudBillingExplorer", "type": "system", "key": "ColudBillingExplorer", "name": "查看器", "isShow": true, "children": []}, {"id": "system:CloudBilling:ColudBillingDashboard", "type": "system", "key": "ColudBillingDashboard", "name": "云账单分析", "isShow": true, "children": []}, {"id": "system:CloudBilling:CloudBillingBudget", "type": "system", "key": "CloudBillingBudget", "name": "预算", "isShow": true, "children": []}]}, {"id": "system:CloudDial", "type": "system", "key": "CloudDial", "name": "可用性监测", "isShow": true, "children": [{"id": "system:CloudDial:CloudDialList", "type": "system", "key": "CloudDialList", "name": "任务", "isShow": true, "children": []}, {"id": "system:CloudDial:CloudDialDashboard", "type": "system", "key": "CloudDialDashboard", "name": "概览", "isShow": true, "children": []}, {"id": "system:CloudDial:CloudDialExplorer", "type": "system", "key": "CloudDialExplorer", "name": "查看器", "isShow": true, "children": []}, {"id": "system:CloudDial:CloudDialSelfNodeList", "type": "system", "key": "CloudDialSelfNodeList", "name": "自建节点管理", "isShow": true, "children": []}]}, {"id": "system:Security", "type": "system", "key": "Security", "name": "安全监测", "isShow": true, "children": [{"id": "system:Security:SecuritySIEMRules", "type": "system", "key": "SecuritySIEMRules", "name": "检测规则", "isShow": true, "children": []}, {"id": "system:Security:SecuritySIEMExplorer", "type": "system", "key": "SecuritySIEMExplorer", "name": "信号", "isShow": true, "children": []}, {"id": "system:Security:SecuritySIEMExecutionLogs", "type": "system", "key": "SecuritySIEMExecutionLogs", "name": "执行日志", "isShow": true, "children": []}]}, {"id": "system:AIMonitor", "type": "system", "key": "AIMonitor", "name": "Agent 监测", "isShow": true, "children": [{"id": "system:AIMonitor:AIMonitorList", "type": "system", "key": "AIMonitorList", "name": "应用列表", "isShow": true, "children": []}, {"id": "system:AIMonitor:AIMonitorExplorer", "type": "system", "key": "AIMonitorExplorer", "name": "查看器", "isShow": true, "children": []}, {"id": "system:AIMonitor:AIMonitorEvaluator", "type": "system", "key": "AIMonitorEvaluator", "name": "评估器", "isShow": true, "children": []}, {"id": "system:AIMonitor:AIMonitorDashboard", "type": "system", "key": "AIMonitorDashboard", "name": "分析看板", "isShow": true, "children": []}]}, {"id": "system:GitLabCI", "type": "system", "key": "GitLabCI", "name": "CI 可视化", "isShow": true, "children": [{"id": "system:GitLabCI:GitLabCIExplorer", "type": "system", "key": "GitLabCIExplorer", "name": "查看器", "isShow": true, "children": []}, {"id": "system:GitLabCI:GitLabCIDashboard", "type": "system", "key": "GitLabCIDashboard", "name": "概览", "isShow": true, "children": []}]}, {"id": "system:Monitor", "type": "system", "key": "Monitor", "name": "监控", "isShow": true, "children": [{"id": "system:Monitor:CheckerRuleList", "type": "system", "key": "CheckerRuleList", "name": "监控器", "isShow": true, "children": []}, {"id": "system:Monitor:AICheckerRuleList", "type": "system", "key": "AICheckerRuleList", "name": "AI 监控器", "isShow": true, "children": []}, {"id": "system:Monitor:SmartCheckerRuleList", "type": "system", "key": "SmartCheckerRuleList", "name": "智能监控", "isShow": true, "children": []}, {"id": "system:Monitor:SLOList", "type": "system", "key": "SLOList", "name": "SLO", "isShow": true, "children": []}, {"id": "system:Monitor:SilenceList", "type": "system", "key": "SilenceList", "name": "静默管理", "isShow": true, "children": []}, {"id": "system:Monitor:CheckerRuleGroupList", "type": "system", "key": "CheckerRuleGroupList", "name": "告警策略管理", "isShow": true, "children": []}, {"id": "system:Monitor:AlertToList", "type": "system", "key": "AlertToList", "name": "通知对象管理", "isShow": true, "children": []}]}, {"id": "system:Integration", "type": "system", "key": "Integration", "name": "集成", "isShow": true, "children": [{"id": "system:Integration:IntegrationList", "type": "system", "key": "IntegrationList", "name": "集成", "isShow": true, "children": []}, {"id": "system:Integration:Datakit", "type": "system", "key": "Datakit", "name": "DataKit", "isShow": true, "children": []}, {"id": "system:Integration:GatewayAccess", "type": "system", "key": "GatewayAccess", "name": "网关接入", "isShow": true, "children": []}, {"id": "system:Integration:ImApplication", "type": "system", "key": "ImApplication", "name": "IM 应用", "isShow": true, "children": []}, {"id": "system:Integration:FunctionDetail", "type": "system", "key": "FunctionDetail", "name": "扩展", "isShow": true, "children": []}, {"id": "system:Integration:CloudAccountList", "type": "system", "key": "CloudAccountList", "name": "云账号管理", "isShow": true, "children": []}, {"id": "system:Integration:ExternalDataSourceList", "type": "system", "key": "ExternalDataSourceList", "name": "外部数据源", "isShow": true, "children": []}, {"id": "system:Integration:DCA", "type": "system", "key": "DCA", "name": "DCA", "isShow": true, "children": []}, {"id": "system:Integration:Mobile", "type": "system", "key": "Mobile", "name": "移动端", "isShow": true, "children": []}]}, {"id": "system:Workspace", "type": "system", "key": "Workspace", "name": "管理", "isShow": true, "children": [{"id": "system:Workspace:WorkspaceDetail", "type": "system", "key": "WorkspaceDetail", "name": "空间设置", "isShow": true, "children": []}, {"id": "system:Workspace:WorkspaceAttrDetail", "type": "system", "key": "WorkspaceAttrDetail", "name": "属性声明", "isShow": true, "children": []}, {"id": "system:Workspace:WorkspaceFieldsList", "type": "system", "key": "WorkspaceFieldsList", "name": "字段管理", "isShow": true, "children": []}, {"id": "system:Workspace:WorkspaceTagsList", "type": "system", "key": "WorkspaceTagsList", "name": "全局标签", "isShow": true, "children": []}, {"id": "system:Workspace:WorkspaceEnvsList", "type": "system", "key": "WorkspaceEnvsList", "name": "环境变量", "isShow": true, "children": []}, {"id": "system:Workspace:WorkspaceMembers", "type": "system", "key": "WorkspaceMembers", "name": "成员管理", "isShow": true, "children": []}, {"id": "system:Workspace:WorkspaceRoles", "type": "system", "key": "WorkspaceRoles", "name": "角色管理", "isShow": true, "children": []}, {"id": "system:Workspace:APIManage", "type": "system", "key": "APIManage", "name": "API Keys 管理", "isShow": true, "children": []}, {"id": "system:Workspace:ClientToken", "type": "system", "key": "ClientToken", "name": "Client Tokens 管理", "isShow": true, "children": []}, {"id": "system:Workspace:MemberInviteList", "type": "system", "key": "MemberInviteList", "name": "邀请记录", "isShow": true, "children": []}, {"id": "system:Workspace:WorkspaceFilterRuleList", "type": "system", "key": "WorkspaceFilterRuleList", "name": "黑名单", "isShow": true, "children": []}, {"id": "system:Workspace:WorkspacePipelineList", "type": "system", "key": "WorkspacePipelineList", "name": "Pipelines", "isShow": true, "children": []}, {"id": "system:Workspace:LogBackupExplorer", "type": "system", "key": "LogBackupExplorer", "name": "数据转发", "isShow": true, "children": []}, {"id": "system:Workspace:DataAccessRuleList", "type": "system", "key": "DataAccessRuleList", "name": "数据访问", "isShow": true, "children": []}, {"id": "system:Workspace:RegexpList", "type": "system", "key": "RegexpList", "name": "正则表达式", "isShow": true, "children": []}, {"id": "system:Workspace:KeyEventsAudit", "type": "system", "key": "KeyEventsAudit", "name": "审计事件", "isShow": true, "children": []}, {"id": "system:Workspace:EmbeddedSharing", "type": "system", "key": "EmbeddedSharing", "name": "分享管理", "isShow": true, "children": []}, {"id": "system:Workspace:CrossNamespacedataAuth", "type": "system", "key": "CrossNamespacedataAuth", "name": "跨工作空间授权", "isShow": true, "children": []}, {"id": "system:Workspace:DataAuthorization", "type": "system", "key": "DataAuthorization", "name": "字段展示权限", "isShow": true, "children": []}, {"id": "system:Workspace:DataScanerList", "type": "system", "key": "DataScanerList", "name": "敏感数据扫描", "isShow": true, "children": []}, {"id": "system:Workspace:WorkspaceCopilotSubscription", "type": "system", "key": "WorkspaceCopilotSubscription", "name": "Obsy", "isShow": true, "children": []}, {"id": "system:Workspace:ErrorCenterList", "type": "system", "key": "ErrorCenterList", "name": "错误中心", "isShow": true, "children": []}, {"id": "system:Workspace:Labs", "type": "system", "key": "Labs", "name": "实验室", "isShow": true, "children": []}]}, {"id": "system:Billing", "type": "system", "key": "Billing", "name": "付费计划与账单", "isShow": true, "children": []}]
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*]
参数名 类型 必选 说明
menus[*] json 一个菜单节点对象,未知字段拒绝;子级不能再嵌套。
例子: {"id": "system:Scene", "type": "system", "key": "Scene", "name": "场景", "isShow": true, "children": [{"id": "system:Scene:DashboardList", "type": "system", "key": "DashboardList", "name": "仪表板", "isShow": true, "children": []}, {"id": "system:Scene:ViewerList", "type": "system", "key": "ViewerList", "name": "查看器", "isShow": true, "children": []}, {"id": "system:Scene:BuiltInViewList", "type": "system", "key": "BuiltInViewList", "name": "内置视图", "isShow": true, "children": []}, {"id": "system:Scene:LinkToTrackService", "type": "system", "key": "LinkToTrackService", "name": "服务管理", "isShow": true, "children": []}, {"id": "system:Scene:RegularReportList", "type": "system", "key": "RegularReportList", "name": "报告", "isShow": true, "children": []}]}
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].id string 必填且全树唯一,1..128字符[A-Za-z0-9_.:-]。系统ID system:<根Key>[:<子Key>];新目录Custom:<key>;资源根级或系统菜单下均menu:<UUIDv4>,自定义目录内才用Custom:<目录key>:<UUIDv4>。移动资源保留UUIDv4后缀并换父前缀。
例子: system:Scene
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].type string 必填system/directory/resource/divider;directory/divider仅根级,自定义目录只容纳resource;原有节点类型不能改。
例子: system
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].key string system/directory条件必填;系统Key/名称/父级不可改。新目录键以字母开头、1..64字母数字,大小写不敏感去重,不占用系统/保留Key;既有目录键不可改。
例子: Scene
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].name string 除divider均必填非空,去首尾空白;新增/改名非系统项最长40字符,同父级名称大小写不敏感不可重名。系统名称原样保留,不能自行翻译。
例子: 场景
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].isShow boolean 必填JSON布尔,控制空间显隐;不覆盖平台隐藏、版本能力或资源权限。
例子: true
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].children
参数名 类型 必选 说明
menus[*].children array 可选默认[]。仅根级system/directory可有子项,最多两层;资源/分隔线必须[]。
例子: []
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].children[*]
参数名 类型 必选 说明
menus[*].children[*] json 一个菜单节点对象,未知字段拒绝;子级不能再嵌套。
例子: {"id": "system:Scene:DashboardList", "type": "system", "key": "DashboardList", "name": "仪表板", "isShow": true, "children": []}
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].children[*].id string 必填且全树唯一,1..128字符[A-Za-z0-9_.:-]。系统ID system:<根Key>[:<子Key>];新目录Custom:<key>;资源根级或系统菜单下均menu:<UUIDv4>,自定义目录内才用Custom:<目录key>:<UUIDv4>。移动资源保留UUIDv4后缀并换父前缀。
例子: system:Scene:DashboardList
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].children[*].type string 必填system/directory/resource/divider;directory/divider仅根级,自定义目录只容纳resource;原有节点类型不能改。
例子: system
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].children[*].key string system/directory条件必填;系统Key/名称/父级不可改。新目录键以字母开头、1..64字母数字,大小写不敏感去重,不占用系统/保留Key;既有目录键不可改。
例子: DashboardList
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].children[*].name string 除divider均必填非空,去首尾空白;新增/改名非系统项最长40字符,同父级名称大小写不敏感不可重名。系统名称原样保留,不能自行翻译。
例子: 仪表板
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].children[*].isShow boolean 必填JSON布尔,控制空间显隐;不覆盖平台隐藏、版本能力或资源权限。
例子: true
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].children[*].children array 可选默认[]。仅根级system/directory可有子项,最多两层;资源/分隔线必须[]。
例子: []
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].children[*].resourceUUID string resource条件必填,本空间活动dashboard/viewer资源UUID;从有权查看的仪表板/查看器列表取得,不能填节点id。
例子: dsbd_example
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].children[*].resourceType string resource条件必填dashboard或viewer,须与实际资源类型一致;同一资源全树最多一个位置。
例子: dashboard
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
参数名 类型 必选 说明
menus[*].resourceUUID string resource条件必填,本空间活动dashboard/viewer资源UUID;从有权查看的仪表板/查看器列表取得,不能填节点id。
例子: dsbd_example
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].resourceType string resource条件必填dashboard或viewer,须与实际资源类型一致;同一资源全树最多一个位置。
例子: dashboard
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
menus[*].openToAllRoles boolean 仅新建directory可选一次性行为:true将该目录加入所有当前可定制角色的选择,false不默认开放新目录;省略按角色权限默认路径处理。该键不保存、不回传,已存在目录提交会拒绝。
例子: false
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
roleConfigs
参数名 类型 必选 说明
roleConfigs json Y 必填完整角色映射,最多1000角色。省略的角色移除既有自定义配置并回到权限模式,不是保持旧值;owner不允许配置。角色不在当前有效目录则拒绝。
允许 null: False
例子: {"readOnly": {"mode": "custom", "selectedNodeIds": ["system:LogIndi:Log"]}}
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
roleConfigs.角色UUID
参数名 类型 必选 说明
roleConfigs.角色UUID json 动态键使用v3 GET roles[].uuid;不是角色名。默认permission,custom限制菜单候选,但从不授予资源/API权限。
例子: {"mode": "custom", "selectedNodeIds": ["system:LogIndi:Log"]}
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
roleConfigs.角色UUID.mode string 必填permission或custom。permission基于该角色权限;custom使用显式节点选择。
例子: custom
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
roleConfigs.角色UUID.selectedNodeIds
参数名 类型 必选 说明
roleConfigs.角色UUID.selectedNodeIds array 可选默认[],custom可选叶子和自定义目录,不能选分隔线或系统父目录;目录选择包含其资源候选。permission模式必须空。未知/已移除ID会过滤,重复去重。
例子: ["system:LogIndi:Log"]
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
roleConfigs.角色UUID.selectedNodeIds[*] string 取完整树有效可选id,不取key/resourceUUID。
例子: system:LogIndi:Log
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
roleConfigs.角色UUID.directoryNodeIds
参数名 类型 必选 说明
roleConfigs.角色UUID.directoryNodeIds array 仅permission模式可选自定义目录范围。缺省按权限及默认目录规则;显式[]限制为无自定义目录,不影响系统权限菜单。custom出现此字段会拒绝。
例子: ["Custom:Operations"]
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
roleConfigs.角色UUID.directoryNodeIds[*] string 单个自定义目录ID,未知目录过滤,不能填系统节点或资源叶子。
例子: Custom:Operations
获取或填写方式: 先从菜单v3 GET读取完整配置,保留已存在身份与配置,按本页规则修改。
参数名 类型 必选 说明
expectedRevision integer Y 必填非负JSON整数,来自本次GET content.revision;不能传字符串/布尔。并发冲突返回409和currentRevision,重新GET并合并后再保存。
允许 null: False
例子: 0
获取或填写方式: 从菜单v3完整配置 content.revision取得,不能自行递增或固定复用0。

响应

HTTP 200,application/json。下方示例展示可直接读取的主要字段。

content
字段 类型 说明
content.schemaVersion integer 固定3。
content.revision integer 当前配置版本;首次保存递增,已有配置仅实质变更递增;关联资源/角色删除可清理引用但不递增此编辑版本。
content.menus
字段 类型 说明
content.menus array 保存的完整菜单树,最多两层;不能删除任何现有/已知系统节点,应以isShow隐藏。与roleConfigs整体保存,不是patch。最多2000节点,两者序列化JSON合计不超过2000000字符。
content.menus[]
字段 类型 说明
content.menus[] json 一个菜单节点对象,未知字段拒绝;子级不能再嵌套。
content.menus[].id string 保存的且全树唯一,1..128字符[A-Za-z0-9_.:-]。系统ID system:<根Key>[:<子Key>];新目录Custom:<key>;资源根级或系统菜单下均menu:<UUIDv4>,自定义目录内才用Custom:<目录key>:<UUIDv4>。移动资源保留UUIDv4后缀并换父前缀。
content.menus[].type string 保存的system/directory/resource/divider;directory/divider仅根级,自定义目录只容纳resource;原有节点类型不能改。
content.menus[].key string system/directory条件保存的;系统Key/名称/父级不可改。新目录键以字母开头、1..64字母数字,大小写不敏感去重,不占用系统/保留Key;既有目录键不可改。
content.menus[].name string 除divider均保存的非空,去首尾空白;新增/改名非系统项最长40字符,同父级名称大小写不敏感不可重名。系统名称原样保留,不能自行翻译。
content.menus[].isShow boolean 保存的JSON布尔,控制空间显隐;不覆盖平台隐藏、版本能力或资源权限。
content.menus[].children
字段 类型 说明
content.menus[].children array 可选默认[]。仅根级system/directory可有子项,最多两层;资源/分隔线必须[]。
content.menus[].children[]
字段 类型 说明
content.menus[].children[] json 一个菜单节点对象,未知字段拒绝;子级不能再嵌套。
content.menus[].children[].id string 保存的且全树唯一,1..128字符[A-Za-z0-9_.:-]。系统ID system:<根Key>[:<子Key>];新目录Custom:<key>;资源根级或系统菜单下均menu:<UUIDv4>,自定义目录内才用Custom:<目录key>:<UUIDv4>。移动资源保留UUIDv4后缀并换父前缀。
content.menus[].children[].type string 保存的system/directory/resource/divider;directory/divider仅根级,自定义目录只容纳resource;原有节点类型不能改。
content.menus[].children[].key string system/directory条件保存的;系统Key/名称/父级不可改。新目录键以字母开头、1..64字母数字,大小写不敏感去重,不占用系统/保留Key;既有目录键不可改。
content.menus[].children[].name string 除divider均保存的非空,去首尾空白;新增/改名非系统项最长40字符,同父级名称大小写不敏感不可重名。系统名称原样保留,不能自行翻译。
content.menus[].children[].isShow boolean 保存的JSON布尔,控制空间显隐;不覆盖平台隐藏、版本能力或资源权限。
content.menus[].children[].children array 可选默认[]。仅根级system/directory可有子项,最多两层;资源/分隔线必须[]。
content.menus[].children[].resourceUUID string resource条件保存的,本空间活动dashboard/viewer资源UUID;从有权查看的仪表板/查看器列表取得,不能填节点id。
content.menus[].children[].resourceType string resource条件保存的dashboard或viewer,须与实际资源类型一致;同一资源全树最多一个位置。
字段 类型 说明
content.menus[].resourceUUID string resource条件保存的,本空间活动dashboard/viewer资源UUID;从有权查看的仪表板/查看器列表取得,不能填节点id。
content.menus[].resourceType string resource条件保存的dashboard或viewer,须与实际资源类型一致;同一资源全树最多一个位置。
content.roleConfigs
字段 类型 说明
content.roleConfigs object 保存的完整角色映射,最多1000角色。省略的角色移除既有自定义配置并回到权限模式,不是保持旧值;owner不允许配置。角色不在当前有效目录则拒绝。
content.roleConfigs.角色UUID
字段 类型 说明
content.roleConfigs.角色UUID json 动态键使用v3 GET roles[].uuid;不是角色名。默认permission,custom限制菜单候选,但从不授予资源/API权限。
content.roleConfigs.角色UUID.mode string 保存的permission或custom。permission基于该角色权限;custom使用显式节点选择。
content.roleConfigs.角色UUID.selectedNodeIds
字段 类型 说明
content.roleConfigs.角色UUID.selectedNodeIds array 可选默认[],custom可选叶子和自定义目录,不能选分隔线或系统父目录;目录选择包含其资源候选。permission模式必须空。未知/已移除ID会过滤,重复去重。
content.roleConfigs.角色UUID.selectedNodeIds[] string 取完整树有效可选id,不取key/resourceUUID。
content.roleConfigs.角色UUID.directoryNodeIds
字段 类型 说明
content.roleConfigs.角色UUID.directoryNodeIds array 仅permission模式可选自定义目录范围。缺省按权限及默认目录规则;显式[]限制为无自定义目录,不影响系统权限菜单。custom出现此字段会拒绝。
content.roleConfigs.角色UUID.directoryNodeIds[] string 单个自定义目录ID,未知目录过滤,不能填系统节点或资源叶子。
content.removedNodeIds
字段 类型 说明
content.removedNodeIds array<string> 本次读取/保存清理的失效资源节点ID;查询不将清理写库。
content.removedNodeIds[] string 被清理节点ID。
content.legacyExtras
字段 类型 说明
content.legacyExtras array<object> 可选历史未知根菜单兼容配置,由旧协议维护,新v3请求不直接提交。
content.legacyExtras[]
字段 类型 说明
content.legacyExtras[].key string 历史Key。
content.legacyExtras[].isShow boolean 历史显隐。
content.legacyExtras[].children array<object> 可选旧二级兼容项。
content.legacyExtraChildren
字段 类型 说明
content.legacyExtraChildren object 可选历史二级兼容映射,键为一级Key。
content.legacyExtraChildren.一级Key
字段 类型 说明
content.legacyExtraChildren.一级Key array<object> 该一级下历史未知子项。
content.legacyExtraChildren.一级Key[]
字段 类型 说明
content.legacyExtraChildren.一级Key[].key string 子Key。
content.legacyExtraChildren.一级Key[].isShow boolean 子项显隐。
字段 类型 说明
content.declaration object 工作空间公共声明。
content.changed boolean 与之前除revision外保存内容是否不同;不是是否首次落库的标志。
{
  "code": 200,
  "content": {
    "schemaVersion": 3,
    "revision": 1,
    "menus": [
      {
        "id": "system:Scene",
        "type": "system",
        "key": "Scene",
        "name": "场景",
        "isShow": true,
        "children": [
          {
            "id": "system:Scene:DashboardList",
            "type": "system",
            "key": "DashboardList",
            "name": "仪表板",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Scene:ViewerList",
            "type": "system",
            "key": "ViewerList",
            "name": "查看器",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Scene:BuiltInViewList",
            "type": "system",
            "key": "BuiltInViewList",
            "name": "内置视图",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Scene:LinkToTrackService",
            "type": "system",
            "key": "LinkToTrackService",
            "name": "服务管理",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Scene:RegularReportList",
            "type": "system",
            "key": "RegularReportList",
            "name": "报告",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:Notebook",
        "type": "system",
        "key": "Notebook",
        "name": "知识库",
        "isShow": true,
        "children": []
      },
      {
        "id": "system:Events",
        "type": "system",
        "key": "Events",
        "name": "事件中心",
        "isShow": true,
        "children": [
          {
            "id": "system:Events:KeyEventsMonitor",
            "type": "system",
            "key": "KeyEventsMonitor",
            "name": "事件中心",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Events:KeyEventsMonitorChart",
            "type": "system",
            "key": "KeyEventsMonitorChart",
            "name": "未恢复事件",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Events:LogBackupExplorer",
            "type": "system",
            "key": "LogBackupExplorer",
            "name": "数据转发",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:ExceptionsTracking",
        "type": "system",
        "key": "ExceptionsTracking",
        "name": "异常追踪",
        "isShow": true,
        "children": [
          {
            "id": "system:ExceptionsTracking:Exceptions",
            "type": "system",
            "key": "Exceptions",
            "name": "异常追踪",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:ExceptionsTracking:AnalysisDashboard",
            "type": "system",
            "key": "AnalysisDashboard",
            "name": "分析看板",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:ExceptionsTracking:ExceptionsSchedule",
            "type": "system",
            "key": "ExceptionsSchedule",
            "name": "日程",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:ExceptionsTracking:ExceptionsTrackingConf",
            "type": "system",
            "key": "ExceptionsTrackingConf",
            "name": "配置管理",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:ExceptionsTracking:CrossWorkspace",
            "type": "system",
            "key": "CrossWorkspace",
            "name": "异常追踪管理",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:Incident",
        "type": "system",
        "key": "Incident",
        "name": "故障中心",
        "isShow": true,
        "children": [
          {
            "id": "system:Incident:IncidentList",
            "type": "system",
            "key": "IncidentList",
            "name": "故障列表",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Incident:IncidentDashboard",
            "type": "system",
            "key": "IncidentDashboard",
            "name": "分析看板",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Incident:IncidentSchedule",
            "type": "system",
            "key": "IncidentSchedule",
            "name": "值班",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Incident:IncidentConfig",
            "type": "system",
            "key": "IncidentConfig",
            "name": "配置管理",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:Error",
        "type": "system",
        "key": "Error",
        "name": "错误中心",
        "isShow": true,
        "children": [
          {
            "id": "system:Error:ErrorList",
            "type": "system",
            "key": "ErrorList",
            "name": "错误列表",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Error:ErrorDashboard",
            "type": "system",
            "key": "ErrorDashboard",
            "name": "分析看板",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:Objectadmin",
        "type": "system",
        "key": "Objectadmin",
        "name": "基础设施",
        "isShow": true,
        "children": [
          {
            "id": "system:Objectadmin:ObjectadminHost",
            "type": "system",
            "key": "ObjectadminHost",
            "name": "主机",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Objectadmin:ObjectadminDocker",
            "type": "system",
            "key": "ObjectadminDocker",
            "name": "容器",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Objectadmin:ObjectadminProcesses",
            "type": "system",
            "key": "ObjectadminProcesses",
            "name": "进程",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Objectadmin:ObjectadminDatabase",
            "type": "system",
            "key": "ObjectadminDatabase",
            "name": "数据库",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Objectadmin:HostNetwork",
            "type": "system",
            "key": "HostNetwork",
            "name": "网络",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Objectadmin:ObjectadminOther",
            "type": "system",
            "key": "ObjectadminOther",
            "name": "资源目录",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Objectadmin:WorkspacePipelineList",
            "type": "system",
            "key": "WorkspacePipelineList",
            "name": "Pipelines",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:Entity",
        "type": "system",
        "key": "Entity",
        "name": "统一目录",
        "isShow": true,
        "children": [
          {
            "id": "system:Entity:EntityList",
            "type": "system",
            "key": "EntityList",
            "name": "实体列表",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Entity:EntityTopology",
            "type": "system",
            "key": "EntityTopology",
            "name": "全景拓扑图",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:DataObservability",
        "type": "system",
        "key": "DataObservability",
        "name": "数据可观测",
        "isShow": true,
        "children": [
          {
            "id": "system:DataObservability:DataObservabilityOverview",
            "type": "system",
            "key": "DataObservabilityOverview",
            "name": "概览",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:DataObservability:DataObservabilityCatalog",
            "type": "system",
            "key": "DataObservabilityCatalog",
            "name": "数据目录",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:DataObservability:DataObservabilityJobs",
            "type": "system",
            "key": "DataObservabilityJobs",
            "name": "作业",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:DataObservability:DataObservabilityLineage",
            "type": "system",
            "key": "DataObservabilityLineage",
            "name": "数据血缘",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:MetricQuery",
        "type": "system",
        "key": "MetricQuery",
        "name": "指标",
        "isShow": true,
        "children": [
          {
            "id": "system:MetricQuery:MetricAnalysis",
            "type": "system",
            "key": "MetricAnalysis",
            "name": "指标分析",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:MetricQuery:MetricMap",
            "type": "system",
            "key": "MetricMap",
            "name": "指标管理",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:MetricQuery:MetricIndicator",
            "type": "system",
            "key": "MetricIndicator",
            "name": "生成指标",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:MetricQuery:WorkspacePipelineList",
            "type": "system",
            "key": "WorkspacePipelineList",
            "name": "Pipelines",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:MetricQuery:DataAccessRuleList",
            "type": "system",
            "key": "DataAccessRuleList",
            "name": "数据访问",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:LogIndi",
        "type": "system",
        "key": "LogIndi",
        "name": "日志",
        "isShow": false,
        "children": [
          {
            "id": "system:LogIndi:Log",
            "type": "system",
            "key": "Log",
            "name": "查看器",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:LogIndi:LogTrackError",
            "type": "system",
            "key": "LogTrackError",
            "name": "错误追踪",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:LogIndi:LogPipelineList",
            "type": "system",
            "key": "LogPipelineList",
            "name": "Pipelines",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:LogIndi:LogIndexList",
            "type": "system",
            "key": "LogIndexList",
            "name": "索引",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:LogIndi:LogFilterRuleList",
            "type": "system",
            "key": "LogFilterRuleList",
            "name": "黑名单",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:LogIndi:LogBackupExplorer",
            "type": "system",
            "key": "LogBackupExplorer",
            "name": "数据转发",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:LogIndi:LogQueryRuleList",
            "type": "system",
            "key": "LogQueryRuleList",
            "name": "数据访问",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:LogIndi:MetricIndicator",
            "type": "system",
            "key": "MetricIndicator",
            "name": "生成指标",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:Tracing",
        "type": "system",
        "key": "Tracing",
        "name": "应用性能监测",
        "isShow": true,
        "children": [
          {
            "id": "system:Tracing:LinkToTrackService",
            "type": "system",
            "key": "LinkToTrackService",
            "name": "服务",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Tracing:LinkToTrackDashboard",
            "type": "system",
            "key": "LinkToTrackDashboard",
            "name": "分析看板",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Tracing:LinkToTrackLink",
            "type": "system",
            "key": "LinkToTrackLink",
            "name": "链路",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Tracing:LinkToTrackError",
            "type": "system",
            "key": "LinkToTrackError",
            "name": "错误追踪",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Tracing:LinkToTrackProfile",
            "type": "system",
            "key": "LinkToTrackProfile",
            "name": "Profiling",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Tracing:LogBackupExplorer",
            "type": "system",
            "key": "LogBackupExplorer",
            "name": "数据转发",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Tracing:DataAccessRuleList",
            "type": "system",
            "key": "DataAccessRuleList",
            "name": "数据访问",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Tracing:MetricIndicator",
            "type": "system",
            "key": "MetricIndicator",
            "name": "生成指标",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Tracing:WorkspacePipelineList",
            "type": "system",
            "key": "WorkspacePipelineList",
            "name": "Pipelines",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:Rum",
        "type": "system",
        "key": "Rum",
        "name": "用户访问监测",
        "isShow": true,
        "children": [
          {
            "id": "system:Rum:RumList",
            "type": "system",
            "key": "RumList",
            "name": "应用列表",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Rum:RumViewer",
            "type": "system",
            "key": "RumViewer",
            "name": "查看器",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Rum:RumDashboard",
            "type": "system",
            "key": "RumDashboard",
            "name": "分析看板",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Rum:RumHeatMap",
            "type": "system",
            "key": "RumHeatMap",
            "name": "用户洞察",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Rum:RumTrack",
            "type": "system",
            "key": "RumTrack",
            "name": "追踪",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Rum:LogBackupExplorer",
            "type": "system",
            "key": "LogBackupExplorer",
            "name": "数据转发",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Rum:DataAccessRuleList",
            "type": "system",
            "key": "DataAccessRuleList",
            "name": "数据访问",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Rum:MetricIndicator",
            "type": "system",
            "key": "MetricIndicator",
            "name": "生成指标",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Rum:WorkspacePipelineList",
            "type": "system",
            "key": "WorkspacePipelineList",
            "name": "Pipelines",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:CloudBilling",
        "type": "system",
        "key": "CloudBilling",
        "name": "云账单",
        "isShow": true,
        "children": [
          {
            "id": "system:CloudBilling:ColudBillingExplorer",
            "type": "system",
            "key": "ColudBillingExplorer",
            "name": "查看器",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:CloudBilling:ColudBillingDashboard",
            "type": "system",
            "key": "ColudBillingDashboard",
            "name": "云账单分析",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:CloudBilling:CloudBillingBudget",
            "type": "system",
            "key": "CloudBillingBudget",
            "name": "预算",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:CloudDial",
        "type": "system",
        "key": "CloudDial",
        "name": "可用性监测",
        "isShow": true,
        "children": [
          {
            "id": "system:CloudDial:CloudDialList",
            "type": "system",
            "key": "CloudDialList",
            "name": "任务",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:CloudDial:CloudDialDashboard",
            "type": "system",
            "key": "CloudDialDashboard",
            "name": "概览",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:CloudDial:CloudDialExplorer",
            "type": "system",
            "key": "CloudDialExplorer",
            "name": "查看器",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:CloudDial:CloudDialSelfNodeList",
            "type": "system",
            "key": "CloudDialSelfNodeList",
            "name": "自建节点管理",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:Security",
        "type": "system",
        "key": "Security",
        "name": "安全监测",
        "isShow": true,
        "children": [
          {
            "id": "system:Security:SecuritySIEMRules",
            "type": "system",
            "key": "SecuritySIEMRules",
            "name": "检测规则",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Security:SecuritySIEMExplorer",
            "type": "system",
            "key": "SecuritySIEMExplorer",
            "name": "信号",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Security:SecuritySIEMExecutionLogs",
            "type": "system",
            "key": "SecuritySIEMExecutionLogs",
            "name": "执行日志",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:AIMonitor",
        "type": "system",
        "key": "AIMonitor",
        "name": "Agent 监测",
        "isShow": true,
        "children": [
          {
            "id": "system:AIMonitor:AIMonitorList",
            "type": "system",
            "key": "AIMonitorList",
            "name": "应用列表",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:AIMonitor:AIMonitorExplorer",
            "type": "system",
            "key": "AIMonitorExplorer",
            "name": "查看器",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:AIMonitor:AIMonitorEvaluator",
            "type": "system",
            "key": "AIMonitorEvaluator",
            "name": "评估器",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:AIMonitor:AIMonitorDashboard",
            "type": "system",
            "key": "AIMonitorDashboard",
            "name": "分析看板",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:GitLabCI",
        "type": "system",
        "key": "GitLabCI",
        "name": "CI 可视化",
        "isShow": true,
        "children": [
          {
            "id": "system:GitLabCI:GitLabCIExplorer",
            "type": "system",
            "key": "GitLabCIExplorer",
            "name": "查看器",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:GitLabCI:GitLabCIDashboard",
            "type": "system",
            "key": "GitLabCIDashboard",
            "name": "概览",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:Monitor",
        "type": "system",
        "key": "Monitor",
        "name": "监控",
        "isShow": true,
        "children": [
          {
            "id": "system:Monitor:CheckerRuleList",
            "type": "system",
            "key": "CheckerRuleList",
            "name": "监控器",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Monitor:AICheckerRuleList",
            "type": "system",
            "key": "AICheckerRuleList",
            "name": "AI 监控器",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Monitor:SmartCheckerRuleList",
            "type": "system",
            "key": "SmartCheckerRuleList",
            "name": "智能监控",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Monitor:SLOList",
            "type": "system",
            "key": "SLOList",
            "name": "SLO",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Monitor:SilenceList",
            "type": "system",
            "key": "SilenceList",
            "name": "静默管理",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Monitor:CheckerRuleGroupList",
            "type": "system",
            "key": "CheckerRuleGroupList",
            "name": "告警策略管理",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Monitor:AlertToList",
            "type": "system",
            "key": "AlertToList",
            "name": "通知对象管理",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:Integration",
        "type": "system",
        "key": "Integration",
        "name": "集成",
        "isShow": true,
        "children": [
          {
            "id": "system:Integration:IntegrationList",
            "type": "system",
            "key": "IntegrationList",
            "name": "集成",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Integration:Datakit",
            "type": "system",
            "key": "Datakit",
            "name": "DataKit",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Integration:GatewayAccess",
            "type": "system",
            "key": "GatewayAccess",
            "name": "网关接入",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Integration:ImApplication",
            "type": "system",
            "key": "ImApplication",
            "name": "IM 应用",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Integration:FunctionDetail",
            "type": "system",
            "key": "FunctionDetail",
            "name": "扩展",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Integration:CloudAccountList",
            "type": "system",
            "key": "CloudAccountList",
            "name": "云账号管理",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Integration:ExternalDataSourceList",
            "type": "system",
            "key": "ExternalDataSourceList",
            "name": "外部数据源",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Integration:DCA",
            "type": "system",
            "key": "DCA",
            "name": "DCA",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Integration:Mobile",
            "type": "system",
            "key": "Mobile",
            "name": "移动端",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:Workspace",
        "type": "system",
        "key": "Workspace",
        "name": "管理",
        "isShow": true,
        "children": [
          {
            "id": "system:Workspace:WorkspaceDetail",
            "type": "system",
            "key": "WorkspaceDetail",
            "name": "空间设置",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:WorkspaceAttrDetail",
            "type": "system",
            "key": "WorkspaceAttrDetail",
            "name": "属性声明",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:WorkspaceFieldsList",
            "type": "system",
            "key": "WorkspaceFieldsList",
            "name": "字段管理",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:WorkspaceTagsList",
            "type": "system",
            "key": "WorkspaceTagsList",
            "name": "全局标签",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:WorkspaceEnvsList",
            "type": "system",
            "key": "WorkspaceEnvsList",
            "name": "环境变量",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:WorkspaceMembers",
            "type": "system",
            "key": "WorkspaceMembers",
            "name": "成员管理",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:WorkspaceRoles",
            "type": "system",
            "key": "WorkspaceRoles",
            "name": "角色管理",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:APIManage",
            "type": "system",
            "key": "APIManage",
            "name": "API Keys 管理",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:ClientToken",
            "type": "system",
            "key": "ClientToken",
            "name": "Client Tokens 管理",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:MemberInviteList",
            "type": "system",
            "key": "MemberInviteList",
            "name": "邀请记录",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:WorkspaceFilterRuleList",
            "type": "system",
            "key": "WorkspaceFilterRuleList",
            "name": "黑名单",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:WorkspacePipelineList",
            "type": "system",
            "key": "WorkspacePipelineList",
            "name": "Pipelines",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:LogBackupExplorer",
            "type": "system",
            "key": "LogBackupExplorer",
            "name": "数据转发",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:DataAccessRuleList",
            "type": "system",
            "key": "DataAccessRuleList",
            "name": "数据访问",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:RegexpList",
            "type": "system",
            "key": "RegexpList",
            "name": "正则表达式",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:KeyEventsAudit",
            "type": "system",
            "key": "KeyEventsAudit",
            "name": "审计事件",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:EmbeddedSharing",
            "type": "system",
            "key": "EmbeddedSharing",
            "name": "分享管理",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:CrossNamespacedataAuth",
            "type": "system",
            "key": "CrossNamespacedataAuth",
            "name": "跨工作空间授权",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:DataAuthorization",
            "type": "system",
            "key": "DataAuthorization",
            "name": "字段展示权限",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:DataScanerList",
            "type": "system",
            "key": "DataScanerList",
            "name": "敏感数据扫描",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:WorkspaceCopilotSubscription",
            "type": "system",
            "key": "WorkspaceCopilotSubscription",
            "name": "Obsy",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:ErrorCenterList",
            "type": "system",
            "key": "ErrorCenterList",
            "name": "错误中心",
            "isShow": true,
            "children": []
          },
          {
            "id": "system:Workspace:Labs",
            "type": "system",
            "key": "Labs",
            "name": "实验室",
            "isShow": true,
            "children": []
          }
        ]
      },
      {
        "id": "system:Billing",
        "type": "system",
        "key": "Billing",
        "name": "付费计划与账单",
        "isShow": true,
        "children": []
      }
    ],
    "roleConfigs": {},
    "changed": true,
    "removedNodeIds": [],
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}
{
  "code": 409,
  "content": {
    "currentRevision": 2
  },
  "errorCode": "ft.WorkspaceMenuRevisionConflict",
  "message": "空间菜单配置已被更新,请刷新后重试",
  "success": false,
  "traceId": "TRACE-EXAMPLE"
}

错误响应

鉴权、限流和公共请求错误参见公共错误定义。

HTTP 状态 errorCode 触发条件 消息或响应说明 处理方式
406 ft.ParameterValidationFailed 请求字段缺失,或字段值违反声明的校验条件 参数解析失败 核对参数位置、字段名、类型和取值。
400 ft.RequestJsonFormatError 请求 JSON 语法无效 请求 JSON 格式错误 按 content.reason、line、column 修正 JSON。
400 ft.JsonFormatError JSON顶层不是对象 部分 json 文件格式错误 提交三项JSON对象。
400 ft.ParamsValidateError 菜单节点/角色配置违反结构、身份、类型、大小、作用域或重复约束 参数校验失败: {} 依据错误content.reason/path定位,读取最新树和角色/资源再修正。
409 ft.WorkspaceMenuRevisionConflict expectedRevision与当前编辑版本不一致 空间菜单配置已被更新,请刷新后重试 读取错误content.currentRevision,再完整GET合并;不要只替换版本强行覆盖。
401 ft.WKSPNotExistOrReleased 当前空间不存在或不是活动状态 工作空间不存在/或已释放 确认当前空间有效,使用对应空间Key。
500 ft.InternalServerError 配置持久化或响应处理失败 内部错误 重新读取完整配置核对revision与结果,合并后再保存,避免覆盖并发修改。

请求例子

import json
from urllib.request import Request, urlopen
base = "https://openapi.guance.com/api/v1"
key = "<DF-API-KEY>"
headers = {"DF-API-KEY": key}
with urlopen(Request(base + "/api/v1/workspace/menu_v3/get", headers=headers)) as response:
    envelope = json.load(response)
if not envelope.get("success") or envelope.get("code") != 200:
    raise RuntimeError(envelope.get("errorCode"), envelope.get("message"))
current = envelope["content"]
# 保留完整树和角色映射,仅隐藏日志根菜单;平台/资源权限不会因此改变。
for node in current["menus"]:
    if node.get("id") == "system:LogIndi":
        node["isShow"] = False
body = {"menus": current["menus"], "roleConfigs": current["roleConfigs"],
        "expectedRevision": current["revision"]}
headers["Content-Type"] = "application/json"
request = Request(base + "/api/v1/workspace/menu_v3/set", method="POST",
                  headers=headers, data=json.dumps(body, ensure_ascii=False).encode("utf-8"))
with urlopen(request) as response:
    result = json.load(response)
if not result.get("success") or result.get("code") != 200:
    raise RuntimeError(result.get("errorCode"), result.get("message"))
print(result)

文档评价

文档内容是否对您有帮助?