-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
243ff7b
commit 3b1f4d6
Showing
12 changed files
with
337 additions
and
86 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { UDropMirrorResponse } from '@/app/dto/MirrorsDTO'; | ||
import { ShutdownRequest, ShutdownResponse } from '@/grpc_generated/route'; | ||
import { GetFlowHttpAddressFromEnv } from '@/rpc/http'; | ||
|
||
export async function POST(request: Request) { | ||
const body = await request.json(); | ||
const { workflowId, flowJobName, sourcePeer, destinationPeer } = body; | ||
const flowServiceAddr = GetFlowHttpAddressFromEnv(); | ||
const req: ShutdownRequest = { | ||
workflowId, | ||
flowJobName, | ||
sourcePeer, | ||
destinationPeer, | ||
}; | ||
console.log('/drop/mirror: req:', req); | ||
const dropStatus: ShutdownResponse = await fetch( | ||
`${flowServiceAddr}/v1/mirrors/drop`, | ||
{ | ||
method: 'POST', | ||
body: JSON.stringify(req), | ||
} | ||
).then((res) => { | ||
return res.json(); | ||
}); | ||
let response: UDropMirrorResponse = { | ||
dropped: dropStatus.ok, | ||
}; | ||
|
||
return new Response(JSON.stringify(response)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.