feat: fully functioning ALB

This commit is contained in:
Zakaria
2026-09-26 16:14:24 -04:00
parent 093afb9b2b
commit 8470b8d17a
44 changed files with 2076 additions and 132 deletions
@@ -81,6 +81,16 @@ describe('GET /clouds/:cloud/services/:service/resources - search query param (#
expect(adapter.capturedQuery?.search).toBeUndefined()
})
test('forwards the state param when provided', async () => {
const adapter = new StubStorageAdapter()
const app = buildApp(adapter)
const response = await app.request('/aws/services/storage/resources?state=running')
expect(response.status).toBe(200)
expect(adapter.capturedQuery?.state).toBe('running')
})
test('filters resources by search term via adapter', async () => {
const adapter = new StubStorageAdapter()
const app = buildApp(adapter)
+12 -1
View File
@@ -82,6 +82,14 @@ export function createCloudRoutes(injectedService?: CloudProxyService) {
return c.json(schema)
})
app.get('/:cloud/services/:service/dependencies', async (c) => {
const cloud = c.req.param('cloud') as CloudProvider
const serviceType = c.req.param('service') as CloudServiceType
if (!isCloudProvider(cloud) || !isServiceType(serviceType)) return c.json({error: 'Unknown cloud or service'}, 404)
return withRuntime(c, async () => c.json(await svc(c).dependencies(cloud, serviceType)))
})
app.get('/:cloud/services/database/snapshots', async (c) => {
const cloud = c.req.param('cloud') as CloudProvider
if (!isCloudProvider(cloud)) return c.json({error: 'Unknown cloud'}, 404)
@@ -119,7 +127,10 @@ export function createCloudRoutes(injectedService?: CloudProxyService) {
if (!isCloudProvider(cloud) || !isServiceType(serviceType)) return c.json({error: 'Unknown cloud or service'}, 404)
return withRuntime(c, async () => {
const resources = await svc(c).listResources(cloud, serviceType, {search: c.req.query('search')})
const resources = await svc(c).listResources(cloud, serviceType, {
search: c.req.query('search'),
state: c.req.query('state'),
})
return c.json(resources)
})
})
+1
View File
@@ -30,6 +30,7 @@ const baseInstance: Ec2Instance = {
instanceType: 't3.micro',
availabilityZone: 'us-east-1a',
securityGroups: [],
networkInterfaces: [],
tags: [],
}