你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

LoadTestRunClient.GetTestRunFileAsync Method

Definition

Overloads

GetTestRunFileAsync(String, String, RequestContext)

[Protocol Method] Get test run file by file name.

GetTestRunFileAsync(String, String, CancellationToken)

Get test run file by file name.

GetTestRunFileAsync(String, String, RequestContext)

Source:
LoadTestRunClient.cs
Source:
LoadTestRunClient.cs

[Protocol Method] Get test run file by file name.

public virtual System.Threading.Tasks.Task<Azure.Response> GetTestRunFileAsync(string testRunId, string fileName, Azure.RequestContext context = default);
public virtual System.Threading.Tasks.Task<Azure.Response> GetTestRunFileAsync(string testRunId, string fileName, Azure.RequestContext context);
abstract member GetTestRunFileAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetTestRunFileAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetTestRunFileAsync (testRunId As String, fileName As String, Optional context As RequestContext = Nothing) As Task(Of Response)
Public Overridable Function GetTestRunFileAsync (testRunId As String, fileName As String, context As RequestContext) As Task(Of Response)

Parameters

testRunId
String

Unique test run identifier for the load test run, must contain only lower-case alphabetic, numeric, underscore or hyphen characters.

fileName
String

Name of the file.

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

testRunId or fileName is null.

testRunId or fileName 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 GetTestRunFileAsync and parse the result.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
LoadTestRunClient client = new LoadTestRunClient(endpoint, credential);

Response response = await client.GetTestRunFileAsync("<testRunId>", "<fileName>");

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

This sample shows how to call GetTestRunFileAsync with all parameters and parse the result.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
LoadTestRunClient client = new LoadTestRunClient(endpoint, credential);

Response response = await client.GetTestRunFileAsync("<testRunId>", "<fileName>");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("url").ToString());
Console.WriteLine(result.GetProperty("fileName").ToString());
Console.WriteLine(result.GetProperty("fileType").ToString());
Console.WriteLine(result.GetProperty("expireDateTime").ToString());
Console.WriteLine(result.GetProperty("validationStatus").ToString());
Console.WriteLine(result.GetProperty("validationFailureDetails").ToString());

Remarks

Below is the JSON schema for the response payload.

Response Body:

Schema for FileInfo:

{
  url: string, # Optional. File URL.
  fileName: string, # Optional. Name of the file.
  fileType: "JMX_FILE" | "USER_PROPERTIES" | "ADDITIONAL_ARTIFACTS", # Optional. File type
  expireDateTime: string (ISO 8601 Format), # Optional. Expiry time of the file (ISO 8601 literal format)
  validationStatus: "NOT_VALIDATED" | "VALIDATION_SUCCESS" | "VALIDATION_FAILURE" | "VALIDATION_INITIATED" | "VALIDATION_NOT_REQUIRED", # Optional. Validation status of the file
  validationFailureDetails: string, # Optional. Validation failure error details
}

Applies to

GetTestRunFileAsync(String, String, CancellationToken)

Source:
LoadTestRunClient.cs

Get test run file by file name.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Developer.LoadTesting.TestRunFileInfo>> GetTestRunFileAsync(string testRunId, string fileName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetTestRunFileAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Developer.LoadTesting.TestRunFileInfo>>
override this.GetTestRunFileAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Developer.LoadTesting.TestRunFileInfo>>
Public Overridable Function GetTestRunFileAsync (testRunId As String, fileName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of TestRunFileInfo))

Parameters

testRunId
String

Unique test run identifier for the load test run, must contain only lower-case alphabetic, numeric, underscore or hyphen characters.

fileName
String

Name of the file.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

testRunId or fileName is null.

testRunId or fileName is an empty string, and was expected to be non-empty.

Applies to