public class Job extends Descriptor implements Comparable<Job>
{
"command" : [ "server", "serverconfig.yaml" ],
"env" : {
"JVM_ARGS" : "-Ddw.feature.randomFeatureFlagEnabled=true"
},
"expires" : null,
"gracePeriod": 60,
"healthCheck" : {
"type" : "http",
"path" : "/healthcheck",
"port" : "http-admin"
},
"id" : "myservice:0.5:3539b7bc2235d53f79e6e8511942bbeaa8816265",
"image" : "myregistry:80/janedoe/myservice:0.5-98c6ff4",
"networkMode" : "bridge",
"ports" : {
"http" : {
"externalPort" : 8060,
"internalPort" : 8080,
"protocol" : "tcp"
},
"http-admin" : {
"externalPort" : 8061,
"internalPort" : 8081,
"protocol" : "tcp"
}
},
"registration" : {
"service/http" : {
"ports" : {
"http" : { }
}
}
},
"registrationDomain" : "",
"securityOpt" : [ "label:user:USER", "apparmor:PROFILE" ],
"token": "insecure-access-token",
"volumes" : {
"/destination/path/in/container.yaml:ro" : "/source/path/in/host.yaml"
}
}
| Modifier and Type | Class and Description |
|---|---|
static class |
Job.Builder |
| Modifier and Type | Field and Description |
|---|---|
static List<String> |
EMPTY_COMMAND |
static String |
EMPTY_CREATING_USER |
static Map<String,String> |
EMPTY_ENV |
static Date |
EMPTY_EXPIRES |
static Integer |
EMPTY_GRACE_PERIOD |
static HealthCheck |
EMPTY_HEALTH_CHECK |
static String |
EMPTY_MOUNT |
static String |
EMPTY_NETWORK_MODE |
static Map<String,PortMapping> |
EMPTY_PORTS |
static Map<ServiceEndpoint,ServicePorts> |
EMPTY_REGISTRATION |
static String |
EMPTY_REGISTRATION_DOMAIN |
static Resources |
EMPTY_RESOURCES |
static List<String> |
EMPTY_SECURITY_OPT |
static String |
EMPTY_TOKEN |
static Map<String,String> |
EMPTY_VOLUMES |
| Constructor and Description |
|---|
Job(JobId id,
String image,
List<String> command,
Map<String,String> env,
Resources resources,
Map<String,PortMapping> ports,
Map<ServiceEndpoint,ServicePorts> registration,
Integer gracePeriod,
Map<String,String> volumes,
Date expires,
String registrationDomain,
String creatingUser,
String token,
HealthCheck healthCheck,
List<String> securityOpt,
String networkMode)
Create a Job.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Job o) |
boolean |
equals(Object o) |
List<String> |
getCommand() |
String |
getCreatingUser() |
Map<String,String> |
getEnv() |
Date |
getExpires() |
Integer |
getGracePeriod() |
HealthCheck |
getHealthCheck() |
JobId |
getId() |
String |
getImage() |
String |
getNetworkMode() |
Map<String,PortMapping> |
getPorts() |
Map<ServiceEndpoint,ServicePorts> |
getRegistration() |
String |
getRegistrationDomain() |
Resources |
getResources() |
List<String> |
getSecurityOpt() |
String |
getToken() |
Map<String,String> |
getVolumes() |
int |
hashCode() |
static Job.Builder |
newBuilder() |
Job.Builder |
toBuilder() |
String |
toString() |
parse, parse, toJsonBytes, toJsonStringpublic static final Resources EMPTY_RESOURCES
public static final Map<String,PortMapping> EMPTY_PORTS
public static final Map<ServiceEndpoint,ServicePorts> EMPTY_REGISTRATION
public static final Integer EMPTY_GRACE_PERIOD
public static final String EMPTY_MOUNT
public static final Date EMPTY_EXPIRES
public static final String EMPTY_REGISTRATION_DOMAIN
public static final String EMPTY_CREATING_USER
public static final String EMPTY_TOKEN
public static final HealthCheck EMPTY_HEALTH_CHECK
public static final String EMPTY_NETWORK_MODE
public Job(JobId id, String image, @Nullable List<String> command, @Nullable Map<String,String> env, @Nullable Resources resources, @Nullable Map<String,PortMapping> ports, @Nullable Map<ServiceEndpoint,ServicePorts> registration, @Nullable Integer gracePeriod, @Nullable Map<String,String> volumes, @Nullable Date expires, @Nullable String registrationDomain, @Nullable String creatingUser, @Nullable String token, @Nullable HealthCheck healthCheck, @Nullable List<String> securityOpt, @Nullable String networkMode)
id - The id of the job.image - The docker image to use.command - The command to pass to the container.env - Environment variables to setresources - Resource specification for the container.ports - The ports you wish to expose from the container.registration - Configuration information for the discovery service (if applicable)gracePeriod - How long to let the container run after deregistering with the discovery
service. If nothing is configured in registration, this option is ignored.volumes - Docker volumes to mount.expires - If set, a timestamp at which the job and any deployments will be removed.registrationDomain - If set, overrides the default domain in which discovery service
registration occurs. What is allowed here will vary based upon the discovery service
plugin used.creatingUser - The user creating the job.token - The token needed to manipulate this job.healthCheck - A health check Helios will execute on the container.securityOpt - A list of strings denoting security options for running Docker containers,
i.e. `docker run --security-opt`.
See Docker docs.networkMode - Sets the networking mode for the container. Supported values are: bridge,
host, and container:<name|id>.
See Docker docs.public JobId getId()
public String getImage()
public Resources getResources()
public Map<String,PortMapping> getPorts()
public Map<ServiceEndpoint,ServicePorts> getRegistration()
public String getRegistrationDomain()
public Integer getGracePeriod()
public Date getExpires()
public String getCreatingUser()
public String getToken()
public HealthCheck getHealthCheck()
public String getNetworkMode()
public static Job.Builder newBuilder()
public int compareTo(@NotNull
Job o)
compareTo in interface Comparable<Job>public Job.Builder toBuilder()
Copyright © 2015. All rights reserved.