Share via


EasmClient.GetAssetResources Method

Definition

Overloads

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

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

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

Retrieve a list of assets for the provided search parameters.

GetAssetResources(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.Pageable<BinaryData> GetAssetResources (string filter, string orderby, int? skip, int? maxpagesize, string mark, Azure.RequestContext context);
abstract member GetAssetResources : string * string * Nullable<int> * Nullable<int> * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetAssetResources : string * string * Nullable<int> * Nullable<int> * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetAssetResources (filter As String, orderby As String, skip As Nullable(Of Integer), maxpagesize As Nullable(Of Integer), mark As String, context As RequestContext) As Pageable(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 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 GetAssetResources 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.GetAssetResources(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 GetAssetResources 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.GetAssetResources("<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

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

Source:
EasmClient.cs

Retrieve a list of assets for the provided search parameters.

public virtual Azure.Pageable<Azure.Analytics.Defender.Easm.AssetResource> GetAssetResources (string filter = default, string orderby = default, int? skip = default, int? maxpagesize = default, string mark = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAssetResources : string * string * Nullable<int> * Nullable<int> * string * System.Threading.CancellationToken -> Azure.Pageable<Azure.Analytics.Defender.Easm.AssetResource>
override this.GetAssetResources : string * string * Nullable<int> * Nullable<int> * string * System.Threading.CancellationToken -> Azure.Pageable<Azure.Analytics.Defender.Easm.AssetResource>
Public Overridable Function GetAssetResources (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 Pageable(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 GetAssetResources.

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

foreach (AssetResource item in client.GetAssetResources())
{
}

This sample shows how to call GetAssetResources with all parameters.

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

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

Applies to