Package sh.createos.jenkins.sandbox
Record Class CreateOSSandboxRequest
java.lang.Object
java.lang.Record
sh.createos.jenkins.sandbox.CreateOSSandboxRequest
public record CreateOSSandboxRequest(String name, String shape, String rootfs, String region, int diskMiB, List<String> networkIds, List<CreateOSDiskAttachment> disks)
extends Record
Immutable inputs for a CreateOS sandbox create request.
-
Constructor Summary
ConstructorsConstructorDescriptionCreateOSSandboxRequest(String name, String shape, String rootfs, String region, int diskMiB, List<String> networkIds, List<CreateOSDiskAttachment> disks) Copies the collections so a caller cannot mutate a request after it is built. -
Method Summary
Modifier and TypeMethodDescriptionintdiskMiB()Returns the value of thediskMiBrecord component.disks()Returns the value of thedisksrecord component.final booleanIndicates whether some other object is "equal to" this one.static CreateOSSandboxRequestfromTemplate(SandboxTemplate template, String name) Builds a sandbox create request that names the sandbox after the agent it will back.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of thenetworkIdsrecord component.region()Returns the value of theregionrecord component.rootfs()Returns the value of therootfsrecord component.shape()Returns the value of theshaperecord component.final StringtoString()Returns a string representation of this record class.Returns this request with a controller-owned sandbox name.
-
Constructor Details
-
Method Details
-
withName
Returns this request with a controller-owned sandbox name. -
fromTemplate
Builds a sandbox create request that names the sandbox after the agent it will back.The name is what lets the controller recognize its own sandboxes later: an agent whose node disappeared leaves a sandbox nobody would otherwise be able to attribute, and billing continues until someone notices.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
shape
Returns the value of theshaperecord component.- Returns:
- the value of the
shaperecord component
-
rootfs
Returns the value of therootfsrecord component.- Returns:
- the value of the
rootfsrecord component
-
region
Returns the value of theregionrecord component.- Returns:
- the value of the
regionrecord component
-
diskMiB
public int diskMiB()Returns the value of thediskMiBrecord component.- Returns:
- the value of the
diskMiBrecord component
-
networkIds
Returns the value of thenetworkIdsrecord component.- Returns:
- the value of the
networkIdsrecord component
-
disks
Returns the value of thedisksrecord component.- Returns:
- the value of the
disksrecord component
-