Share via


EasmClient.GetDataConnectionsAsync Method

Definition

Overloads

GetDataConnectionsAsync(Nullable<Int32>, Nullable<Int32>, RequestContext)

[Protocol Method] Retrieve a list of data connections.

GetDataConnectionsAsync(Nullable<Int32>, Nullable<Int32>, CancellationToken)

Retrieve a list of data connections.

GetDataConnectionsAsync(Nullable<Int32>, Nullable<Int32>, RequestContext)

Source:
EasmClient.cs

[Protocol Method] Retrieve a list of data connections.

public virtual Azure.AsyncPageable<BinaryData> GetDataConnectionsAsync (int? skip, int? maxpagesize, Azure.RequestContext context);
abstract member GetDataConnectionsAsync : Nullable<int> * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetDataConnectionsAsync : Nullable<int> * Nullable<int> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetDataConnectionsAsync (skip As Nullable(Of Integer), maxpagesize As Nullable(Of Integer), context As RequestContext) As AsyncPageable(Of BinaryData)

Parameters

skip
Nullable<Int32>

The number of result items to skip.

maxpagesize
Nullable<Int32>

The maximum number of result items per page.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The AsyncPageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.

Exceptions

Service returned a non-success status code.

Examples

This sample shows how to call GetDataConnectionsAsync and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);

await foreach (BinaryData item in client.GetDataConnectionsAsync(null, null, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("kind").ToString());
    Console.WriteLine(result.GetProperty("name").ToString());
}

This sample shows how to call GetDataConnectionsAsync with all parameters and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);

await foreach (BinaryData item in client.GetDataConnectionsAsync(1234, 1234, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("kind").ToString());
    Console.WriteLine(result.GetProperty("id").ToString());
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("displayName").ToString());
    Console.WriteLine(result.GetProperty("content").ToString());
    Console.WriteLine(result.GetProperty("createdDate").ToString());
    Console.WriteLine(result.GetProperty("frequency").ToString());
    Console.WriteLine(result.GetProperty("frequencyOffset").ToString());
    Console.WriteLine(result.GetProperty("updatedDate").ToString());
    Console.WriteLine(result.GetProperty("userUpdatedAt").ToString());
    Console.WriteLine(result.GetProperty("active").ToString());
    Console.WriteLine(result.GetProperty("inactiveMessage").ToString());
}

Applies to

GetDataConnectionsAsync(Nullable<Int32>, Nullable<Int32>, CancellationToken)

Source:
EasmClient.cs

Retrieve a list of data connections.

public virtual Azure.AsyncPageable<Azure.Analytics.Defender.Easm.DataConnection> GetDataConnectionsAsync (int? skip = default, int? maxpagesize = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetDataConnectionsAsync : Nullable<int> * Nullable<int> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Analytics.Defender.Easm.DataConnection>
override this.GetDataConnectionsAsync : Nullable<int> * Nullable<int> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Analytics.Defender.Easm.DataConnection>
Public Overridable Function GetDataConnectionsAsync (Optional skip As Nullable(Of Integer) = Nothing, Optional maxpagesize As Nullable(Of Integer) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of DataConnection)

Parameters

skip
Nullable<Int32>

The number of result items to skip.

maxpagesize
Nullable<Int32>

The maximum number of result items per page.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetDataConnectionsAsync.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);

await foreach (DataConnection item in client.GetDataConnectionsAsync())
{
}

This sample shows how to call GetDataConnectionsAsync with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);

await foreach (DataConnection item in client.GetDataConnectionsAsync(skip: 1234, maxpagesize: 1234))
{
}

Applies to