/*
* Copyright 2010-2014, CloudBees Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cloudbees.sdk.pool;
import com.cloudbees.api.BeesClient;
import com.cloudbees.api.BeesClientConfiguration;
import com.cloudbees.api.ServerPoolInfo;
import java.util.HashMap;
import java.util.Map;
/**
* @author Fabian Donze
*/
public class PoolClient extends BeesClient {
public PoolClient(String serverApiUrl, String apikey, String secret, String format, String version) {
super(serverApiUrl, apikey, secret, format, version);
}
public PoolClient(BeesClientConfiguration beesClientConfiguration) {
super(beesClientConfiguration);
}
public ServerPoolInfo serverPoolUpdate(String poolId, Map<String, String> parameters) throws Exception
{
Map<String, String> params = new HashMap<String, String>();
params.put("pool_id", poolId);
params.put("parameters", createParameter(parameters));
String url = getRequestURL("server.pool.update", params);
String response = executeRequest(url);
ServerPoolInfo apiResponse = (ServerPoolInfo)readResponse(response);
return apiResponse;
}
}