Skip to content

Commit

Permalink
Merge pull request #73 from kloudlite/features/design
Browse files Browse the repository at this point in the history
Features/design
  • Loading branch information
abdheshnayak authored Jan 26, 2024
2 parents 0ed4ab1 + 62f7332 commit e7b5760
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 501 deletions.
122 changes: 8 additions & 114 deletions gql-queries-generator/doc/queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3878,6 +3878,14 @@ query consoleListImagePullSecrets($projectName: String!, $envName: String!, $sea
}
}

mutation authCli_updateDeviceCluster($deviceName: String!, $clusterName: String!) {
core_updateVpnClusterName(deviceName: $deviceName, clusterName: $clusterName)
}

mutation authCli_UpdateDeviceNs($deviceName: String!, $ns: String!) {
core_updateVpnDeviceNs(deviceName: $deviceName, ns: $ns)
}

mutation authCli_CoreUpdateDevicePorts($deviceName: String!, $ports: [PortIn!]!) {
core_updateVPNDevicePorts(deviceName: $deviceName, ports: $ports)
}
Expand Down Expand Up @@ -3957,120 +3965,6 @@ mutation authCli_updateCoreDevicePorts($deviceName: String!, $ports: [PortIn!]!)
core_updateVPNDevicePorts(deviceName: $deviceName, ports: $ports)
}

query authCli_getDevice($clusterName: String!, $name: String!) {
infra_getVPNDevice(clusterName: $clusterName, name: $name) {
displayName
markedForDeletion
metadata {
name
namespace
}
spec {
cnameRecords {
host
target
}
activeNamespace
nodeSelector
ports {
port
targetPort
}
}
status {
isReady
message {
RawMessage
}
}
wireguardConfig {
encoding
value
}
}
}

query authCli_listDevices($pq: CursorPaginationIn, $clusterName: String) {
infra_listVPNDevices(clusterName: $clusterName, pq: $pq) {
edges {
node {
displayName
metadata {
name
}
spec {
activeNamespace
disabled
nodeSelector
ports {
port
targetPort
}
}
status {
isReady
message {
RawMessage
}
}
wireguardConfig {
encoding
value
}
}
}
}
}

mutation authCli_updateDevice($clusterName: String!, $vpnDevice: VPNDeviceIn!) {
infra_updateVPNDevice(clusterName: $clusterName, vpnDevice: $vpnDevice) {
metadata {
name
}
spec {
activeNamespace
cnameRecords {
target
host
}
ports {
targetPort
port
}
}
status {
message {
RawMessage
}
isReady
}
}
}

mutation authCli_updateDevicePort($clusterName: String!, $deviceName: String!, $ports: [PortIn!]!) {
infra_updateVPNDevicePorts(
clusterName: $clusterName
deviceName: $deviceName
ports: $ports
)
}

mutation authCli_updateDeviceNs($clusterName: String!, $deviceName: String!, $namespace: String!) {
infra_updateVPNDeviceNs(
clusterName: $clusterName
deviceName: $deviceName
namespace: $namespace
)
}

mutation authCli_createDevice($clusterName: String!, $vpnDevice: VPNDeviceIn!) {
infra_createVPNDevice(clusterName: $clusterName, vpnDevice: $vpnDevice) {
metadata {
name
}
}
}

query authCli_CoreCheckNameAvailability($resType: ConsoleResType!, $name: String!) {
core_checkNameAvailability(resType: $resType, name: $name) {
result
Expand Down
111 changes: 19 additions & 92 deletions src/apps/auth/server/gql/cli-queries.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
/* eslint-disable camelcase */
import gql from 'graphql-tag';
import { IExecutor } from '~/root/lib/server/helpers/execute-query-with-context';
import { infraQueries } from './queries/infra-queries';
import { vpnQueries } from './queries/device-queries';

export const cliQueries = (executor: IExecutor) => ({
...vpnQueries(executor),
...infraQueries(executor),

cli_coreCheckNameAvailability: executor(
gql`
query Core_checkNameAvailability(
$resType: ConsoleResType!
$name: String!
) {
core_checkNameAvailability(resType: $resType, name: $name) {
result
suggestedNames
}
}
`,
{
transformer: (data: any) => data.core_checkNameAvailability,
vars: (_: any) => {},
}
),

cli_getMresKeys: executor(
gql`
query Core_getManagedResouceOutputKeyValues(
Expand Down Expand Up @@ -251,35 +268,17 @@ export const cliQueries = (executor: IExecutor) => ({
edges {
cursor
node {
createdBy {
userEmail
userId
userName
}
creationTime
displayName
enabled
environmentName
kind
lastUpdatedBy {
userEmail
userId
userName
}
markedForDeletion
metadata {
annotations
creationTimestamp
deletionTimestamp
generation
labels
name
namespace
}
projectName
spec {
displayName
freeze
containers {
args
command
Expand All @@ -296,62 +295,13 @@ export const cliQueries = (executor: IExecutor) => ({
type
}
image
imagePullPolicy
livenessProbe {
failureThreshold
httpGet {
httpHeaders
path
port
}
initialDelay
interval
shell {
command
}
tcp {
port
}
type
}
name
readinessProbe {
failureThreshold
initialDelay
interval
type
}
resourceCpu {
max
min
}
resourceMemory {
max
min
}
volumes {
items {
fileName
key
}
mountPath
refName
type
}
}
hpa {
enabled
maxReplicas
minReplicas
thresholdCpu
thresholdMemory
}
intercept {
enabled
toDevice
}
nodeSelector
region
replicas
serviceAccount
services {
Expand All @@ -360,39 +310,16 @@ export const cliQueries = (executor: IExecutor) => ({
targetPort
type
}
tolerations {
effect
key
operator
tolerationSeconds
value
}
}
status {
checks
isReady
lastReadyGeneration
lastReconcileTime
message {
RawMessage
}
resources {
apiVersion
kind
name
namespace
}
}
updateTime
}
}
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
totalCount
}
}
`,
Expand Down
Loading

0 comments on commit e7b5760

Please sign in to comment.