LoadTestAdministrationClient.GetTestFile 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
GetTestFile(String, String, RequestContext) |
[Protocol Method] Get all the files that are associated with a test.
|
GetTestFile(String, String, CancellationToken) |
Get all the files that are associated with a test. |
GetTestFile(String, String, RequestContext)
[Protocol Method] Get all the files that are associated with a test.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetTestFile(String, String, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response GetTestFile(string testId, string fileName, Azure.RequestContext context = default);
public virtual Azure.Response GetTestFile(string testId, string fileName, Azure.RequestContext context);
abstract member GetTestFile : string * string * Azure.RequestContext -> Azure.Response
override this.GetTestFile : string * string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetTestFile (testId As String, fileName As String, Optional context As RequestContext = Nothing) As Response
Public Overridable Function GetTestFile (testId As String, fileName As String, context As RequestContext) As Response
Parameters
- testId
- String
Unique test identifier for the load test, 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
testId
or fileName
is null.
testId
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 GetTestFile and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
LoadTestAdministrationClient client = new LoadTestAdministrationClient(endpoint, credential);
Response response = client.GetTestFile("<testId>", "<fileName>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call GetTestFile with all parameters and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
LoadTestAdministrationClient client = new LoadTestAdministrationClient(endpoint, credential);
Response response = client.GetTestFile("<testId>", "<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
GetTestFile(String, String, CancellationToken)
Get all the files that are associated with a test.
public virtual Azure.Response<Azure.Developer.LoadTesting.TestFileInfo> GetTestFile(string testId, string fileName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetTestFile : string * string * System.Threading.CancellationToken -> Azure.Response<Azure.Developer.LoadTesting.TestFileInfo>
override this.GetTestFile : string * string * System.Threading.CancellationToken -> Azure.Response<Azure.Developer.LoadTesting.TestFileInfo>
Public Overridable Function GetTestFile (testId As String, fileName As String, Optional cancellationToken As CancellationToken = Nothing) As Response(Of TestFileInfo)
Parameters
- testId
- String
Unique test identifier for the load test, 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
testId
or fileName
is null.
testId
or fileName
is an empty string, and was expected to be non-empty.