Class MultipartBody

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ec2.MultipartBody
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:00.972Z") @Stability(Stable) public abstract class MultipartBody extends software.amazon.jsii.JsiiObject
The base class for all classes which can be used as MultipartUserData.

Example:

 MultipartUserData multipartUserData = new MultipartUserData();
 UserData commandsUserData = UserData.forLinux();
 multipartUserData.addUserDataPart(commandsUserData, MultipartBody.SHELL_SCRIPT, true);
 // Adding commands to the multipartUserData adds them to commandsUserData, and vice-versa.
 multipartUserData.addCommands("touch /root/multi.txt");
 commandsUserData.addCommands("touch /root/userdata.txt");
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Content type for boot hooks.
    static final String
    Content type for shell scripts.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    MultipartBody(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    MultipartBody(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Constructs the raw MultipartBody using specified body, content type and transfer encoding.
    Constructs the new MultipartBody wrapping existing UserData.
    fromUserData(UserData userData, String contentType)
    Constructs the new MultipartBody wrapping existing UserData.
    abstract List<String>
    Render body part as the string.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Field Details

    • CLOUD_BOOTHOOK

      @Stability(Stable) public static final String CLOUD_BOOTHOOK
      Content type for boot hooks.
    • SHELL_SCRIPT

      @Stability(Stable) public static final String SHELL_SCRIPT
      Content type for shell scripts.
  • Constructor Details

    • MultipartBody

      protected MultipartBody(software.amazon.jsii.JsiiObjectRef objRef)
    • MultipartBody

      protected MultipartBody(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • MultipartBody

      @Stability(Stable) protected MultipartBody()
  • Method Details

    • fromRawBody

      @Stability(Stable) @NotNull public static MultipartBody fromRawBody(@NotNull MultipartBodyOptions opts)
      Constructs the raw MultipartBody using specified body, content type and transfer encoding.

      When transfer encoding is specified (typically as Base64), it's caller responsibility to convert body to Base64 either by wrapping with Fn.base64 or by converting it by other converters.

      Parameters:
      opts - This parameter is required.
    • fromUserData

      @Stability(Stable) @NotNull public static MultipartBody fromUserData(@NotNull UserData userData, @Nullable String contentType)
      Constructs the new MultipartBody wrapping existing UserData. Modification to UserData are reflected in subsequent renders of the part.

      For more information about content types see MultipartBodyOptions.contentType.

      Parameters:
      userData - user data to wrap into body part. This parameter is required.
      contentType - optional content type, if default one should not be used.
    • fromUserData

      @Stability(Stable) @NotNull public static MultipartBody fromUserData(@NotNull UserData userData)
      Constructs the new MultipartBody wrapping existing UserData. Modification to UserData are reflected in subsequent renders of the part.

      For more information about content types see MultipartBodyOptions.contentType.

      Parameters:
      userData - user data to wrap into body part. This parameter is required.
    • renderBodyPart

      @Stability(Stable) @NotNull public abstract List<String> renderBodyPart()
      Render body part as the string.

      Subclasses should not add leading nor trailing new line characters (\r \n)