DeviceUpdateClient.GetVersionsAsync 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.
[Protocol Method] Get a list of all update versions that match the specified provider and name.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.AsyncPageable<BinaryData> GetVersionsAsync(string provider, string name, string filter = default, Azure.RequestContext context = default);
abstract member GetVersionsAsync : string * string * string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetVersionsAsync : string * string * string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetVersionsAsync (provider As String, name As String, Optional filter As String = Nothing, Optional context As RequestContext = Nothing) As AsyncPageable(Of BinaryData)
Parameters
- provider
- String
Update provider.
- name
- String
Update name.
- filter
- String
Optional to filter updates by isDeployable property.
- context
- RequestContext
The request options, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
provider or name is null.
provider or name 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 GetVersionsAsync with required parameters and parse the result.
var credential = new DefaultAzureCredential();
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new DeviceUpdateClient(endpoint, "<instanceId>", credential);
await foreach (var data in client.GetVersionsAsync("<provider>", "<name>"))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.ToString());
}
This sample shows how to call GetVersionsAsync with all parameters, and how to parse the result.
var credential = new DefaultAzureCredential();
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new DeviceUpdateClient(endpoint, "<instanceId>", credential);
await foreach (var data in client.GetVersionsAsync("<provider>", "<name>", "<filter>"))
{
JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
Console.WriteLine(result.ToString());
}
Remarks
Schema for Response Body:
{
value: [string],
nextLink: string
}
Schema for Response Error:
{
error: {
code: string,
message: string,
target: string,
details: [Error],
innererror: {
code: string,
message: string,
errorDetail: string,
innerError: InnerError
},
occurredDateTime: string (ISO 8601 Format)
}
}