Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/design #73

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading