From fb6f824128a2ee0c546a7d56e5ef0b0aae20ab22 Mon Sep 17 00:00:00 2001 From: nxtcoder36 Date: Fri, 29 Nov 2024 12:58:26 +0530 Subject: [PATCH] service binding listing, intercept start and remove queries added --- gql-queries-generator/doc/queries.graphql | 100 ++++++++++++++++ src/apps/auth/server/gql/cli-queries.ts | 138 ++++++++++++++++++++++ src/generated/gql/server.ts | 103 ++++++++++++++++ 3 files changed, 341 insertions(+) diff --git a/gql-queries-generator/doc/queries.graphql b/gql-queries-generator/doc/queries.graphql index 7ae969a73..504af6ec2 100644 --- a/gql-queries-generator/doc/queries.graphql +++ b/gql-queries-generator/doc/queries.graphql @@ -4850,6 +4850,106 @@ query authCli_getConfig($envName: String!, $name: String!) { } } +query authCli_listServices($envName: String!, $pagination: CursorPaginationIn) { + core_listServiceBindings(envName: $envName, pagination: $pagination) { + edges { + cursor + node { + accountName + apiVersion + clusterName + creationTime + environmentName + id + interceptStatus { + intercepted + portMappings { + containerPort + servicePort + } + toAddr + } + kind + markedForDeletion + metadata { + annotations + creationTimestamp + deletionTimestamp + generation + labels + name + namespace + } + recordVersion + spec { + globalIP + hostname + ports { + appProtocol + name + nodePort + port + protocol + targetPort { + IntVal + StrVal + Type + } + } + serviceIP + serviceRef { + name + namespace + } + } + status { + checkList { + debug + description + hide + name + title + } + checks + isReady + lastReadyGeneration + lastReconcileTime + message { + RawMessage + } + resources { + apiVersion + kind + name + namespace + } + } + updateTime + } + } + pageInfo { + endCursor + hasNextPage + hasPrevPage + startCursor + } + totalCount + } +} + +mutation authCli_createServiceIntercept($envName: String!, $serviceName: String!, $interceptTo: String!, $portMappings: [Github__com___kloudlite___operator___apis___crds___v1__SvcInterceptPortMappingsIn!]) { + core_createServiceIntercept( + envName: $envName + serviceName: $serviceName + interceptTo: $interceptTo + portMappings: $portMappings + ) +} + +mutation authCli_deleteServiceIntercept($envName: String!, $serviceName: String!) { + core_deleteServiceIntercept(envName: $envName, serviceName: $serviceName) +} + query authCli_listApps($pq: CursorPaginationIn, $envName: String!) { apps: core_listExternalApps(pq: $pq, envName: $envName) { edges { diff --git a/src/apps/auth/server/gql/cli-queries.ts b/src/apps/auth/server/gql/cli-queries.ts index 071f2f08d..592a15eda 100644 --- a/src/apps/auth/server/gql/cli-queries.ts +++ b/src/apps/auth/server/gql/cli-queries.ts @@ -487,6 +487,144 @@ export const cliQueries = (executor: IExecutor) => ({ } ), + cli_listServices: executor( + gql` + query Core_listServiceBindings( + $envName: String! + $pagination: CursorPaginationIn + ) { + core_listServiceBindings(envName: $envName, pagination: $pagination) { + edges { + cursor + node { + accountName + apiVersion + clusterName + creationTime + environmentName + id + interceptStatus { + intercepted + portMappings { + containerPort + servicePort + } + toAddr + } + kind + markedForDeletion + metadata { + annotations + creationTimestamp + deletionTimestamp + generation + labels + name + namespace + } + recordVersion + spec { + globalIP + hostname + ports { + appProtocol + name + nodePort + port + protocol + targetPort { + IntVal + StrVal + Type + } + } + serviceIP + serviceRef { + name + namespace + } + } + status { + checkList { + debug + description + hide + name + title + } + checks + isReady + lastReadyGeneration + lastReconcileTime + message { + RawMessage + } + resources { + apiVersion + kind + name + namespace + } + } + updateTime + } + } + pageInfo { + endCursor + hasNextPage + hasPrevPage + startCursor + } + totalCount + } + } + `, + { + transformer: (data: any) => data.core_listServiceBindings, + vars: (_: any) => {}, + } + ), + + cli_createServiceIntercept: executor( + gql` + mutation Core_createServiceIntercept( + $envName: String! + $serviceName: String! + $interceptTo: String! + $portMappings: [Github__com___kloudlite___operator___apis___crds___v1__SvcInterceptPortMappingsIn!] + ) { + core_createServiceIntercept( + envName: $envName + serviceName: $serviceName + interceptTo: $interceptTo + portMappings: $portMappings + ) + } + `, + { + transformer: (data: any) => data.core_createServiceIntercept, + vars: (_: any) => {}, + } + ), + + cli_deleteServiceIntercept: executor( + gql` + mutation Core_deleteServiceIntercept( + $envName: String! + $serviceName: String! + ) { + core_deleteServiceIntercept( + envName: $envName + serviceName: $serviceName + ) + } + `, + { + transformer: (data: any) => data.core_deleteServiceIntercept, + vars: (_: any) => {}, + } + ), + cli_listApps: executor( gql` query Core_listApps($pq: CursorPaginationIn, $envName: String!) { diff --git a/src/generated/gql/server.ts b/src/generated/gql/server.ts index 268053e8a..691c083e1 100644 --- a/src/generated/gql/server.ts +++ b/src/generated/gql/server.ts @@ -6625,6 +6625,109 @@ export type AuthCli_GetConfigQuery = { }; }; +export type AuthCli_ListServicesQueryVariables = Exact<{ + envName: Scalars['String']['input']; + pagination?: InputMaybe; +}>; + +export type AuthCli_ListServicesQuery = { + core_listServiceBindings?: { + totalCount: number; + edges: Array<{ + cursor: string; + node: { + accountName: string; + apiVersion?: string; + clusterName: string; + creationTime: any; + environmentName: string; + id: string; + kind?: string; + markedForDeletion?: boolean; + recordVersion: number; + updateTime: any; + interceptStatus?: { + intercepted?: boolean; + toAddr: string; + portMappings?: Array<{ containerPort: number; servicePort: number }>; + }; + metadata?: { + annotations?: any; + creationTimestamp: any; + deletionTimestamp?: any; + generation: number; + labels?: any; + name: string; + namespace?: string; + }; + spec?: { + globalIP: string; + hostname?: string; + serviceIP?: string; + ports?: Array<{ + appProtocol?: string; + name?: string; + nodePort?: number; + port: number; + protocol?: K8s__Io___Api___Core___V1__Protocol; + targetPort?: { IntVal: number; StrVal: string; Type: number }; + }>; + serviceRef?: { name: string; namespace: string }; + }; + status?: { + checks?: any; + isReady: boolean; + lastReadyGeneration?: number; + lastReconcileTime?: any; + checkList?: Array<{ + debug?: boolean; + description?: string; + hide?: boolean; + name: string; + title: string; + }>; + message?: { RawMessage?: any }; + resources?: Array<{ + apiVersion: string; + kind: string; + name: string; + namespace: string; + }>; + }; + }; + }>; + pageInfo: { + endCursor?: string; + hasNextPage?: boolean; + hasPrevPage?: boolean; + startCursor?: string; + }; + }; +}; + +export type AuthCli_CreateServiceInterceptMutationVariables = Exact<{ + envName: Scalars['String']['input']; + serviceName: Scalars['String']['input']; + interceptTo: Scalars['String']['input']; + portMappings?: InputMaybe< + | Array + | Github__Com___Kloudlite___Operator___Apis___Crds___V1__SvcInterceptPortMappingsIn + >; +}>; + +export type AuthCli_CreateServiceInterceptMutation = { + core_createServiceIntercept: boolean; +}; + +export type AuthCli_DeleteServiceInterceptMutationVariables = Exact<{ + envName: Scalars['String']['input']; + serviceName: Scalars['String']['input']; +}>; + +export type AuthCli_DeleteServiceInterceptMutation = { + core_deleteServiceIntercept: boolean; +}; + export type AuthCli_ListAppsQueryVariables = Exact<{ pq?: InputMaybe; envName: Scalars['String']['input'];