pub struct Builder { /* private fields */ }Expand description
A builder for InstanceMetadataOptions.
Implementations§
source§impl Builder
impl Builder
sourcepub fn http_tokens(self, input: InstanceMetadataHttpTokensState) -> Self
pub fn http_tokens(self, input: InstanceMetadataHttpTokensState) -> Self
The state of token usage for your instance metadata requests. If the parameter is not specified in the request, the default state is optional.
If the state is optional, you can choose to retrieve instance metadata with or without a signed token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0 role credentials are returned.
If the state is required, you must send a signed token header with any instance metadata retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the version 1.0 credentials are not available.
sourcepub fn set_http_tokens(
self,
input: Option<InstanceMetadataHttpTokensState>
) -> Self
pub fn set_http_tokens(
self,
input: Option<InstanceMetadataHttpTokensState>
) -> Self
The state of token usage for your instance metadata requests. If the parameter is not specified in the request, the default state is optional.
If the state is optional, you can choose to retrieve instance metadata with or without a signed token header on your request. If you retrieve the IAM role credentials without a token, the version 1.0 role credentials are returned. If you retrieve the IAM role credentials using a valid signed token, the version 2.0 role credentials are returned.
If the state is required, you must send a signed token header with any instance metadata retrieval requests. In this state, retrieving the IAM role credentials always returns the version 2.0 credentials; the version 1.0 credentials are not available.
Examples found in repository?
5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475
pub fn deser_structure_crate_model_instance_metadata_options(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::InstanceMetadataOptions, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::InstanceMetadataOptions::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("HttpTokens") /* HttpTokens com.amazonaws.autoscaling#InstanceMetadataOptions$HttpTokens */ => {
let var_238 =
Some(
Result::<crate::model::InstanceMetadataHttpTokensState, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::InstanceMetadataHttpTokensState::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_http_tokens(var_238);
}
,
s if s.matches("HttpPutResponseHopLimit") /* HttpPutResponseHopLimit com.amazonaws.autoscaling#InstanceMetadataOptions$HttpPutResponseHopLimit */ => {
let var_239 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.autoscaling#InstanceMetadataHttpPutResponseHopLimit`)"))
}
?
)
;
builder = builder.set_http_put_response_hop_limit(var_239);
}
,
s if s.matches("HttpEndpoint") /* HttpEndpoint com.amazonaws.autoscaling#InstanceMetadataOptions$HttpEndpoint */ => {
let var_240 =
Some(
Result::<crate::model::InstanceMetadataEndpointState, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::InstanceMetadataEndpointState::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_http_endpoint(var_240);
}
,
_ => {}
}
}
Ok(builder.build())
}sourcepub fn http_put_response_hop_limit(self, input: i32) -> Self
pub fn http_put_response_hop_limit(self, input: i32) -> Self
The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel.
Default: 1
sourcepub fn set_http_put_response_hop_limit(self, input: Option<i32>) -> Self
pub fn set_http_put_response_hop_limit(self, input: Option<i32>) -> Self
The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further instance metadata requests can travel.
Default: 1
Examples found in repository?
5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475
pub fn deser_structure_crate_model_instance_metadata_options(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::InstanceMetadataOptions, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::InstanceMetadataOptions::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("HttpTokens") /* HttpTokens com.amazonaws.autoscaling#InstanceMetadataOptions$HttpTokens */ => {
let var_238 =
Some(
Result::<crate::model::InstanceMetadataHttpTokensState, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::InstanceMetadataHttpTokensState::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_http_tokens(var_238);
}
,
s if s.matches("HttpPutResponseHopLimit") /* HttpPutResponseHopLimit com.amazonaws.autoscaling#InstanceMetadataOptions$HttpPutResponseHopLimit */ => {
let var_239 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.autoscaling#InstanceMetadataHttpPutResponseHopLimit`)"))
}
?
)
;
builder = builder.set_http_put_response_hop_limit(var_239);
}
,
s if s.matches("HttpEndpoint") /* HttpEndpoint com.amazonaws.autoscaling#InstanceMetadataOptions$HttpEndpoint */ => {
let var_240 =
Some(
Result::<crate::model::InstanceMetadataEndpointState, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::InstanceMetadataEndpointState::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_http_endpoint(var_240);
}
,
_ => {}
}
}
Ok(builder.build())
}sourcepub fn http_endpoint(self, input: InstanceMetadataEndpointState) -> Self
pub fn http_endpoint(self, input: InstanceMetadataEndpointState) -> Self
This parameter enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the default state is enabled.
If you specify a value of disabled, you will not be able to access your instance metadata.
sourcepub fn set_http_endpoint(
self,
input: Option<InstanceMetadataEndpointState>
) -> Self
pub fn set_http_endpoint(
self,
input: Option<InstanceMetadataEndpointState>
) -> Self
This parameter enables or disables the HTTP metadata endpoint on your instances. If the parameter is not specified, the default state is enabled.
If you specify a value of disabled, you will not be able to access your instance metadata.
Examples found in repository?
5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475
pub fn deser_structure_crate_model_instance_metadata_options(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::InstanceMetadataOptions, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::InstanceMetadataOptions::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("HttpTokens") /* HttpTokens com.amazonaws.autoscaling#InstanceMetadataOptions$HttpTokens */ => {
let var_238 =
Some(
Result::<crate::model::InstanceMetadataHttpTokensState, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::InstanceMetadataHttpTokensState::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_http_tokens(var_238);
}
,
s if s.matches("HttpPutResponseHopLimit") /* HttpPutResponseHopLimit com.amazonaws.autoscaling#InstanceMetadataOptions$HttpPutResponseHopLimit */ => {
let var_239 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.autoscaling#InstanceMetadataHttpPutResponseHopLimit`)"))
}
?
)
;
builder = builder.set_http_put_response_hop_limit(var_239);
}
,
s if s.matches("HttpEndpoint") /* HttpEndpoint com.amazonaws.autoscaling#InstanceMetadataOptions$HttpEndpoint */ => {
let var_240 =
Some(
Result::<crate::model::InstanceMetadataEndpointState, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::InstanceMetadataEndpointState::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_http_endpoint(var_240);
}
,
_ => {}
}
}
Ok(builder.build())
}sourcepub fn build(self) -> InstanceMetadataOptions
pub fn build(self) -> InstanceMetadataOptions
Consumes the builder and constructs a InstanceMetadataOptions.
Examples found in repository?
5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475
pub fn deser_structure_crate_model_instance_metadata_options(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::InstanceMetadataOptions, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::InstanceMetadataOptions::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("HttpTokens") /* HttpTokens com.amazonaws.autoscaling#InstanceMetadataOptions$HttpTokens */ => {
let var_238 =
Some(
Result::<crate::model::InstanceMetadataHttpTokensState, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::InstanceMetadataHttpTokensState::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_http_tokens(var_238);
}
,
s if s.matches("HttpPutResponseHopLimit") /* HttpPutResponseHopLimit com.amazonaws.autoscaling#InstanceMetadataOptions$HttpPutResponseHopLimit */ => {
let var_239 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.autoscaling#InstanceMetadataHttpPutResponseHopLimit`)"))
}
?
)
;
builder = builder.set_http_put_response_hop_limit(var_239);
}
,
s if s.matches("HttpEndpoint") /* HttpEndpoint com.amazonaws.autoscaling#InstanceMetadataOptions$HttpEndpoint */ => {
let var_240 =
Some(
Result::<crate::model::InstanceMetadataEndpointState, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::InstanceMetadataEndpointState::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_http_endpoint(var_240);
}
,
_ => {}
}
}
Ok(builder.build())
}