Package-level declarations

Types

Link copied to clipboard
class FakeIot(jobs: Storage<StoredJob> = Storage.InMemory(), streams: Storage<StoredStream> = Storage.InMemory(), certificates: Storage<StoredCertificate> = Storage.InMemory(), region: Region = Region.of("ldn-north-1"), clock: Clock = Clock.systemUTC()) : ChaoticHttpHandler

The AWS IoT control plane, of which the Jobs and stream operations are implemented. Share the jobs storage with a FakeIotJobsDataPlane and the control plane and the device API see one jobs state.

Link copied to clipboard
data class StoredCertificate(val certificateId: CertificateId, val certificateArn: ARN, val status: CertificateStatus, val certificatePem: String? = null, val caCertificateId: CertificateId? = null, val ownedBy: String? = null, val customerVersion: Int? = null, val generationId: String? = null, val certificateMode: CertificateMode? = null, val notBefore: Timestamp? = null, val notAfter: Timestamp? = null, val creationDate: Timestamp, val lastModifiedDate: Timestamp)
Link copied to clipboard
data class StoredJob(val jobId: JobId, val jobArn: ARN, val targets: List<ARN>, val document: String?, val description: String?, val targetSelection: TargetSelection, val status: JobStatus, val comment: String?, val forceCanceled: Boolean?, val timeoutConfig: TimeoutConfig?, val createdAt: Timestamp, val lastUpdatedAt: Timestamp, val completedAt: Timestamp?, val executions: Map<ThingName, StoredJobExecution>)

The job record FakeIot keeps, keyed by jobId. Public so that a Storage can be shared with FakeIotJobsDataPlane: construct both fakes over the same Storage instance and the control plane and the device API see one jobs state.

Link copied to clipboard
data class StoredJobExecution(val thingName: ThingName, val thingArn: ARN, val status: JobExecutionStatus, val statusDetails: Map<String, String>, val queuedAt: Timestamp, val startedAt: Timestamp?, val lastUpdatedAt: Timestamp, val versionNumber: Long, val executionNumber: Long, val forceCanceled: Boolean? = null)
Link copied to clipboard
data class StoredStream(val streamId: StreamId, val streamArn: ARN, val streamVersion: Int, val files: List<StreamFile>, val roleArn: ARN, val description: String?, val createdAt: Timestamp, val lastUpdatedAt: Timestamp)

The stream record FakeIot keeps, keyed by streamId. A stream's bytes are not modelled: the fake records where they were said to be, since devices fetch them over MQTT rather than from this API.

Properties

Link copied to clipboard

Functions

Link copied to clipboard

The fake runs no live timers, so an in-progress execution of a job with a timeout config always reports its full budget as remaining.

Link copied to clipboard

When every execution of an in-progress SNAPSHOT job is terminal, the job completes.

Link copied to clipboard

Every (job, execution) pair for the thing, oldest first.

Link copied to clipboard
fun main()
Link copied to clipboard

The $next selection: the oldest IN_PROGRESS execution for the thing first, else the oldest QUEUED one, considering only jobs which are themselves still IN_PROGRESS. This is a read: callers decide whether the pick transitions.

Link copied to clipboard

The thing an arn:...:thing/NAME target names, or null for any other resource type - a thinggroup/NAME target most of all, whose tail is a group name and not a device.