All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openstack4j.openstack.senlin.internal.SenlinClusterPolicyServiceImpl Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
package org.openstack4j.openstack.senlin.internal;

import org.openstack4j.api.senlin.SenlinClusterPolicyService;
import org.openstack4j.model.senlin.ClusterPolicy;
import org.openstack4j.openstack.senlin.domain.SenlinClusterPolicy;

import java.util.List;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * This class contains getters for all implementation of the available cluster services
 * 
 * @author lion
 */
public class SenlinClusterPolicyServiceImpl extends BaseSenlinServices implements SenlinClusterPolicyService {

	@Override
	public List list(String clusterID) {
		checkNotNull(clusterID);
		return get(SenlinClusterPolicy.ClusterPolicy.class, uri("/clusters/%s/policies", clusterID)).execute().getList();
	}

	@Override
	public ClusterPolicy get(String clusterID, String policyID) {
		checkNotNull(clusterID);
		checkNotNull(policyID);
		return get(SenlinClusterPolicy.class, uri("/clusters/%s/policies/%s", clusterID, policyID)).execute();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy