Show / Hide Table of Contents

Class MultipartBody

The base class for all classes which can be used as {@link MultipartUserData}.

Inheritance
System.Object
MultipartBody
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public abstract class MultipartBody : DeputyBase
Syntax (vb)
Public MustInherit Class MultipartBody
    Inherits DeputyBase
Remarks

ExampleMetadata: infused

Examples
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");

Synopsis

Constructors

MultipartBody()
MultipartBody(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

MultipartBody(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

Properties

CLOUD_BOOTHOOK

Content type for boot hooks.

SHELL_SCRIPT

Content type for shell scripts.

Methods

FromRawBody(IMultipartBodyOptions)

Constructs the raw MultipartBody using specified body, content type and transfer encoding.

FromUserData(UserData, String)

Constructs the new MultipartBody wrapping existing UserData. Modification to UserData are reflected in subsequent renders of the part.

RenderBodyPart()

Render body part as the string.

Constructors

MultipartBody()

protected MultipartBody()

MultipartBody(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected MultipartBody(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

MultipartBody(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected MultipartBody(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

Properties

CLOUD_BOOTHOOK

Content type for boot hooks.

public static string CLOUD_BOOTHOOK { get; }
Property Value

System.String

SHELL_SCRIPT

Content type for shell scripts.

public static string SHELL_SCRIPT { get; }
Property Value

System.String

Methods

FromRawBody(IMultipartBodyOptions)

Constructs the raw MultipartBody using specified body, content type and transfer encoding.

public static MultipartBody FromRawBody(IMultipartBodyOptions opts)
Parameters
opts IMultipartBodyOptions
Returns

MultipartBody

Remarks

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.

FromUserData(UserData, String)

Constructs the new MultipartBody wrapping existing UserData. Modification to UserData are reflected in subsequent renders of the part.

public static MultipartBody FromUserData(UserData userData, string contentType = null)
Parameters
userData UserData

user data to wrap into body part.

contentType System.String

optional content type, if default one should not be used.

Returns

MultipartBody

Remarks

For more information about content types see {@link MultipartBodyOptions.contentType}.

RenderBodyPart()

Render body part as the string.

public abstract string[] RenderBodyPart()
Returns

System.String[]

Remarks

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

Back to top Generated by DocFX