use of io.github.satr.common.OperationValueResult in project intellij-idea-plugin-connector-for-aws-lambda by satr.
the class FunctionConnectorModel method deleteAwsLogStreamsFor.
public OperationValueResult deleteAwsLogStreamsFor(String functionName) {
OperationValueResult operationResult = new OperationValueResultImpl();
LogGroup logGroup = getLogGroupForAwsLambdaFunction(functionName);
if (logGroup == null) {
operationResult.addError("Not found log group for the function \"%s\"", functionName);
return operationResult;
}
DeleteLogGroupResult deleteLogGroupResult = awsLogClient.deleteLogGroup(new DeleteLogGroupRequest(logGroup.getLogGroupName()));
int httpStatusCode = deleteLogGroupResult.getSdkHttpMetadata().getHttpStatusCode();
if (httpStatusCode == HttpStatusCode.OK.getCode()) {
return operationResult;
}
operationResult.addError("Operation responded with code %d", httpStatusCode);
return operationResult;
}
Aggregations