Package com.redhat.gss.redhat_support_lib.api

Examples of com.redhat.gss.redhat_support_lib.api.API


                if (splitCredentials[1] != null) {
                    password = splitCredentials[1];
                }
            }
            Config config = new Config();
            API api = new API(username, password, config.getURL(), config.getProxyUser(), config.getProxyPassword(),
                config.getProxyURL(), config.getProxyPort(), config.getUserAgent(), config.isDevel());
            // check if we are authorized
            api.getProblems().diagnoseStr("test");
            if (SERVER_REPORT.equalsIgnoreCase(attachment)) {
                String report = new JdrReportRunner().getReport();
                api.getAttachments().add(caseNum, true, report, attachment);
                log.info("File attached to URL " + api.getConfigHelper().getUrl());
                try {
                    new File(report).delete();
                    log.debug("Report " + report + " deleted");
                } catch (Exception e) {
                    log.error("Failed to delete JDR Report File", e);
                }
            }
            if (attachment.startsWith(RESOURCE_REPORT)) {
                String resourceId = attachment.replaceAll(".*/", "").replaceAll("\\:.*", "").trim();
                log.info("About to attach report for resourceId=" + resourceId);
                int resId = Integer.parseInt(resourceId);
                String report = new ResourceJdrReportRunner(resId).getReport();
                if (report != null) {
                    api.getAttachments().add(caseNum, true, report, attachment);
                    try {
                        new File(report).delete();
                        log.debug("Report " + report + " deleted");
                    } catch (Exception e) {
                        log.error("Failed to delete JDR Report File", e);
View Full Code Here

TOP

Related Classes of com.redhat.gss.redhat_support_lib.api.API

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.