brooklyn.entity.container.DockerAttributes Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of brooklyn-clocker-docker Show documentation
Show all versions of brooklyn-clocker-docker Show documentation
Clocker Brooklyn entities and locations for Docker integration.
/*
* Copyright 2014-2015 by Cloudsoft Corporation Limited
*
* 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 brooklyn.entity.container;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import brooklyn.config.ConfigInheritance;
import brooklyn.config.ConfigKey;
import brooklyn.entity.Entity;
import brooklyn.entity.basic.ConfigKeys;
import brooklyn.event.AttributeSensor;
import brooklyn.event.basic.AttributeSensorAndConfigKey;
import brooklyn.event.basic.PortAttributeSensorAndConfigKey;
import brooklyn.event.basic.Sensors;
import brooklyn.location.docker.strategy.DockerAwarePlacementStrategy;
import brooklyn.util.flags.TypeCoercions;
import brooklyn.util.internal.ssh.SshTool;
import brooklyn.util.javalang.Reflections;
import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import com.google.common.reflect.TypeToken;
public class DockerAttributes {
/** Do not instantiate. */
private DockerAttributes() { }
/*
* Configuration.
*/
public static final ConfigKey DOCKERFILE_URL = ConfigKeys.newStringConfigKey(
"docker.dockerfile.url", "URL of a Dockerfile to use");
public static final ConfigKey DOCKERFILE_NAME = ConfigKeys.newStringConfigKey(
"docker.dockerfile.name", "Name for the image created by the Dockerfile being used");
public static final AttributeSensorAndConfigKey DOCKER_IMAGE_ID = ConfigKeys.newStringSensorAndConfigKey(
"docker.image.id", "The ID of a Docker image to use for a container");
public static final AttributeSensorAndConfigKey DOCKER_IMAGE_REPOSITORY = ConfigKeys.newStringSensorAndConfigKey(
"docker.image.repository", "The repository of the Docker image used by a container");
public static final AttributeSensorAndConfigKey DOCKER_IMAGE_NAME = ConfigKeys.newStringSensorAndConfigKey(
"docker.image.name", "The name of the Docker image used by a container");
public static final AttributeSensorAndConfigKey DOCKER_IMAGE_TAG = ConfigKeys.newStringSensorAndConfigKey(
"docker.image.tag", "The tag of the image to use", "latest");
public static final AttributeSensorAndConfigKey DOCKER_HARDWARE_ID = ConfigKeys.newStringSensorAndConfigKey(
"docker.hardwareId", "The ID of a Docker hardware type to use for a container", "small");
public static final AttributeSensorAndConfigKey DOCKER_CONTAINER_NAME = ConfigKeys.newStringSensorAndConfigKey(
"docker.container.name", "The name of the Docker container");
public static final ConfigKey DOCKER_PASSWORD = ConfigKeys.newConfigKeyWithPrefix("docker.", SshTool.PROP_PASSWORD);
public static final ConfigKey DOCKER_USE_HOST_DNS_NAME = ConfigKeys.newBooleanConfigKey(
"docker.useHostDnsName", "Container uses same DNS hostname as Docker host", Boolean.TRUE);
public static final ConfigKey DOCKER_CPU_SHARES = ConfigKeys.newIntegerConfigKey(
"docker.cpuShares", "Container CPU shares configuration");
public static final ConfigKey DOCKER_MEMORY = ConfigKeys.newIntegerConfigKey(
"docker.memory", "Container memory configuration");
public static final ConfigKey MANAGED = ConfigKeys.newBooleanConfigKey(
"docker.container.managed", "Set to false if the container is not managed by Brooklyn and Clocker", Boolean.TRUE);
public static final AttributeSensorAndConfigKey