Skip to content

Commit

Permalink
Add verify_tls to REST API
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwang401 committed Jan 28, 2024
1 parent 73caf89 commit 92405f8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/Transformers/Admin/NodeTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public function transform(Node $node): array
'location_id' => $node->location_id,
'name' => $node->name,
'cluster' => $node->cluster,
'verify_tls' => $node->verify_tls,
'fqdn' => $node->fqdn,
'port' => $node->port,
'memory' => $node->memory,
Expand All @@ -30,7 +31,7 @@ public function transform(Node $node): array
'coterm_tls_enabled' => $node->coterm_tls_enabled,
'coterm_fqdn' => $node->coterm_fqdn,
'coterm_port' => $node->coterm_port,
'servers_count' => (int) $node->servers_count,
'servers_count' => (int)$node->servers_count,
];
}
}
4 changes: 3 additions & 1 deletion resources/scripts/api/admin/nodes/createNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ interface CreateNodeParameters {
locationId: number
name: string
cluster: string
verifyTls: boolean
fqdn: string
tokenId: string
secret: string
Expand All @@ -26,6 +27,7 @@ const createNode = async (data: CreateNodeParameters): Promise<Node> => {
location_id: data.locationId,
name: data.name,
cluster: data.cluster,
verify_tls: data.verifyTls,
fqdn: data.fqdn,
token_id: data.tokenId,
secret: data.secret,
Expand All @@ -43,4 +45,4 @@ const createNode = async (data: CreateNodeParameters): Promise<Node> => {
return rawDataToNode(responseData)
}

export default createNode
export default createNode
4 changes: 3 additions & 1 deletion resources/scripts/api/admin/nodes/getNodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface Node {
locationId: number
name: string
cluster: string
verifyTls: boolean
fqdn: string
port: number
memory: number
Expand All @@ -29,6 +30,7 @@ export const rawDataToNode = (data: any): Node => ({
locationId: data.location_id,
name: data.name,
cluster: data.cluster,
verifyTls: data.verify_tls,
fqdn: data.fqdn,
port: data.port,
memory: data.memory,
Expand Down Expand Up @@ -84,4 +86,4 @@ const getNodes = async ({
}
}

export default getNodes
export default getNodes
4 changes: 3 additions & 1 deletion resources/scripts/api/admin/nodes/updateNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ interface UpdateNodeParameters {
locationId: number
name: string
cluster: string
verifyTls: boolean
fqdn: string
port: number
tokenId?: string | null
Expand All @@ -26,6 +27,7 @@ const updateNode = async (nodeId: number, payload: UpdateNodeParameters) => {
location_id: payload.locationId,
name: payload.name,
cluster: payload.cluster,
verify_tls: payload.verifyTls,
fqdn: payload.fqdn,
port: payload.port,
token_id: payload.tokenId ? payload.tokenId : undefined,
Expand All @@ -43,4 +45,4 @@ const updateNode = async (nodeId: number, payload: UpdateNodeParameters) => {
return rawDataToNode(data)
}

export default updateNode
export default updateNode

0 comments on commit 92405f8

Please sign in to comment.