Statefile
In Nanocl, a Statefile
refers to a file that will containt the current state you want.
It will help you manage your Cargoes
, Virtual Machines
, Resources
, Jobs
and Secrets
.
ApiVersion required | string Api version to use or remote url |
Array of objects or null (StatefileArg) Arguments to pass to the Statefile | |
Array of objects or null (CargoSpecPartial) List of cargoes to create and run | |
Group | string or null Set the group of defined objects default to |
Array of objects or null (JobPartial) List of jobs to create and run | |
Namespace | string or null Namespace where the cargoes and virtual machines are deployed |
Array of objects or null (ResourcePartial) List of resources to create | |
Array of objects or null (SecretPartial) List of secrets to create | |
Array of strings or SubStateDef (object) or null (SubState) Include sub states that will be applied before the current state | |
Array of objects or null (VmSpecPartial) List of virtual machines to create and run |
{- "ApiVersion": "string",
- "Args": [
- {
- "Name": "string",
- "Kind": "String",
- "Default": "string"
}
], - "SubStates": [
- "string"
], - "Group": "string",
- "Namespace": "string",
- "Secrets": [
- {
- "Name": "string",
- "Kind": "string",
- "Immutable": true,
- "Metadata": {
- "property1": "string",
- "property2": "string"
}, - "Data": {
- "property1": "string",
- "property2": "string"
}
}
], - "Resources": [
- {
- "Name": "string",
- "Kind": "string",
- "Data": {
- "property1": "string",
- "property2": "string"
}, - "Metadata": {
- "property1": "string",
- "property2": "string"
}
}
], - "Cargoes": [
- {
- "Name": "string",
- "Metadata": {
- "property1": "string",
- "property2": "string"
}, - "InitContainer": {
- "Hostname": "string",
- "Domainname": "string",
- "User": "string",
- "AttachStdin": true,
- "AttachStdout": true,
- "AttachStderr": true,
- "ExposedPorts": {
- "property1": { },
- "property2": { }
}, - "Tty": true,
- "OpenStdin": true,
- "StdinOnce": true,
- "Env": [
- "string"
], - "Cmd": [
- "string"
], - "Healthcheck": {
- "Test": [
- "string"
], - "Interval": 0,
- "Timeout": 0,
- "Retries": 0,
- "StartPeriod": 0,
- "StartInterval": 0
}, - "ArgsEscaped": true,
- "Image": "string",
- "Volumes": {
- "property1": { },
- "property2": { }
}, - "WorkingDir": "string",
- "Entrypoint": [
- "string"
], - "NetworkDisabled": true,
- "MacAddress": "string",
- "OnBuild": [
- "string"
], - "Labels": {
- "property1": "string",
- "property2": "string"
}, - "StopSignal": "string",
- "StopTimeout": 0,
- "Shell": [
- "string"
], - "HostConfig": {
- "CpuShares": 0,
- "Memory": 0,
- "CgroupParent": "string",
- "BlkioWeight": 0,
- "BlkioWeightDevice": [
- {
- "Path": "string",
- "Weight": 0
}
], - "BlkioDeviceReadBps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceWriteBps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceReadIOps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceWriteIOps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "CpuPeriod": 0,
- "CpuQuota": 0,
- "CpuRealtimePeriod": 0,
- "CpuRealtimeRuntime": 0,
- "CpusetCpus": "string",
- "CpusetMems": "string",
- "Devices": [
- {
- "PathOnHost": "string",
- "PathInContainer": "string",
- "CgroupPermissions": "string"
}
], - "DeviceCgroupRules": [
- "string"
], - "DeviceRequests": [
- {
- "Driver": "string",
- "Count": 0,
- "DeviceIDs": [
- "string"
], - "Capabilities": [
- [
- "string"
]
], - "Options": {
- "property1": "string",
- "property2": "string"
}
}
], - "KernelMemoryTCP": 0,
- "MemoryReservation": 0,
- "MemorySwap": 0,
- "MemorySwappiness": 0,
- "NanoCpus": 0,
- "OomKillDisable": true,
- "Init": true,
- "PidsLimit": 0,
- "Ulimits": [
- {
- "Name": "string",
- "Soft": 0,
- "Hard": 0
}
], - "CpuCount": 0,
- "CpuPercent": 0,
- "IOMaximumIOps": 0,
- "IOMaximumBandwidth": 0,
- "Binds": [
- "string"
], - "ContainerIDFile": "string",
- "LogConfig": {
- "Type": "string",
- "Config": {
- "property1": "string",
- "property2": "string"
}
}, - "NetworkMode": "string",
- "PortBindings": {
- "<port/tcp|udp>": [
- {
- "HostPort": "string",
- "HostIp": "string"
}
]
}, - "RestartPolicy": {
- "Name": "EMPTY",
- "MaximumRetryCount": 0
}, - "AutoRemove": true,
- "VolumeDriver": "string",
- "VolumesFrom": [
- "string"
], - "Mounts": [
- {
- "Target": "string",
- "Source": "string",
- "Type": "EMPTY",
- "ReadOnly": true,
- "Consistency": "string",
- "BindOptions": {
- "Propagation": "EMPTY",
- "NonRecursive": true,
- "CreateMountpoint": true,
- "ReadOnlyNonRecursive": true,
- "ReadOnlyForceRecursive": true
}, - "VolumeOptions": {
- "NoCopy": true,
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "DriverConfig": {
- "Name": "string",
- "Options": {
- "property1": null,
- "property2": null
}
}
}, - "TmpfsOptions": {
- "SizeBytes": 0,
- "Mode": 0
}
}
], - "ConsoleSize": [
- 0
], - "Annotations": {
- "property1": "string",
- "property2": "string"
}, - "CapAdd": [
- "string"
], - "CapDrop": [
- "string"
], - "CgroupnsMode": "EMPTY",
- "Dns": [
- "string"
], - "DnsOptions": [
- "string"
], - "DnsSearch": [
- "string"
], - "ExtraHosts": [
- "string"
], - "GroupAdd": [
- "string"
], - "IpcMode": "string",
- "Cgroup": "string",
- "Links": [
- "string"
], - "OomScoreAdj": 0,
- "PidMode": "string",
- "Privileged": true,
- "PublishAllPorts": true,
- "ReadonlyRootfs": true,
- "SecurityOpt": [
- "string"
], - "StorageOpt": {
- "property1": "string",
- "property2": "string"
}, - "Tmpfs": {
- "property1": "string",
- "property2": "string"
}, - "UTSMode": "string",
- "UsernsMode": "string",
- "ShmSize": 0,
- "Sysctls": {
- "property1": "string",
- "property2": "string"
}, - "Runtime": "string",
- "Isolation": "EMPTY",
- "MaskedPaths": [
- "string"
], - "ReadonlyPaths": [
- "string"
]
}, - "NetworkingConfig": {
- "EndpointsConfig": {
- "property1": {
- "IPAMConfig": {
- "IPv4Address": "string",
- "IPv6Address": "string",
- "LinkLocalIPs": [
- "string"
]
}, - "Links": [
- "string"
], - "MacAddress": "string",
- "Aliases": [
- "string"
], - "NetworkID": "string",
- "EndpointID": "string",
- "Gateway": "string",
- "IPAddress": "string",
- "IPPrefixLen": 0,
- "IPv6Gateway": "string",
- "GlobalIPv6Address": "string",
- "GlobalIPv6PrefixLen": 0,
- "DriverOpts": {
- "property1": "string",
- "property2": "string"
}, - "DNSNames": [
- "string"
]
}, - "property2": {
- "IPAMConfig": {
- "IPv4Address": "string",
- "IPv6Address": "string",
- "LinkLocalIPs": [
- "string"
]
}, - "Links": [
- "string"
], - "MacAddress": "string",
- "Aliases": [
- "string"
], - "NetworkID": "string",
- "EndpointID": "string",
- "Gateway": "string",
- "IPAddress": "string",
- "IPPrefixLen": 0,
- "IPv6Gateway": "string",
- "GlobalIPv6Address": "string",
- "GlobalIPv6PrefixLen": 0,
- "DriverOpts": {
- "property1": "string",
- "property2": "string"
}, - "DNSNames": [
- "string"
]
}
}
}
}, - "Secrets": [
- "string"
], - "ImagePullSecret": "string",
- "ImagePullPolicy": "Never",
- "Container": {
- "Hostname": "string",
- "Domainname": "string",
- "User": "string",
- "AttachStdin": true,
- "AttachStdout": true,
- "AttachStderr": true,
- "ExposedPorts": {
- "property1": { },
- "property2": { }
}, - "Tty": true,
- "OpenStdin": true,
- "StdinOnce": true,
- "Env": [
- "string"
], - "Cmd": [
- "string"
], - "Healthcheck": {
- "Test": [
- "string"
], - "Interval": 0,
- "Timeout": 0,
- "Retries": 0,
- "StartPeriod": 0,
- "StartInterval": 0
}, - "ArgsEscaped": true,
- "Image": "string",
- "Volumes": {
- "property1": { },
- "property2": { }
}, - "WorkingDir": "string",
- "Entrypoint": [
- "string"
], - "NetworkDisabled": true,
- "MacAddress": "string",
- "OnBuild": [
- "string"
], - "Labels": {
- "property1": "string",
- "property2": "string"
}, - "StopSignal": "string",
- "StopTimeout": 0,
- "Shell": [
- "string"
], - "HostConfig": {
- "CpuShares": 0,
- "Memory": 0,
- "CgroupParent": "string",
- "BlkioWeight": 0,
- "BlkioWeightDevice": [
- {
- "Path": "string",
- "Weight": 0
}
], - "BlkioDeviceReadBps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceWriteBps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceReadIOps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceWriteIOps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "CpuPeriod": 0,
- "CpuQuota": 0,
- "CpuRealtimePeriod": 0,
- "CpuRealtimeRuntime": 0,
- "CpusetCpus": "string",
- "CpusetMems": "string",
- "Devices": [
- {
- "PathOnHost": "string",
- "PathInContainer": "string",
- "CgroupPermissions": "string"
}
], - "DeviceCgroupRules": [
- "string"
], - "DeviceRequests": [
- {
- "Driver": "string",
- "Count": 0,
- "DeviceIDs": [
- "string"
], - "Capabilities": [
- [
- "string"
]
], - "Options": {
- "property1": "string",
- "property2": "string"
}
}
], - "KernelMemoryTCP": 0,
- "MemoryReservation": 0,
- "MemorySwap": 0,
- "MemorySwappiness": 0,
- "NanoCpus": 0,
- "OomKillDisable": true,
- "Init": true,
- "PidsLimit": 0,
- "Ulimits": [
- {
- "Name": "string",
- "Soft": 0,
- "Hard": 0
}
], - "CpuCount": 0,
- "CpuPercent": 0,
- "IOMaximumIOps": 0,
- "IOMaximumBandwidth": 0,
- "Binds": [
- "string"
], - "ContainerIDFile": "string",
- "LogConfig": {
- "Type": "string",
- "Config": {
- "property1": "string",
- "property2": "string"
}
}, - "NetworkMode": "string",
- "PortBindings": {
- "<port/tcp|udp>": [
- {
- "HostPort": "string",
- "HostIp": "string"
}
]
}, - "RestartPolicy": {
- "Name": "EMPTY",
- "MaximumRetryCount": 0
}, - "AutoRemove": true,
- "VolumeDriver": "string",
- "VolumesFrom": [
- "string"
], - "Mounts": [
- {
- "Target": "string",
- "Source": "string",
- "Type": "EMPTY",
- "ReadOnly": true,
- "Consistency": "string",
- "BindOptions": {
- "Propagation": "EMPTY",
- "NonRecursive": true,
- "CreateMountpoint": true,
- "ReadOnlyNonRecursive": true,
- "ReadOnlyForceRecursive": true
}, - "VolumeOptions": {
- "NoCopy": true,
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "DriverConfig": {
- "Name": "string",
- "Options": {
- "property1": null,
- "property2": null
}
}
}, - "TmpfsOptions": {
- "SizeBytes": 0,
- "Mode": 0
}
}
], - "ConsoleSize": [
- 0
], - "Annotations": {
- "property1": "string",
- "property2": "string"
}, - "CapAdd": [
- "string"
], - "CapDrop": [
- "string"
], - "CgroupnsMode": "EMPTY",
- "Dns": [
- "string"
], - "DnsOptions": [
- "string"
], - "DnsSearch": [
- "string"
], - "ExtraHosts": [
- "string"
], - "GroupAdd": [
- "string"
], - "IpcMode": "string",
- "Cgroup": "string",
- "Links": [
- "string"
], - "OomScoreAdj": 0,
- "PidMode": "string",
- "Privileged": true,
- "PublishAllPorts": true,
- "ReadonlyRootfs": true,
- "SecurityOpt": [
- "string"
], - "StorageOpt": {
- "property1": "string",
- "property2": "string"
}, - "Tmpfs": {
- "property1": "string",
- "property2": "string"
}, - "UTSMode": "string",
- "UsernsMode": "string",
- "ShmSize": 0,
- "Sysctls": {
- "property1": "string",
- "property2": "string"
}, - "Runtime": "string",
- "Isolation": "EMPTY",
- "MaskedPaths": [
- "string"
], - "ReadonlyPaths": [
- "string"
]
}, - "NetworkingConfig": {
- "EndpointsConfig": {
- "property1": {
- "IPAMConfig": {
- "IPv4Address": "string",
- "IPv6Address": "string",
- "LinkLocalIPs": [
- "string"
]
}, - "Links": [
- "string"
], - "MacAddress": "string",
- "Aliases": [
- "string"
], - "NetworkID": "string",
- "EndpointID": "string",
- "Gateway": "string",
- "IPAddress": "string",
- "IPPrefixLen": 0,
- "IPv6Gateway": "string",
- "GlobalIPv6Address": "string",
- "GlobalIPv6PrefixLen": 0,
- "DriverOpts": {
- "property1": "string",
- "property2": "string"
}, - "DNSNames": [
- "string"
]
}, - "property2": {
- "IPAMConfig": {
- "IPv4Address": "string",
- "IPv6Address": "string",
- "LinkLocalIPs": [
- "string"
]
}, - "Links": [
- "string"
], - "MacAddress": "string",
- "Aliases": [
- "string"
], - "NetworkID": "string",
- "EndpointID": "string",
- "Gateway": "string",
- "IPAddress": "string",
- "IPPrefixLen": 0,
- "IPv6Gateway": "string",
- "GlobalIPv6Address": "string",
- "GlobalIPv6PrefixLen": 0,
- "DriverOpts": {
- "property1": "string",
- "property2": "string"
}, - "DNSNames": [
- "string"
]
}
}
}
}, - "Replication": {
- "Mode": "Auto"
}
}
], - "VirtualMachines": [
- {
- "Name": "string",
- "Metadata": {
- "property1": "string",
- "property2": "string"
}, - "Hostname": "string",
- "User": "string",
- "Password": "string",
- "SshKey": "string",
- "Disk": {
- "Image": "string",
- "Size": 0
}, - "MacAddress": "string",
- "Labels": {
- "property1": "string",
- "property2": "string"
}, - "HostConfig": {
- "Cpu": 0,
- "Memory": 0,
- "NetIface": "string",
- "LinkNetIface": "string",
- "Kvm": true,
- "Dns": [
- "string"
], - "Runtime": "string",
- "RuntimeNetwork": "string",
- "HostTun": true
}
}
], - "Jobs": [
- {
- "Name": "string",
- "Secrets": [
- "string"
], - "Metadata": {
- "property1": "string",
- "property2": "string"
}, - "Schedule": "string",
- "Ttl": 0,
- "ImagePullSecret": "string",
- "ImagePullPolicy": "Never",
- "Containers": [
- {
- "Hostname": "string",
- "Domainname": "string",
- "User": "string",
- "AttachStdin": true,
- "AttachStdout": true,
- "AttachStderr": true,
- "ExposedPorts": {
- "property1": { },
- "property2": { }
}, - "Tty": true,
- "OpenStdin": true,
- "StdinOnce": true,
- "Env": [
- "string"
], - "Cmd": [
- "string"
], - "Healthcheck": {
- "Test": [
- "string"
], - "Interval": 0,
- "Timeout": 0,
- "Retries": 0,
- "StartPeriod": 0,
- "StartInterval": 0
}, - "ArgsEscaped": true,
- "Image": "string",
- "Volumes": {
- "property1": { },
- "property2": { }
}, - "WorkingDir": "string",
- "Entrypoint": [
- "string"
], - "NetworkDisabled": true,
- "MacAddress": "string",
- "OnBuild": [
- "string"
], - "Labels": {
- "property1": "string",
- "property2": "string"
}, - "StopSignal": "string",
- "StopTimeout": 0,
- "Shell": [
- "string"
], - "HostConfig": {
- "CpuShares": 0,
- "Memory": 0,
- "CgroupParent": "string",
- "BlkioWeight": 0,
- "BlkioWeightDevice": [
- {
- "Path": "string",
- "Weight": 0
}
], - "BlkioDeviceReadBps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceWriteBps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceReadIOps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "BlkioDeviceWriteIOps": [
- {
- "Path": "string",
- "Rate": 0
}
], - "CpuPeriod": 0,
- "CpuQuota": 0,
- "CpuRealtimePeriod": 0,
- "CpuRealtimeRuntime": 0,
- "CpusetCpus": "string",
- "CpusetMems": "string",
- "Devices": [
- {
- "PathOnHost": "string",
- "PathInContainer": "string",
- "CgroupPermissions": "string"
}
], - "DeviceCgroupRules": [
- "string"
], - "DeviceRequests": [
- {
- "Driver": "string",
- "Count": 0,
- "DeviceIDs": [
- "string"
], - "Capabilities": [
- [
- null
]
], - "Options": {
- "property1": "string",
- "property2": "string"
}
}
], - "KernelMemoryTCP": 0,
- "MemoryReservation": 0,
- "MemorySwap": 0,
- "MemorySwappiness": 0,
- "NanoCpus": 0,
- "OomKillDisable": true,
- "Init": true,
- "PidsLimit": 0,
- "Ulimits": [
- {
- "Name": "string",
- "Soft": 0,
- "Hard": 0
}
], - "CpuCount": 0,
- "CpuPercent": 0,
- "IOMaximumIOps": 0,
- "IOMaximumBandwidth": 0,
- "Binds": [
- "string"
], - "ContainerIDFile": "string",
- "LogConfig": {
- "Type": "string",
- "Config": {
- "property1": "string",
- "property2": "string"
}
}, - "NetworkMode": "string",
- "PortBindings": {
- "<port/tcp|udp>": [
- {
- "HostPort": "string",
- "HostIp": "string"
}
]
}, - "RestartPolicy": {
- "Name": "EMPTY",
- "MaximumRetryCount": 0
}, - "AutoRemove": true,
- "VolumeDriver": "string",
- "VolumesFrom": [
- "string"
], - "Mounts": [
- {
- "Target": "string",
- "Source": "string",
- "Type": "EMPTY",
- "ReadOnly": true,
- "Consistency": "string",
- "BindOptions": {
- "Propagation": "EMPTY",
- "NonRecursive": true,
- "CreateMountpoint": true,
- "ReadOnlyNonRecursive": true,
- "ReadOnlyForceRecursive": true
}, - "VolumeOptions": {
- "NoCopy": true,
- "Labels": {
- "property1": null,
- "property2": null
}, - "DriverConfig": {
- "Name": null,
- "Options": { }
}
}, - "TmpfsOptions": {
- "SizeBytes": 0,
- "Mode": 0
}
}
], - "ConsoleSize": [
- 0
], - "Annotations": {
- "property1": "string",
- "property2": "string"
}, - "CapAdd": [
- "string"
], - "CapDrop": [
- "string"
], - "CgroupnsMode": "EMPTY",
- "Dns": [
- "string"
], - "DnsOptions": [
- "string"
], - "DnsSearch": [
- "string"
], - "ExtraHosts": [
- "string"
], - "GroupAdd": [
- "string"
], - "IpcMode": "string",
- "Cgroup": "string",
- "Links": [
- "string"
], - "OomScoreAdj": 0,
- "PidMode": "string",
- "Privileged": true,
- "PublishAllPorts": true,
- "ReadonlyRootfs": true,
- "SecurityOpt": [
- "string"
], - "StorageOpt": {
- "property1": "string",
- "property2": "string"
}, - "Tmpfs": {
- "property1": "string",
- "property2": "string"
}, - "UTSMode": "string",
- "UsernsMode": "string",
- "ShmSize": 0,
- "Sysctls": {
- "property1": "string",
- "property2": "string"
}, - "Runtime": "string",
- "Isolation": "EMPTY",
- "MaskedPaths": [
- "string"
], - "ReadonlyPaths": [
- "string"
]
}, - "NetworkingConfig": {
- "EndpointsConfig": {
- "property1": {
- "IPAMConfig": {
- "IPv4Address": "string",
- "IPv6Address": "string",
- "LinkLocalIPs": [
- null
]
}, - "Links": [
- "string"
], - "MacAddress": "string",
- "Aliases": [
- "string"
], - "NetworkID": "string",
- "EndpointID": "string",
- "Gateway": "string",
- "IPAddress": "string",
- "IPPrefixLen": 0,
- "IPv6Gateway": "string",
- "GlobalIPv6Address": "string",
- "GlobalIPv6PrefixLen": 0,
- "DriverOpts": {
- "property1": "string",
- "property2": "string"
}, - "DNSNames": [
- "string"
]
}, - "property2": {
- "IPAMConfig": {
- "IPv4Address": "string",
- "IPv6Address": "string",
- "LinkLocalIPs": [
- null
]
}, - "Links": [
- "string"
], - "MacAddress": "string",
- "Aliases": [
- "string"
], - "NetworkID": "string",
- "EndpointID": "string",
- "Gateway": "string",
- "IPAddress": "string",
- "IPPrefixLen": 0,
- "IPv6Gateway": "string",
- "GlobalIPv6Address": "string",
- "GlobalIPv6PrefixLen": 0,
- "DriverOpts": {
- "property1": "string",
- "property2": "string"
}, - "DNSNames": [
- "string"
]
}
}
}
}
]
}
]
}