Search in sources :

Example 1 with APIManagerSetupExportParams

use of com.axway.apim.setup.lib.APIManagerSetupExportParams in project apim-cli by Axway-API-Management-Plus.

the class APIManagerSettingsApp method exportConfig.

@CLIServiceMethod(name = "get", description = "Get actual API-Manager configuration")
public static int exportConfig(String[] args) {
    APIManagerSetupExportParams params;
    try {
        params = (APIManagerSetupExportParams) APIManagerSetupExportCLIOptions.create(args).getParams();
    } catch (AppException e) {
        LOG.error("Error " + e.getMessage());
        return e.getError().getCode();
    }
    APIManagerSettingsApp app = new APIManagerSettingsApp();
    return app.runExport(params).getRc();
}
Also used : AppException(com.axway.apim.lib.errorHandling.AppException) APIManagerSetupExportParams(com.axway.apim.setup.lib.APIManagerSetupExportParams) CLIServiceMethod(com.axway.apim.cli.CLIServiceMethod)

Example 2 with APIManagerSetupExportParams

use of com.axway.apim.setup.lib.APIManagerSetupExportParams in project apim-cli by Axway-API-Management-Plus.

the class ExportManagerConfigTestAction method runTest.

@Override
public ExportResult runTest(TestContext context) {
    APIManagerSetupExportParams params = new APIManagerSetupExportParams();
    addParameters(params, context);
    params.setRemoteHostName(getVariable(context, PARAM_NAME));
    params.setRemoteHostId(getVariable(context, PARAM_ID));
    APIManagerSettingsApp app = new APIManagerSettingsApp();
    LOG.info("Running " + app.getClass().getSimpleName() + " with params: " + params);
    ExportResult result = app.runExport(params);
    if (this.getExpectedReturnCode(context) != result.getRc()) {
        throw new ValidationException("Expected RC was: " + this.getExpectedReturnCode(context) + " but got: " + result.getRc());
    }
    return result;
}
Also used : APIManagerSetupExportParams(com.axway.apim.setup.lib.APIManagerSetupExportParams) ValidationException(com.consol.citrus.exceptions.ValidationException) APIManagerSettingsApp(com.axway.apim.setup.APIManagerSettingsApp) ExportResult(com.axway.apim.lib.ExportResult)

Aggregations

APIManagerSetupExportParams (com.axway.apim.setup.lib.APIManagerSetupExportParams)2 CLIServiceMethod (com.axway.apim.cli.CLIServiceMethod)1 ExportResult (com.axway.apim.lib.ExportResult)1 AppException (com.axway.apim.lib.errorHandling.AppException)1 APIManagerSettingsApp (com.axway.apim.setup.APIManagerSettingsApp)1 ValidationException (com.consol.citrus.exceptions.ValidationException)1