com.amazonaws.services.autoscaling.model.InstanceMetadataOptions Maven / Gradle / Ivy
Show all versions of aws-java-sdk-autoscaling Show documentation
/*
* Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.autoscaling.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* The metadata options for the instances. For more information, see Configuring the Instance Metadata Options in the Amazon EC2 Auto Scaling User Guide.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class InstanceMetadataOptions implements Serializable, Cloneable {
/**
*
* 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.
*
*/
private String httpTokens;
/**
*
* The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further
* instance metadata requests can travel.
*
*
* Default: 1
*
*/
private Integer httpPutResponseHopLimit;
/**
*
* 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.
*
*
*/
private String httpEndpoint;
/**
*
* 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.
*
*
* @param httpTokens
* 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.
* @see InstanceMetadataHttpTokensState
*/
public void setHttpTokens(String httpTokens) {
this.httpTokens = httpTokens;
}
/**
*
* 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.
*
*
* @return 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.
* @see InstanceMetadataHttpTokensState
*/
public String getHttpTokens() {
return this.httpTokens;
}
/**
*
* 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.
*
*
* @param httpTokens
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceMetadataHttpTokensState
*/
public InstanceMetadataOptions withHttpTokens(String httpTokens) {
setHttpTokens(httpTokens);
return this;
}
/**
*
* 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.
*
*
* @param httpTokens
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceMetadataHttpTokensState
*/
public InstanceMetadataOptions withHttpTokens(InstanceMetadataHttpTokensState httpTokens) {
this.httpTokens = httpTokens.toString();
return this;
}
/**
*
* The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further
* instance metadata requests can travel.
*
*
* Default: 1
*
*
* @param httpPutResponseHopLimit
* The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further
* instance metadata requests can travel.
*
* Default: 1
*/
public void setHttpPutResponseHopLimit(Integer httpPutResponseHopLimit) {
this.httpPutResponseHopLimit = httpPutResponseHopLimit;
}
/**
*
* The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further
* instance metadata requests can travel.
*
*
* Default: 1
*
*
* @return The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the
* further instance metadata requests can travel.
*
* Default: 1
*/
public Integer getHttpPutResponseHopLimit() {
return this.httpPutResponseHopLimit;
}
/**
*
* The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further
* instance metadata requests can travel.
*
*
* Default: 1
*
*
* @param httpPutResponseHopLimit
* The desired HTTP PUT response hop limit for instance metadata requests. The larger the number, the further
* instance metadata requests can travel.
*
* Default: 1
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceMetadataOptions withHttpPutResponseHopLimit(Integer httpPutResponseHopLimit) {
setHttpPutResponseHopLimit(httpPutResponseHopLimit);
return this;
}
/**
*
* 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.
*
*
*
* @param httpEndpoint
* 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.
*
* @see InstanceMetadataEndpointState
*/
public void setHttpEndpoint(String httpEndpoint) {
this.httpEndpoint = httpEndpoint;
}
/**
*
* 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.
*
*
*
* @return 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.
*
* @see InstanceMetadataEndpointState
*/
public String getHttpEndpoint() {
return this.httpEndpoint;
}
/**
*
* 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.
*
*
*
* @param httpEndpoint
* 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.
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceMetadataEndpointState
*/
public InstanceMetadataOptions withHttpEndpoint(String httpEndpoint) {
setHttpEndpoint(httpEndpoint);
return this;
}
/**
*
* 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.
*
*
*
* @param httpEndpoint
* 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.
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceMetadataEndpointState
*/
public InstanceMetadataOptions withHttpEndpoint(InstanceMetadataEndpointState httpEndpoint) {
this.httpEndpoint = httpEndpoint.toString();
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getHttpTokens() != null)
sb.append("HttpTokens: ").append(getHttpTokens()).append(",");
if (getHttpPutResponseHopLimit() != null)
sb.append("HttpPutResponseHopLimit: ").append(getHttpPutResponseHopLimit()).append(",");
if (getHttpEndpoint() != null)
sb.append("HttpEndpoint: ").append(getHttpEndpoint());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof InstanceMetadataOptions == false)
return false;
InstanceMetadataOptions other = (InstanceMetadataOptions) obj;
if (other.getHttpTokens() == null ^ this.getHttpTokens() == null)
return false;
if (other.getHttpTokens() != null && other.getHttpTokens().equals(this.getHttpTokens()) == false)
return false;
if (other.getHttpPutResponseHopLimit() == null ^ this.getHttpPutResponseHopLimit() == null)
return false;
if (other.getHttpPutResponseHopLimit() != null && other.getHttpPutResponseHopLimit().equals(this.getHttpPutResponseHopLimit()) == false)
return false;
if (other.getHttpEndpoint() == null ^ this.getHttpEndpoint() == null)
return false;
if (other.getHttpEndpoint() != null && other.getHttpEndpoint().equals(this.getHttpEndpoint()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getHttpTokens() == null) ? 0 : getHttpTokens().hashCode());
hashCode = prime * hashCode + ((getHttpPutResponseHopLimit() == null) ? 0 : getHttpPutResponseHopLimit().hashCode());
hashCode = prime * hashCode + ((getHttpEndpoint() == null) ? 0 : getHttpEndpoint().hashCode());
return hashCode;
}
@Override
public InstanceMetadataOptions clone() {
try {
return (InstanceMetadataOptions) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}