Package com.cloudbees.sdk.commands.bg

Source Code of com.cloudbees.sdk.commands.bg.ApplicationClient

package com.cloudbees.sdk.commands.bg;


import com.cloudbees.api.ApplicationCreateResponse;
import com.cloudbees.api.BeesClientConfiguration;
import com.cloudbees.api.StaxClient;

import java.util.HashMap;
import java.util.Map;

public class ApplicationClient extends StaxClient {
    public ApplicationClient(BeesClientConfiguration beesClientConfiguration) {
        super(beesClientConfiguration);
    }

    public ApplicationClient(String server, String apikey, String secret, String format, String version) {
        super(server, apikey, secret, format, version);
    }

    public ApplicationCreateResponse applicationCreate(String appId, Map<String, String> parameters, Map<String, String> appParameters, Map<String, String> appVariables) throws Exception
    {
        Map<String, String> params = new HashMap<String, String>();
        params.put("app_id", appId);
        params.put("parameters", createParameter(parameters));
        params.put("app_parameters", createParameter(appParameters));
        params.put("app_variables", createParameter(appVariables));
        String url = getRequestURL("application.create", params);
        String response = executeRequest(url);
        ApplicationCreateResponse apiResponse =
                (ApplicationCreateResponse)readResponse(response);
        return apiResponse;
    }
}
TOP

Related Classes of com.cloudbees.sdk.commands.bg.ApplicationClient

TOP
Copyright © 2018 www.massapi.com. 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.