Search in sources :

Example 1 with OperationValueResult

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;
}
Also used : OperationValueResultImpl(io.github.satr.common.OperationValueResultImpl) OperationValueResult(io.github.satr.common.OperationValueResult)

Aggregations

OperationValueResult (io.github.satr.common.OperationValueResult)1 OperationValueResultImpl (io.github.satr.common.OperationValueResultImpl)1