Virtual Networkのすべての IP アドレスの Ddos 保護状態を取得します
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/ddosProtectionStatus?api-version=2023-09-01
With optional parameters:
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/ddosProtectionStatus?top={top}&skipToken={skipToken}&api-version=2023-09-01
URI パラメーター
名前 |
/ |
必須 |
型 |
説明 |
resourceGroupName
|
path |
True
|
string
|
リソース グループの名前。
|
subscriptionId
|
path |
True
|
string
|
Microsoft Azure サブスクリプションを一意に識別するサブスクリプションの資格情報。 サブスクリプション ID は、全ての修理依頼についてURI の一部を生じさせます。
|
virtualNetworkName
|
path |
True
|
string
|
仮想ネットワークの名前。
|
api-version
|
query |
True
|
string
|
クライアント API バージョン。
|
skipToken
|
query |
|
string
|
nextLink で指定された skipToken。
|
top
|
query |
|
integer
int32
|
返される IP アドレスの最大数。
|
応答
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー。
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名前 |
説明 |
user_impersonation
|
ユーザー アカウントの借用
|
例
Get Ddos Protection Status of a Virtual Network
Sample Request
POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/ddosProtectionStatus?top=75&api-version=2023-09-01
/**
* Samples for VirtualNetworks ListDdosProtectionStatus.
*/
public final class Main {
/*
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2023-09-01/examples/
* VirtualNetworkGetDdosProtectionStatus.json
*/
/**
* Sample code: Get Ddos Protection Status of a Virtual Network.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getDdosProtectionStatusOfAVirtualNetwork(com.azure.resourcemanager.AzureResourceManager azure) {
azure.networks().manager().serviceClient().getVirtualNetworks().listDdosProtectionStatus("rg1", "test-vnet", 75,
null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.network import NetworkManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-network
# USAGE
python virtual_network_get_ddos_protection_status.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = NetworkManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.virtual_networks.begin_list_ddos_protection_status(
resource_group_name="rg1",
virtual_network_name="test-vnet",
).result()
for item in response:
print(item)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2023-09-01/examples/VirtualNetworkGetDdosProtectionStatus.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armnetwork_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/network/resource-manager/Microsoft.Network/stable/2023-09-01/examples/VirtualNetworkGetDdosProtectionStatus.json
func ExampleVirtualNetworksClient_BeginListDdosProtectionStatus() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetwork.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewVirtualNetworksClient().BeginListDdosProtectionStatus(ctx, "rg1", "test-vnet", &armnetwork.VirtualNetworksClientBeginListDdosProtectionStatusOptions{Top: to.Ptr[int32](75),
SkipToken: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
for res.More() {
page, err := res.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.VirtualNetworkDdosProtectionStatusResult = armnetwork.VirtualNetworkDdosProtectionStatusResult{
// Value: []*armnetwork.PublicIPDdosProtectionStatusResult{
// {
// DdosProtectionPlanID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"),
// IsWorkloadProtected: to.Ptr(armnetwork.IsWorkloadProtectedTrue),
// PublicIPAddress: to.Ptr("10.0.1.5"),
// PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip"),
// },
// {
// IsWorkloadProtected: to.Ptr(armnetwork.IsWorkloadProtectedFalse),
// PublicIPAddress: to.Ptr("10.0.1.6"),
// PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip2"),
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetworkManagementClient } = require("@azure/arm-network");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets the Ddos Protection Status of all IP Addresses under the Virtual Network
*
* @summary Gets the Ddos Protection Status of all IP Addresses under the Virtual Network
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2023-09-01/examples/VirtualNetworkGetDdosProtectionStatus.json
*/
async function getDdosProtectionStatusOfAVirtualNetwork() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "rg1";
const virtualNetworkName = "test-vnet";
const top = 75;
const options = {
top,
};
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.virtualNetworks.beginListDdosProtectionStatusAndWait(
resourceGroupName,
virtualNetworkName,
options,
)) {
resArray.push(item);
}
console.log(resArray);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"value": [
{
"publicIpAddressId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip",
"publicIpAddress": "10.0.1.5",
"isWorkloadProtected": "True",
"ddosProtectionPlanId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ddosProtectionPlans/test-plan"
},
{
"publicIpAddressId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-pip2",
"publicIpAddress": "10.0.1.6",
"isWorkloadProtected": "False"
}
]
}
Location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/ddosProtectionStatus?api-version=2023-09-01
定義
CloudError
サービスからのエラー応答。
CloudErrorBody
サービスからのエラー応答。
名前 |
型 |
説明 |
code
|
string
|
エラーの識別子。 コードは不変であり、プログラムによって使用されることを意図しています。
|
details
|
CloudErrorBody[]
|
エラーに関するその他の詳細の一覧。
|
message
|
string
|
ユーザー インターフェイスでの表示に適したエラーを説明するメッセージ。
|
target
|
string
|
特定のエラーのターゲット。 たとえば、エラーが発生したプロパティの名前です。
|
IsWorkloadProtected
IP アドレスが DDoS ワークロードで保護されているかどうかを示す値。
名前 |
型 |
説明 |
False
|
string
|
|
True
|
string
|
|
PublicIpDdosProtectionStatusResult
GetPublicIpAddressDdosProtectionStatusOperation API サービス呼び出しの応答。
名前 |
型 |
説明 |
ddosProtectionPlanId
|
string
|
DDoS 保護プラン IP アドレスがプランを通じて保護されている場合の のリソース ID。
|
isWorkloadProtected
|
IsWorkloadProtected
|
IP アドレスが DDoS ワークロードで保護されているかどうかを示す値。
|
publicIpAddress
|
string
|
パブリック IP リソースの IP アドレス
|
publicIpAddressId
|
string
|
パブリック IP ARM リソース ID
|
VirtualNetworkDdosProtectionStatusResult
GetVirtualNetworkDdosProtectionStatusOperation の応答。