Share via


ChaosTargetCollection.GetIfExists(String, CancellationToken) Method

Definition

Tries to get details for this resource from the service.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}
  • Operation Id: Targets_Get
  • Default Api Version: 2024-01-01
  • Resource: ChaosTargetResource
public virtual Azure.NullableResponse<Azure.ResourceManager.Chaos.ChaosTargetResource> GetIfExists (string targetName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetIfExists : string * System.Threading.CancellationToken -> Azure.NullableResponse<Azure.ResourceManager.Chaos.ChaosTargetResource>
override this.GetIfExists : string * System.Threading.CancellationToken -> Azure.NullableResponse<Azure.ResourceManager.Chaos.ChaosTargetResource>
Public Overridable Function GetIfExists (targetName As String, Optional cancellationToken As CancellationToken = Nothing) As NullableResponse(Of ChaosTargetResource)

Parameters

targetName
String

String that represents a Target resource name.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

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

targetName is null.

Applies to