Udostępnij za pośrednictwem


EasmClient.GetSavedFilterAsync Method

Definition

Overloads

GetSavedFilterAsync(String, RequestContext)

[Protocol Method] Retrieve a saved filter by filterName.

GetSavedFilterAsync(String, CancellationToken)

Retrieve a saved filter by filterName.

GetSavedFilterAsync(String, RequestContext)

Source:
EasmClient.cs

[Protocol Method] Retrieve a saved filter by filterName.

public virtual System.Threading.Tasks.Task<Azure.Response> GetSavedFilterAsync (string filterName, Azure.RequestContext context);
abstract member GetSavedFilterAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetSavedFilterAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetSavedFilterAsync (filterName As String, context As RequestContext) As Task(Of Response)

Parameters

filterName
String

The caller provided unique name for the resource.

context
RequestContext

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

Returns

The response returned from the service.

Exceptions

filterName is null.

filterName is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

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

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

Response response = await client.GetSavedFilterAsync("<filterName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("name").ToString());

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

Response response = await client.GetSavedFilterAsync("<filterName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("filter").ToString());
Console.WriteLine(result.GetProperty("description").ToString());

Applies to

GetSavedFilterAsync(String, CancellationToken)

Source:
EasmClient.cs

Retrieve a saved filter by filterName.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Defender.Easm.SavedFilter>> GetSavedFilterAsync (string filterName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetSavedFilterAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Defender.Easm.SavedFilter>>
override this.GetSavedFilterAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Defender.Easm.SavedFilter>>
Public Overridable Function GetSavedFilterAsync (filterName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of SavedFilter))

Parameters

filterName
String

The caller provided unique name for the resource.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

filterName is null.

filterName is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetSavedFilterAsync.

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

Response<SavedFilter> response = await client.GetSavedFilterAsync("<filterName>");

This sample shows how to call GetSavedFilterAsync with all parameters.

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

Response<SavedFilter> response = await client.GetSavedFilterAsync("<filterName>");

Applies to