/*
* 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 lightsail-2016-11-28.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.Lightsail.Model
{
///
/// Describes information about ports for an Amazon Lightsail instance.
///
public partial class InstancePortInfo
{
private AccessDirection _accessDirection;
private string _accessFrom;
private PortAccessType _accessType;
private List _cidrListAliases = new List();
private List _cidrs = new List();
private string _commonName;
private int? _fromPort;
private List _ipv6Cidrs = new List();
private NetworkProtocol _protocol;
private int? _toPort;
///
/// Gets and sets the property AccessDirection.
///
/// The access direction (inbound
or outbound
).
///
///
///
/// Lightsail currently supports only inbound
access direction.
///
///
///
public AccessDirection AccessDirection
{
get { return this._accessDirection; }
set { this._accessDirection = value; }
}
// Check to see if AccessDirection property is set
internal bool IsSetAccessDirection()
{
return this._accessDirection != null;
}
///
/// Gets and sets the property AccessFrom.
///
/// The location from which access is allowed. For example, Anywhere (0.0.0.0/0)
,
/// or Custom
if a specific IP address or range of IP addresses is allowed.
///
///
public string AccessFrom
{
get { return this._accessFrom; }
set { this._accessFrom = value; }
}
// Check to see if AccessFrom property is set
internal bool IsSetAccessFrom()
{
return this._accessFrom != null;
}
///
/// Gets and sets the property AccessType.
///
/// The type of access (Public
or Private
).
///
///
public PortAccessType AccessType
{
get { return this._accessType; }
set { this._accessType = value; }
}
// Check to see if AccessType property is set
internal bool IsSetAccessType()
{
return this._accessType != null;
}
///
/// Gets and sets the property CidrListAliases.
///
/// An alias that defines access for a preconfigured range of IP addresses.
///
///
///
/// The only alias currently supported is lightsail-connect
, which allows
/// IP addresses of the browser-based RDP/SSH client in the Lightsail console to connect
/// to your instance.
///
///
public List CidrListAliases
{
get { return this._cidrListAliases; }
set { this._cidrListAliases = value; }
}
// Check to see if CidrListAliases property is set
internal bool IsSetCidrListAliases()
{
return this._cidrListAliases != null && this._cidrListAliases.Count > 0;
}
///
/// Gets and sets the property Cidrs.
///
/// The IPv4 address, or range of IPv4 addresses (in CIDR notation) that are allowed to
/// connect to an instance through the ports, and the protocol.
///
///
///
/// The ipv6Cidrs
parameter lists the IPv6 addresses that are allowed to
/// connect to an instance.
///
///
///
/// For more information about CIDR block notation, see Classless
/// Inter-Domain Routing on Wikipedia.
///
///
public List Cidrs
{
get { return this._cidrs; }
set { this._cidrs = value; }
}
// Check to see if Cidrs property is set
internal bool IsSetCidrs()
{
return this._cidrs != null && this._cidrs.Count > 0;
}
///
/// Gets and sets the property CommonName.
///
/// The common name of the port information.
///
///
public string CommonName
{
get { return this._commonName; }
set { this._commonName = value; }
}
// Check to see if CommonName property is set
internal bool IsSetCommonName()
{
return this._commonName != null;
}
///
/// Gets and sets the property FromPort.
///
/// The first port in a range of open ports on an instance.
///
///
///
/// Allowed ports:
///
/// -
///
/// TCP and UDP -
0
to 65535
///
/// -
///
/// ICMP - The ICMP type for IPv4 addresses. For example, specify
8
as the
/// fromPort
(ICMP type), and -1
as the toPort
/// (ICMP code), to enable ICMP Ping. For more information, see Control
/// Messages on Wikipedia.
///
/// -
///
/// ICMPv6 - The ICMP type for IPv6 addresses. For example, specify
128
as
/// the fromPort
(ICMPv6 type), and 0
as toPort
/// (ICMPv6 code). For more information, see Internet
/// Control Message Protocol for IPv6.
///
///
///
[AWSProperty(Min=-1, Max=65535)]
public int FromPort
{
get { return this._fromPort.GetValueOrDefault(); }
set { this._fromPort = value; }
}
// Check to see if FromPort property is set
internal bool IsSetFromPort()
{
return this._fromPort.HasValue;
}
///
/// Gets and sets the property Ipv6Cidrs.
///
/// The IPv6 address, or range of IPv6 addresses (in CIDR notation) that are allowed to
/// connect to an instance through the ports, and the protocol. Only devices with an IPv6
/// address can connect to an instance through IPv6; otherwise, IPv4 should be used.
///
///
///
/// The cidrs
parameter lists the IPv4 addresses that are allowed to connect
/// to an instance.
///
///
///
/// For more information about CIDR block notation, see Classless
/// Inter-Domain Routing on Wikipedia.
///
///
public List Ipv6Cidrs
{
get { return this._ipv6Cidrs; }
set { this._ipv6Cidrs = value; }
}
// Check to see if Ipv6Cidrs property is set
internal bool IsSetIpv6Cidrs()
{
return this._ipv6Cidrs != null && this._ipv6Cidrs.Count > 0;
}
///
/// Gets and sets the property Protocol.
///
/// The IP protocol name.
///
///
///
/// The name can be one of the following:
///
/// -
///
///
tcp
- Transmission Control Protocol (TCP) provides reliable, ordered,
/// and error-checked delivery of streamed data between applications running on hosts
/// communicating by an IP network. If you have an application that doesn't require reliable
/// data stream service, use UDP instead.
///
/// -
///
///
all
- All transport layer protocol types. For more general information,
/// see Transport layer on
/// Wikipedia.
///
/// -
///
///
udp
- With User Datagram Protocol (UDP), computer applications can send
/// messages (or datagrams) to other hosts on an Internet Protocol (IP) network. Prior
/// communications are not required to set up transmission channels or data paths. Applications
/// that don't require reliable data stream service can use UDP, which provides a connectionless
/// datagram service that emphasizes reduced latency over reliability. If you do require
/// reliable data stream service, use TCP instead.
///
/// -
///
///
icmp
- Internet Control Message Protocol (ICMP) is used to send error
/// messages and operational information indicating success or failure when communicating
/// with an instance. For example, an error is indicated when an instance could not be
/// reached. When you specify icmp
as the protocol
, you must
/// specify the ICMP type using the fromPort
parameter, and ICMP code using
/// the toPort
parameter.
///
///
///
public NetworkProtocol Protocol
{
get { return this._protocol; }
set { this._protocol = value; }
}
// Check to see if Protocol property is set
internal bool IsSetProtocol()
{
return this._protocol != null;
}
///
/// Gets and sets the property ToPort.
///
/// The last port in a range of open ports on an instance.
///
///
///
/// Allowed ports:
///
/// -
///
/// TCP and UDP -
0
to 65535
///
/// -
///
/// ICMP - The ICMP code for IPv4 addresses. For example, specify
8
as the
/// fromPort
(ICMP type), and -1
as the toPort
/// (ICMP code), to enable ICMP Ping. For more information, see Control
/// Messages on Wikipedia.
///
/// -
///
/// ICMPv6 - The ICMP code for IPv6 addresses. For example, specify
128
as
/// the fromPort
(ICMPv6 type), and 0
as toPort
/// (ICMPv6 code). For more information, see Internet
/// Control Message Protocol for IPv6.
///
///
///
[AWSProperty(Min=-1, Max=65535)]
public int ToPort
{
get { return this._toPort.GetValueOrDefault(); }
set { this._toPort = value; }
}
// Check to see if ToPort property is set
internal bool IsSetToPort()
{
return this._toPort.HasValue;
}
}
}