public class Job extends Descriptor implements Comparable<Job>
{
"command" : [ "server", "serverconfig.yaml" ],
"env" : {
"JVM_ARGS" : "-Ddw.feature.randomFeatureFlagEnabled=true"
},
"expires" : null,
"id" : "myservice:0.5:3539b7bc2235d53f79e6e8511942bbeaa8816265",
"image" : "myregistry:80/janedoe/myservice:0.5-98c6ff4",
"ports" : {
"http" : {
"externalPort" : 8060,
"internalPort" : 8080,
"protocol" : "tcp"
},
"http-admin" : {
"externalPort" : 8061,
"internalPort" : 8081,
"protocol" : "tcp"
}
},
"registration" : {
"service/http" : {
"ports" : {
"http" : { }
}
}
},
"registrationDomain" : "",
"volumes" : {
"/path/to/mysecretconfig.yaml:ro:ro" : "/path/to/mysecretconfig.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 String |
EMPTY_MOUNT |
static Map<String,PortMapping> |
EMPTY_PORTS |
static Map<ServiceEndpoint,ServicePorts> |
EMPTY_REGISTRATION |
static String |
EMPTY_REGISTRATION_DOMAIN |
static Resources |
EMPTY_RESOURCES |
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)
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() |
JobId |
getId() |
String |
getImage() |
Map<String,PortMapping> |
getPorts() |
Map<ServiceEndpoint,ServicePorts> |
getRegistration() |
String |
getRegistrationDomain() |
Resources |
getResources() |
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 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)
id - The id if 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, override the default domain in which discovery service
registration occurs. What is allowed here will vary based upon the discovery service
plugin used.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 static Job.Builder newBuilder()
public int compareTo(Job o)
compareTo in interface Comparable<Job>public Job.Builder toBuilder()
Copyright © 2014. All rights reserved.