Skip to content

Commit 24b9808

Browse files
committed
moved namspace API
1 parent 5af0f46 commit 24b9808

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.0.81-beta-2",
3+
"version": "0.0.81-beta-3",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/Common.service.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
CDMaterialsApprovalInfo,
1616
CDMaterialFilterQuery,
1717
ImagePromotionMaterialInfo,
18+
EnvironmentListHelmResponse,
1819
} from './Types'
1920
import { ApiResourceType } from '../Pages'
2021

@@ -344,3 +345,8 @@ export function getClusterListMin() {
344345
export const getResourceGroupListRaw = (clusterId: string): Promise<ResponseType<ApiResourceType>> => {
345346
return get(`${ROUTES.API_RESOURCE}/${ROUTES.GVK}/${clusterId}`)
346347
}
348+
349+
export function getNamespaceListMin(clusterIdsCsv: string): Promise<EnvironmentListHelmResponse> {
350+
const URL = `${ROUTES.NAMESPACE}/autocomplete?ids=${clusterIdsCsv}`
351+
return get(URL)
352+
}

src/Common/Constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const ROUTES = {
5151
CLUSTER: 'cluster',
5252
API_RESOURCE: 'k8s/api-resources',
5353
GVK: 'gvk',
54+
NAMESPACE: 'env/namespace',
5455
}
5556

5657
export enum KEY_VALUE {

src/Common/Types.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,3 +867,20 @@ export interface DeploymentWindowProfileMetaData {
867867
excludedUserEmails: string[]
868868
warningMessage: string
869869
}
870+
871+
export interface EnvironmentListHelmResult {
872+
clusterId: number
873+
clusterName: string
874+
environments: EnvironmentHelmResult[]
875+
}
876+
877+
export interface EnvironmentHelmResult {
878+
environmentId: number
879+
environmentName: string
880+
namespace: string
881+
environmentIdentifier: string
882+
isVirtualEnvironment?: boolean // Need to confirm for not full mode
883+
allowedDeploymentTypes?: DeploymentAppTypes[]
884+
}
885+
886+
export type EnvironmentListHelmResponse = ResponseType<EnvironmentListHelmResult[]>

0 commit comments

Comments
 (0)