Pobiera określoną regułę ruchu wychodzącego modułu równoważenia obciążenia.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}?api-version=2023-06-01
Parametry identyfikatora URI
Nazwa |
W |
Wymagane |
Typ |
Opis |
loadBalancerName
|
path |
True
|
string
|
Nazwa modułu równoważenia obciążenia.
|
outboundRuleName
|
path |
True
|
string
|
Nazwa reguły ruchu wychodzącego.
|
resourceGroupName
|
path |
True
|
string
|
Nazwa grupy zasobów.
|
subscriptionId
|
path |
True
|
string
|
Poświadczenia subskrypcji, które jednoznacznie identyfikują subskrypcję platformy Microsoft Azure. Identyfikator subskrypcji stanowi część identyfikatora URI dla każdego wywołania usługi.
|
api-version
|
query |
True
|
string
|
Wersja interfejsu API klienta.
|
Odpowiedzi
Nazwa |
Typ |
Opis |
200 OK
|
OutboundRule
|
Żądanie powiodło się. Operacja zwraca wynikowy zasób OutboundRule.
|
Other Status Codes
|
CloudError
|
Odpowiedź na błąd opisująca, dlaczego operacja nie powiodła się.
|
Zabezpieczenia
azure_auth
Przepływ OAuth2 usługi Azure Active Directory.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nazwa |
Opis |
user_impersonation
|
personifikacja konta użytkownika
|
Przykłady
LoadBalancerOutboundRuleGet
Sample Request
GET https://management.azure.com/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/outboundRules/rule1?api-version=2023-06-01
/**
* Samples for LoadBalancerOutboundRules Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/network/resource-manager/Microsoft.Network/stable/2023-06-01/examples/LoadBalancerOutboundRuleGet.
* json
*/
/**
* Sample code: LoadBalancerOutboundRuleGet.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void loadBalancerOutboundRuleGet(com.azure.resourcemanager.AzureResourceManager azure) {
azure.networks().manager().serviceClient().getLoadBalancerOutboundRules().getWithResponse("testrg", "lb1",
"rule1", 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 load_balancer_outbound_rule_get.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.load_balancer_outbound_rules.get(
resource_group_name="testrg",
load_balancer_name="lb1",
outbound_rule_name="rule1",
)
print(response)
# x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2023-06-01/examples/LoadBalancerOutboundRuleGet.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/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/network/resource-manager/Microsoft.Network/stable/2023-06-01/examples/LoadBalancerOutboundRuleGet.json
func ExampleLoadBalancerOutboundRulesClient_Get() {
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)
}
res, err := clientFactory.NewLoadBalancerOutboundRulesClient().Get(ctx, "testrg", "lb1", "rule1", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.OutboundRule = armnetwork.OutboundRule{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/outboundRules/rule1"),
// Name: to.Ptr("rule1"),
// Type: to.Ptr("Microsoft.Network/loadBalancers/outboundRules"),
// Etag: to.Ptr("W/\"00000000-0000-0000-0000-000000000000\""),
// Properties: &armnetwork.OutboundRulePropertiesFormat{
// AllocatedOutboundPorts: to.Ptr[int32](64),
// BackendAddressPool: &armnetwork.SubResource{
// ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/bepool1"),
// },
// EnableTCPReset: to.Ptr(true),
// FrontendIPConfigurations: []*armnetwork.SubResource{
// {
// ID: to.Ptr("/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfrontend"),
// }},
// IdleTimeoutInMinutes: to.Ptr[int32](15),
// ProvisioningState: to.Ptr(armnetwork.ProvisioningStateSucceeded),
// Protocol: to.Ptr(armnetwork.LoadBalancerOutboundRuleProtocolTCP),
// },
// }
}
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 specified load balancer outbound rule.
*
* @summary Gets the specified load balancer outbound rule.
* x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2023-06-01/examples/LoadBalancerOutboundRuleGet.json
*/
async function loadBalancerOutboundRuleGet() {
const subscriptionId = process.env["NETWORK_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["NETWORK_RESOURCE_GROUP"] || "testrg";
const loadBalancerName = "lb1";
const outboundRuleName = "rule1";
const credential = new DefaultAzureCredential();
const client = new NetworkManagementClient(credential, subscriptionId);
const result = await client.loadBalancerOutboundRules.get(
resourceGroupName,
loadBalancerName,
outboundRuleName,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Network;
// Generated from example definition: specification/network/resource-manager/Microsoft.Network/stable/2023-06-01/examples/LoadBalancerOutboundRuleGet.json
// this example is just showing the usage of "LoadBalancerOutboundRules_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this LoadBalancerResource created on azure
// for more information of creating LoadBalancerResource, please refer to the document of LoadBalancerResource
string subscriptionId = "subid";
string resourceGroupName = "testrg";
string loadBalancerName = "lb1";
ResourceIdentifier loadBalancerResourceId = LoadBalancerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, loadBalancerName);
LoadBalancerResource loadBalancer = client.GetLoadBalancerResource(loadBalancerResourceId);
// get the collection of this OutboundRuleResource
OutboundRuleCollection collection = loadBalancer.GetOutboundRules();
// invoke the operation
string outboundRuleName = "rule1";
NullableResponse<OutboundRuleResource> response = await collection.GetIfExistsAsync(outboundRuleName);
OutboundRuleResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
OutboundRuleData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
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
{
"name": "rule1",
"id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/outboundRules/rule1",
"type": "Microsoft.Network/loadBalancers/outboundRules",
"etag": "W/\"00000000-0000-0000-0000-000000000000\"",
"properties": {
"provisioningState": "Succeeded",
"frontendIPConfigurations": [
{
"id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfrontend"
}
],
"allocatedOutboundPorts": 64,
"idleTimeoutInMinutes": 15,
"protocol": "Tcp",
"enableTcpReset": true,
"backendAddressPool": {
"id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/backendAddressPools/bepool1"
}
}
}
Definicje
CloudError
Odpowiedź na błąd z usługi.
CloudErrorBody
Odpowiedź na błąd z usługi.
Nazwa |
Typ |
Opis |
code
|
string
|
Identyfikator błędu. Kody są niezmienne i mają być używane programowo.
|
details
|
CloudErrorBody[]
|
Lista dodatkowych szczegółów dotyczących błędu.
|
message
|
string
|
Komunikat opisujący błąd, który ma być odpowiedni do wyświetlania w interfejsie użytkownika.
|
target
|
string
|
Element docelowy określonego błędu. Na przykład nazwa właściwości w błędzie.
|
LoadBalancerOutboundRuleProtocol
Protokół reguły ruchu wychodzącego w module równoważenia obciążenia.
Nazwa |
Typ |
Opis |
All
|
string
|
|
Tcp
|
string
|
|
Udp
|
string
|
|
OutboundRule
Reguła ruchu wychodzącego modułu równoważenia obciążenia.
Nazwa |
Typ |
Opis |
etag
|
string
|
Unikatowy ciąg tylko do odczytu, który zmienia się za każdym razem, gdy zasób jest aktualizowany.
|
id
|
string
|
Identyfikator zasobu.
|
name
|
string
|
Nazwa zasobu, który jest unikatowy w zestawie reguł ruchu wychodzącego używanych przez moduł równoważenia obciążenia. Ta nazwa może służyć do uzyskiwania dostępu do zasobu.
|
properties.allocatedOutboundPorts
|
integer
|
Liczba portów wychodzących, które mają być używane dla translatora adresów sieciowych.
|
properties.backendAddressPool
|
SubResource
|
Odwołanie do puli adresów IP. Ruch wychodzący jest losowo obciążony między adresami IP w adresach IP zaplecza.
|
properties.enableTcpReset
|
boolean
|
Odbieranie dwukierunkowego resetowania protokołu TCP w przypadku przekroczenia limitu czasu bezczynności przepływu TCP lub nieoczekiwanego zakończenia połączenia. Ten element jest używany tylko wtedy, gdy protokół jest ustawiony na TCP.
|
properties.frontendIPConfigurations
|
SubResource[]
|
Adresy IP frontonu modułu równoważenia obciążenia.
|
properties.idleTimeoutInMinutes
|
integer
|
Limit czasu bezczynności połączenia TCP.
|
properties.protocol
|
LoadBalancerOutboundRuleProtocol
|
Protokół reguły ruchu wychodzącego w module równoważenia obciążenia.
|
properties.provisioningState
|
ProvisioningState
|
Stan aprowizacji zasobu reguły ruchu wychodzącego.
|
type
|
string
|
Typ zasobu.
|
ProvisioningState
Bieżący stan aprowizacji.
Nazwa |
Typ |
Opis |
Deleting
|
string
|
|
Failed
|
string
|
|
Succeeded
|
string
|
|
Updating
|
string
|
|
SubResource
Odwołanie do innego podźródła.
Nazwa |
Typ |
Opis |
id
|
string
|
Identyfikator zasobu.
|