Share via


EasmClient.GetDiscoveryTemplates Method

Definition

Overloads

GetDiscoveryTemplates(String, Nullable<Int32>, Nullable<Int32>, RequestContext)

[Protocol Method] Retrieve a list of disco templates for the provided search parameters.

GetDiscoveryTemplates(String, Nullable<Int32>, Nullable<Int32>, CancellationToken)

Retrieve a list of disco templates for the provided search parameters.

GetDiscoveryTemplates(String, Nullable<Int32>, Nullable<Int32>, RequestContext)

Source:
EasmClient.cs

[Protocol Method] Retrieve a list of disco templates for the provided search parameters.

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

Parameters

filter
String

Filter the result list using the given expression.

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 Pageable<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 GetDiscoveryTemplates and parse the result.

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

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

This sample shows how to call GetDiscoveryTemplates 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);

foreach (BinaryData item in client.GetDiscoveryTemplates("<filter>", 1234, 1234, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("id").ToString());
    Console.WriteLine(result.GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("displayName").ToString());
    Console.WriteLine(result.GetProperty("industry").ToString());
    Console.WriteLine(result.GetProperty("region").ToString());
    Console.WriteLine(result.GetProperty("countryCode").ToString());
    Console.WriteLine(result.GetProperty("stateCode").ToString());
    Console.WriteLine(result.GetProperty("city").ToString());
    Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString());
    Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("names")[0].ToString());
}

Applies to

GetDiscoveryTemplates(String, Nullable<Int32>, Nullable<Int32>, CancellationToken)

Source:
EasmClient.cs

Retrieve a list of disco templates for the provided search parameters.

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

Parameters

filter
String

Filter the result list using the given expression.

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 GetDiscoveryTemplates.

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

foreach (DiscoveryTemplate item in client.GetDiscoveryTemplates())
{
}

This sample shows how to call GetDiscoveryTemplates with all parameters.

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

foreach (DiscoveryTemplate item in client.GetDiscoveryTemplates(filter: "<filter>", skip: 1234, maxpagesize: 1234))
{
}

Applies to