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 Details

  • Method Details

    • withName

      public CreateOSSandboxRequest withName(String sandboxName)
      Returns this request with a controller-owned sandbox name.
    • fromTemplate

      public static CreateOSSandboxRequest fromTemplate(SandboxTemplate template, String name)
      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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • shape

      public String shape()
      Returns the value of the shape record component.
      Returns:
      the value of the shape record component
    • rootfs

      public String rootfs()
      Returns the value of the rootfs record component.
      Returns:
      the value of the rootfs record component
    • region

      public String region()
      Returns the value of the region record component.
      Returns:
      the value of the region record component
    • diskMiB

      public int diskMiB()
      Returns the value of the diskMiB record component.
      Returns:
      the value of the diskMiB record component
    • networkIds

      public List<String> networkIds()
      Returns the value of the networkIds record component.
      Returns:
      the value of the networkIds record component
    • disks

      public List<CreateOSDiskAttachment> disks()
      Returns the value of the disks record component.
      Returns:
      the value of the disks record component