添加jcc-client

This commit is contained in:
jhnine 2022-09-26 10:38:51 +08:00
parent 538322b936
commit 33b8394564
10 changed files with 66 additions and 72 deletions

View File

@ -22,31 +22,31 @@ export default {
deleteCurrent(clusterName, namespace, name, classification) {
if (classification === 'userProject') { // 用户项目
return request({
url: `/api/v1/namespace/delete/${clusterName}/${namespace}`,
url: `/jcc-client/api/v1/namespace/delete/${clusterName}/${namespace}`,
method: 'delete'
})
}
if (classification === 'storage') { // 存储卷
return request({
url: `/api/v1/pvc/deletePvc/${clusterName}/${namespace}/${name}`,
url: `/jcc-client/api/v1/pvc/deletePvc/${clusterName}/${namespace}/${name}`,
method: 'delete'
})
}
if (classification === 'pods') { // 容器节点
return request({
url: `/api/v1/pod/deletePod/${clusterName}/${namespace}/${name}`,
url: `/jcc-client/api/v1/pod/deletePod/${clusterName}/${namespace}/${name}`,
method: 'delete'
})
}
if (classification === 'services') { // 服务
return request({
url: `/api/v1/service/delete/${clusterName}/${namespace}/${name}`,
url: `/jcc-client/api/v1/service/delete/${clusterName}/${namespace}/${name}`,
method: 'delete'
})
} else {
// 工作负载 部署 有状态副本集 守护进程集
return request({
url: `/api/v1/deployment/${classification}/delete/${clusterName}/${namespace}/${name}`,
url: `/jcc-client/api/v1/deployment/${classification}/delete/${clusterName}/${namespace}/${name}`,
method: 'delete'
})
}
@ -91,14 +91,14 @@ export default {
// 工作负载创建 --> 容器镜像获取数据 get
// 获取应用名称列表 http://119.45.100.73:30880/kapis/resources.kubesphere.io/v1alpha3/deployments?limit=-1&sortBy=updateTime&page=1
// http://119.45.100.73:30880/api/v1/namespaces/jh-test1/configmaps
// http://119.45.100.73:30880/api/v1/namespaces/jh-test1/secrets
// http://119.45.100.73:30880/api/v1/namespaces/jh-test1/limitranges
// http://119.45.100.73:30880/api/v1/namespaces/jh-test1/secrets?fieldSelector=type%3Dkubernetes.io%2Fdockerconfigjson
// http://119.45.100.73:30880/jcc-client/api/v1/namespaces/jh-test1/configmaps
// http://119.45.100.73:30880/jcc-client/api/v1/namespaces/jh-test1/secrets
// http://119.45.100.73:30880/jcc-client/api/v1/namespaces/jh-test1/limitranges
// http://119.45.100.73:30880/jcc-client/api/v1/namespaces/jh-test1/secrets?fieldSelector=type%3Dkubernetes.io%2Fdockerconfigjson
// 工作负载创建 --> 挂载存储获取数据 get
// http://119.45.100.73:30880/kapis/resources.kubesphere.io/v1alpha3/namespaces/jh-test1/persistentvolumeclaims?limit=-1&sortBy=createTime&page=1
// http://119.45.100.73:30880/api/v1/namespaces/jh-test1
// http://119.45.100.73:30880/jcc-client/api/v1/namespaces/jh-test1
//
// http://119.45.100.73:30880/kapis/resources.kubesphere.io/v1alpha3/namespaces/jh-test1/nodes?sortBy=createTime&limit=10&labelSelector=%21node-role.kubernetes.io%2Fedge

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 节点管理页面--查询节点列表
export function getNodeManageList(params) {
return request({
url: '/api/v1/node/list',
url: '/jcc-client/api/v1/node/list',
method: 'get',
params
})
@ -12,7 +12,7 @@ export function getNodeManageList(params) {
// 节点管理页面--查询节点列表监控数据
export function getNodeMetrics(params) {
return request({
url: '/api/v1/overview/getNodeMetrics',
url: '/jcc-client/api/v1/overview/getNodeMetrics',
method: 'get',
params
})
@ -21,7 +21,7 @@ export function getNodeMetrics(params) {
// 节点二级页面--节点详情
export function getNodeDetails(clusterName, nodeName) {
return request({
url: `/api/v1/node/detail/${clusterName}/${nodeName}`,
url: `/jcc-client/api/v1/node/detail/${clusterName}/${nodeName}`,
method: 'get'
})
}
@ -29,7 +29,7 @@ export function getNodeDetails(clusterName, nodeName) {
// 节点管理页面--启动/停止
export function switchNode(data) {
return request({
url: '/api/v1/node/switch',
url: '/jcc-client/api/v1/node/switch',
method: 'put',
data
})
@ -38,7 +38,7 @@ export function switchNode(data) {
// 节点管理页面--污点管理
export function taintsNode(data) {
return request({
url: '/api/v1/node/taints',
url: '/jcc-client/api/v1/node/taints',
method: 'put',
data
})
@ -47,7 +47,7 @@ export function taintsNode(data) {
// 节点管理页面--编辑节点标签
export function updateNodeLabels(data) {
return request({
url: '/api/v1/node/labels',
url: '/jcc-client/api/v1/node/labels',
method: 'put',
data
})
@ -56,7 +56,7 @@ export function updateNodeLabels(data) {
// 节点管理页面--集群节点数量
export function getNodeNums(url) {
return request({
url: `/api/v1/node/count/${url}`,
url: `/jcc-client/api/v1/node/count/${url}`,
method: 'get'
})
}
@ -64,7 +64,7 @@ export function getNodeNums(url) {
// 节点详情页面--资源使用状态图表
export function getMonitorData(params) {
return request({
url: '/api/v1/node/getNodeMetrics1h',
url: '/jcc-client/api/v1/node/getNodeMetrics1h',
method: 'get',
params
})
@ -73,7 +73,7 @@ export function getMonitorData(params) {
// 节点详情页面--节点监控图表
export function getMonitorDetailData(params) {
return request({
url: '/api/v1/node/getNodeMetrics8h',
url: '/jcc-client/api/v1/node/getNodeMetrics8h',
method: 'get',
params
})
@ -82,7 +82,7 @@ export function getMonitorDetailData(params) {
// 节点二级页面--容器节点列表
export function getPodDetails(clusterName, nodeName) {
return request({
url: `/api/v1/pod/listForNode/${clusterName}/${nodeName}`,
url: `/jcc-client/api/v1/pod/listForNode/${clusterName}/${nodeName}`,
method: 'get'
})
}

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 容器概览页面--JCCE组件状态API
export function getAPIState(params) {
return request({
url: '/api/v1/overview/getApiServerMetrics',
url: '/jcc-client/api/v1/overview/getApiServerMetrics',
method: 'get',
params
})
@ -12,7 +12,7 @@ export function getAPIState(params) {
// 容器概览页面--JCCE组件状态调度器
export function getSchedulerState(params) {
return request({
url: '/api/v1/overview/getScheduleMetrics',
url: '/jcc-client/api/v1/overview/getScheduleMetrics',
method: 'get',
params
})
@ -21,7 +21,7 @@ export function getSchedulerState(params) {
// 容器概览页面--集群资源使用情况
export function getClusterResource(params) {
return request({
url: '/api/v1/overview/getClusterMetrics',
url: '/jcc-client/api/v1/overview/getClusterMetrics',
method: 'get',
params
})
@ -30,7 +30,7 @@ export function getClusterResource(params) {
// 容器概览页面--节点用量 Top5
export function getNodeBriefMessage(params) {
return request({
url: '/api/v1/overview/getNodeMetrics',
url: '/jcc-client/api/v1/overview/getNodeMetrics',
method: 'get',
params
})

View File

@ -4,7 +4,7 @@ import request from '@/utils/request'
// 查询容器列表
export function getPodList(params) {
return request({
url: '/api/v1/pod/listAll',
url: '/jcc-client/api/v1/pod/listAll',
method: 'get',
params: params
})
@ -13,7 +13,7 @@ export function getPodList(params) {
// 查询容器详情
export function searchPodDetail(clusterName, namespace, podName) {
return request({
url: `/api/v1/pod/getPod/${clusterName}/${namespace}/${podName}`,
url: `/jcc-client/api/v1/pod/getPod/${clusterName}/${namespace}/${podName}`,
method: 'get'
})
}
@ -21,7 +21,7 @@ export function searchPodDetail(clusterName, namespace, podName) {
// 查询容器节点监控
export function searchPodMetrics(params) {
return request({
url: `/api/v1/pod/metrics`,
url: `/jcc-client/api/v1/pod/metrics`,
method: 'get',
params: params
})

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 项目管理页面--查询项目列表queryType user-用户项目列表system-系统项目列表)
export function getProjectList(params) {
return request({
url: '/api/v1/namespace/list',
url: '/jcc-client/api/v1/namespace/list',
method: 'get',
params: params
})
@ -12,7 +12,7 @@ export function getProjectList(params) {
// 项目管理页面--查询项目列表监控数据
export function getDetailUserProject(params) {
return request({
url: '/api/v1/namespace/getBatchMetrics',
url: '/jcc-client/api/v1/namespace/getBatchMetrics',
params
})
}
@ -20,7 +20,7 @@ export function getDetailUserProject(params) {
// 项目管理页面--创建项目
export function createProjectData(data) {
return request({
url: `/api/v1/namespace/create`,
url: `/jcc-client/api/v1/namespace/create`,
method: 'post',
data
})
@ -29,7 +29,7 @@ export function createProjectData(data) {
// 项目管理页面--查询项目名称是否重复
export function searchProjectName(params) {
return request({
url: `/api/v1/namespace/judge`,
url: `/jcc-client/api/v1/namespace/judge`,
method: 'get',
params
})
@ -38,7 +38,7 @@ export function searchProjectName(params) {
// 项目管理页面--编辑项目
export function updateProjectData(data) {
return request({
url: `/api/v1/namespace/update`,
url: `/jcc-client/api/v1/namespace/update`,
method: 'patch',
data
})
@ -47,7 +47,7 @@ export function updateProjectData(data) {
// 项目管理页面--查询项目详情
export function searchProjectDetail(params) {
return request({
url: `/api/v1/namespace/detail`,
url: `/jcc-client/api/v1/namespace/detail`,
method: 'get',
params
})
@ -56,7 +56,7 @@ export function searchProjectDetail(params) {
// 项目详情页面--容器节点列表
export function getProjectPods(params) {
return request({
url: '/api/v1/namespace/container/group',
url: '/jcc-client/api/v1/namespace/container/group',
method: 'get',
params
})
@ -65,7 +65,7 @@ export function getProjectPods(params) {
// 项目二级页面--项目监控图表
export function getProjectMonitor(params) {
return request({
url: '/api/v1/namespace/getMetrics',
url: '/jcc-client/api/v1/namespace/getMetrics',
method: 'get',
params
})
@ -73,7 +73,7 @@ export function getProjectMonitor(params) {
// 项目二级页面--项目应用资源
export function getProjectQuotas(params) {
return request({
url: '/api/v1/namespace/resources',
url: '/jcc-client/api/v1/namespace/resources',
method: 'get',
params
})

View File

@ -4,7 +4,7 @@ import request from '@/utils/request'
// 创建服务
export function createServiceData(data) {
return request({
url: `/api/v1/service/create`,
url: `/jcc-client/api/v1/service/create`,
method: 'post',
data
})
@ -13,7 +13,7 @@ export function createServiceData(data) {
// 查询服务详情
export function searchServiceDetail(params) {
return request({
url: `/api/v1/service/detail`,
url: `/jcc-client/api/v1/service/detail`,
method: 'get',
params
})
@ -22,7 +22,7 @@ export function searchServiceDetail(params) {
// 查询服务名是否重复
export function searchServiceJudge(clusterName, namespace, serviceName) {
return request({
url: `/api/v1/service/isExist/${clusterName}/${namespace || 'default'}/${serviceName}`,
url: `/jcc-client/api/v1/service/isExist/${clusterName}/${namespace || 'default'}/${serviceName}`,
method: 'get'
})
}
@ -30,7 +30,7 @@ export function searchServiceJudge(clusterName, namespace, serviceName) {
// 查询服务列表
export function getServiceList(params) {
return request({
url: '/api/v1/service/list',
url: '/jcc-client/api/v1/service/list',
method: 'get',
params
})
@ -39,7 +39,7 @@ export function getServiceList(params) {
// 配置服务文件
export function searchServiceMetrics(data) {
return request({
url: `/api/v1/service/metrics`,
url: `/jcc-client/api/v1/service/metrics`,
method: 'post',
data
})

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 存储管理页面--存储卷列表
export function getVolume(params) {
return request({
url: '/api/v1/pvc/listAll',
url: '/jcc-client/api/v1/pvc/listAll',
method: 'get',
params
})
@ -12,7 +12,7 @@ export function getVolume(params) {
// 存储管理页面--存储卷别名编辑
export function updatePvcAlias(data) {
return request({
url: '/api/v1/pvc/updatePvcAlias',
url: '/jcc-client/api/v1/pvc/updatePvcAlias',
method: 'patch',
data
})
@ -21,7 +21,7 @@ export function updatePvcAlias(data) {
// 存储管理页面--创建存储卷 获取项目列表
export function getStorageProject(params) {
return request({
url: '/api/v1/pvc/getNamespaceNames',
url: '/jcc-client/api/v1/pvc/getNamespaceNames',
method: 'get',
params
})
@ -30,7 +30,7 @@ export function getStorageProject(params) {
// 存储管理页面--创建存储卷 查询存储卷是否重名
export function checkStorageName(clusterName, namespace, pvcName) {
return request({
url: `/api/v1/pvc/isPvcExist/${clusterName}/${namespace || 'default'}/${pvcName}`,
url: `/jcc-client/api/v1/pvc/isPvcExist/${clusterName}/${namespace || 'default'}/${pvcName}`,
method: 'get'
})
}
@ -38,7 +38,7 @@ export function checkStorageName(clusterName, namespace, pvcName) {
// 存储管理页面--创建存储卷 查询所有存储类
export function getStorageJuan(params) {
return request({
url: `/api/v1/sc/list`,
url: `/jcc-client/api/v1/sc/list`,
method: 'get',
params
})
@ -47,7 +47,7 @@ export function getStorageJuan(params) {
// 存储管理页面--获取存储卷配置
export function getPvcConfig(clusterName, namespace, pvcName) {
return request({
url: `/api/v1/pvc/getPvcConfig/${clusterName}/${namespace}/${pvcName}`,
url: `/jcc-client/api/v1/pvc/getPvcConfig/${clusterName}/${namespace}/${pvcName}`,
method: 'get'
})
}
@ -55,7 +55,7 @@ export function getPvcConfig(clusterName, namespace, pvcName) {
// 存储管理页面--编辑存储卷配置
export function updatePvcConfig(clusterName, namespace, pvcName, data) {
return request({
url: `/api/v1/pvc/updatePvcConfig/${clusterName}/${namespace}/${pvcName}`,
url: `/jcc-client/api/v1/pvc/updatePvcConfig/${clusterName}/${namespace}/${pvcName}`,
method: 'put',
data,
headers: {
@ -67,7 +67,7 @@ export function updatePvcConfig(clusterName, namespace, pvcName, data) {
// 存储管理页面--创建存储卷
export function saveStorageJuan(data) {
return request({
url: '/api/v1/pvc/create',
url: '/jcc-client/api/v1/pvc/create',
method: 'post',
data
})

View File

@ -8,7 +8,7 @@ import request from '@/utils/request'
// 工作负载管理页面--列表接口
export function getWorkloadsList(params) {
return request({
url: `/api/v1/deployment/${params.type}/list`,
url: `/jcc-client/api/v1/deployment/${params.type}/list`,
method: 'get',
params: {
...params,
@ -20,7 +20,7 @@ export function getWorkloadsList(params) {
// 工作负载详情页面--负载容器节点列表
export function getWorkloadPods(clusterName, namespace, deploymentName, type) {
return request({
url: `/api/v1/pod/list/${clusterName}/${namespace}/${deploymentName}/${type}`,
url: `/jcc-client/api/v1/pod/list/${clusterName}/${namespace}/${deploymentName}/${type}`,
method: 'get'
})
}
@ -28,7 +28,7 @@ export function getWorkloadPods(clusterName, namespace, deploymentName, type) {
// 工作负载--创建
export function createWorkloads(type, params) {
return request({
url: `/api/v1/deployment/${type}/create`,
url: `/jcc-client/api/v1/deployment/${type}/create`,
method: 'get',
params
})
@ -37,7 +37,7 @@ export function createWorkloads(type, params) {
// 工作负载-编辑配置文件
export function editWorkloadsSetting(type, clusterName, data) {
return request({
url: `/api/v1/deployment/${type}/config/${clusterName}`,
url: `/jcc-client/api/v1/deployment/${type}/config/${clusterName}`,
method: 'post',
data
})
@ -46,7 +46,7 @@ export function editWorkloadsSetting(type, clusterName, data) {
// 工作负载详情页面-版本记录
export function getWorkloadsReplicaSet(type, params) {
return request({
url: `/api/v1/deployment/${type}/replicaSet`,
url: `/jcc-client/api/v1/deployment/${type}/replicaSet`,
method: 'get',
params
})
@ -55,7 +55,7 @@ export function getWorkloadsReplicaSet(type, params) {
// 工作负载-创建-检查名称是否存在
export function getWorkloadsIsExist(type, clusterName, namespace, stateName) {
return request({
url: `/api/v1/deployment/${type}/isExist/${clusterName}/${namespace || 'default'}/${stateName}`,
url: `/jcc-client/api/v1/deployment/${type}/isExist/${clusterName}/${namespace || 'default'}/${stateName}`,
method: 'get'
})
}
@ -63,7 +63,7 @@ export function getWorkloadsIsExist(type, clusterName, namespace, stateName) {
// 工作负载详情页面-接口地址 (部署、有状态副本集、守护进程集)
export function getWorkloadsDetail(type, params) {
return request({
url: `/api/v1/deployment/${type}/details`,
url: `/jcc-client/api/v1/deployment/${type}/details`,
method: 'get',
params
})
@ -72,7 +72,7 @@ export function getWorkloadsDetail(type, params) {
// 工作负载-更新接口
export function updateWorkloads(type, data) {
return request({
url: `/api/v1/deployment/${type}/update`,
url: `/jcc-client/api/v1/deployment/${type}/update`,
method: 'patch',
data
})
@ -81,7 +81,7 @@ export function updateWorkloads(type, data) {
// 工作负载-重新部署
export function patchRedeploy(data) {
return request({
url: '/api/v1/deployment/deployments/redeploy',
url: '/jcc-client/api/v1/deployment/deployments/redeploy',
method: 'patch',
data
})
@ -90,7 +90,7 @@ export function patchRedeploy(data) {
// 工作负载-部署-查询弹性伸缩
export function getAutoScaling(params) {
return request({
url: '/api/v1/deployment/hpa',
url: '/jcc-client/api/v1/deployment/hpa',
method: 'get',
params
})
@ -99,7 +99,7 @@ export function getAutoScaling(params) {
// 工作负载-部署-确定弹性伸缩
export function doAutoScaling(data) {
return request({
url: '/api/v1/deployment/autoScaling',
url: '/jcc-client/api/v1/deployment/autoScaling',
method: 'post',
data
})
@ -108,7 +108,7 @@ export function doAutoScaling(data) {
// 工作负载-版本回退
export function rollBack(type, data) {
return request({
url: `/api/v1/deployment/${type}/back`,
url: `/jcc-client/api/v1/deployment/${type}/back`,
method: 'post',
data
})
@ -117,7 +117,7 @@ export function rollBack(type, data) {
// 负载二级页面--监控接口
export function getMonitorDetailData(params) {
return request({
url: '/api/v1/deployment/getMetrics',
url: '/jcc-client/api/v1/deployment/getMetrics',
method: 'get',
params
})
@ -126,7 +126,7 @@ export function getMonitorDetailData(params) {
// 工作负载新建
export function getWorkloadCreate(type, clusterName, data) {
return request({
url: `/api/v1/deployment/${type}/${clusterName}/create`,
url: `/jcc-client/api/v1/deployment/${type}/${clusterName}/create`,
method: 'post',
data
})
@ -135,7 +135,7 @@ export function getWorkloadCreate(type, clusterName, data) {
// 获取配置字典列表
export function getConfigmapData(params) {
return request({
url: '/api/v1/configmap/list',
url: '/jcc-client/api/v1/configmap/list',
method: 'get',
params
})
@ -144,7 +144,7 @@ export function getConfigmapData(params) {
// 获取保密字典列表
export function getSecretData(params) {
return request({
url: '/api/v1/secret/list',
url: '/jcc-client/api/v1/secret/list',
method: 'get',
params
})

View File

@ -62,7 +62,7 @@ export function getEarthDetails(area) {
// 整体总负载 平均使用情况
export function getTotalAverage() {
return request({
url: '/api/v1/sphere/getOverallMetrics',
url: '/jcc-client/api/v1/sphere/getOverallMetrics',
method: 'get'
})
}

View File

@ -64,12 +64,6 @@ module.exports = {
changeOrigin: true,
secure: false
},
'^/api': {
ws: false,
target: 'http://10.101.15.6:9999/', /* 测试环境 */
changeOrigin: true,
secure: false
},
// '/kapis/terminal.kubesphere.io': {
// ws: true,
// changeOrigin: true,