AWS SDK Version 4 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Describes one or more secondary networks.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to DescribeSecondaryNetworksAsync.

Namespace: Amazon.EC2
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z

Syntax

C#
public abstract DescribeSecondaryNetworksResponse DescribeSecondaryNetworks(
         DescribeSecondaryNetworksRequest request
)

Parameters

request
Type: Amazon.EC2.Model.DescribeSecondaryNetworksRequest

Container for the necessary parameters to execute the DescribeSecondaryNetworks service method.

Return Value


The response from the DescribeSecondaryNetworks service method, as returned by EC2.

Examples

This example describes the specified secondary networks.

To describe specified secondary networks


var client = new AmazonEC2Client();
var response = client.DescribeSecondaryNetworks(new DescribeSecondaryNetworksRequest 
{
    SecondaryNetworkIds = new List<string> {
        "sn-0123456789abcdef0",
        "sn-0987654321fedcba0"
    }
});

List<SecondaryNetwork> secondaryNetworks = response.SecondaryNetworks;

            

This example uses filters to describe any secondary network you own that has a tag with the key Environment and the value Production and whose state is create-complete.

To describe secondary networks using filters


var client = new AmazonEC2Client();
var response = client.DescribeSecondaryNetworks(new DescribeSecondaryNetworksRequest 
{
    Filters = new List<Filter> {
        new Filter {
            Name = "tag:Environment",
            Values = new List<string> {
                "Production"
            }
        },
        new Filter {
            Name = "state",
            Values = new List<string> {
                "create-complete"
            }
        }
    },
    MaxResults = 5
});

string nextToken = response.NextToken;
List<SecondaryNetwork> secondaryNetworks = response.SecondaryNetworks;

            

Version Information

.NET Framework:
Supported in: 4.7.2 and newer

See Also