/*
* Copyright 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.
*/
/*
* Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.EC2.Model
{
///
/// Container for the parameters to the ModifyInstanceAttribute operation.
/// Modifies the specified attribute of the specified instance. You can specify only one
/// attribute at a time.
///
///
///
/// Note: Using this action to change the security groups associated with an elastic
/// network interface (ENI) attached to an instance can result in an error if the instance
/// has more than one ENI. To change the security groups associated with an ENI attached
/// to an instance that has multiple ENIs, we recommend that you use the ModifyNetworkInterfaceAttribute
/// action.
///
///
///
/// To modify some attributes, the instance must be stopped. For more information, see
/// Modify
/// a stopped instance in the Amazon EC2 User Guide.
///
///
public partial class ModifyInstanceAttributeRequest : AmazonEC2Request
{
private InstanceAttributeName _attribute;
private List _blockDeviceMappings = new List();
private bool? _disableApiStop;
private bool? _disableApiTermination;
private bool? _ebsOptimized;
private bool? _enaSupport;
private List _groups = new List();
private string _instanceId;
private string _instanceInitiatedShutdownBehavior;
private string _instanceType;
private string _kernel;
private string _ramdisk;
private bool? _sourceDestCheck;
private string _sriovNetSupport;
private string _userData;
private string _value;
///
/// Empty constructor used to set properties independently even when a simple constructor is available
///
public ModifyInstanceAttributeRequest() { }
///
/// Instantiates ModifyInstanceAttributeRequest with the parameterized properties
///
/// The ID of the instance.
/// The name of the attribute to modify. You can modify the following attributes only: disableApiTermination
| instanceType
| kernel
| ramdisk
| instanceInitiatedShutdownBehavior
| blockDeviceMapping
| userData
| sourceDestCheck
| groupSet
| ebsOptimized
| sriovNetSupport
| enaSupport
| nvmeSupport
| disableApiStop
| enclaveOptions
public ModifyInstanceAttributeRequest(string instanceId, InstanceAttributeName attribute)
{
_instanceId = instanceId;
_attribute = attribute;
}
///
/// Gets and sets the property Attribute.
///
/// The name of the attribute to modify.
///
///
///
/// You can modify the following attributes only: disableApiTermination
|
/// instanceType
| kernel
| ramdisk
| instanceInitiatedShutdownBehavior
/// | blockDeviceMapping
| userData
| sourceDestCheck
/// | groupSet
| ebsOptimized
| sriovNetSupport
/// | enaSupport
| nvmeSupport
| disableApiStop
/// | enclaveOptions
///
///
///
public InstanceAttributeName Attribute
{
get { return this._attribute; }
set { this._attribute = value; }
}
// Check to see if Attribute property is set
internal bool IsSetAttribute()
{
return this._attribute != null;
}
///
/// Gets and sets the property BlockDeviceMappings.
///
/// Modifies the DeleteOnTermination
attribute for volumes that are currently
/// attached. The volume must be owned by the caller. If no value is specified for DeleteOnTermination
,
/// the default is true
and the volume is deleted when the instance is terminated.
///
///
///
/// To add instance store volumes to an Amazon EBS-backed instance, you must add them
/// when you launch the instance. For more information, see Update
/// the block device mapping when launching an instance in the Amazon EC2 User
/// Guide.
///
///
public List BlockDeviceMappings
{
get { return this._blockDeviceMappings; }
set { this._blockDeviceMappings = value; }
}
// Check to see if BlockDeviceMappings property is set
internal bool IsSetBlockDeviceMappings()
{
return this._blockDeviceMappings != null && this._blockDeviceMappings.Count > 0;
}
///
/// Gets and sets the property DisableApiStop.
///
/// Indicates whether an instance is enabled for stop protection. For more information,
/// see Stop
/// Protection.
///
///
public bool DisableApiStop
{
get { return this._disableApiStop.GetValueOrDefault(); }
set { this._disableApiStop = value; }
}
// Check to see if DisableApiStop property is set
internal bool IsSetDisableApiStop()
{
return this._disableApiStop.HasValue;
}
///
/// Gets and sets the property DisableApiTermination.
///
/// If the value is true
, you can't terminate the instance using the Amazon
/// EC2 console, CLI, or API; otherwise, you can. You cannot use this parameter for Spot
/// Instances.
///
///
public bool DisableApiTermination
{
get { return this._disableApiTermination.GetValueOrDefault(); }
set { this._disableApiTermination = value; }
}
// Check to see if DisableApiTermination property is set
internal bool IsSetDisableApiTermination()
{
return this._disableApiTermination.HasValue;
}
///
/// Gets and sets the property EbsOptimized.
///
/// Specifies whether the instance is optimized for Amazon EBS I/O. This optimization
/// provides dedicated throughput to Amazon EBS and an optimized configuration stack to
/// provide optimal EBS I/O performance. This optimization isn't available with all instance
/// types. Additional usage charges apply when using an EBS Optimized instance.
///
///
public bool EbsOptimized
{
get { return this._ebsOptimized.GetValueOrDefault(); }
set { this._ebsOptimized = value; }
}
// Check to see if EbsOptimized property is set
internal bool IsSetEbsOptimized()
{
return this._ebsOptimized.HasValue;
}
///
/// Gets and sets the property EnaSupport.
///
/// Set to true
to enable enhanced networking with ENA for the instance.
///
///
///
/// This option is supported only for HVM instances. Specifying this option with a PV
/// instance can make it unreachable.
///
///
public bool EnaSupport
{
get { return this._enaSupport.GetValueOrDefault(); }
set { this._enaSupport = value; }
}
// Check to see if EnaSupport property is set
internal bool IsSetEnaSupport()
{
return this._enaSupport.HasValue;
}
///
/// Gets and sets the property Groups.
///
/// Replaces the security groups of the instance with the specified security groups. You
/// must specify the ID of at least one security group, even if it's just the default
/// security group for the VPC.
///
///
public List Groups
{
get { return this._groups; }
set { this._groups = value; }
}
// Check to see if Groups property is set
internal bool IsSetGroups()
{
return this._groups != null && this._groups.Count > 0;
}
///
/// Gets and sets the property InstanceId.
///
/// The ID of the instance.
///
///
[AWSProperty(Required=true)]
public string InstanceId
{
get { return this._instanceId; }
set { this._instanceId = value; }
}
// Check to see if InstanceId property is set
internal bool IsSetInstanceId()
{
return this._instanceId != null;
}
///
/// Gets and sets the property InstanceInitiatedShutdownBehavior.
///
/// Specifies whether an instance stops or terminates when you initiate shutdown from
/// the instance (using the operating system command for system shutdown).
///
///
public string InstanceInitiatedShutdownBehavior
{
get { return this._instanceInitiatedShutdownBehavior; }
set { this._instanceInitiatedShutdownBehavior = value; }
}
// Check to see if InstanceInitiatedShutdownBehavior property is set
internal bool IsSetInstanceInitiatedShutdownBehavior()
{
return this._instanceInitiatedShutdownBehavior != null;
}
///
/// Gets and sets the property InstanceType.
///
/// Changes the instance type to the specified value. For more information, see Instance
/// types in the Amazon EC2 User Guide. If the instance type is not valid,
/// the error returned is InvalidInstanceAttributeValue
.
///
///
public string InstanceType
{
get { return this._instanceType; }
set { this._instanceType = value; }
}
// Check to see if InstanceType property is set
internal bool IsSetInstanceType()
{
return this._instanceType != null;
}
///
/// Gets and sets the property Kernel.
///
/// Changes the instance's kernel to the specified value. We recommend that you use PV-GRUB
/// instead of kernels and RAM disks. For more information, see PV-GRUB.
///
///
public string Kernel
{
get { return this._kernel; }
set { this._kernel = value; }
}
// Check to see if Kernel property is set
internal bool IsSetKernel()
{
return this._kernel != null;
}
///
/// Gets and sets the property Ramdisk.
///
/// Changes the instance's RAM disk to the specified value. We recommend that you use
/// PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB.
///
///
public string Ramdisk
{
get { return this._ramdisk; }
set { this._ramdisk = value; }
}
// Check to see if Ramdisk property is set
internal bool IsSetRamdisk()
{
return this._ramdisk != null;
}
///
/// Gets and sets the property SourceDestCheck.
///
/// Enable or disable source/destination checks, which ensure that the instance is either
/// the source or the destination of any traffic that it receives. If the value is true
,
/// source/destination checks are enabled; otherwise, they are disabled. The default value
/// is true
. You must disable source/destination checks if the instance runs
/// services such as network address translation, routing, or firewalls.
///
///
public bool SourceDestCheck
{
get { return this._sourceDestCheck.GetValueOrDefault(); }
set { this._sourceDestCheck = value; }
}
// Check to see if SourceDestCheck property is set
internal bool IsSetSourceDestCheck()
{
return this._sourceDestCheck.HasValue;
}
///
/// Gets and sets the property SriovNetSupport.
///
/// Set to simple
to enable enhanced networking with the Intel 82599 Virtual
/// Function interface for the instance.
///
///
///
/// There is no way to disable enhanced networking with the Intel 82599 Virtual Function
/// interface at this time.
///
///
///
/// This option is supported only for HVM instances. Specifying this option with a PV
/// instance can make it unreachable.
///
///
public string SriovNetSupport
{
get { return this._sriovNetSupport; }
set { this._sriovNetSupport = value; }
}
// Check to see if SriovNetSupport property is set
internal bool IsSetSriovNetSupport()
{
return this._sriovNetSupport != null;
}
///
/// Gets and sets the property UserData.
///
/// Changes the instance's user data to the specified value. If you are using an Amazon
/// Web Services SDK or command line tool, base64-encoding is performed for you, and you
/// can load the text from a file. Otherwise, you must provide base64-encoded text.
///
///
public string UserData
{
get { return this._userData; }
set { this._userData = value; }
}
// Check to see if UserData property is set
internal bool IsSetUserData()
{
return this._userData != null;
}
///
/// Gets and sets the property Value.
///
/// A new value for the attribute. Use only with the kernel
, ramdisk
,
/// userData
, disableApiTermination
, or instanceInitiatedShutdownBehavior
/// attribute.
///
///
public string Value
{
get { return this._value; }
set { this._value = value; }
}
// Check to see if Value property is set
internal bool IsSetValue()
{
return this._value != null;
}
}
}