feat: fully functioning ALB
This commit is contained in:
@@ -108,15 +108,34 @@ export async function getServiceSchema(
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export type LoadBalancingDependencies = {
|
||||
vpcs: Array<{id: string; cidrBlock: string}>;
|
||||
subnets: Array<{id: string; vpcId: string; availabilityZone: string; cidrBlock: string}>;
|
||||
securityGroups: Array<{id: string; vpcId: string; name: string; description: string}>;
|
||||
};
|
||||
|
||||
export async function getLoadBalancingDependencies(
|
||||
service: "loadbalancing" | "targetgroups" = "loadbalancing",
|
||||
signal?: AbortSignal,
|
||||
): Promise<LoadBalancingDependencies & {instances?: Array<{id: string; name: string; privateIp: string | null}>}> {
|
||||
const res = await apiClient.call<LoadBalancingDependencies>(
|
||||
apiEndpointKeys.clouds.dependencies,
|
||||
requestOptions("aws", service, {signal}),
|
||||
{cloud: "aws", service},
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function listCloudResources(
|
||||
cloud: CloudProvider,
|
||||
service: CloudServiceType,
|
||||
search?: string,
|
||||
signal?: AbortSignal,
|
||||
state?: string,
|
||||
): Promise<CloudResource[]> {
|
||||
const res = await apiClient.call<CloudResource[]>(
|
||||
apiEndpointKeys.clouds.resources.list,
|
||||
requestOptions(cloud, service, { signal, params: { search } }),
|
||||
requestOptions(cloud, service, { signal, params: { search, state } }),
|
||||
{ cloud, service },
|
||||
);
|
||||
return res.data;
|
||||
@@ -905,6 +924,49 @@ export async function listCollectionItems(
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function listFlatItems(
|
||||
cloud: CloudProvider,
|
||||
service: CloudServiceType,
|
||||
resourceId: string,
|
||||
cursor?: string,
|
||||
signal?: AbortSignal,
|
||||
): Promise<CollectionPage<ChildItem>> {
|
||||
const res = await apiClient.call<CollectionPage<ChildItem>>(
|
||||
apiEndpointKeys.clouds.flatItems.list,
|
||||
requestOptions(cloud, service, { signal, params: cursor ? { cursor } : undefined }),
|
||||
{ cloud, service, id: resourceId },
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function deleteFlatItem(
|
||||
cloud: CloudProvider,
|
||||
service: CloudServiceType,
|
||||
resourceId: string,
|
||||
itemId: string,
|
||||
signal?: AbortSignal,
|
||||
): Promise<void> {
|
||||
await apiClient.call<void>(
|
||||
apiEndpointKeys.clouds.flatItems.delete,
|
||||
requestOptions(cloud, service, { signal }),
|
||||
{ cloud, service, id: resourceId, itemId },
|
||||
);
|
||||
}
|
||||
|
||||
export async function putFlatItem(
|
||||
cloud: CloudProvider,
|
||||
service: CloudServiceType,
|
||||
resourceId: string,
|
||||
body: Record<string, unknown>,
|
||||
): Promise<ChildItem> {
|
||||
const res = await apiClient.call<ChildItem, Record<string, unknown>>(
|
||||
apiEndpointKeys.clouds.flatItems.create,
|
||||
requestOptions(cloud, service, {body}),
|
||||
{cloud, service, id: resourceId},
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function listSqlDatabases(
|
||||
cloud: CloudProvider,
|
||||
serverId: string,
|
||||
|
||||
Reference in New Issue
Block a user