Skip to content

Commit

Permalink
Merge pull request #299 from kloudlite/ref/kl-cli-api-clusters
Browse files Browse the repository at this point in the history
kl cli update for listing of clusters
  • Loading branch information
nxtCoder19 authored Sep 23, 2024
2 parents 5ae84e9 + 43546e5 commit 50094a4
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 88 deletions.
39 changes: 18 additions & 21 deletions gql-queries-generator/doc/queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4482,8 +4482,8 @@ query consoleGetRegistryImage($image: String!) {
}
}

query consoleGetRegistryImageUrl($image: String!, $meta: Map!) {
core_getRegistryImageURL(image: $image, meta: $meta) {
query consoleGetRegistryImageUrl {
core_getRegistryImageURL {
scriptUrl
url
}
Expand Down Expand Up @@ -6482,6 +6482,22 @@ query authCli_getRemoteLogin($loginId: String!, $secret: String!) {
}
}

query authCli_listAccountClusters($pagination: CursorPaginationIn) {
infra_listBYOKClusters(pagination: $pagination) {
edges {
node {
clusterToken
displayName
id
metadata {
name
labels
}
}
}
}
}

mutation authCli_createClusterReference($cluster: BYOKClusterIn!) {
infra_createBYOKCluster(cluster: $cluster) {
id
Expand Down Expand Up @@ -6626,25 +6642,6 @@ query authCli_listImportedManagedResources($envName: String!, $search: SearchImp
}
}

query authCli_listByokClusters($search: SearchCluster, $pagination: CursorPaginationIn) {
infra_listBYOKClusters(search: $search, pagination: $pagination) {
edges {
cursor
node {
clusterToken
displayName
id
metadata {
name
namespace
}
updateTime
}
}
totalCount
}
}

mutation authSetRemoteAuthHeader($loginId: String!, $authHeader: String) {
auth_setRemoteAuthHeader(loginId: $loginId, authHeader: $authHeader)
}
Expand Down
54 changes: 23 additions & 31 deletions src/apps/auth/server/gql/cli-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,29 @@ export const cliQueries = (executor: IExecutor) => ({
vars: (_: any) => {},
}
),
cli_listAccountClusters: executor(
gql`
query Infra_listBYOKClusters($pagination: CursorPaginationIn) {
infra_listBYOKClusters(pagination: $pagination) {
edges {
node {
clusterToken
displayName
id
metadata {
name
labels
}
}
}
}
}
`,
{
transformer: (data: any) => data.infra_listBYOKClusters,
vars(_: any) {},
}
),
cli_createClusterReference: executor(
gql`
mutation Infra_createBYOKCluster($cluster: BYOKClusterIn!) {
Expand Down Expand Up @@ -905,35 +928,4 @@ export const cliQueries = (executor: IExecutor) => ({
vars(_: any) {},
}
),
cli_listByokClusters: executor(
gql`
query Infra_listBYOKClusters(
$search: SearchCluster
$pagination: CursorPaginationIn
) {
infra_listBYOKClusters(search: $search, pagination: $pagination) {
edges {
cursor
node {
clusterToken
displayName
id
metadata {
name
namespace
}
updateTime
}
}
totalCount
}
}
`,
{
transformer: (data: any) => {
return data.infra_listBYOKClusters;
},
vars(_: any) {},
}
),
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ export const RegistryImageInstruction = ({
const { data, isLoading, error } = useCustomSwr(
'registry-image-instructions',
async () => {
return api.getRegistryImageUrl({
image: '<image_name:image_tag>',
meta: {},
});
return api.getRegistryImageUrl();
}
);

Expand Down
12 changes: 6 additions & 6 deletions src/apps/console/server/gql/queries/registry-image-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const registryImagesQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleDeleteRegistryImageMutation) =>
data.core_deleteRegistryImage,
vars(_: ConsoleDeleteRegistryImageMutationVariables) { },
vars(_: ConsoleDeleteRegistryImageMutationVariables) {},
}
),
getRegistryImage: executor(
Expand All @@ -51,13 +51,13 @@ export const registryImagesQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleGetRegistryImageQuery) =>
data.core_getRegistryImage,
vars(_: ConsoleGetRegistryImageQueryVariables) { },
vars(_: ConsoleGetRegistryImageQueryVariables) {},
}
),
getRegistryImageUrl: executor(
gql`
query Core_getRegistryImageURL($image: String!, $meta: Map!) {
core_getRegistryImageURL(image: $image, meta: $meta) {
query Core_getRegistryImageURL {
core_getRegistryImageURL {
scriptUrl
url
}
Expand All @@ -66,7 +66,7 @@ export const registryImagesQueries = (executor: IExecutor) => ({
{
transformer: (data: ConsoleGetRegistryImageUrlQuery) =>
data.core_getRegistryImageURL,
vars(_: ConsoleGetRegistryImageUrlQueryVariables) { },
vars(_: ConsoleGetRegistryImageUrlQueryVariables) {},
}
),
listRegistryImages: executor(
Expand Down Expand Up @@ -101,7 +101,7 @@ export const registryImagesQueries = (executor: IExecutor) => ({
transformer: (data: ConsoleListRegistryImagesQuery) => {
return data.core_listRegistryImages;
},
vars(_: ConsoleListRegistryImagesQueryVariables) { },
vars(_: ConsoleListRegistryImagesQueryVariables) {},
}
),
});
2 changes: 1 addition & 1 deletion src/generated/codegen-sdl.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
overwrite: true
schema: "http://gateway.kloudlite.svc.cluster.local:3000"
schema: "http://gateway-api.kloudlite.svc.cluster.local:3000"
generates:
gql/sdl.graphql:
plugins:
Expand Down
2 changes: 1 addition & 1 deletion src/generated/codegen.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
overwrite: true
schema: "http://gateway.kloudlite.svc.cluster.local:3000"
schema: "http://gateway-api.kloudlite.svc.cluster.local:3000"
generates:
gql/server.ts:
documents:
Expand Down
7 changes: 6 additions & 1 deletion src/generated/gql/sdl.graphql
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
Indicates exactly one field must be supplied and this field must not be `null`.
"""
directive @oneOf on INPUT_OBJECT

"""Exposes a URL that specifies the behavior of this scalar."""
directive @specifiedBy(
"""The URL that specifies the behavior of this scalar."""
Expand Down Expand Up @@ -3951,7 +3956,7 @@ type Query {
core_getManagedResouceOutputKeyValues(envName: String, keyrefs: [ManagedResourceKeyRefIn], msvcName: String): [ManagedResourceKeyValueRef!]!
core_getManagedResource(envName: String, msvcName: String, name: String!): ManagedResource
core_getRegistryImage(image: String!): RegistryImage
core_getRegistryImageURL(image: String!, meta: Map!): RegistryImageURL!
core_getRegistryImageURL: RegistryImageURL!
core_getRouter(envName: String!, name: String!): Router
core_getSecret(envName: String!, name: String!): Secret
core_getSecretValues(envName: String!, queries: [SecretKeyRefIn!]): [SecretKeyValueRef!]
Expand Down
41 changes: 18 additions & 23 deletions src/generated/gql/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6114,8 +6114,7 @@ export type ConsoleGetRegistryImageQuery = {
};

export type ConsoleGetRegistryImageUrlQueryVariables = Exact<{
image: Scalars['String']['input'];
meta: Scalars['Map']['input'];
[key: string]: never;
}>;

export type ConsoleGetRegistryImageUrlQuery = {
Expand Down Expand Up @@ -8133,6 +8132,23 @@ export type AuthCli_GetRemoteLoginQuery = {
auth_getRemoteLogin?: { authHeader?: string; status: string };
};

export type AuthCli_ListAccountClustersQueryVariables = Exact<{
pagination?: InputMaybe<CursorPaginationIn>;
}>;

export type AuthCli_ListAccountClustersQuery = {
infra_listBYOKClusters?: {
edges: Array<{
node: {
clusterToken: string;
displayName: string;
id: string;
metadata: { name: string; labels?: any };
};
}>;
};
};

export type AuthCli_CreateClusterReferenceMutationVariables = Exact<{
cluster: ByokClusterIn;
}>;
Expand Down Expand Up @@ -8276,27 +8292,6 @@ export type AuthCli_ListImportedManagedResourcesQuery = {
};
};

export type AuthCli_ListByokClustersQueryVariables = Exact<{
search?: InputMaybe<SearchCluster>;
pagination?: InputMaybe<CursorPaginationIn>;
}>;

export type AuthCli_ListByokClustersQuery = {
infra_listBYOKClusters?: {
totalCount: number;
edges: Array<{
cursor: string;
node: {
clusterToken: string;
displayName: string;
id: string;
updateTime: any;
metadata: { name: string; namespace?: string };
};
}>;
};
};

export type AuthSetRemoteAuthHeaderMutationVariables = Exact<{
loginId: Scalars['String']['input'];
authHeader?: InputMaybe<Scalars['String']['input']>;
Expand Down

0 comments on commit 50094a4

Please sign in to comment.