共用方式為


SubnetCollection Class

Definition

A class representing a collection of SubnetResource and their operations. Each SubnetResource in the collection will belong to the same instance of VirtualNetworkResource. To get a SubnetCollection instance call the GetSubnets method from an instance of VirtualNetworkResource.

public class SubnetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable<Azure.ResourceManager.Network.SubnetResource>, System.Collections.Generic.IEnumerable<Azure.ResourceManager.Network.SubnetResource>
type SubnetCollection = class
    inherit ArmCollection
    interface seq<SubnetResource>
    interface IEnumerable
    interface IAsyncEnumerable<SubnetResource>
Public Class SubnetCollection
Inherits ArmCollection
Implements IAsyncEnumerable(Of SubnetResource), IEnumerable(Of SubnetResource)
Inheritance
SubnetCollection
Implements

Constructors

SubnetCollection()

Initializes a new instance of the SubnetCollection class for mocking.

Properties

Client

Gets the ArmClient this resource client was created from.

(Inherited from ArmCollection)
Diagnostics

Gets the diagnostic options for this resource client.

(Inherited from ArmCollection)
Endpoint

Gets the base uri for this resource client.

(Inherited from ArmCollection)
Id

Gets the resource identifier.

(Inherited from ArmCollection)
Pipeline

Gets the pipeline for this resource client.

(Inherited from ArmCollection)

Methods

CreateOrUpdate(WaitUntil, String, SubnetData, CancellationToken)

Creates or updates a subnet in the specified virtual network.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
  • Operation Id: Subnets_CreateOrUpdate
  • Default Api Version: 2024-03-01
  • Resource: SubnetResource
CreateOrUpdateAsync(WaitUntil, String, SubnetData, CancellationToken)

Creates or updates a subnet in the specified virtual network.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
  • Operation Id: Subnets_CreateOrUpdate
  • Default Api Version: 2024-03-01
  • Resource: SubnetResource
Exists(String, String, CancellationToken)

Checks to see if the resource exists in azure.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
  • Operation Id: Subnets_Get
  • Default Api Version: 2024-03-01
  • Resource: SubnetResource
ExistsAsync(String, String, CancellationToken)

Checks to see if the resource exists in azure.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
  • Operation Id: Subnets_Get
  • Default Api Version: 2024-03-01
  • Resource: SubnetResource
Get(String, String, CancellationToken)

Gets the specified subnet by virtual network and resource group.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
  • Operation Id: Subnets_Get
  • Default Api Version: 2024-03-01
  • Resource: SubnetResource
GetAll(CancellationToken)

Gets all subnets in a virtual network.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets
  • Operation Id: Subnets_List
  • Default Api Version: 2024-03-01
  • Resource: SubnetResource
GetAllAsync(CancellationToken)

Gets all subnets in a virtual network.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets
  • Operation Id: Subnets_List
  • Default Api Version: 2024-03-01
  • Resource: SubnetResource
GetAsync(String, String, CancellationToken)

Gets the specified subnet by virtual network and resource group.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
  • Operation Id: Subnets_Get
  • Default Api Version: 2024-03-01
  • Resource: SubnetResource
GetIfExists(String, String, CancellationToken)

Tries to get details for this resource from the service.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
  • Operation Id: Subnets_Get
  • Default Api Version: 2024-03-01
  • Resource: SubnetResource
GetIfExistsAsync(String, String, CancellationToken)

Tries to get details for this resource from the service.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
  • Operation Id: Subnets_Get
  • Default Api Version: 2024-03-01
  • Resource: SubnetResource
TryGetApiVersion(ResourceType, String)

Gets the api version override if it has been set for the current client options.

(Inherited from ArmCollection)

Explicit Interface Implementations

IAsyncEnumerable<SubnetResource>.GetAsyncEnumerator(CancellationToken)

Returns an enumerator that iterates asynchronously through the collection.

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

IEnumerable<SubnetResource>.GetEnumerator()

Returns an enumerator that iterates through the collection.

Applies to