Share via


EasmClient.GetDiscoveryGroup Method

Definition

Overloads

GetDiscoveryGroup(String, RequestContext)

[Protocol Method] Retrieve a discovery group with a given groupName.

GetDiscoveryGroup(String, CancellationToken)

Retrieve a discovery group with a given groupName.

GetDiscoveryGroup(String, RequestContext)

Source:
EasmClient.cs

[Protocol Method] Retrieve a discovery group with a given groupName.

public virtual Azure.Response GetDiscoveryGroup (string groupName, Azure.RequestContext context);
abstract member GetDiscoveryGroup : string * Azure.RequestContext -> Azure.Response
override this.GetDiscoveryGroup : string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetDiscoveryGroup (groupName As String, context As RequestContext) As Response

Parameters

groupName
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

groupName is null.

groupName 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 GetDiscoveryGroup 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 = client.GetDiscoveryGroup("<groupName>", null);

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

This sample shows how to call GetDiscoveryGroup 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 = client.GetDiscoveryGroup("<groupName>", 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("description").ToString());
Console.WriteLine(result.GetProperty("tier").ToString());
Console.WriteLine(result.GetProperty("frequencyMilliseconds").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());
Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString());
Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString());
Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString());
Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString());
Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString());
Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString());
Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString());
Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString());
Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString());
Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString());
Console.WriteLine(result.GetProperty("createdDate").ToString());
Console.WriteLine(result.GetProperty("templateId").ToString());

Applies to

GetDiscoveryGroup(String, CancellationToken)

Source:
EasmClient.cs

Retrieve a discovery group with a given groupName.

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

Parameters

groupName
String

The caller provided unique name for the resource.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

groupName is null.

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

Examples

This sample shows how to call GetDiscoveryGroup.

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

Response<DiscoveryGroup> response = client.GetDiscoveryGroup("<groupName>");

This sample shows how to call GetDiscoveryGroup with all parameters.

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

Response<DiscoveryGroup> response = client.GetDiscoveryGroup("<groupName>");

Applies to