diff --git a/gql-queries-generator/doc/queries.graphql b/gql-queries-generator/doc/queries.graphql index b05c25872..c51017d02 100644 --- a/gql-queries-generator/doc/queries.graphql +++ b/gql-queries-generator/doc/queries.graphql @@ -4851,6 +4851,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 118941814..420583b8d 100644 --- a/src/generated/gql/server.ts +++ b/src/generated/gql/server.ts @@ -6626,6 +6626,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'];