Share via


EasmClient.GetAssetResourcesAsync Method

Definition

Overloads

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

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

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

Retrieve a list of assets for the provided search parameters.

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

Source:
EasmClient.cs

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

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

Parameters

filter
String

Filter the result list using the given expression.

orderby
String

A list of expressions that specify the order of the returned resources.

skip
Nullable<Int32>

The number of result items to skip.

maxpagesize
Nullable<Int32>

The maximum number of result items per page.

mark
String

Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response.

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 GetAssetResourcesAsync 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.GetAssetResourcesAsync(null, null, null, null, null, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("kind").ToString());
    Console.WriteLine(result.GetProperty("id").ToString());
}

This sample shows how to call GetAssetResourcesAsync 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.GetAssetResourcesAsync("<filter>", "<orderby>", 1234, 1234, "<mark>", 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("uuid").ToString());
    Console.WriteLine(result.GetProperty("createdDate").ToString());
    Console.WriteLine(result.GetProperty("updatedDate").ToString());
    Console.WriteLine(result.GetProperty("state").ToString());
    Console.WriteLine(result.GetProperty("externalId").ToString());
    Console.WriteLine(result.GetProperty("labels")[0].ToString());
    Console.WriteLine(result.GetProperty("wildcard").ToString());
    Console.WriteLine(result.GetProperty("discoGroupName").ToString());
    Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("id").ToString());
    Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("displayName").ToString());
    Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("kind").ToString());
    Console.WriteLine(result.GetProperty("auditTrail")[0].GetProperty("reason").ToString());
    Console.WriteLine(result.GetProperty("reason").ToString());
}

Applies to

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

Source:
EasmClient.cs

Retrieve a list of assets for the provided search parameters.

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

Parameters

filter
String

Filter the result list using the given expression.

orderby
String

A list of expressions that specify the order of the returned resources.

skip
Nullable<Int32>

The number of result items to skip.

maxpagesize
Nullable<Int32>

The maximum number of result items per page.

mark
String

Specify this value instead of 'skip' to use cursor-based searching. Initial value is '*' and subsequent values are returned in the response.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetAssetResourcesAsync.

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

await foreach (AssetResource item in client.GetAssetResourcesAsync())
{
}

This sample shows how to call GetAssetResourcesAsync with all parameters.

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

await foreach (AssetResource item in client.GetAssetResourcesAsync(filter: "<filter>", orderby: "<orderby>", skip: 1234, maxpagesize: 1234, mark: "<mark>"))
{
}

Applies to