EasmClient.GetSummary Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetSummary(RequestContent, RequestContext) |
[Protocol Method] Get asset summary details for the summary request.
|
GetSummary(ReportAssetSummaryPayload, CancellationToken) |
Get asset summary details for the summary request. |
GetSummary(RequestContent, RequestContext)
- Source:
- EasmClient.cs
[Protocol Method] Get asset summary details for the summary request.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetSummary(ReportAssetSummaryPayload, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response GetSummary (Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member GetSummary : Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.GetSummary : Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function GetSummary (content As RequestContent, Optional context As RequestContext = Nothing) As Response
Parameters
- content
- RequestContent
The content to send as the body of the request.
- 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
content
is null.
Service returned a non-success status code.
Examples
This sample shows how to call GetSummary and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);
using RequestContent content = RequestContent.Create(new object());
Response response = client.GetSummary(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call GetSummary with all request content and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);
using RequestContent content = RequestContent.Create(new
{
metricCategories = new object[]
{
"<metricCategories>"
},
metrics = new object[]
{
"<metrics>"
},
filters = new object[]
{
"<filters>"
},
groupBy = "<groupBy>",
segmentBy = "<segmentBy>",
labelName = "<labelName>",
});
Response response = client.GetSummary(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("updatedAt").ToString());
Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("metricCategory").ToString());
Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("metric").ToString());
Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("filter").ToString());
Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("labelName").ToString());
Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("count").ToString());
Console.WriteLine(result.GetProperty("assetSummaries")[0].GetProperty("link").ToString());
Applies to
GetSummary(ReportAssetSummaryPayload, CancellationToken)
- Source:
- EasmClient.cs
Get asset summary details for the summary request.
public virtual Azure.Response<Azure.Analytics.Defender.Easm.ReportAssetSummaryResult> GetSummary (Azure.Analytics.Defender.Easm.ReportAssetSummaryPayload reportAssetSummaryPayload, System.Threading.CancellationToken cancellationToken = default);
abstract member GetSummary : Azure.Analytics.Defender.Easm.ReportAssetSummaryPayload * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Defender.Easm.ReportAssetSummaryResult>
override this.GetSummary : Azure.Analytics.Defender.Easm.ReportAssetSummaryPayload * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Defender.Easm.ReportAssetSummaryResult>
Public Overridable Function GetSummary (reportAssetSummaryPayload As ReportAssetSummaryPayload, Optional cancellationToken As CancellationToken = Nothing) As Response(Of ReportAssetSummaryResult)
Parameters
- reportAssetSummaryPayload
- ReportAssetSummaryPayload
A request body used to retrieve summary asset information. One and only one collection of summary identifiers must be provided: filters, metrics, or metricCategories.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
reportAssetSummaryPayload
is null.
Examples
This sample shows how to call GetSummary.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);
ReportAssetSummaryPayload reportAssetSummaryPayload = new ReportAssetSummaryPayload();
Response<ReportAssetSummaryResult> response = client.GetSummary(reportAssetSummaryPayload);
This sample shows how to call GetSummary with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
EasmClient client = new EasmClient(endpoint, credential);
ReportAssetSummaryPayload reportAssetSummaryPayload = new ReportAssetSummaryPayload
{
MetricCategories = { "<metricCategories>" },
Metrics = { "<metrics>" },
Filters = { "<filters>" },
GroupBy = "<groupBy>",
SegmentBy = "<segmentBy>",
LabelName = "<labelName>",
};
Response<ReportAssetSummaryResult> response = client.GetSummary(reportAssetSummaryPayload);
Applies to
Azure SDK for .NET