Class: AWSCDK::EC2::MultipartBody
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::EC2::MultipartBody
- Defined in:
- ec2/multipart_body.rb
Overview
The base class for all classes which can be used as MultipartUserData.
Class Method Summary collapse
-
.CLOUD_BOOTHOOK ⇒ String
Content type for boot hooks.
-
.from_raw_body(opts) ⇒ AWSCDK::EC2::MultipartBody
Constructs the raw
MultipartBodyusing specified body, content type and transfer encoding. -
.from_user_data(user_data, content_type = nil) ⇒ AWSCDK::EC2::MultipartBody
Constructs the new
MultipartBodywrapping existingUserData. - .jsii_overridable_methods ⇒ Object
-
.SHELL_SCRIPT ⇒ String
Content type for shell scripts.
Instance Method Summary collapse
-
#initialize ⇒ MultipartBody
constructor
A new instance of MultipartBody.
-
#render_body_part ⇒ Array<String>
Render body part as the string.
Constructor Details
#initialize ⇒ MultipartBody
Returns a new instance of MultipartBody.
8 9 10 |
# File 'ec2/multipart_body.rb', line 8 def initialize Jsii::Object.instance_method(:initialize).bind(self).call end |
Class Method Details
.CLOUD_BOOTHOOK ⇒ String
Content type for boot hooks.
47 48 49 |
# File 'ec2/multipart_body.rb', line 47 def self.CLOUD_BOOTHOOK() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.MultipartBody", "CLOUD_BOOTHOOK") end |
.from_raw_body(opts) ⇒ AWSCDK::EC2::MultipartBody
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.
25 26 27 28 29 |
# File 'ec2/multipart_body.rb', line 25 def self.from_raw_body(opts) opts = opts.is_a?(Hash) ? ::AWSCDK::EC2::MultipartBodyOptions.new(**opts.transform_keys(&:to_sym)) : opts Jsii::Type.check_type(opts, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLk11bHRpcGFydEJvZHlPcHRpb25zIn0=")), "opts") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.MultipartBody", "fromRawBody", [opts]) end |
.from_user_data(user_data, content_type = nil) ⇒ AWSCDK::EC2::MultipartBody
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.
38 39 40 41 42 |
# File 'ec2/multipart_body.rb', line 38 def self.from_user_data(user_data, content_type = nil) Jsii::Type.check_type(user_data, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlVzZXJEYXRhIn0=")), "userData") Jsii::Type.check_type(content_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "contentType") unless content_type.nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.MultipartBody", "fromUserData", [user_data, content_type]) end |
.jsii_overridable_methods ⇒ Object
12 13 14 15 16 |
# File 'ec2/multipart_body.rb', line 12 def self.jsii_overridable_methods { :render_body_part => { kind: :method, name: "renderBodyPart", is_optional: false }, } end |
.SHELL_SCRIPT ⇒ String
Content type for shell scripts.
54 55 56 |
# File 'ec2/multipart_body.rb', line 54 def self.SHELL_SCRIPT() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_ec2.MultipartBody", "SHELL_SCRIPT") end |
Instance Method Details
#render_body_part ⇒ Array<String>
Render body part as the string.
Subclasses should not add leading nor trailing new line characters (\r \n)
63 64 65 |
# File 'ec2/multipart_body.rb', line 63 def render_body_part() jsii_call_method("renderBodyPart", []) end |