Module types/output
APIs
- ContainerCapabilities
- ContainerDevice
- ContainerHealthcheck
- ContainerHost
- ContainerLabel
- ContainerMount
- ContainerMountBindOptions
- ContainerMountTmpfsOptions
- ContainerMountVolumeOptions
- ContainerMountVolumeOptionsLabel
- ContainerNetworkData
- ContainerNetworksAdvanced
- ContainerPort
- ContainerUlimit
- ContainerUpload
- ContainerVolume
- GetNetworkIpamConfig
- NetworkIpamConfig
- NetworkLabel
- SecretLabel
- ServiceAuth
- ServiceConvergeConfig
- ServiceEndpointSpec
- ServiceEndpointSpecPort
- ServiceLabel
- ServiceMode
- ServiceModeReplicated
- ServiceRollbackConfig
- ServiceTaskSpec
- ServiceTaskSpecContainerSpec
- ServiceTaskSpecContainerSpecConfig
- ServiceTaskSpecContainerSpecDnsConfig
- ServiceTaskSpecContainerSpecHealthcheck
- ServiceTaskSpecContainerSpecHost
- ServiceTaskSpecContainerSpecLabel
- ServiceTaskSpecContainerSpecMount
- ServiceTaskSpecContainerSpecMountBindOptions
- ServiceTaskSpecContainerSpecMountTmpfsOptions
- ServiceTaskSpecContainerSpecMountVolumeOptions
- ServiceTaskSpecContainerSpecMountVolumeOptionsLabel
- ServiceTaskSpecContainerSpecPrivileges
- ServiceTaskSpecContainerSpecPrivilegesCredentialSpec
- ServiceTaskSpecContainerSpecPrivilegesSeLinuxContext
- ServiceTaskSpecContainerSpecSecret
- ServiceTaskSpecLogDriver
- ServiceTaskSpecPlacement
- ServiceTaskSpecPlacementPlatform
- ServiceTaskSpecResources
- ServiceTaskSpecResourcesLimits
- ServiceTaskSpecResourcesLimitsGenericResources
- ServiceTaskSpecResourcesReservation
- ServiceTaskSpecResourcesReservationGenericResources
- ServiceTaskSpecRestartPolicy
- ServiceUpdateConfig
- VolumeLabel
APIs
interface ContainerCapabilities
interface ContainerCapabilitiesproperty adds
adds?: string[];list of linux capabilities to add.
property drops
drops?: string[];list of linux capabilities to drop.
interface ContainerDevice
interface ContainerDeviceproperty containerPath
containerPath?: undefined | string;The path in the container where the device will be binded.
property hostPath
hostPath: string;The path on the host where the device is located.
property permissions
permissions?: undefined | string;The cgroup permissions given to the
container to access the device.
Defaults to rwm.
interface ContainerHealthcheck
interface ContainerHealthcheckproperty interval
interval?: undefined | string;Time between running the check (ms|s|m|h). Default: 0s.
property retries
retries?: undefined | number;Consecutive failures needed to report unhealthy. Default: 0.
property startPeriod
startPeriod?: undefined | string;Start period for the container to initialize before counting retries towards unstable (ms|s|m|h). Default: 0s.
property tests
tests: string[];Command to run to check health. For example, to run curl -f http://localhost/health set the
command to be ["CMD", "curl", "-f", "http://localhost/health"].
property timeout
timeout?: undefined | string;Maximum time to allow one check to run (ms|s|m|h). Default: 0s.
interface ContainerHost
interface ContainerHostproperty host
host: string;Hostname to add.
property ip
ip: string;IP address this hostname should resolve to.
interface ContainerLabel
interface ContainerLabelproperty label
label: string;Name of the label
property value
value: string;Value of the label
interface ContainerMount
interface ContainerMountproperty bindOptions
bindOptions?: outputs.ContainerMountBindOptions;Optional configuration for the bind type.
property readOnly
readOnly?: undefined | false | true;If true, this volume will be readonly. Defaults to false.
property source
source?: undefined | string;The mount source (e.g., a volume name, a host path)
property target
target: string;The container path.
property tmpfsOptions
tmpfsOptions?: outputs.ContainerMountTmpfsOptions;Optional configuration for the tmpf type.
property type
type: string;The mount type: valid values are bind|volume|tmpfs.
property volumeOptions
volumeOptions?: outputs.ContainerMountVolumeOptions;Optional configuration for the volume type.
interface ContainerMountBindOptions
interface ContainerMountBindOptionsproperty propagation
propagation?: undefined | string;A propagation mode with the value.
interface ContainerMountTmpfsOptions
interface ContainerMountTmpfsOptionsproperty mode
mode?: undefined | number;The permission mode for the tmpfs mount in an integer.
property sizeBytes
sizeBytes?: undefined | number;The size for the tmpfs mount in bytes.
interface ContainerMountVolumeOptions
interface ContainerMountVolumeOptionsproperty driverName
driverName?: undefined | string;property driverOptions
driverOptions?: undefined | {[key: string]: string};Options for the driver.
property labels
labels?: ContainerMountVolumeOptionsLabel[];Adding labels.
property noCopy
noCopy?: undefined | false | true;Whether to populate volume with data from the target.
interface ContainerMountVolumeOptionsLabel
interface ContainerMountVolumeOptionsLabelproperty label
label: string;Name of the label
property value
value: string;Value of the label
interface ContainerNetworkData
interface ContainerNetworkDataproperty gateway
gateway: string;Deprecated: Use networkData instead. The network gateway of the container as read from its
NetworkSettings.
property ipAddress
ipAddress: string;Deprecated: Use networkData instead. The IP address of the container’s first network it.
property ipPrefixLength
ipPrefixLength: number;Deprecated: Use networkData instead. The IP prefix length of the container as read from its
NetworkSettings.
property networkName
networkName: string;interface ContainerNetworksAdvanced
interface ContainerNetworksAdvancedproperty aliases
aliases?: string[];The network aliases of the container in the specific network.
property ipv4Address
ipv4Address?: undefined | string;The IPV4 address of the container in the specific network.
property ipv6Address
ipv6Address?: undefined | string;The IPV6 address of the container in the specific network.
property name
name: string;The name of the network.
interface ContainerPort
interface ContainerPortproperty external
external: number;Port exposed out of the container. If not given a free random port >= 32768 will be used.
property internal
internal: number;Port within the container.
property ip
ip?: undefined | string;IP address this hostname should resolve to.
property protocol
protocol?: undefined | string;Protocol that can be used over this port,
defaults to tcp.
interface ContainerUlimit
interface ContainerUlimitproperty hard
hard: number;property name
name: string;property soft
soft: number;interface ContainerUpload
interface ContainerUploadproperty content
content?: undefined | string;Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
property contentBase64
contentBase64?: undefined | string;property executable
executable?: undefined | false | true;If true, the file will be uploaded with user executable permission. Defaults to false.
property file
file: string;path to a file in the container.
property source
source?: undefined | string;A filename that references a file which will be uploaded as the object content. This allows for large file uploads that do not get stored in state.
property sourceHash
sourceHash?: undefined | string;If using source, this will force an update if the file content has updated but the filename has not.
interface ContainerVolume
interface ContainerVolumeproperty containerPath
containerPath?: undefined | string;The path in the container where the device will be binded.
property fromContainer
fromContainer?: undefined | string;The container where the volume is coming from.
property hostPath
hostPath?: undefined | string;The path on the host where the device is located.
property readOnly
readOnly?: undefined | false | true;If true, this volume will be readonly. Defaults to false.
property volumeName
volumeName?: undefined | string;The name of the docker volume which should be mounted.
interface GetNetworkIpamConfig
interface GetNetworkIpamConfigproperty auxAddress
auxAddress?: undefined | {[key: string]: any};property gateway
gateway?: undefined | string;property ipRange
ipRange?: undefined | string;property subnet
subnet?: undefined | string;interface NetworkIpamConfig
interface NetworkIpamConfigproperty auxAddress
auxAddress?: undefined | {[key: string]: any};property gateway
gateway?: undefined | string;property ipRange
ipRange?: undefined | string;property subnet
subnet?: undefined | string;interface NetworkLabel
interface NetworkLabelproperty label
label: string;Name of the label
property value
value: string;Value of the label
interface SecretLabel
interface SecretLabelproperty label
label: string;Name of the label
property value
value: string;Value of the label
interface ServiceAuth
interface ServiceAuthproperty password
password?: undefined | string;The password to use for authenticating to the registry. If this is blank, the DOCKER_REGISTRY_PASS is also be checked.
property serverAddress
serverAddress: string;The address of the registry server
property username
username?: undefined | string;The username to use for authenticating to the registry. If this is blank, the DOCKER_REGISTRY_USER is also be checked.
interface ServiceConvergeConfig
interface ServiceConvergeConfigproperty delay
delay?: undefined | string;Time between each the check to check docker endpoint (ms|s|m|h). For example, to check if
all tasks are up when a service is created, or to check if all tasks are successfully updated on an update. Default: 7s.
property timeout
timeout?: undefined | string;The timeout of the service to reach the desired state (s|m). Default: 3m.
interface ServiceEndpointSpec
interface ServiceEndpointSpecproperty mode
mode: string;The mode of resolution to use for internal load balancing between tasks. (vip|dnsrr). Default: vip.
property ports
ports?: ServiceEndpointSpecPort[];See Ports below for details.
interface ServiceEndpointSpecPort
interface ServiceEndpointSpecPortproperty name
name?: undefined | string;The name of the Docker service.
property protocol
protocol?: undefined | string;Protocol that can be used over this port: tcp|udp|sctp. Default: tcp.
property publishMode
publishMode?: undefined | string;Represents the mode in which the port is to be published: ingress|host
property publishedPort
publishedPort: number;The port on the swarm hosts. If not set the value of targetPort will be used.
property targetPort
targetPort: number;Port inside the container.
interface ServiceLabel
interface ServiceLabelproperty label
label: string;Name of the label
property value
value: string;Value of the label
interface ServiceMode
interface ServiceModeproperty global
global?: undefined | false | true;set it to true to run the service in the global mode
property replicated
replicated: ServiceModeReplicated;, which contains atm only the amount of replicas
interface ServiceModeReplicated
interface ServiceModeReplicatedproperty replicas
replicas?: undefined | number;interface ServiceRollbackConfig
interface ServiceRollbackConfigproperty delay
delay?: undefined | string;Delay between restart attempts (ms|s|m|h)
all tasks are up when a service is created, or to check if all tasks are successfully updated on an update. Default: 7s.
property failureAction
failureAction?: undefined | string;Action on update failure: pause|continue|rollback.
property maxFailureRatio
maxFailureRatio?: undefined | string;The failure rate to tolerate during an update as float. Important: the floatneed to be wrapped in a string to avoid internal
casting and precision errors.
property monitor
monitor?: undefined | string;Duration after each task update to monitor for failure (ns|us|ms|s|m|h)
property order
order?: undefined | string;Update order either ‘stop-first’ or ‘start-first’.
property parallelism
parallelism?: undefined | number;The maximum number of tasks to be updated in one iteration simultaneously (0 to update all at once).
interface ServiceTaskSpec
interface ServiceTaskSpecproperty containerSpec
containerSpec: ServiceTaskSpecContainerSpec;See ContainerSpec below for details.
property forceUpdate
forceUpdate: number;A counter that triggers an update even if no relevant parameters have been changed. See Docker Spec.
property logDriver
logDriver?: outputs.ServiceTaskSpecLogDriver;See Log Driver below for details.
property networks
networks?: string[];Ids of the networks in which the container will be put in.
property placement
placement: ServiceTaskSpecPlacement;See Placement below for details.
property resources
resources: ServiceTaskSpecResources;See Resources below for details.
property restartPolicy
restartPolicy: ServiceTaskSpecRestartPolicy;See Restart Policy below for details.
property runtime
runtime: string;Runtime is the type of runtime specified for the task executor. See Docker Runtime.
interface ServiceTaskSpecContainerSpec
interface ServiceTaskSpecContainerSpecproperty args
args?: string[];Arguments to the command.
property commands
commands?: string[];The command to be run in the image.
property configs
configs?: ServiceTaskSpecContainerSpecConfig[];See Configs below for details.
property dir
dir?: undefined | string;The working directory for commands to run in.
property dnsConfig
dnsConfig: ServiceTaskSpecContainerSpecDnsConfig;See DNS Config below for details.
property env
env?: undefined | {[key: string]: string};A list of environment variables in the form VAR=value.
property groups
groups?: string[];A list of additional groups that the container process will run as.
property healthcheck
healthcheck: ServiceTaskSpecContainerSpecHealthcheck;See Healthcheck below for details.
property hostname
hostname?: undefined | string;The hostname to use for the container, as a valid RFC 1123 hostname.
property hosts
hosts?: ServiceTaskSpecContainerSpecHost[];property image
image: string;The image used to create the Docker service.
property isolation
isolation?: undefined | string;Isolation technology of the containers running the service. (Windows only). Valid values are: default|process|hyperv
property labels
labels?: ServiceTaskSpecContainerSpecLabel[];See Labels below for details.
property mounts
mounts?: ServiceTaskSpecContainerSpecMount[];See Mounts below for details.
property privileges
privileges?: outputs.ServiceTaskSpecContainerSpecPrivileges;See Privileges below for details.
property readOnly
readOnly?: undefined | false | true;Mount the container’s root filesystem as read only.
property secrets
secrets?: ServiceTaskSpecContainerSpecSecret[];See Secrets below for details.
property stopGracePeriod
stopGracePeriod: string;Amount of time to wait for the container to terminate before forcefully removing it (ms|s|m|h).
property stopSignal
stopSignal?: undefined | string;Signal to stop the container.
property user
user?: undefined | string;The user inside the container.
interface ServiceTaskSpecContainerSpecConfig
interface ServiceTaskSpecContainerSpecConfigproperty configId
configId: string;ConfigID represents the ID of the specific config.
property configName
configName?: undefined | string;The name of the config that this references, but internally it is just provided for lookup/display purposes
property fileGid
fileGid?: undefined | string;Represents the file GID. Defaults: 0
property fileMode
fileMode?: undefined | number;Represents the FileMode of the file. Defaults: 0444
property fileName
fileName: string;Represents the final filename in the filesystem. The specific target file that the config data is written within the docker container, e.g. /root/config/config.json
property fileUid
fileUid?: undefined | string;Represents the file UID. Defaults: 0
interface ServiceTaskSpecContainerSpecDnsConfig
interface ServiceTaskSpecContainerSpecDnsConfigproperty nameservers
nameservers: string[];The IP addresses of the name servers, for example, 8.8.8.8
property options
options?: string[];A list of internal resolver variables to be modified, for example, debug, ndots:3
property searches
searches?: string[];A search list for host-name lookup.
interface ServiceTaskSpecContainerSpecHealthcheck
interface ServiceTaskSpecContainerSpecHealthcheckproperty interval
interval?: undefined | string;Time between running the check (ms|s|m|h). Default: 0s.
property retries
retries?: undefined | number;Consecutive failures needed to report unhealthy. Default: 0.
property startPeriod
startPeriod?: undefined | string;Start period for the container to initialize before counting retries towards unstable (ms|s|m|h). Default: 0s.
property tests
tests: string[];Command to run to check health. For example, to run curl -f http://localhost/health set the
command to be ["CMD", "curl", "-f", "http://localhost/health"].
property timeout
timeout?: undefined | string;Maximum time to allow one check to run (ms|s|m|h). Default: 0s.
interface ServiceTaskSpecContainerSpecHost
interface ServiceTaskSpecContainerSpecHostproperty host
host: string;A list of hostname/IP mappings to add to the container’s hosts file.
property ip
ip: string;The ip
interface ServiceTaskSpecContainerSpecLabel
interface ServiceTaskSpecContainerSpecLabelproperty label
label: string;Name of the label
property value
value: string;Value of the label
interface ServiceTaskSpecContainerSpecMount
interface ServiceTaskSpecContainerSpecMountproperty bindOptions
bindOptions?: outputs.ServiceTaskSpecContainerSpecMountBindOptions;Optional configuration for the bind type.
property readOnly
readOnly?: undefined | false | true;Mount the container’s root filesystem as read only.
property source
source?: undefined | string;The mount source (e.g., a volume name, a host path)
property target
target: string;The container path.
property tmpfsOptions
tmpfsOptions?: outputs.ServiceTaskSpecContainerSpecMountTmpfsOptions;Optional configuration for the tmpf type.
property type
type: string;SELinux type label
property volumeOptions
volumeOptions?: outputs.ServiceTaskSpecContainerSpecMountVolumeOptions;Optional configuration for the volume type.
interface ServiceTaskSpecContainerSpecMountBindOptions
interface ServiceTaskSpecContainerSpecMountBindOptionsproperty propagation
propagation?: undefined | string;A propagation mode with the value.
interface ServiceTaskSpecContainerSpecMountTmpfsOptions
interface ServiceTaskSpecContainerSpecMountTmpfsOptionsproperty mode
mode?: undefined | number;See Mode below for details.
property sizeBytes
sizeBytes?: undefined | number;The size for the tmpfs mount in bytes.
interface ServiceTaskSpecContainerSpecMountVolumeOptions
interface ServiceTaskSpecContainerSpecMountVolumeOptionsproperty driverName
driverName?: undefined | string;property driverOptions
driverOptions?: undefined | {[key: string]: string};property labels
labels?: ServiceTaskSpecContainerSpecMountVolumeOptionsLabel[];See Labels below for details.
property noCopy
noCopy?: undefined | false | true;Whether to populate volume with data from the target.
interface ServiceTaskSpecContainerSpecMountVolumeOptionsLabel
interface ServiceTaskSpecContainerSpecMountVolumeOptionsLabelproperty label
label: string;Name of the label
property value
value: string;Value of the label
interface ServiceTaskSpecContainerSpecPrivileges
interface ServiceTaskSpecContainerSpecPrivilegesproperty credentialSpec
credentialSpec?: outputs.ServiceTaskSpecContainerSpecPrivilegesCredentialSpec;For managed service account (Windows only)
property seLinuxContext
seLinuxContext?: outputs.ServiceTaskSpecContainerSpecPrivilegesSeLinuxContext;SELinux labels of the container
interface ServiceTaskSpecContainerSpecPrivilegesCredentialSpec
interface ServiceTaskSpecContainerSpecPrivilegesCredentialSpecproperty file
file?: undefined | string;Load credential spec from this file.
property registry
registry?: undefined | string;Load credential spec from this value in the Windows registry.
interface ServiceTaskSpecContainerSpecPrivilegesSeLinuxContext
interface ServiceTaskSpecContainerSpecPrivilegesSeLinuxContextproperty disable
disable?: undefined | false | true;Disable SELinux
property level
level?: undefined | string;SELinux level label
property role
role?: undefined | string;SELinux role label
property type
type?: undefined | string;SELinux type label
property user
user?: undefined | string;The user inside the container.
interface ServiceTaskSpecContainerSpecSecret
interface ServiceTaskSpecContainerSpecSecretproperty fileGid
fileGid?: undefined | string;Represents the file GID. Defaults: 0
property fileMode
fileMode?: undefined | number;Represents the FileMode of the file. Defaults: 0444
property fileName
fileName: string;Represents the final filename in the filesystem. The specific target file that the secret data is written within the docker container, e.g. /root/secret/secret.json
property fileUid
fileUid?: undefined | string;Represents the file UID. Defaults: 0
property secretId
secretId: string;ConfigID represents the ID of the specific secret.
property secretName
secretName?: undefined | string;The name of the secret that this references, but internally it is just provided for lookup/display purposes
interface ServiceTaskSpecLogDriver
interface ServiceTaskSpecLogDriverproperty name
name: string;The logging driver to use. Either (none|json-file|syslog|journald|gelf|fluentd|awslogs|splunk|etwlogs|gcplogs).
property options
options?: undefined | {[key: string]: string};The options for the logging driver, e.g.
interface ServiceTaskSpecPlacement
interface ServiceTaskSpecPlacementproperty constraints
constraints?: string[];An array of constraints. e.g.: node.role==manager
property platforms
platforms?: ServiceTaskSpecPlacementPlatform[];Platforms stores all the platforms that the service’s image can run on
property prefs
prefs?: string[];Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence, e.g.: spread=node.role.manager
interface ServiceTaskSpecPlacementPlatform
interface ServiceTaskSpecPlacementPlatformproperty architecture
architecture: string;The architecture, e.g., amd64
property os
os: string;The operation system, e.g., linux
interface ServiceTaskSpecResources
interface ServiceTaskSpecResourcesproperty limits
limits?: outputs.ServiceTaskSpecResourcesLimits;Describes the resources which can be advertised by a node and requested by a task.
property reservation
reservation?: outputs.ServiceTaskSpecResourcesReservation;An object describing the resources which can be advertised by a node and requested by a task.
interface ServiceTaskSpecResourcesLimits
interface ServiceTaskSpecResourcesLimitsproperty genericResources
genericResources?: outputs.ServiceTaskSpecResourcesLimitsGenericResources;User-defined resources can be either Integer resources (e.g, SSD=3) or String resources (e.g, GPU=UUID1)
property memoryBytes
memoryBytes?: undefined | number;The amount of memory in bytes the container allocates
property nanoCpus
nanoCpus?: undefined | number;CPU shares in units of 1/1e9 (or 10^-9) of the CPU. Should be at least 1000000
interface ServiceTaskSpecResourcesLimitsGenericResources
interface ServiceTaskSpecResourcesLimitsGenericResourcesproperty discreteResourcesSpecs
discreteResourcesSpecs?: string[];The Integer resources, delimited by =
property namedResourcesSpecs
namedResourcesSpecs?: string[];The String resources, delimited by =
interface ServiceTaskSpecResourcesReservation
interface ServiceTaskSpecResourcesReservationproperty genericResources
genericResources?: outputs.ServiceTaskSpecResourcesReservationGenericResources;User-defined resources can be either Integer resources (e.g, SSD=3) or String resources (e.g, GPU=UUID1)
property memoryBytes
memoryBytes?: undefined | number;The amount of memory in bytes the container allocates
property nanoCpus
nanoCpus?: undefined | number;CPU shares in units of 1/1e9 (or 10^-9) of the CPU. Should be at least 1000000
interface ServiceTaskSpecResourcesReservationGenericResources
interface ServiceTaskSpecResourcesReservationGenericResourcesproperty discreteResourcesSpecs
discreteResourcesSpecs?: string[];The Integer resources, delimited by =
property namedResourcesSpecs
namedResourcesSpecs?: string[];The String resources, delimited by =
interface ServiceTaskSpecRestartPolicy
interface ServiceTaskSpecRestartPolicyproperty condition
condition?: undefined | string;Condition for restart: (none|on-failure|any)
property delay
delay?: undefined | string;Delay between restart attempts (ms|s|m|h)
property maxAttempts
maxAttempts?: undefined | number;Maximum attempts to restart a given container before giving up (default value is 0, which is ignored)
property window
window?: undefined | string;The time window used to evaluate the restart policy (default value is 0, which is unbounded) (ms|s|m|h)
interface ServiceUpdateConfig
interface ServiceUpdateConfigproperty delay
delay?: undefined | string;Delay between updates (ns|us|ms|s|m|h), e.g. 5s.
property failureAction
failureAction?: undefined | string;Action on update failure: pause|continue|rollback.
property maxFailureRatio
maxFailureRatio?: undefined | string;The failure rate to tolerate during an update as float. Important: the floatneed to be wrapped in a string to avoid internal
casting and precision errors.
property monitor
monitor?: undefined | string;Duration after each task update to monitor for failure (ns|us|ms|s|m|h)
property order
order?: undefined | string;Update order either ‘stop-first’ or ‘start-first’.
property parallelism
parallelism?: undefined | number;The maximum number of tasks to be updated in one iteration simultaneously (0 to update all at once).
interface VolumeLabel
interface VolumeLabelproperty label
label: string;property value
value: string;