Skip to content

Commit

Permalink
service binding listing, intercept start and remove queries added (#337)
Browse files Browse the repository at this point in the history
Co-authored-by: nxtcoder36 <[email protected]>
  • Loading branch information
nxtCoder19 and nxtcoder36 authored Dec 9, 2024
1 parent 8671d55 commit c3b3d9b
Show file tree
Hide file tree
Showing 3 changed files with 341 additions and 0 deletions.
100 changes: 100 additions & 0 deletions gql-queries-generator/doc/queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
138 changes: 138 additions & 0 deletions src/apps/auth/server/gql/cli-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!) {
Expand Down
103 changes: 103 additions & 0 deletions src/generated/gql/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6626,6 +6626,109 @@ export type AuthCli_GetConfigQuery = {
};
};

export type AuthCli_ListServicesQueryVariables = Exact<{
envName: Scalars['String']['input'];
pagination?: InputMaybe<CursorPaginationIn>;
}>;

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>
| 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<CursorPaginationIn>;
envName: Scalars['String']['input'];
Expand Down

0 comments on commit c3b3d9b

Please sign in to comment.