adding a real test Method for API gateway
This commit is contained in:
@@ -263,6 +263,25 @@ export interface ApiGatewayTestRouteResult {
|
||||
durationMs: number;
|
||||
}
|
||||
|
||||
export interface TestApiGatewayMethodInput {
|
||||
resourceId: string;
|
||||
httpMethod: string;
|
||||
pathWithQueryString: string;
|
||||
body: string;
|
||||
headers: Record<string, string>;
|
||||
multiValueHeaders: Record<string, string[]>;
|
||||
stageVariables: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface ApiGatewayMethodTestResult {
|
||||
statusCode: number;
|
||||
body: string;
|
||||
headers: Record<string, string>;
|
||||
multiValueHeaders: Record<string, string[]>;
|
||||
log: string | null;
|
||||
latency: number | null;
|
||||
}
|
||||
|
||||
export interface ApiGatewayRouteOverview {
|
||||
resourceId: string;
|
||||
path: string;
|
||||
@@ -445,6 +464,20 @@ export async function testApiGatewayRoute(
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function testApiGatewayMethod(
|
||||
cloud: CloudProvider,
|
||||
apiId: string,
|
||||
input: TestApiGatewayMethodInput,
|
||||
signal?: AbortSignal,
|
||||
): Promise<ApiGatewayMethodTestResult> {
|
||||
const res = await apiClient.call<ApiGatewayMethodTestResult, TestApiGatewayMethodInput>(
|
||||
apiEndpointKeys.clouds.resources.testApiGatewayMethod,
|
||||
requestOptions(cloud, "apigateway", { signal, body: input, timeout: INVOKE_TIMEOUT_MS }),
|
||||
{ cloud, id: apiId },
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function createS3LambdaTrigger(
|
||||
cloud: CloudProvider,
|
||||
bucketName: string,
|
||||
|
||||
Reference in New Issue
Block a user