Skip to content

Commit

Permalink
Features/release checklist (#62)
Browse files Browse the repository at this point in the history
* ✨ Added cli queries

* ✨ Added some cli queries
  • Loading branch information
abdheshnayak authored Jan 2, 2024
1 parent 680a551 commit 6706730
Show file tree
Hide file tree
Showing 3 changed files with 503 additions and 97 deletions.
76 changes: 76 additions & 0 deletions gql-queries-generator/doc/queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2679,6 +2679,82 @@ query consoleGetBuildRun($repoName: String!, $buildRunName: String!) {
}
}

query authCli_listProjects($clusterName: String, $search: SearchProjects, $pq: CursorPaginationIn) {
core_listProjects(clusterName: $clusterName, search: $search, pq: $pq) {
edges {
cursor
node {
accountName
apiVersion
clusterName
createdBy {
userEmail
userId
userName
}
creationTime
displayName
id
kind
lastUpdatedBy {
userEmail
userId
userName
}
markedForDeletion
metadata {
annotations
creationTimestamp
deletionTimestamp
generation
labels
name
namespace
}
recordVersion
spec {
accountName
clusterName
displayName
logo
targetNamespace
}
status {
checks
isReady
lastReadyGeneration
lastReconcileTime
message {
RawMessage
}
resources {
apiVersion
kind
name
namespace
}
}
syncStatus {
action
error
lastSyncedAt
recordVersion
state
syncScheduledAt
}
updateTime
}
}
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
totalCount
}
}

query authCli_getKubeConfig($name: String!) {
infra_getCluster(name: $name) {
adminKubeconfig {
Expand Down
147 changes: 147 additions & 0 deletions src/apps/auth/server/gql/cli-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,153 @@ import {
} from '~/root/src/generated/gql/server';

export const cliQueries = (executor: IExecutor) => ({
cli_listDevices: executor(
gql`
query Infra_listVPNDevices(
$pq: CursorPaginationIn
$clusterName: String
) {
infra_listVPNDevices(pq: $pq, clusterName: $clusterName) {
edges {
node {
displayName
markedForDeletion
metadata {
name
namespace
}
spec {
cnameRecords {
host
target
}
deviceNamespace
ports {
port
targetPort
}
}
status {
isReady
message {
RawMessage
}
}
}
}
}
}
`,
{
transformer: (data: any) => data.infra_listVPNDevices,
vars: (_: any) => {},
}
),

cli_getDevice: executor(
gql`
query Infra_getVPNDevice($clusterName: String!, $name: String!) {
infra_getVPNDevice(clusterName: $clusterName, name: $name) {
displayName
markedForDeletion
metadata {
name
namespace
}
spec {
cnameRecords {
host
target
}
deviceNamespace
nodeSelector
ports {
port
targetPort
}
}
status {
isReady
message {
RawMessage
}
}
wireguardConfig {
encoding
value
}
}
}
`,
{
transformer: (data: any) => data.infra_getVPNDevice,
vars: (_: any) => {},
}
),

cli_listEnvironments: executor(
gql`
query Core_listProjects($project: ProjectId!, $pq: CursorPaginationIn) {
core_listEnvironments(project: $project, pq: $pq) {
edges {
node {
displayName
markedForDeletion
metadata {
name
namespace
}
spec {
isEnvironment
projectName
targetNamespace
}
status {
isReady
message {
RawMessage
}
}
}
}
}
}
`,
{
transformer: (data: any) => data.core_listEnvironments,
vars: (_: any) => {},
}
),

cli_listProjects: executor(
gql`
query Core_listProjects($clusterName: String, $pq: CursorPaginationIn) {
core_listProjects(clusterName: $clusterName, pq: $pq) {
edges {
node {
displayName
markedForDeletion
metadata {
name
namespace
}
status {
isReady
message {
RawMessage
}
}
}
}
}
}
`,
{
transformer: (data: any) => data.core_listProjects,
vars: (_: any) => {},
}
),

cli_getKubeConfig: executor(
gql`
query Infra_getCluster($name: String!) {
Expand Down
Loading

0 comments on commit 6706730

Please sign in to comment.