diff --git a/sdk/mixedreality/Azure.MixedReality.Authentication/shared/AuthenticationEndpoint.cs b/sdk/mixedreality/Azure.MixedReality.Authentication/shared/AuthenticationEndpoint.cs index 1cb3026e044b..238c8483bed0 100644 --- a/sdk/mixedreality/Azure.MixedReality.Authentication/shared/AuthenticationEndpoint.cs +++ b/sdk/mixedreality/Azure.MixedReality.Authentication/shared/AuthenticationEndpoint.cs @@ -4,6 +4,8 @@ using Azure.Core; using System; +#nullable enable + namespace Azure.MixedReality.Authentication { internal static class AuthenticationEndpoint diff --git a/sdk/mixedreality/Azure.MixedReality.Authentication/shared/MixedRealityTokenCredential.cs b/sdk/mixedreality/Azure.MixedReality.Authentication/shared/MixedRealityTokenCredential.cs index f6e2b5b697da..990f62975ff7 100644 --- a/sdk/mixedreality/Azure.MixedReality.Authentication/shared/MixedRealityTokenCredential.cs +++ b/sdk/mixedreality/Azure.MixedReality.Authentication/shared/MixedRealityTokenCredential.cs @@ -6,6 +6,8 @@ using System.Threading.Tasks; using Azure.Core; +#nullable enable + namespace Azure.MixedReality.Authentication { /// diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/Azure.MixedReality.RemoteRendering.sln b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/Azure.MixedReality.RemoteRendering.sln new file mode 100644 index 000000000000..471d3c8bd365 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/Azure.MixedReality.RemoteRendering.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30804.86 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.MixedReality.RemoteRendering", "src\Azure.MixedReality.RemoteRendering.csproj", "{ECE9B1E6-05DF-4DFE-9B1C-52A16B3ABB7A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.MixedReality.RemoteRendering.Tests", "tests\Azure.MixedReality.RemoteRendering.Tests.csproj", "{2B67CBA1-55D8-491E-80CC-96A590E3F4F7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{85271BAE-8B48-43B6-8A16-BBD3F14F7AA1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.MixedReality.Authentication", "..\Azure.MixedReality.Authentication\src\Azure.MixedReality.Authentication.csproj", "{D918FBC5-CB77-4ADB-9880-8C7F7808D30C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ECE9B1E6-05DF-4DFE-9B1C-52A16B3ABB7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECE9B1E6-05DF-4DFE-9B1C-52A16B3ABB7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECE9B1E6-05DF-4DFE-9B1C-52A16B3ABB7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECE9B1E6-05DF-4DFE-9B1C-52A16B3ABB7A}.Release|Any CPU.Build.0 = Release|Any CPU + {2B67CBA1-55D8-491E-80CC-96A590E3F4F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B67CBA1-55D8-491E-80CC-96A590E3F4F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B67CBA1-55D8-491E-80CC-96A590E3F4F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B67CBA1-55D8-491E-80CC-96A590E3F4F7}.Release|Any CPU.Build.0 = Release|Any CPU + {85271BAE-8B48-43B6-8A16-BBD3F14F7AA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85271BAE-8B48-43B6-8A16-BBD3F14F7AA1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85271BAE-8B48-43B6-8A16-BBD3F14F7AA1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85271BAE-8B48-43B6-8A16-BBD3F14F7AA1}.Release|Any CPU.Build.0 = Release|Any CPU + {D918FBC5-CB77-4ADB-9880-8C7F7808D30C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D918FBC5-CB77-4ADB-9880-8C7F7808D30C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D918FBC5-CB77-4ADB-9880-8C7F7808D30C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D918FBC5-CB77-4ADB-9880-8C7F7808D30C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DC488E19-B259-4BFE-A0F2-ABE222B90514} + EndGlobalSection +EndGlobal diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/CHANGELOG.md b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/CHANGELOG.md new file mode 100644 index 000000000000..34a3d3de3cc3 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/CHANGELOG.md @@ -0,0 +1,4 @@ +# Release History + +## 1.0.0-beta.1 (2021-05-02) +- Initial version of client. diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/Directory.Build.props b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/Directory.Build.props new file mode 100644 index 000000000000..1a9611bd4924 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/README.md b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/README.md new file mode 100644 index 000000000000..58b0f40c0811 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/README.md @@ -0,0 +1,362 @@ +# Azure Remote Rendering client library for .NET + +Azure Remote Rendering (ARR) is a service that enables you to render high-quality, interactive 3D content in the cloud and stream it in real time to devices, such as the HoloLens 2. + +This SDK offers functionality to convert assets to the format expected by the runtime, and also to manage +the lifetime of remote rendering sessions. + +> NOTE: Once a session is running, a client application will connect to it using one of the "runtime SDKs". +> These SDKs are designed to best support the needs of an interactive application doing 3d rendering. +> They are available in ([.net](https://docs.microsoft.com/dotnet/api/microsoft.azure.remoterendering) +> or ([C++](https://docs.microsoft.com/cpp/api/remote-rendering/)). + +[Product documentation](https://docs.microsoft.com/azure/remote-rendering/) + +## Getting started + +### Install the package + +Install the Azure Mixed Reality ARR client library for .NET using one of the following methods. + +From Visual Studio Package Manager: + +```powershell +Install-Package Azure.MixedReality.RemoteRendering -AllowPrereleaseVersions +``` + +From .NET CLI + +```dotnetcli +dotnet add package Azure.MixedReality.RemoteRendering --version 1.0.0-beta.1 +``` + +Add a package reference: + +```xml + +``` + +### Prerequisites + +You will need an [Azure subscription](https://azure.microsoft.com/free/) and an [Azure Remote Rendering account](https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account) to use this package. + +### Authenticate the client + +Constructing a remote rendering client requires an authenticated account, and a remote rendering endpoint. +A RemoteRenderingAccount object is constructed from an accountId and an account domain. +For an account created in the eastus region, the account domain will have the form "eastus.mixedreality.azure.com". +There are several different forms of authentication: + +- Account Key authentication + - Account keys enable you to get started quickly with using Azure Remote Rendering. But before you deploy your application + to production, we recommend that you update your app to use Azure AD authentication. +- Azure Active Directory (AD) token authentication + - If you're building an enterprise application and your company is using Azure AD as its identity system, you can use + user-based Azure AD authentication in your app. You then grant access to your Azure Remote Rendering accounts by using + your existing Azure AD security groups. You can also grant access directly to users in your organization. + - Otherwise, we recommend that you obtain Azure AD tokens from a web service that supports your app. We recommend this + method for production applications because it allows you to avoid embedding the credentials for access to Azure Spatial + Anchors in your client application. + +See [here](https://docs.microsoft.com/azure/remote-rendering/how-tos/authentication) for detailed instructions and information. + +In all the following examples, the client is constructed with a `remoteRenderingEndpoint` Uri object. +The available endpoints correspond to regions, and the choice of endpoint determines the region in which the service performs its work. +An example is `https://remoterendering.eastus2.mixedreality.azure.com`. + +> NOTE: For converting assets, it is preferable to pick a region close to the storage containing the assets. + +> NOTE: For rendering, it is strongly recommended that you pick the closest region to the devices using the service. +> The time taken to communicate with the server impacts the quality of the experience. + +#### Authenticating with account key authentication + +Use the `AccountKeyCredential` object to use an account identifier and account key to authenticate: + +```csharp Snippet:CreateAClient +RemoteRenderingAccount account = new RemoteRenderingAccount(accountId, accountDomain); +AzureKeyCredential accountKeyCredential = new AzureKeyCredential(accountKey); + +RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, account, accountKeyCredential); +``` + +#### Authenticating with an AAD client secret + +Use the `ClientSecretCredential` object to perform client secret authentication. + +```csharp Snippet:CreateAClientWithAAD +RemoteRenderingAccount account = new RemoteRenderingAccount(accountId, accountDomain); + +TokenCredential credential = new ClientSecretCredential(tenantId, clientId, clientSecret, new TokenCredentialOptions +{ + AuthorityHost = new Uri($"https://login.microsoftonline.com/{tenantId}") +}); + +RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, account, credential); +``` + +#### Authenticating a user using device code authentication + +Use the `DeviceCodeCredential` object to perform device code authentication. + +```csharp Snippet:CreateAClientWithDeviceCode +RemoteRenderingAccount account = new RemoteRenderingAccount(accountId, accountDomain); + +Task deviceCodeCallback(DeviceCodeInfo deviceCodeInfo, CancellationToken cancellationToken) +{ + Debug.WriteLine(deviceCodeInfo.Message); + Console.WriteLine(deviceCodeInfo.Message); + return Task.FromResult(0); +} + +TokenCredential credential = new DeviceCodeCredential(deviceCodeCallback, tenantId, clientId, new TokenCredentialOptions +{ + AuthorityHost = new Uri($"https://login.microsoftonline.com/{tenantId}"), +}); + +RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, account, credential); +``` + +See [here](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/Device-Code-Flow) for more +information about using device code authentication flow. + +#### Interactive authentication with DefaultAzureCredential + +Use the `DefaultAzureCredential` object with `includeInteractiveCredentials: true` to use default interactive authentication +flow: + +```csharp Snippet:CreateAClientWithAzureCredential +RemoteRenderingAccount account = new RemoteRenderingAccount(accountId, accountDomain); +TokenCredential credential = new DefaultAzureCredential(includeInteractiveCredentials: true); + +RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, account, credential); +``` + +#### Authenticating with a static access token + +You can pass a Mixed Reality access token as an `AccessToken` previously retrieved from the +[Mixed Reality STS service](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/mixedreality/Azure.MixedReality.Authentication) +to be used with a Mixed Reality client library: + +```csharp Snippet:CreateAClientWithStaticAccessToken +RemoteRenderingAccount account = new RemoteRenderingAccount(accountId, accountDomain); + +// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves +// a Mixed Reality access token from a web service. The web service would use the +// MixedRealityStsClient and credentials to obtain an access token to be returned +// to the client. +AccessToken accessToken = GetMixedRealityAccessTokenFromWebService(); + +RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, account, accessToken); +``` + +## Key concepts + +### RemoteRenderingClient + +The `RemoteRenderingClient` is the client library used to access the RemoteRenderingService. +It provides methods to create and manage asset conversions and rendering sessions. + +## Examples + +- [Convert a simple asset](#convert-a-simple-asset) +- [Convert a more complex asset](#convert-a-more-complex-asset) +- [Get the output when an asset conversion has finished](#get-the-output-when-an-asset-conversion-has-finished) +- [List conversions](#list-conversions) +- [Create a session](#create-a-session) +- [Extend the lease time of a session](#extend-the-lease-time-of-a-session) +- [List sessions](#list-sessions) +- [Stop a session](#stop-a-session) + +### Convert a simple asset + +We assume that a RemoteRenderingClient has been constructed as described in the [Authenticate the Client](#authenticate-the-client) section. +The following snippet describes how to request that "box.fbx", found at the root of the blob container at the given URI, gets converted. + +```csharp Snippet:StartAnAssetConversion + AssetConversionInputOptions inputOptions = new AssetConversionInputOptions(storageUri, "box.fbx"); + AssetConversionOutputOptions outputOptions = new AssetConversionOutputOptions(storageUri); + AssetConversionOptions conversionOptions = new AssetConversionOptions(inputOptions, outputOptions); + + // A randomly generated GUID is a good choice for a conversionId. + string conversionId = Guid.NewGuid().ToString(); + + AssetConversionOperation conversionOperation = client.StartConversion(conversionId, conversionOptions); +``` + +The output files will be placed beside the input asset. + +### Convert a more complex asset + +Assets can reference other files, and blob containers can contain files belonging to many different assets. +In this example, we show how prefixes can be used to organize your blobs and how to convert an asset to take account of that organization. +Assume that the blob container at `inputStorageUri` contains many files, including "Bicycle/bicycle.gltf", "Bicycle/bicycle.bin" and "Bicycle/saddleTexture.jpg". +(So the prefix "Bicycle" is acting very like a folder.) +We want to convert the gltf so that it has access to the other files which share the prefix, without requiring the conversion service to access any other files. +To keep things tidy, we also want the output files to be written to a different storage container and given a common prefix: "ConvertedBicycle". +The code is as follows: + +```csharp Snippet:StartAComplexAssetConversion + AssetConversionInputOptions input = new AssetConversionInputOptions(inputStorageUri, "bicycle.gltf") + { + BlobPrefix = "Bicycle" + }; + AssetConversionOutputOptions output = new AssetConversionOutputOptions(outputStorageUri) + { + BlobPrefix = "ConvertedBicycle" + }; + AssetConversionOptions conversionOptions = new AssetConversionOptions(inputOptions, outputOptions); + + string conversionId = Guid.NewGuid().ToString(); + + AssetConversionOperation conversionOperation = client.StartConversion(conversionId, conversionOptions); +``` + +> NOTE: when a prefix is given in the input options, then the input file parameter is assumed to be relative to that prefix. +> The same applies to the output file parameter in output options. + +### Get the output when an asset conversion has finished + +Converting an asset can take anywhere from seconds to hours. +This code uses an existing conversionOperation and polls regularly until the conversion has finished or failed. +The default polling period is 10 seconds. +Note that a conversionOperation can be constructed from the conversionId of an existing conversion and a client. + +```csharp Snippet:QueryConversionStatus + AssetConversion conversion = conversionOperation.WaitForCompletionAsync().Result; + if (conversion.Status == AssetConversionStatus.Succeeded) + { + Console.WriteLine($"Conversion succeeded: Output written to {conversion.Output.OutputAssetUri}"); + } + else if (conversion.Status == AssetConversionStatus.Failed) + { + Console.WriteLine($"Conversion failed: {conversion.Error.Code} {conversion.Error.Message}"); + } +``` + +### List conversions + +You can get information about your conversions using the `getConversions` method. +This method may return conversions which have yet to start, conversions which are running and conversions which have finished. +In this example, we just list the output URIs of successful conversions started in the last day. + +```csharp Snippet:ListConversions + foreach (var conversion in client.GetConversions()) + { + if ((conversion.Status == AssetConversionStatus.Succeeded) && (conversion.CreatedOn > DateTimeOffset.Now.AddDays(-1))) + { + Console.WriteLine($"output asset URI: {conversion.Output.OutputAssetUri}"); + } + } +``` + +### Create a session + +We assume that a RemoteRenderingClient has been constructed as described in the [Authenticate the Client](#authenticate-the-client) section. +The following snippet describes how to request that a new rendering session be started. + +```csharp Snippet:CreateASession + RenderingSessionOptions options = new RenderingSessionOptions(TimeSpan.FromMinutes(30), RenderingServerSize.Standard); + + // A randomly generated GUID is a good choice for a sessionId. + string sessionId = Guid.NewGuid().ToString(); + + StartRenderingSessionOperation startSessionOperation = client.StartSession(sessionId, options); + + RenderingSession newSession = startSessionOperation.WaitForCompletionAsync().Result; + if (newSession.Status == RenderingSessionStatus.Ready) + { + Console.WriteLine($"Session {sessionId} is ready."); + } + else if (newSession.Status == RenderingSessionStatus.Error) + { + Console.WriteLine($"Session {sessionId} encountered an error: {newSession.Error.Code} {newSession.Error.Message}"); + } +``` + +### Extend the lease time of a session + +If a session is approaching its maximum lease time, but you want to keep it alive, you will need to make a call to increase +its maximum lease time. +This example shows how to query the current properties and then extend the lease if it will expire soon. + +> NOTE: The runtime SDKs also offer this functionality, and in many typical scenarios, you would use them to +> extend the session lease. + +```csharp Snippet:UpdateSession + RenderingSession currentSession = client.GetSession(sessionId); + + if (currentSession.MaxLeaseTime - DateTimeOffset.Now.Subtract(currentSession.CreatedOn.Value) < TimeSpan.FromMinutes(2)) + { + TimeSpan newLeaseTime = currentSession.MaxLeaseTime.Value.Add(TimeSpan.FromMinutes(30)); + + UpdateSessionOptions longerLeaseSettings = new UpdateSessionOptions(newLeaseTime); + + client.UpdateSession(sessionId, longerLeaseSettings); + } +``` + +### List sessions + +You can get information about your sessions using the `getSessions` method. +This method may return sessions which have yet to start and sessions which are ready. + +```csharp Snippet:ListSessions + foreach (var properties in client.GetSessions()) + { + if (properties.Status == RenderingSessionStatus.Starting) + { + Console.WriteLine($"Session \"{properties.SessionId}\" is starting."); + } + else if (properties.Status == RenderingSessionStatus.Ready) + { + Console.WriteLine($"Session \"{properties.SessionId}\" is ready at host {properties.Host}"); + } + } +``` + +### Stop a session + +The following code will stop a running session with given id. + +```csharp Snippet:StopSession + client.StopSession(sessionId); +``` + +## Troubleshooting + +For general troubleshooting advice concerning Azure Remote Rendering, see [the Troubleshoot page](https://docs.microsoft.com/azure/remote-rendering/resources/troubleshoot) for remote rendering at docs.microsoft.com. + +The client methods will throw exceptions if the request cannot be made. +However, in the case of both conversions and sessions, the requests can succeed but the requested operation may not be successful. +In this case, no exception will be thrown, but the returned objects can be inspected to understand what happened. + +If the asset in a conversion is invalid, the conversion operation will return an AssetConversion object +with a Failed status and carrying a RemoteRenderingServiceError with details. +Once the conversion service is able to process the file, a <assetName>.result.json file will be written to the output container. +If the input asset is invalid, then that file will contain a more detailed description of the problem. + +Similarly, sometimes when a session is requested, the session ends up in an error state. +The startSessionOperation method will return a RenderingSession object, but that object will have an Error status and carry a +RemoteRenderingServiceError with details. + +## Next steps + +- Read the [Product documentation](https://docs.microsoft.com/azure/remote-rendering/) +- Learn about the runtime SDKs: + - .NET: https://docs.microsoft.com/dotnet/api/microsoft.azure.remoterendering + - C++: https://docs.microsoft.com/cpp/api/remote-rendering/ + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License +Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. +For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the +PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this +once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact +[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/AssetConversionOperation.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/AssetConversionOperation.cs new file mode 100644 index 000000000000..c3d50e9abd5f --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/AssetConversionOperation.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Azure.MixedReality.RemoteRendering +{ + /// + /// Operation which represents an ongoing conversion operation. + /// It is returned by StartConversion, but can also be constructed from the id of a preexisting conversion. + /// + public class AssetConversionOperation : Operation + { + private RemoteRenderingClient _client; + private Response _response; + + /// + /// Construct an operation from a conversion which already exists. + /// + /// + /// + public AssetConversionOperation(string conversionId, RemoteRenderingClient client) + { + _client = client; + _response = client.GetConversionInternal(conversionId, $"{nameof(AssetConversionOperation)}.{nameof(AssetConversionOperation)}"); + } + + /// + /// Internal constructor. + /// + /// + /// + internal AssetConversionOperation(RemoteRenderingClient client, Response response) + { + _client = client; + _response = response; + } + + /// + public override string Id => _response.Value.ConversionId; + + /// + public override AssetConversion Value + { + get + { + return _response.Value; + } + } + + /// + public override bool HasCompleted + { + get { return (_response.Value.Status != AssetConversionStatus.NotStarted) && (_response.Value.Status != AssetConversionStatus.Running); } + } + + /// + public override bool HasValue + { + get { return true; } + } + + /// + public override Response GetRawResponse() + { + return _response.GetRawResponse(); + } + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) + { + if (!HasCompleted) + { + _response = _client.GetConversionInternal(_response.Value.ConversionId, $"{nameof(AssetConversionOperation)}.{nameof(UpdateStatus)}", cancellationToken); + } + return _response.GetRawResponse(); + } + + /// + public async override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) + { + if (!HasCompleted) + { + _response = await _client.GetConversionInternalAsync(_response.Value.ConversionId, $"{nameof(AssetConversionOperation)}.{nameof(UpdateStatus)}", cancellationToken).ConfigureAwait(false); + } + return _response.GetRawResponse(); + } + + /// + public async override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) + { + return await WaitForCompletionAsync(TimeSpan.FromSeconds(10), cancellationToken).ConfigureAwait(false); + } + + /// + public async override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) + { + while (true) + { + await UpdateStatusAsync(cancellationToken).ConfigureAwait(false); + if (HasCompleted) + { + break; + } + await Task.Delay(pollingInterval, cancellationToken).ConfigureAwait(false); + } + return _response; + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Azure.MixedReality.RemoteRendering.csproj b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Azure.MixedReality.RemoteRendering.csproj new file mode 100644 index 000000000000..478a28cb7c5d --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Azure.MixedReality.RemoteRendering.csproj @@ -0,0 +1,28 @@ + + + Microsoft Azure Mixed Reality ARR Client + 1.0.0-beta.1 + Azure MixedReality + Microsoft + $(RequiredTargetFrameworks) + + + + + + + + + + + + + + + + + + + + + diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversion.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversion.cs new file mode 100644 index 000000000000..afdc2f9ae640 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversion.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using System; + +namespace Azure.MixedReality.RemoteRendering +{ + /// + /// Information concerning the state of a conversion. + /// + [CodeGenModel("Conversion")] + public partial class AssetConversion + { + /// The id of the conversion supplied when the conversion was created. + [CodeGenMember("Id")] + public string ConversionId { get; } + + /// Settings for where to retrieve input files from and where to write output files. Supplied when creating the conversion. + [CodeGenMember("Settings")] + public AssetConversionOptions Options { get; } + + /// The time when the conversion was created. Date and time in ISO 8601 format. + [CodeGenMember("CreationTime")] + public DateTimeOffset CreatedOn { get; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionInputOptions.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionInputOptions.cs new file mode 100644 index 000000000000..c7c99aac5693 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionInputOptions.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using System; + +namespace Azure.MixedReality.RemoteRendering +{ + /// Settings for the conversion input. + [CodeGenModel("ConversionInputSettings")] + public partial class AssetConversionInputOptions + { + /// The URI of the Azure blob storage container containing the input model. + [CodeGenMember("StorageContainerUri")] + public Uri StorageContainerUri { get; } + /// The relative path starting at blobPrefix (or at the container root if blobPrefix is not specified) to the input model. Must point to file with a supported file format ending. + [CodeGenMember("RelativeInputAssetPath")] + public string RelativeInputAssetPath { get; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionOptions.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionOptions.cs new file mode 100644 index 000000000000..764eb3b5c29c --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionOptions.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + /// + /// Information concerning the state of a conversion. + /// + [CodeGenModel("ConversionSettings")] + public partial class AssetConversionOptions + { + /// Options for the conversion input. + [CodeGenMember("InputLocation")] + public AssetConversionInputOptions InputOptions { get; } + + /// Options for the conversion output. + [CodeGenMember("OutputLocation")] + public AssetConversionOutputOptions OutputOptions { get; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionOutput.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionOutput.cs new file mode 100644 index 000000000000..95c90536ef14 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionOutput.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + /// Information about the output of a successful conversion. Only present when the status of the conversion is 'Succeeded'. + [CodeGenModel("ConversionOutput")] + public partial class AssetConversionOutput + { + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionOutputOptions.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionOutputOptions.cs new file mode 100644 index 000000000000..94baed6e2489 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionOutputOptions.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using System; + +namespace Azure.MixedReality.RemoteRendering +{ + [CodeGenModel("ConversionOutputSettings")] + public partial class AssetConversionOutputOptions + { + /// The URI of the Azure blob storage container containing the input model. + [CodeGenMember("StorageContainerUri")] + public Uri StorageContainerUri { get; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionStatus.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionStatus.cs new file mode 100644 index 000000000000..aeb1fbb7a2e2 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/AssetConversionStatus.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + /// The status of the conversion. Terminal states are 'Cancelled', 'Failed', 'Succeeded'. + [CodeGenModel("ConversionStatus")] + public partial struct AssetConversionStatus + { + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/ConversionList.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/ConversionList.cs new file mode 100644 index 000000000000..19ab2bd92618 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/ConversionList.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + [CodeGenModel("ConversionList")] + internal partial class ConversionList + { + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/CreateConversionSettings.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/CreateConversionSettings.cs new file mode 100644 index 000000000000..650ed793c1ba --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/CreateConversionSettings.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + [CodeGenModel("CreateConversionSettings")] + internal partial class CreateConversionSettings + { + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RemoteRenderingServiceError.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RemoteRenderingServiceError.cs new file mode 100644 index 000000000000..6e935e5cf167 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RemoteRenderingServiceError.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + /// + /// Specific details about errors that occurred, describing why a conversion failed or a rendering session is in an error state. + /// + [CodeGenModel("Error")] + public partial class RemoteRenderingServiceError + { + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RenderingServerSize.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RenderingServerSize.cs new file mode 100644 index 000000000000..5a5f2122011d --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RenderingServerSize.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + /// + /// The "size" of server to use for a rendering session: Standard or Premium. + /// + [CodeGenModel("SessionSize")] + public partial struct RenderingServerSize + { + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RenderingSession.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RenderingSession.cs new file mode 100644 index 000000000000..fbbd8390a14b --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RenderingSession.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using System; + +namespace Azure.MixedReality.RemoteRendering +{ + /// + /// The properties of a remote rendering session. + /// + [CodeGenModel("SessionProperties")] + public partial class RenderingSession + { + /// The id of the session supplied when the session was created. + [CodeGenMember("Id")] + public string SessionId { get; } + + /// The host where the rendering session is reachable. + [CodeGenMember("Hostname")] + public string Host { get; } + + /// The time in minutes the session will run after reaching the 'Ready' state. + [CodeGenMember("MaxLeaseTimeMinutes")] + internal int? MaxLeaseTimeMinutes { get; } + + /// The time the session will run after reaching the 'Ready' state. + public TimeSpan? MaxLeaseTime + { + get + { + if (MaxLeaseTimeMinutes.HasValue) + { + return TimeSpan.FromMinutes(MaxLeaseTimeMinutes.Value); + } + else + { + return null; + } + } + } + + /// The time when the rendering session was created. Date and time in ISO 8601 format. + [CodeGenMember("CreationTime")] + public DateTimeOffset? CreatedOn { get; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RenderingSessionOptions.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RenderingSessionOptions.cs new file mode 100644 index 000000000000..fb5005df661c --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RenderingSessionOptions.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using System; + +namespace Azure.MixedReality.RemoteRendering +{ + /// The Options requested when starting a session. + [CodeGenModel("CreateSessionSettings")] + public partial class RenderingSessionOptions + { + /// Initializes a new instance of RenderingSessionOptions. + /// The time the session will run after reaching the 'Ready' state. The provided values will be rounded to the nearest minute. + /// Size of the server used for the rendering session. Remote Rendering with Standard size server has a maximum scene size of 20 million polygons. Remote Rendering with Premium size does not enforce a hard maximum, but performance may be degraded if your content exceeds the rendering capabilities of the service. + public RenderingSessionOptions(TimeSpan maxLeaseTime, RenderingServerSize size) + { + MaxLeaseTimeMinutes = (int)Math.Round(maxLeaseTime.TotalMinutes); + Size = size; + } + + /// Initializes a new instance of RenderingSessionOptions. + /// The time in minutes the session will run after reaching the 'Ready' state. + /// Size of the server used for the rendering session. Remote Rendering with Standard size server has a maximum scene size of 20 million polygons. Remote Rendering with Premium size does not enforce a hard maximum, but performance may be degraded if your content exceeds the rendering capabilities of the service. + internal RenderingSessionOptions(int maxLeaseTimeMinutes, RenderingServerSize size) + { + MaxLeaseTimeMinutes = maxLeaseTimeMinutes; + Size = size; + } + + /// The time in minutes the session will run after reaching the 'Ready' state. + [CodeGenMember("MaxLeaseTimeMinutes")] + internal int MaxLeaseTimeMinutes { get; } + + /// The time the session will run after reaching the 'Ready' state. + public TimeSpan MaxLeaseTime + { + get + { + return TimeSpan.FromMinutes(MaxLeaseTimeMinutes); + } + } + } +} \ No newline at end of file diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RenderingSessionStatus.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RenderingSessionStatus.cs new file mode 100644 index 000000000000..5e3a5feece90 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/RenderingSessionStatus.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + /// + /// The status of the rendering session. Once the status reached the 'Ready' state it can be connected to. The terminal state is 'Stopped'. + /// + [CodeGenModel("SessionStatus")] + public partial struct RenderingSessionStatus + { + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/SessionsList.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/SessionsList.cs new file mode 100644 index 000000000000..2abcc0e2c99b --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/SessionsList.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + [CodeGenModel("SessionsList")] + internal partial class SessionsList + { + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/UpdateSessionOptions.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/UpdateSessionOptions.cs new file mode 100644 index 000000000000..fd2d0a41ef46 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Customizations/Models/UpdateSessionOptions.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using System; + +namespace Azure.MixedReality.RemoteRendering +{ + /// + /// This defines new values for session properties which can be adjusted. + /// + [CodeGenModel("UpdateSessionSettings")] + public partial class UpdateSessionOptions + { + /// Initializes a new instance of UpdateSessionOptions. + /// Update to the time the session will run after it reached the 'Ready' state. It has to be bigger than the current value of maxLeaseTimeMinutes. + internal UpdateSessionOptions(int maxLeaseTimeMinutes) + { + MaxLeaseTimeMinutes = maxLeaseTimeMinutes; + } + + /// + /// Options requesting that the lease time should be set to the given value (which is rounded to minutes). + /// + /// Update to the time the session will run after it reached the 'Ready' state. It has to be bigger than the current value. + public UpdateSessionOptions(TimeSpan maxLeaseTime) + { + MaxLeaseTimeMinutes = (int)Math.Round(maxLeaseTime.TotalMinutes); + } + + /// Update to the time the session will run after it reached the 'Ready' state. It has to be bigger than the current value of maxLeaseTimeMinutes. + [CodeGenMember("MaxTimeSpanMinutes")] + internal int MaxLeaseTimeMinutes { get; } + + /// + /// The new lease time to use for the session. + /// + public TimeSpan MaxLeaseTime + { + get + { + return TimeSpan.FromMinutes(MaxLeaseTimeMinutes); + } + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingCreateConversionHeaders.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingCreateConversionHeaders.cs new file mode 100644 index 000000000000..41b2b093d777 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingCreateConversionHeaders.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + internal class MixedRealityRemoteRenderingCreateConversionHeaders + { + private readonly Response _response; + public MixedRealityRemoteRenderingCreateConversionHeaders(Response response) + { + _response = response; + } + /// Microsoft Correlation Vector. Include this value when reporting issues. + public string MSCV => _response.Headers.TryGetValue("MS-CV", out string value) ? value : null; + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingCreateSessionHeaders.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingCreateSessionHeaders.cs new file mode 100644 index 000000000000..c131b04cbd70 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingCreateSessionHeaders.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + internal class MixedRealityRemoteRenderingCreateSessionHeaders + { + private readonly Response _response; + public MixedRealityRemoteRenderingCreateSessionHeaders(Response response) + { + _response = response; + } + /// Microsoft Correlation Vector. Include this value when reporting issues. + public string MSCV => _response.Headers.TryGetValue("MS-CV", out string value) ? value : null; + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingGetConversionHeaders.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingGetConversionHeaders.cs new file mode 100644 index 000000000000..cee452b5038f --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingGetConversionHeaders.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + internal class MixedRealityRemoteRenderingGetConversionHeaders + { + private readonly Response _response; + public MixedRealityRemoteRenderingGetConversionHeaders(Response response) + { + _response = response; + } + /// Microsoft Correlation Vector. Include this value when reporting issues. + public string MSCV => _response.Headers.TryGetValue("MS-CV", out string value) ? value : null; + /// Time in seconds when the status of this conversion should be polled again. + public int? RetryAfter => _response.Headers.TryGetValue("Retry-After", out int? value) ? value : null; + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingListConversionsHeaders.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingListConversionsHeaders.cs new file mode 100644 index 000000000000..9e9daab6d7bf --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingListConversionsHeaders.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + internal class MixedRealityRemoteRenderingListConversionsHeaders + { + private readonly Response _response; + public MixedRealityRemoteRenderingListConversionsHeaders(Response response) + { + _response = response; + } + /// Microsoft Correlation Vector. Include this value when reporting issues. + public string MSCV => _response.Headers.TryGetValue("MS-CV", out string value) ? value : null; + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingRestClient.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingRestClient.cs new file mode 100644 index 000000000000..e6ad5007c3ee --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingRestClient.cs @@ -0,0 +1,803 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.MixedReality.RemoteRendering +{ + internal partial class MixedRealityRemoteRenderingRestClient + { + private string endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of MixedRealityRemoteRenderingRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The endpoint to use e.g. https://remoterendering.eastus.mixedreality.azure.com a list can be found at https://docs.microsoft.com/en-us/azure/remote-rendering/reference/regions. + /// Api Version. + /// or is null. + public MixedRealityRemoteRenderingRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string endpoint, string apiVersion = "2021-01-01-preview") + { + if (endpoint == null) + { + throw new ArgumentNullException(nameof(endpoint)); + } + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateCreateConversionRequest(Guid accountId, string conversionId, CreateConversionSettings body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, false); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/conversions/", false); + uri.AppendPath(conversionId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body); + request.Content = content; + return message; + } + + /// + /// Creates a conversion using an asset stored in an Azure Blob Storage account. + /// If the remote rendering account has been linked with the storage account no Shared Access Signatures (storageContainerReadListSas, storageContainerWriteSas) for storage access need to be provided. + /// Documentation how to link your Azure Remote Rendering account with the Azure Blob Storage account can be found in the [documentation](https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts). + /// + /// All files in the input container starting with the blobPrefix will be retrieved to perform the conversion. To cut down on conversion times only necessary files should be available under the blobPrefix. + /// . + /// + /// the Azure Remote Rendering account id. + /// An ID uniquely identifying the conversion for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// Request body configuring the settings for an asset conversion. + /// The cancellation token to use. + /// or is null. + public async Task> CreateConversionAsync(Guid accountId, string conversionId, CreateConversionSettings body, CancellationToken cancellationToken = default) + { + if (conversionId == null) + { + throw new ArgumentNullException(nameof(conversionId)); + } + if (body == null) + { + throw new ArgumentNullException(nameof(body)); + } + + using var message = CreateCreateConversionRequest(accountId, conversionId, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new MixedRealityRemoteRenderingCreateConversionHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + case 201: + { + AssetConversion value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssetConversion.DeserializeAssetConversion(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// + /// Creates a conversion using an asset stored in an Azure Blob Storage account. + /// If the remote rendering account has been linked with the storage account no Shared Access Signatures (storageContainerReadListSas, storageContainerWriteSas) for storage access need to be provided. + /// Documentation how to link your Azure Remote Rendering account with the Azure Blob Storage account can be found in the [documentation](https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts). + /// + /// All files in the input container starting with the blobPrefix will be retrieved to perform the conversion. To cut down on conversion times only necessary files should be available under the blobPrefix. + /// . + /// + /// the Azure Remote Rendering account id. + /// An ID uniquely identifying the conversion for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// Request body configuring the settings for an asset conversion. + /// The cancellation token to use. + /// or is null. + public ResponseWithHeaders CreateConversion(Guid accountId, string conversionId, CreateConversionSettings body, CancellationToken cancellationToken = default) + { + if (conversionId == null) + { + throw new ArgumentNullException(nameof(conversionId)); + } + if (body == null) + { + throw new ArgumentNullException(nameof(body)); + } + + using var message = CreateCreateConversionRequest(accountId, conversionId, body); + _pipeline.Send(message, cancellationToken); + var headers = new MixedRealityRemoteRenderingCreateConversionHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + case 201: + { + AssetConversion value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssetConversion.DeserializeAssetConversion(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetConversionRequest(Guid accountId, string conversionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, false); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/conversions/", false); + uri.AppendPath(conversionId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Gets the status of a previously created asset conversion. + /// the Azure Remote Rendering account id. + /// An ID uniquely identifying the conversion for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// The cancellation token to use. + /// is null. + public async Task> GetConversionAsync(Guid accountId, string conversionId, CancellationToken cancellationToken = default) + { + if (conversionId == null) + { + throw new ArgumentNullException(nameof(conversionId)); + } + + using var message = CreateGetConversionRequest(accountId, conversionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new MixedRealityRemoteRenderingGetConversionHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + { + AssetConversion value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssetConversion.DeserializeAssetConversion(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets the status of a previously created asset conversion. + /// the Azure Remote Rendering account id. + /// An ID uniquely identifying the conversion for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// The cancellation token to use. + /// is null. + public ResponseWithHeaders GetConversion(Guid accountId, string conversionId, CancellationToken cancellationToken = default) + { + if (conversionId == null) + { + throw new ArgumentNullException(nameof(conversionId)); + } + + using var message = CreateGetConversionRequest(accountId, conversionId); + _pipeline.Send(message, cancellationToken); + var headers = new MixedRealityRemoteRenderingGetConversionHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + { + AssetConversion value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssetConversion.DeserializeAssetConversion(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListConversionsRequest(Guid accountId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, false); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/conversions", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Gets a list of all conversions. Returns a batch of conversions- if more conversions are available the @nextLink property contains the a URL where the next batch of conversions can be requested. This URL will need the same authentication as all calls to the Azure Remote Rendering API. + /// the Azure Remote Rendering account id. + /// The cancellation token to use. + public async Task> ListConversionsAsync(Guid accountId, CancellationToken cancellationToken = default) + { + using var message = CreateListConversionsRequest(accountId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new MixedRealityRemoteRenderingListConversionsHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + { + ConversionList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConversionList.DeserializeConversionList(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets a list of all conversions. Returns a batch of conversions- if more conversions are available the @nextLink property contains the a URL where the next batch of conversions can be requested. This URL will need the same authentication as all calls to the Azure Remote Rendering API. + /// the Azure Remote Rendering account id. + /// The cancellation token to use. + public ResponseWithHeaders ListConversions(Guid accountId, CancellationToken cancellationToken = default) + { + using var message = CreateListConversionsRequest(accountId); + _pipeline.Send(message, cancellationToken); + var headers = new MixedRealityRemoteRenderingListConversionsHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + { + ConversionList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConversionList.DeserializeConversionList(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateSessionRequest(Guid accountId, string sessionId, RenderingSessionOptions body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, false); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/sessions/", false); + uri.AppendPath(sessionId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body); + request.Content = content; + return message; + } + + /// Creates a new rendering session. + /// the Azure Remote Rendering account id. + /// An ID uniquely identifying the rendering session for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// Settings of the session to be created. + /// The cancellation token to use. + /// or is null. + public async Task> CreateSessionAsync(Guid accountId, string sessionId, RenderingSessionOptions body, CancellationToken cancellationToken = default) + { + if (sessionId == null) + { + throw new ArgumentNullException(nameof(sessionId)); + } + if (body == null) + { + throw new ArgumentNullException(nameof(body)); + } + + using var message = CreateCreateSessionRequest(accountId, sessionId, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new MixedRealityRemoteRenderingCreateSessionHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + case 201: + { + RenderingSession value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RenderingSession.DeserializeRenderingSession(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Creates a new rendering session. + /// the Azure Remote Rendering account id. + /// An ID uniquely identifying the rendering session for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// Settings of the session to be created. + /// The cancellation token to use. + /// or is null. + public ResponseWithHeaders CreateSession(Guid accountId, string sessionId, RenderingSessionOptions body, CancellationToken cancellationToken = default) + { + if (sessionId == null) + { + throw new ArgumentNullException(nameof(sessionId)); + } + if (body == null) + { + throw new ArgumentNullException(nameof(body)); + } + + using var message = CreateCreateSessionRequest(accountId, sessionId, body); + _pipeline.Send(message, cancellationToken); + var headers = new MixedRealityRemoteRenderingCreateSessionHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + case 201: + { + RenderingSession value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RenderingSession.DeserializeRenderingSession(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetSessionRequest(Guid accountId, string sessionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, false); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/sessions/", false); + uri.AppendPath(sessionId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Gets properties of a particular rendering session. + /// the Azure Remote Rendering account id. + /// An ID uniquely identifying the rendering session for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// The cancellation token to use. + /// is null. + public async Task> GetSessionAsync(Guid accountId, string sessionId, CancellationToken cancellationToken = default) + { + if (sessionId == null) + { + throw new ArgumentNullException(nameof(sessionId)); + } + + using var message = CreateGetSessionRequest(accountId, sessionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RenderingSession value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RenderingSession.DeserializeRenderingSession(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets properties of a particular rendering session. + /// the Azure Remote Rendering account id. + /// An ID uniquely identifying the rendering session for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// The cancellation token to use. + /// is null. + public Response GetSession(Guid accountId, string sessionId, CancellationToken cancellationToken = default) + { + if (sessionId == null) + { + throw new ArgumentNullException(nameof(sessionId)); + } + + using var message = CreateGetSessionRequest(accountId, sessionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RenderingSession value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RenderingSession.DeserializeRenderingSession(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateSessionRequest(Guid accountId, string sessionId, UpdateSessionOptions body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, false); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/sessions/", false); + uri.AppendPath(sessionId, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body); + request.Content = content; + return message; + } + + /// Updates a particular rendering session. + /// the Azure Remote Rendering account id. + /// An ID uniquely identifying the rendering session for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// Settings of the session to be updated. + /// The cancellation token to use. + /// or is null. + public async Task> UpdateSessionAsync(Guid accountId, string sessionId, UpdateSessionOptions body, CancellationToken cancellationToken = default) + { + if (sessionId == null) + { + throw new ArgumentNullException(nameof(sessionId)); + } + if (body == null) + { + throw new ArgumentNullException(nameof(body)); + } + + using var message = CreateUpdateSessionRequest(accountId, sessionId, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RenderingSession value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RenderingSession.DeserializeRenderingSession(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Updates a particular rendering session. + /// the Azure Remote Rendering account id. + /// An ID uniquely identifying the rendering session for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// Settings of the session to be updated. + /// The cancellation token to use. + /// or is null. + public Response UpdateSession(Guid accountId, string sessionId, UpdateSessionOptions body, CancellationToken cancellationToken = default) + { + if (sessionId == null) + { + throw new ArgumentNullException(nameof(sessionId)); + } + if (body == null) + { + throw new ArgumentNullException(nameof(body)); + } + + using var message = CreateUpdateSessionRequest(accountId, sessionId, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RenderingSession value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RenderingSession.DeserializeRenderingSession(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateStopSessionRequest(Guid accountId, string sessionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, false); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/sessions/", false); + uri.AppendPath(sessionId, true); + uri.AppendPath("/:stop", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Stops a particular rendering session. + /// the Azure Remote Rendering account id. + /// An ID uniquely identifying the rendering session for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// The cancellation token to use. + /// is null. + public async Task> StopSessionAsync(Guid accountId, string sessionId, CancellationToken cancellationToken = default) + { + if (sessionId == null) + { + throw new ArgumentNullException(nameof(sessionId)); + } + + using var message = CreateStopSessionRequest(accountId, sessionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new MixedRealityRemoteRenderingStopSessionHeaders(message.Response); + switch (message.Response.Status) + { + case 204: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Stops a particular rendering session. + /// the Azure Remote Rendering account id. + /// An ID uniquely identifying the rendering session for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// The cancellation token to use. + /// is null. + public ResponseWithHeaders StopSession(Guid accountId, string sessionId, CancellationToken cancellationToken = default) + { + if (sessionId == null) + { + throw new ArgumentNullException(nameof(sessionId)); + } + + using var message = CreateStopSessionRequest(accountId, sessionId); + _pipeline.Send(message, cancellationToken); + var headers = new MixedRealityRemoteRenderingStopSessionHeaders(message.Response); + switch (message.Response.Status) + { + case 204: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSessionsRequest(Guid accountId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, false); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/sessions", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Get a list of all rendering sessions. + /// the Azure Remote Rendering account id. + /// The cancellation token to use. + public async Task> ListSessionsAsync(Guid accountId, CancellationToken cancellationToken = default) + { + using var message = CreateListSessionsRequest(accountId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SessionsList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SessionsList.DeserializeSessionsList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Get a list of all rendering sessions. + /// the Azure Remote Rendering account id. + /// The cancellation token to use. + public Response ListSessions(Guid accountId, CancellationToken cancellationToken = default) + { + using var message = CreateListSessionsRequest(accountId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SessionsList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SessionsList.DeserializeSessionsList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListConversionsNextPageRequest(string nextLink, Guid accountId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Gets a list of all conversions. Returns a batch of conversions- if more conversions are available the @nextLink property contains the a URL where the next batch of conversions can be requested. This URL will need the same authentication as all calls to the Azure Remote Rendering API. + /// The URL to the next page of results. + /// the Azure Remote Rendering account id. + /// The cancellation token to use. + /// is null. + public async Task> ListConversionsNextPageAsync(string nextLink, Guid accountId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListConversionsNextPageRequest(nextLink, accountId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new MixedRealityRemoteRenderingListConversionsHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + { + ConversionList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ConversionList.DeserializeConversionList(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets a list of all conversions. Returns a batch of conversions- if more conversions are available the @nextLink property contains the a URL where the next batch of conversions can be requested. This URL will need the same authentication as all calls to the Azure Remote Rendering API. + /// The URL to the next page of results. + /// the Azure Remote Rendering account id. + /// The cancellation token to use. + /// is null. + public ResponseWithHeaders ListConversionsNextPage(string nextLink, Guid accountId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListConversionsNextPageRequest(nextLink, accountId); + _pipeline.Send(message, cancellationToken); + var headers = new MixedRealityRemoteRenderingListConversionsHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + { + ConversionList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ConversionList.DeserializeConversionList(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListSessionsNextPageRequest(string nextLink, Guid accountId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Get a list of all rendering sessions. + /// The URL to the next page of results. + /// the Azure Remote Rendering account id. + /// The cancellation token to use. + /// is null. + public async Task> ListSessionsNextPageAsync(string nextLink, Guid accountId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListSessionsNextPageRequest(nextLink, accountId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SessionsList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SessionsList.DeserializeSessionsList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Get a list of all rendering sessions. + /// The URL to the next page of results. + /// the Azure Remote Rendering account id. + /// The cancellation token to use. + /// is null. + public Response ListSessionsNextPage(string nextLink, Guid accountId, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListSessionsNextPageRequest(nextLink, accountId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SessionsList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SessionsList.DeserializeSessionsList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingStopSessionHeaders.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingStopSessionHeaders.cs new file mode 100644 index 000000000000..c3655cf35bfa --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/MixedRealityRemoteRenderingStopSessionHeaders.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + internal class MixedRealityRemoteRenderingStopSessionHeaders + { + private readonly Response _response; + public MixedRealityRemoteRenderingStopSessionHeaders(Response response) + { + _response = response; + } + /// Microsoft Correlation Vector. Include this value when reporting issues. + public string MSCV => _response.Headers.TryGetValue("MS-CV", out string value) ? value : null; + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversion.Serialization.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversion.Serialization.cs new file mode 100644 index 000000000000..705c9515083b --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversion.Serialization.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + public partial class AssetConversion + { + internal static AssetConversion DeserializeAssetConversion(JsonElement element) + { + string id = default; + AssetConversionOptions settings = default; + Optional output = default; + RemoteRenderingServiceError error = default; + AssetConversionStatus status = default; + DateTimeOffset creationTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("settings")) + { + settings = AssetConversionOptions.DeserializeAssetConversionOptions(property.Value); + continue; + } + if (property.NameEquals("output")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + output = AssetConversionOutput.DeserializeAssetConversionOutput(property.Value); + continue; + } + if (property.NameEquals("error")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + error = null; + continue; + } + error = RemoteRenderingServiceError.DeserializeRemoteRenderingServiceError(property.Value); + continue; + } + if (property.NameEquals("status")) + { + status = new AssetConversionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("creationTime")) + { + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new AssetConversion(id, settings, output.Value, error, status, creationTime); + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversion.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversion.cs new file mode 100644 index 000000000000..750bb68c3233 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversion.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.MixedReality.RemoteRendering +{ + /// The Conversion. + public partial class AssetConversion + { + /// Initializes a new instance of AssetConversion. + /// The id of the conversion supplied when the conversion was created. + /// Settings for where to retrieve input files from and where to write output files. Supplied when creating the conversion. + /// The error object containing details about the conversion failure. + /// The status of the conversion. Terminal states are 'Cancelled', 'Failed', 'Succeeded'. + /// The time when the conversion was created. Date and time in ISO 8601 format. + /// or is null. + internal AssetConversion(string conversionId, AssetConversionOptions options, RemoteRenderingServiceError error, AssetConversionStatus status, DateTimeOffset createdOn) + { + if (conversionId == null) + { + throw new ArgumentNullException(nameof(conversionId)); + } + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + ConversionId = conversionId; + Options = options; + Error = error; + Status = status; + CreatedOn = createdOn; + } + + /// Initializes a new instance of AssetConversion. + /// The id of the conversion supplied when the conversion was created. + /// Settings for where to retrieve input files from and where to write output files. Supplied when creating the conversion. + /// Information about the output of a successful conversion. Only present when the status of the conversion is 'Succeeded'. + /// The error object containing details about the conversion failure. + /// The status of the conversion. Terminal states are 'Cancelled', 'Failed', 'Succeeded'. + /// The time when the conversion was created. Date and time in ISO 8601 format. + internal AssetConversion(string conversionId, AssetConversionOptions options, AssetConversionOutput output, RemoteRenderingServiceError error, AssetConversionStatus status, DateTimeOffset createdOn) + { + ConversionId = conversionId; + Options = options; + Output = output; + Error = error; + Status = status; + CreatedOn = createdOn; + } + /// Information about the output of a successful conversion. Only present when the status of the conversion is 'Succeeded'. + public AssetConversionOutput Output { get; } + /// The error object containing details about the conversion failure. + public RemoteRenderingServiceError Error { get; } + /// The status of the conversion. Terminal states are 'Cancelled', 'Failed', 'Succeeded'. + public AssetConversionStatus Status { get; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionInputOptions.Serialization.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionInputOptions.Serialization.cs new file mode 100644 index 000000000000..baf23088be28 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionInputOptions.Serialization.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + public partial class AssetConversionInputOptions : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("storageContainerUri"); + writer.WriteStringValue(StorageContainerUri.AbsoluteUri); + if (Optional.IsDefined(StorageContainerReadListSas)) + { + writer.WritePropertyName("storageContainerReadListSas"); + writer.WriteStringValue(StorageContainerReadListSas); + } + if (Optional.IsDefined(BlobPrefix)) + { + writer.WritePropertyName("blobPrefix"); + writer.WriteStringValue(BlobPrefix); + } + writer.WritePropertyName("relativeInputAssetPath"); + writer.WriteStringValue(RelativeInputAssetPath); + writer.WriteEndObject(); + } + + internal static AssetConversionInputOptions DeserializeAssetConversionInputOptions(JsonElement element) + { + Uri storageContainerUri = default; + Optional storageContainerReadListSas = default; + Optional blobPrefix = default; + string relativeInputAssetPath = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageContainerUri")) + { + storageContainerUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageContainerReadListSas")) + { + storageContainerReadListSas = property.Value.GetString(); + continue; + } + if (property.NameEquals("blobPrefix")) + { + blobPrefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("relativeInputAssetPath")) + { + relativeInputAssetPath = property.Value.GetString(); + continue; + } + } + return new AssetConversionInputOptions(storageContainerUri, storageContainerReadListSas.Value, blobPrefix.Value, relativeInputAssetPath); + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionInputOptions.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionInputOptions.cs new file mode 100644 index 000000000000..cbf0d8356dcc --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionInputOptions.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.MixedReality.RemoteRendering +{ + /// Settings for the conversion input. + public partial class AssetConversionInputOptions + { + /// Initializes a new instance of AssetConversionInputOptions. + /// The URI of the Azure blob storage container containing the input model. + /// The relative path starting at blobPrefix (or at the container root if blobPrefix is not specified) to the input model. Must point to file with a supported file format ending. + /// or is null. + public AssetConversionInputOptions(Uri storageContainerUri, string relativeInputAssetPath) + { + if (storageContainerUri == null) + { + throw new ArgumentNullException(nameof(storageContainerUri)); + } + if (relativeInputAssetPath == null) + { + throw new ArgumentNullException(nameof(relativeInputAssetPath)); + } + + StorageContainerUri = storageContainerUri; + RelativeInputAssetPath = relativeInputAssetPath; + } + + /// Initializes a new instance of AssetConversionInputOptions. + /// The URI of the Azure blob storage container containing the input model. + /// An Azure blob storage container shared access signature giving read and list access to the storage container. Optional. If not is not provided the Azure Remote Rendering rendering account needs to be linked with the storage account containing the blob container. For security purposes this field will never be filled out in responses bodies. + /// Only Blobs starting with this prefix will be downloaded to perform the conversion. + /// The relative path starting at blobPrefix (or at the container root if blobPrefix is not specified) to the input model. Must point to file with a supported file format ending. + internal AssetConversionInputOptions(Uri storageContainerUri, string storageContainerReadListSas, string blobPrefix, string relativeInputAssetPath) + { + StorageContainerUri = storageContainerUri; + StorageContainerReadListSas = storageContainerReadListSas; + BlobPrefix = blobPrefix; + RelativeInputAssetPath = relativeInputAssetPath; + } + /// An Azure blob storage container shared access signature giving read and list access to the storage container. Optional. If not is not provided the Azure Remote Rendering rendering account needs to be linked with the storage account containing the blob container. For security purposes this field will never be filled out in responses bodies. + public string StorageContainerReadListSas { get; set; } + /// Only Blobs starting with this prefix will be downloaded to perform the conversion. + public string BlobPrefix { get; set; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOptions.Serialization.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOptions.Serialization.cs new file mode 100644 index 000000000000..9a09afbe19ca --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOptions.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + public partial class AssetConversionOptions : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("inputLocation"); + writer.WriteObjectValue(InputOptions); + writer.WritePropertyName("outputLocation"); + writer.WriteObjectValue(OutputOptions); + writer.WriteEndObject(); + } + + internal static AssetConversionOptions DeserializeAssetConversionOptions(JsonElement element) + { + AssetConversionInputOptions inputLocation = default; + AssetConversionOutputOptions outputLocation = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("inputLocation")) + { + inputLocation = AssetConversionInputOptions.DeserializeAssetConversionInputOptions(property.Value); + continue; + } + if (property.NameEquals("outputLocation")) + { + outputLocation = AssetConversionOutputOptions.DeserializeAssetConversionOutputOptions(property.Value); + continue; + } + } + return new AssetConversionOptions(inputLocation, outputLocation); + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOptions.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOptions.cs new file mode 100644 index 000000000000..9230fe1ce5ff --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOptions.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.MixedReality.RemoteRendering +{ + /// Settings for where to retrieve input files from and where to write output files. Supplied when creating the conversion. + public partial class AssetConversionOptions + { + /// Initializes a new instance of AssetConversionOptions. + /// Settings for the conversion input. + /// Settings for the conversion output. + /// or is null. + public AssetConversionOptions(AssetConversionInputOptions inputOptions, AssetConversionOutputOptions outputOptions) + { + if (inputOptions == null) + { + throw new ArgumentNullException(nameof(inputOptions)); + } + if (outputOptions == null) + { + throw new ArgumentNullException(nameof(outputOptions)); + } + + InputOptions = inputOptions; + OutputOptions = outputOptions; + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOutput.Serialization.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOutput.Serialization.cs new file mode 100644 index 000000000000..f9773d525e89 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOutput.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + public partial class AssetConversionOutput + { + internal static AssetConversionOutput DeserializeAssetConversionOutput(JsonElement element) + { + Optional outputAssetUri = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("outputAssetUri")) + { + outputAssetUri = property.Value.GetString(); + continue; + } + } + return new AssetConversionOutput(outputAssetUri.Value); + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOutput.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOutput.cs new file mode 100644 index 000000000000..3938dd3da78e --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOutput.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.MixedReality.RemoteRendering +{ + /// Information about the output of a successful conversion. Only present when the status of the conversion is 'Succeeded'. + public partial class AssetConversionOutput + { + /// Initializes a new instance of AssetConversionOutput. + internal AssetConversionOutput() + { + } + + /// Initializes a new instance of AssetConversionOutput. + /// URL of the asset generated by the conversion process. + internal AssetConversionOutput(string outputAssetUri) + { + OutputAssetUri = outputAssetUri; + } + + /// URL of the asset generated by the conversion process. + public string OutputAssetUri { get; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOutputOptions.Serialization.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOutputOptions.Serialization.cs new file mode 100644 index 000000000000..bd34c4295508 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOutputOptions.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + public partial class AssetConversionOutputOptions : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("storageContainerUri"); + writer.WriteStringValue(StorageContainerUri.AbsoluteUri); + if (Optional.IsDefined(StorageContainerWriteSas)) + { + writer.WritePropertyName("storageContainerWriteSas"); + writer.WriteStringValue(StorageContainerWriteSas); + } + if (Optional.IsDefined(BlobPrefix)) + { + writer.WritePropertyName("blobPrefix"); + writer.WriteStringValue(BlobPrefix); + } + if (Optional.IsDefined(OutputAssetFilename)) + { + writer.WritePropertyName("outputAssetFilename"); + writer.WriteStringValue(OutputAssetFilename); + } + writer.WriteEndObject(); + } + + internal static AssetConversionOutputOptions DeserializeAssetConversionOutputOptions(JsonElement element) + { + Uri storageContainerUri = default; + Optional storageContainerWriteSas = default; + Optional blobPrefix = default; + Optional outputAssetFilename = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageContainerUri")) + { + storageContainerUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageContainerWriteSas")) + { + storageContainerWriteSas = property.Value.GetString(); + continue; + } + if (property.NameEquals("blobPrefix")) + { + blobPrefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("outputAssetFilename")) + { + outputAssetFilename = property.Value.GetString(); + continue; + } + } + return new AssetConversionOutputOptions(storageContainerUri, storageContainerWriteSas.Value, blobPrefix.Value, outputAssetFilename.Value); + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOutputOptions.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOutputOptions.cs new file mode 100644 index 000000000000..68dc359cb77c --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOutputOptions.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.MixedReality.RemoteRendering +{ + /// Settings for the conversion output. + public partial class AssetConversionOutputOptions + { + /// Initializes a new instance of AssetConversionOutputOptions. + /// The URI of the Azure blob storage container where the result of the conversion should be written to. + /// is null. + public AssetConversionOutputOptions(Uri storageContainerUri) + { + if (storageContainerUri == null) + { + throw new ArgumentNullException(nameof(storageContainerUri)); + } + + StorageContainerUri = storageContainerUri; + } + + /// Initializes a new instance of AssetConversionOutputOptions. + /// The URI of the Azure blob storage container where the result of the conversion should be written to. + /// An Azure blob storage container shared access signature giving write access to the storage container. Optional. If not is not provided the Azure Remote Rendering rendering account needs to be linked with the storage account containing the blob container. For security purposes this field will never be filled out in responses bodies. + /// A prefix which gets prepended in front of all files produced by the conversion process. Will be treaded as a virtual folder. + /// The file name of the output asset. Must end in '.arrAsset'. + internal AssetConversionOutputOptions(Uri storageContainerUri, string storageContainerWriteSas, string blobPrefix, string outputAssetFilename) + { + StorageContainerUri = storageContainerUri; + StorageContainerWriteSas = storageContainerWriteSas; + BlobPrefix = blobPrefix; + OutputAssetFilename = outputAssetFilename; + } + /// An Azure blob storage container shared access signature giving write access to the storage container. Optional. If not is not provided the Azure Remote Rendering rendering account needs to be linked with the storage account containing the blob container. For security purposes this field will never be filled out in responses bodies. + public string StorageContainerWriteSas { get; set; } + /// A prefix which gets prepended in front of all files produced by the conversion process. Will be treaded as a virtual folder. + public string BlobPrefix { get; set; } + /// The file name of the output asset. Must end in '.arrAsset'. + public string OutputAssetFilename { get; set; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionStatus.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionStatus.cs new file mode 100644 index 000000000000..e506216fd645 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.MixedReality.RemoteRendering +{ + /// The status of the conversion. Terminal states are 'Cancelled', 'Failed', 'Succeeded'. + public readonly partial struct AssetConversionStatus : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public AssetConversionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "NotStarted"; + private const string RunningValue = "Running"; + private const string CancelledValue = "Cancelled"; + private const string FailedValue = "Failed"; + private const string SucceededValue = "Succeeded"; + + /// NotStarted. + public static AssetConversionStatus NotStarted { get; } = new AssetConversionStatus(NotStartedValue); + /// Running. + public static AssetConversionStatus Running { get; } = new AssetConversionStatus(RunningValue); + /// Cancelled. + public static AssetConversionStatus Cancelled { get; } = new AssetConversionStatus(CancelledValue); + /// Failed. + public static AssetConversionStatus Failed { get; } = new AssetConversionStatus(FailedValue); + /// Succeeded. + public static AssetConversionStatus Succeeded { get; } = new AssetConversionStatus(SucceededValue); + /// Determines if two values are the same. + public static bool operator ==(AssetConversionStatus left, AssetConversionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssetConversionStatus left, AssetConversionStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AssetConversionStatus(string value) => new AssetConversionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssetConversionStatus other && Equals(other); + /// + public bool Equals(AssetConversionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/ConversionList.Serialization.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/ConversionList.Serialization.cs new file mode 100644 index 000000000000..da1384590aa7 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/ConversionList.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + internal partial class ConversionList + { + internal static ConversionList DeserializeConversionList(JsonElement element) + { + IReadOnlyList conversions = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("conversions")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AssetConversion.DeserializeAssetConversion(item)); + } + conversions = array; + continue; + } + if (property.NameEquals("@nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ConversionList(conversions, nextLink.Value); + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/ConversionList.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/ConversionList.cs new file mode 100644 index 000000000000..bfc172d84392 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/ConversionList.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.MixedReality.RemoteRendering +{ + /// The ConversionList. + internal partial class ConversionList + { + /// Initializes a new instance of ConversionList. + /// The list of conversions. + /// is null. + internal ConversionList(IEnumerable conversions) + { + if (conversions == null) + { + throw new ArgumentNullException(nameof(conversions)); + } + + Conversions = conversions.ToList(); + } + + /// Initializes a new instance of ConversionList. + /// The list of conversions. + /// If more conversions are available this link with the same authentication header can be used to retrieve further values. + internal ConversionList(IReadOnlyList conversions, string nextLink) + { + Conversions = conversions; + NextLink = nextLink; + } + + /// The list of conversions. + public IReadOnlyList Conversions { get; } + /// If more conversions are available this link with the same authentication header can be used to retrieve further values. + public string NextLink { get; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/CreateConversionSettings.Serialization.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/CreateConversionSettings.Serialization.cs new file mode 100644 index 000000000000..1f1dbb9d7b41 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/CreateConversionSettings.Serialization.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + internal partial class CreateConversionSettings : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("settings"); + writer.WriteObjectValue(Settings); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/CreateConversionSettings.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/CreateConversionSettings.cs new file mode 100644 index 000000000000..5e0cfda2c70e --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/CreateConversionSettings.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.MixedReality.RemoteRendering +{ + /// Request to start a conversion. + internal partial class CreateConversionSettings + { + /// Initializes a new instance of CreateConversionSettings. + /// Settings for where to retrieve input files from and where to write output files. Supplied when creating the conversion. + /// is null. + public CreateConversionSettings(AssetConversionOptions settings) + { + if (settings == null) + { + throw new ArgumentNullException(nameof(settings)); + } + + Settings = settings; + } + + /// Settings for where to retrieve input files from and where to write output files. Supplied when creating the conversion. + public AssetConversionOptions Settings { get; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/ErrorResponse.Serialization.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/ErrorResponse.Serialization.cs new file mode 100644 index 000000000000..fdc412d8e95a --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/ErrorResponse.Serialization.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.MixedReality.RemoteRendering; + +namespace Azure.MixedReality.RemoteRendering.Models +{ + internal partial class ErrorResponse + { + internal static ErrorResponse DeserializeErrorResponse(JsonElement element) + { + RemoteRenderingServiceError error = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("error")) + { + error = RemoteRenderingServiceError.DeserializeRemoteRenderingServiceError(property.Value); + continue; + } + } + return new ErrorResponse(error); + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/ErrorResponse.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/ErrorResponse.cs new file mode 100644 index 000000000000..8cb88a78179e --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/ErrorResponse.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.MixedReality.RemoteRendering; + +namespace Azure.MixedReality.RemoteRendering.Models +{ + /// The ErrorResponse. + internal partial class ErrorResponse + { + /// Initializes a new instance of ErrorResponse. + /// The error object containing details of why the request failed. + /// is null. + internal ErrorResponse(RemoteRenderingServiceError error) + { + if (error == null) + { + throw new ArgumentNullException(nameof(error)); + } + + Error = error; + } + + /// The error object containing details of why the request failed. + public RemoteRenderingServiceError Error { get; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RemoteRenderingServiceError.Serialization.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RemoteRenderingServiceError.Serialization.cs new file mode 100644 index 000000000000..90b076d9aa76 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RemoteRenderingServiceError.Serialization.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + public partial class RemoteRenderingServiceError + { + internal static RemoteRenderingServiceError DeserializeRemoteRenderingServiceError(JsonElement element) + { + string code = default; + string message = default; + Optional> details = default; + Optional target = default; + Optional innerError = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code")) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("details")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeRemoteRenderingServiceError(item)); + } + details = array; + continue; + } + if (property.NameEquals("target")) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("innerError")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + innerError = DeserializeRemoteRenderingServiceError(property.Value); + continue; + } + } + return new RemoteRenderingServiceError(code, message, Optional.ToList(details), target.Value, innerError.Value); + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RemoteRenderingServiceError.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RemoteRenderingServiceError.cs new file mode 100644 index 000000000000..78156f00ef9a --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RemoteRenderingServiceError.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + /// The Error. + public partial class RemoteRenderingServiceError + { + /// Initializes a new instance of RemoteRenderingServiceError. + /// Error code. + /// A human-readable representation of the error. + /// or is null. + internal RemoteRenderingServiceError(string code, string message) + { + if (code == null) + { + throw new ArgumentNullException(nameof(code)); + } + if (message == null) + { + throw new ArgumentNullException(nameof(message)); + } + + Code = code; + Message = message; + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of RemoteRenderingServiceError. + /// Error code. + /// A human-readable representation of the error. + /// An array of details about specific errors that led to this reported error. + /// The target of the particular error (e.g., the name of the property in error). + /// An object containing more specific information than the current object about the error. + internal RemoteRenderingServiceError(string code, string message, IReadOnlyList details, string target, RemoteRenderingServiceError innerError) + { + Code = code; + Message = message; + Details = details; + Target = target; + InnerError = innerError; + } + + /// Error code. + public string Code { get; } + /// A human-readable representation of the error. + public string Message { get; } + /// An array of details about specific errors that led to this reported error. + public IReadOnlyList Details { get; } + /// The target of the particular error (e.g., the name of the property in error). + public string Target { get; } + /// An object containing more specific information than the current object about the error. + public RemoteRenderingServiceError InnerError { get; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingServerSize.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingServerSize.cs new file mode 100644 index 000000000000..9371a6ac86cf --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingServerSize.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.MixedReality.RemoteRendering +{ + /// Size of the server used for the rendering session. Remote Rendering with Standard size server has a maximum scene size of 20 million polygons. Remote Rendering with Premium size does not enforce a hard maximum, but performance may be degraded if your content exceeds the rendering capabilities of the service. + public readonly partial struct RenderingServerSize : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public RenderingServerSize(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StandardValue = "Standard"; + private const string PremiumValue = "Premium"; + + /// Standard. + public static RenderingServerSize Standard { get; } = new RenderingServerSize(StandardValue); + /// Premium. + public static RenderingServerSize Premium { get; } = new RenderingServerSize(PremiumValue); + /// Determines if two values are the same. + public static bool operator ==(RenderingServerSize left, RenderingServerSize right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RenderingServerSize left, RenderingServerSize right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RenderingServerSize(string value) => new RenderingServerSize(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RenderingServerSize other && Equals(other); + /// + public bool Equals(RenderingServerSize other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSession.Serialization.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSession.Serialization.cs new file mode 100644 index 000000000000..97bcd578313f --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSession.Serialization.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + public partial class RenderingSession + { + internal static RenderingSession DeserializeRenderingSession(JsonElement element) + { + string id = default; + Optional arrInspectorPort = default; + Optional handshakePort = default; + Optional elapsedTimeMinutes = default; + Optional hostname = default; + Optional maxLeaseTimeMinutes = default; + RenderingServerSize size = default; + RenderingSessionStatus status = default; + Optional teraflops = default; + Optional error = default; + Optional creationTime = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("arrInspectorPort")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + arrInspectorPort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("handshakePort")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + handshakePort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("elapsedTimeMinutes")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + elapsedTimeMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("hostname")) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("maxLeaseTimeMinutes")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + maxLeaseTimeMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("size")) + { + size = new RenderingServerSize(property.Value.GetString()); + continue; + } + if (property.NameEquals("status")) + { + status = new RenderingSessionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("teraflops")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + teraflops = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("error")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + error = null; + continue; + } + error = RemoteRenderingServiceError.DeserializeRemoteRenderingServiceError(property.Value); + continue; + } + if (property.NameEquals("creationTime")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + } + return new RenderingSession(id, Optional.ToNullable(arrInspectorPort), Optional.ToNullable(handshakePort), Optional.ToNullable(elapsedTimeMinutes), hostname.Value, Optional.ToNullable(maxLeaseTimeMinutes), size, status, Optional.ToNullable(teraflops), error.Value, Optional.ToNullable(creationTime)); + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSession.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSession.cs new file mode 100644 index 000000000000..8f197f13ac0f --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSession.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.MixedReality.RemoteRendering +{ + /// The SessionProperties. + public partial class RenderingSession + { + /// Initializes a new instance of RenderingSession. + /// The id of the session supplied when the sessions was created. + /// Size of the server used for the rendering session. Remote Rendering with Standard size server has a maximum scene size of 20 million polygons. Remote Rendering with Premium size does not enforce a hard maximum, but performance may be degraded if your content exceeds the rendering capabilities of the service. + /// The status of the rendering session. Once the status reached the 'Ready' state it can be connected to. The terminal state is 'Stopped'. + /// is null. + internal RenderingSession(string sessionId, RenderingServerSize size, RenderingSessionStatus status) + { + if (sessionId == null) + { + throw new ArgumentNullException(nameof(sessionId)); + } + + SessionId = sessionId; + Size = size; + Status = status; + } + + /// Initializes a new instance of RenderingSession. + /// The id of the session supplied when the sessions was created. + /// The TCP port at which the Azure Remote Rendering Inspector tool is hosted. + /// The TCP port used for the handshake. + /// Amount of time in minutes the session is or has been in Ready state. Time is rounded down to a full minute. + /// The hostname under which the rendering session is reachable. + /// The time in minutes the session will run after reaching the 'Ready' state. + /// Size of the server used for the rendering session. Remote Rendering with Standard size server has a maximum scene size of 20 million polygons. Remote Rendering with Premium size does not enforce a hard maximum, but performance may be degraded if your content exceeds the rendering capabilities of the service. + /// The status of the rendering session. Once the status reached the 'Ready' state it can be connected to. The terminal state is 'Stopped'. + /// The computational power of the rendering session GPU measured in Teraflops. + /// The error object containing details about the rendering session startup failure. + /// The time when the rendering session was created. Date and time in ISO 8601 format. + internal RenderingSession(string sessionId, int? arrInspectorPort, int? handshakePort, int? elapsedTimeMinutes, string host, int? maxLeaseTimeMinutes, RenderingServerSize size, RenderingSessionStatus status, float? teraflops, RemoteRenderingServiceError error, DateTimeOffset? createdOn) + { + SessionId = sessionId; + ArrInspectorPort = arrInspectorPort; + HandshakePort = handshakePort; + ElapsedTimeMinutes = elapsedTimeMinutes; + Host = host; + MaxLeaseTimeMinutes = maxLeaseTimeMinutes; + Size = size; + Status = status; + Teraflops = teraflops; + Error = error; + CreatedOn = createdOn; + } + /// The TCP port at which the Azure Remote Rendering Inspector tool is hosted. + public int? ArrInspectorPort { get; } + /// The TCP port used for the handshake. + public int? HandshakePort { get; } + /// Amount of time in minutes the session is or has been in Ready state. Time is rounded down to a full minute. + public int? ElapsedTimeMinutes { get; } + /// Size of the server used for the rendering session. Remote Rendering with Standard size server has a maximum scene size of 20 million polygons. Remote Rendering with Premium size does not enforce a hard maximum, but performance may be degraded if your content exceeds the rendering capabilities of the service. + public RenderingServerSize Size { get; } + /// The status of the rendering session. Once the status reached the 'Ready' state it can be connected to. The terminal state is 'Stopped'. + public RenderingSessionStatus Status { get; } + /// The computational power of the rendering session GPU measured in Teraflops. + public float? Teraflops { get; } + /// The error object containing details about the rendering session startup failure. + public RemoteRenderingServiceError Error { get; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSessionOptions.Serialization.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSessionOptions.Serialization.cs new file mode 100644 index 000000000000..c1ac4ac9b9d0 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSessionOptions.Serialization.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + public partial class RenderingSessionOptions : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("maxLeaseTimeMinutes"); + writer.WriteNumberValue(MaxLeaseTimeMinutes); + writer.WritePropertyName("size"); + writer.WriteStringValue(Size.ToString()); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSessionOptions.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSessionOptions.cs new file mode 100644 index 000000000000..358614b57b90 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSessionOptions.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.MixedReality.RemoteRendering +{ + /// The CreateSessionSettings. + public partial class RenderingSessionOptions + { + /// Size of the server used for the rendering session. Remote Rendering with Standard size server has a maximum scene size of 20 million polygons. Remote Rendering with Premium size does not enforce a hard maximum, but performance may be degraded if your content exceeds the rendering capabilities of the service. + public RenderingServerSize Size { get; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSessionStatus.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSessionStatus.cs new file mode 100644 index 000000000000..982a9d055ad8 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/RenderingSessionStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.MixedReality.RemoteRendering +{ + /// The status of the rendering session. Once the status reached the 'Ready' state it can be connected to. The terminal state is 'Stopped'. + public readonly partial struct RenderingSessionStatus : IEquatable + { + private readonly string _value; + + /// Determines if two values are the same. + /// is null. + public RenderingSessionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ErrorValue = "Error"; + private const string ExpiredValue = "Expired"; + private const string StartingValue = "Starting"; + private const string ReadyValue = "Ready"; + private const string StoppedValue = "Stopped"; + + /// Error. + public static RenderingSessionStatus Error { get; } = new RenderingSessionStatus(ErrorValue); + /// Expired. + public static RenderingSessionStatus Expired { get; } = new RenderingSessionStatus(ExpiredValue); + /// Starting. + public static RenderingSessionStatus Starting { get; } = new RenderingSessionStatus(StartingValue); + /// Ready. + public static RenderingSessionStatus Ready { get; } = new RenderingSessionStatus(ReadyValue); + /// Stopped. + public static RenderingSessionStatus Stopped { get; } = new RenderingSessionStatus(StoppedValue); + /// Determines if two values are the same. + public static bool operator ==(RenderingSessionStatus left, RenderingSessionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RenderingSessionStatus left, RenderingSessionStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RenderingSessionStatus(string value) => new RenderingSessionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RenderingSessionStatus other && Equals(other); + /// + public bool Equals(RenderingSessionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/SessionsList.Serialization.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/SessionsList.Serialization.cs new file mode 100644 index 000000000000..dff93706c4f4 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/SessionsList.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + internal partial class SessionsList + { + internal static SessionsList DeserializeSessionsList(JsonElement element) + { + IReadOnlyList sessions = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sessions")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RenderingSession.DeserializeRenderingSession(item)); + } + sessions = array; + continue; + } + if (property.NameEquals("@nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new SessionsList(sessions, nextLink.Value); + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/SessionsList.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/SessionsList.cs new file mode 100644 index 000000000000..58c98adcebd3 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/SessionsList.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.MixedReality.RemoteRendering +{ + /// The result of a list sessions request. + internal partial class SessionsList + { + /// Initializes a new instance of SessionsList. + /// The list of rendering sessions. Does not include sessions in 'Stopped' state. + /// is null. + internal SessionsList(IEnumerable sessions) + { + if (sessions == null) + { + throw new ArgumentNullException(nameof(sessions)); + } + + Sessions = sessions.ToList(); + } + + /// Initializes a new instance of SessionsList. + /// The list of rendering sessions. Does not include sessions in 'Stopped' state. + /// If more rendering sessions are available this link with the same authentication header can be used to retrieve further values. + internal SessionsList(IReadOnlyList sessions, string nextLink) + { + Sessions = sessions; + NextLink = nextLink; + } + + /// The list of rendering sessions. Does not include sessions in 'Stopped' state. + public IReadOnlyList Sessions { get; } + /// If more rendering sessions are available this link with the same authentication header can be used to retrieve further values. + public string NextLink { get; } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/UpdateSessionOptions.Serialization.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/UpdateSessionOptions.Serialization.cs new file mode 100644 index 000000000000..fb553fe3cf77 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/UpdateSessionOptions.Serialization.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + public partial class UpdateSessionOptions : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("maxLeaseTimeMinutes"); + writer.WriteNumberValue(MaxLeaseTimeMinutes); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/UpdateSessionOptions.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/UpdateSessionOptions.cs new file mode 100644 index 000000000000..7b8cfe89d3cb --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/UpdateSessionOptions.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.MixedReality.RemoteRendering +{ + /// The UpdateSessionSettings. + public partial class UpdateSessionOptions + { + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/GlobalSuppressions.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..9f29ed00d8a0 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/GlobalSuppressions.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0001:Use one of the following pre-approved namespace groups (https://azure.github.io/azure-sdk/registered_namespaces.html): Azure.AI, Azure.Analytics, Azure.Communication, Azure.Data, Azure.DigitalTwins, Azure.Iot, Azure.Learn, Azure.Media, Azure.Management, Azure.Messaging, Azure.Search, Azure.Security, Azure.Storage, Azure.Template, Azure.Identity, Microsoft.Extensions.Azure", Justification = "", Scope = "namespace", Target = "~N:Azure.MixedReality.RemoteRendering")] +[assembly: SuppressMessage("Usage", "AZC0001:Use one of the following pre-approved namespace groups (https://azure.github.io/azure-sdk/registered_namespaces.html): Azure.AI, Azure.Analytics, Azure.Communication, Azure.Data, Azure.DigitalTwins, Azure.Iot, Azure.Learn, Azure.Media, Azure.Management, Azure.Messaging, Azure.Search, Azure.Security, Azure.Storage, Azure.Template, Azure.Identity, Microsoft.Extensions.Azure", Justification = "", Scope = "namespace", Target = "~N:Azure.MixedReality.RemoteRendering.Models")] diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/RemoteRenderingAccount.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/RemoteRenderingAccount.cs new file mode 100644 index 000000000000..ba8cb1d5d3ad --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/RemoteRenderingAccount.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using System; + +namespace Azure.MixedReality.RemoteRendering +{ + /// + /// Represents Azure Remote Rendering account details. + /// + public class RemoteRenderingAccount + { + /// + /// Gets the Azure Remote Rendering account domain. + /// + public string AccountDomain { get; } + + /// + /// Gets the Azure Remote Rendering account identifier. + /// + public Guid AccountId { get; } + + /// + /// Initializes a new instance of the class. + /// + /// The Azure Remote Rendering account identifier. + /// + /// The Azure Remote Rendering account domain. For example, for an account created in the eastus region, this will have the form "eastus.mixedreality.azure.com". + /// + /// cannot be parsed as a Guid. + public RemoteRenderingAccount(Guid accountId, string accountDomain) + { + Argument.AssertNotNullOrWhiteSpace(accountDomain, nameof(accountDomain)); + AccountId = accountId; + AccountDomain = accountDomain; + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/RemoteRenderingClient.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/RemoteRenderingClient.cs new file mode 100644 index 000000000000..d3d98834edcc --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/RemoteRenderingClient.cs @@ -0,0 +1,548 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core.Pipeline; +using Azure.MixedReality.Authentication; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + /// + /// The client to use for interacting with the Azure Remote Rendering. + /// + public class RemoteRenderingClient + { + private readonly Guid _accountId; + + private readonly ClientDiagnostics _clientDiagnostics; + + private readonly HttpPipeline _pipeline; + + private readonly MixedRealityRemoteRenderingRestClient _restClient; + + /// + /// Initializes a new instance of the class. + /// + /// The rendering service endpoint. This determines the region in which the rendering VM is created. + /// The Azure Remote Rendering account details. + /// An access token used to access the specified Azure Remote Rendering account. + /// The options. + public RemoteRenderingClient(Uri remoteRenderingEndpoint, RemoteRenderingAccount account, AccessToken accessToken, RemoteRenderingClientOptions options = null) + : this(remoteRenderingEndpoint, account, new StaticAccessTokenCredential(accessToken), options) { } + + /// + /// Initializes a new instance of the class. + /// + /// The rendering service endpoint. This determines the region in which the rendering VM is created. + /// The Azure Remote Rendering account details. + /// The Azure Remote Rendering account primary or secondary key credential. + /// The options. + public RemoteRenderingClient(Uri remoteRenderingEndpoint, RemoteRenderingAccount account, AzureKeyCredential keyCredential, RemoteRenderingClientOptions options = null) + : this(remoteRenderingEndpoint, account, new MixedRealityAccountKeyCredential(account.AccountId, keyCredential), options) { } + + /// + /// Initializes a new instance of the class. + /// + /// The rendering service endpoint. This determines the region in which the rendering VM is created. + /// The Azure Remote Rendering account details. + /// The credential used to access the Mixed Reality service. + /// The options. + public RemoteRenderingClient(Uri remoteRenderingEndpoint, RemoteRenderingAccount account, TokenCredential credential, RemoteRenderingClientOptions options = null) + { + Argument.AssertNotNull(account, nameof(account)); + Argument.AssertNotNull(credential, nameof(credential)); + + options ??= new RemoteRenderingClientOptions(); + + Uri authenticationEndpoint = options.AuthenticationEndpoint ?? AuthenticationEndpoint.ConstructFromDomain(account.AccountDomain); + TokenCredential mrTokenCredential = MixedRealityTokenCredential.GetMixedRealityCredential(account.AccountId, authenticationEndpoint, credential); + + _accountId = account.AccountId; + _clientDiagnostics = new ClientDiagnostics(options); + _pipeline = HttpPipelineBuilder.Build(options, new BearerTokenAuthenticationPolicy(mrTokenCredential, GetDefaultScope(remoteRenderingEndpoint))); + _restClient = new MixedRealityRemoteRenderingRestClient(_clientDiagnostics, _pipeline, remoteRenderingEndpoint.ToString(), options.Version); + } + +#pragma warning disable CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable. + + /// Initializes a new instance of RemoteRenderingClient for mocking. + protected RemoteRenderingClient() + { + } + +#pragma warning restore CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable. + + #region Conversions + + /// + /// Creates a conversion using an asset stored in an Azure Blob Storage account. + /// If the remote rendering account has been linked with the storage account no Shared Access Signatures (storageContainerReadListSas, storageContainerWriteSas) for storage access need to be provided. + /// Documentation how to link your Azure Remote Rendering account with the Azure Blob Storage account can be found in the [documentation](https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts). + /// All files in the input container starting with the blobPrefix will be retrieved to perform the conversion. To cut down on conversion times only necessary files should be available under the blobPrefix. + /// . + /// + /// An ID uniquely identifying the conversion for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// The settings for an asset conversion. + /// The cancellation token to use. + /// or is null. + public virtual AssetConversionOperation StartConversion(string conversionId, AssetConversionOptions options, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(StartConversion)}"); + scope.AddAttribute(nameof(conversionId), conversionId); + scope.Start(); + try + { + var result = _restClient.CreateConversion(_accountId, conversionId, new CreateConversionSettings(options), cancellationToken); + return new AssetConversionOperation(this, result); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// Creates a conversion using an asset stored in an Azure Blob Storage account. + /// If the remote rendering account has been linked with the storage account no Shared Access Signatures (storageContainerReadListSas, storageContainerWriteSas) for storage access need to be provided. + /// Documentation how to link your Azure Remote Rendering account with the Azure Blob Storage account can be found in the [documentation](https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts). + /// All files in the input container starting with the blobPrefix will be retrieved to perform the conversion. To cut down on conversion times only necessary files should be available under the blobPrefix. + /// . + /// + /// An ID uniquely identifying the conversion for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// Request body configuring the settings for an asset conversion. + /// The cancellation token to use. + /// or is null. + public virtual async Task StartConversionAsync(string conversionId, AssetConversionOptions options, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(StartConversion)}"); + scope.AddAttribute(nameof(conversionId), conversionId); + scope.Start(); + try + { + var result = await _restClient.CreateConversionAsync(_accountId, conversionId, new CreateConversionSettings(options), cancellationToken).ConfigureAwait(false); + return new AssetConversionOperation(this, result); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// Gets the status of a previously created asset conversion. + /// the conversion id. + /// The cancellation token to use. + /// is null. + public virtual Response GetConversion(string conversionId, CancellationToken cancellationToken = default) + { + return GetConversionInternal(conversionId, $"{nameof(RemoteRenderingClient)}.{nameof(GetConversion)}", cancellationToken); + } + + /// Gets the status of a previously created asset conversion. + /// the conversion id. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetConversionAsync(string conversionId, CancellationToken cancellationToken = default) + { + return await GetConversionInternalAsync(conversionId, $"{nameof(RemoteRenderingClient)}.{nameof(GetConversion)}", cancellationToken).ConfigureAwait(false); + } + + /// Gets a list of all conversions. + /// The cancellation token to use. + public virtual Pageable GetConversions(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(GetConversions)}"); + scope.Start(); + try + { + var result = _restClient.ListConversions(_accountId, cancellationToken); + return Page.FromValues(result.Value.Conversions, result.Value.NextLink, result.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(GetConversions)}"); + scope.Start(); + try + { + var result = _restClient.ListConversionsNextPage(nextLink, _accountId, cancellationToken); + return Page.FromValues(result.Value.Conversions, result.Value.NextLink, result.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Gets a list of all conversions. + /// The cancellation token to use. + public virtual AsyncPageable GetConversionsAync(CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(GetConversionsAync)}"); + scope.Start(); + try + { + var result = await _restClient.ListConversionsAsync(_accountId, cancellationToken).ConfigureAwait(false); + return Page.FromValues(result.Value.Conversions, result.Value.NextLink, result.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(GetConversionsAync)}"); + scope.Start(); + try + { + var result = await _restClient.ListConversionsNextPageAsync(nextLink, _accountId, cancellationToken).ConfigureAwait(false); + return Page.FromValues(result.Value.Conversions, result.Value.NextLink, result.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + #endregion + #region Sessions + + /// Creates a new rendering session. + /// An ID uniquely identifying the rendering session for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// Options of session to be created. + /// The cancellation token to use. + /// or is null. + public virtual StartRenderingSessionOperation StartSession(string sessionId, RenderingSessionOptions options, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(StartSession)}"); + scope.AddAttribute(nameof(sessionId), sessionId); + scope.Start(); + try + { + var result = _restClient.CreateSession(_accountId, sessionId, options, cancellationToken); + return new StartRenderingSessionOperation(this, Response.FromValue(result.Value, result.GetRawResponse())); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// Creates a new rendering session. + /// An ID uniquely identifying the rendering session for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. + /// Options of the session to be created. + /// The cancellation token to use. + /// or is null. + public virtual async Task StartSessionAsync(string sessionId, RenderingSessionOptions options, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(StartSession)}"); + scope.AddAttribute(nameof(sessionId), sessionId); + scope.Start(); + try + { + var result = await _restClient.CreateSessionAsync(_accountId, sessionId, options, cancellationToken).ConfigureAwait(false); + return new StartRenderingSessionOperation(this, Response.FromValue(result.Value, result.GetRawResponse())); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// Gets properties of a particular rendering session. + /// ID of a previously created session. + /// The cancellation token to use. + /// is null. + public virtual Response GetSession(string sessionId, CancellationToken cancellationToken = default) + { + return GetSessionInternal(sessionId, $"{nameof(RemoteRenderingClient)}.{nameof(GetSession)}", cancellationToken); + } + + /// Gets properties of a particular rendering session. + /// ID of a previously created session. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetSessionAsync(string sessionId, CancellationToken cancellationToken = default) + { + return await GetSessionInternalAsync(sessionId, $"{nameof(RemoteRenderingClient)}.{nameof(GetSession)}", cancellationToken).ConfigureAwait(false); + } + + /// Updates a particular rendering session. + /// ID of a previously created session. + /// Settings of the session to be updated. + /// The cancellation token to use. + /// or is null. + public virtual Response UpdateSession(string sessionId, UpdateSessionOptions options, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(UpdateSession)}"); + scope.AddAttribute(nameof(sessionId), sessionId); + scope.Start(); + try + { + var result = _restClient.UpdateSession(_accountId, sessionId, options, cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// Updates a particular rendering session. + /// ID of a previously created session. + /// Settings of the session to be updated. + /// The cancellation token to use. + /// or is null. + public virtual async Task> UpdateSessionAsync(string sessionId, UpdateSessionOptions options, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(UpdateSession)}"); + scope.AddAttribute(nameof(sessionId), sessionId); + scope.Start(); + try + { + var result = await _restClient.UpdateSessionAsync(_accountId, sessionId, options, cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// Stops a particular rendering session. + /// ID of the session to stop. + /// The cancellation token to use. + /// is null. + public virtual Response StopSession(string sessionId, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(StopSession)}"); + scope.AddAttribute(nameof(sessionId), sessionId); + scope.Start(); + try + { + return _restClient.StopSession(_accountId, sessionId, cancellationToken); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// Stops a particular rendering session. + /// ID of the session to stop. + /// The cancellation token to use. + /// is null. + public virtual async Task StopSessionAsync(string sessionId, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(StopSession)}"); + scope.AddAttribute(nameof(sessionId), sessionId); + scope.Start(); + + try + { + return await _restClient.StopSessionAsync(_accountId, sessionId, cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// Get a list of all rendering sessions. + /// The cancellation token to use. + public virtual Pageable GetSessions(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(GetSessions)}"); + scope.Start(); + try + { + var result = _restClient.ListSessions(_accountId, cancellationToken); + return Page.FromValues(result.Value.Sessions, result.Value.NextLink, result.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(GetSessions)}"); + scope.Start(); + try + { + var result = _restClient.ListSessionsNextPage(nextLink, _accountId, cancellationToken); + return Page.FromValues(result.Value.Sessions, result.Value.NextLink, result.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + + /// Get a list of all rendering sessions. + /// The cancellation token to use. + public virtual AsyncPageable GetSessionsAsync(CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(GetSessions)}"); + scope.Start(); + try + { + var result = await _restClient.ListSessionsAsync(_accountId, cancellationToken).ConfigureAwait(false); + return Page.FromValues(result.Value.Sessions, result.Value.NextLink, result.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(GetSessions)}"); + scope.Start(); + try + { + var result = await _restClient.ListSessionsNextPageAsync(nextLink, _accountId, cancellationToken).ConfigureAwait(false); + return Page.FromValues(result.Value.Sessions, result.Value.NextLink, result.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + #endregion + #region Private methods + + private static string GetDefaultScope(Uri uri) + => $"{uri.GetComponents(UriComponents.SchemeAndServer, UriFormat.SafeUnescaped)}/.default"; + + /// Gets the status of a previously created asset conversion. + /// the conversion id. + /// A string to for a diagnostic scope. + /// The cancellation token to use. + /// is null. + internal Response GetConversionInternal(string conversionId, string diagnosticScopeName, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope(diagnosticScopeName); + scope.AddAttribute(nameof(conversionId), conversionId); + scope.Start(); + try + { + var result = _restClient.GetConversion(_accountId, conversionId, cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// Gets the status of a previously created asset conversion. + /// the conversion id. + /// A string to for a diagnostic scope. + /// The cancellation token to use. + /// is null. + internal async Task> GetConversionInternalAsync(string conversionId, string diagnosticScopeName, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope(diagnosticScopeName); + scope.AddAttribute(nameof(conversionId), conversionId); + scope.Start(); + try + { + var result = await _restClient.GetConversionAsync(_accountId, conversionId, cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// Gets properties of a particular rendering session. + /// ID of a previously created session. + /// A string to for a diagnostic scope. + /// The cancellation token to use. + /// is null. + internal Response GetSessionInternal(string sessionId, string diagnosticScopeName, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope(diagnosticScopeName); + scope.AddAttribute(nameof(sessionId), sessionId); + scope.Start(); + try + { + var result = _restClient.GetSession(_accountId, sessionId, cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// Gets properties of a particular rendering session. + /// ID of a previously created session. + /// A string to for a diagnostic scope. + /// The cancellation token to use. + /// is null. + internal async Task> GetSessionInternalAsync(string sessionId, string diagnosticScopeName, CancellationToken cancellationToken = default) + { + using DiagnosticScope scope = _clientDiagnostics.CreateScope(diagnosticScopeName); + scope.AddAttribute(nameof(sessionId), sessionId); + scope.Start(); + try + { + var result = await _restClient.GetSessionAsync(_accountId, sessionId, cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + #endregion + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/RemoteRenderingClientOptions.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/RemoteRenderingClientOptions.cs new file mode 100644 index 000000000000..b07378eee8f7 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/RemoteRenderingClientOptions.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering +{ + /// + /// The . + /// Implements the . + /// + /// + public class RemoteRenderingClientOptions : ClientOptions + { + internal string Version { get; } + + /// + /// The authentication endpoint. If this is not set, the RemoteRenderingClient will use a value based on the account domain. + /// + internal Uri AuthenticationEndpoint { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// The version. + public RemoteRenderingClientOptions(ServiceVersion version = ServiceVersion.V2021_01_01_Preview) + { + Version = version switch + { + ServiceVersion.V2021_01_01_Preview => "2021-01-01-preview", + _ => throw new ArgumentException($"The service version {version} is not supported by this library.", nameof(version)) + }; + + AuthenticationEndpoint = null; + } + + /// + /// The Azure Remote Rendering service version. + /// + public enum ServiceVersion + { + /// + /// Version V2021_01_01_preview of the Azure Remote Rendering service. + /// +#pragma warning disable CA1707 // Identifiers should not contain underscores + V2021_01_01_Preview = 1, +#pragma warning restore CA1707 // Identifiers should not contain underscores + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/StartRenderingSessionOperation.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/StartRenderingSessionOperation.cs new file mode 100644 index 000000000000..95d0ed2b3585 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/StartRenderingSessionOperation.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Azure.MixedReality.RemoteRendering +{ + /// + /// Operation which represents the starting of a session. + /// It is returned by StartSession, but you can also construct a StartSessionOperation for a sessionId which already exists. + /// + public class StartRenderingSessionOperation : Operation + { + private RemoteRenderingClient _client; + private Response _response; + + /// + /// Construct a StartSessionOperation from a session which already exists. + /// + /// + /// + public StartRenderingSessionOperation(string sessionId, RemoteRenderingClient client) + { + _client = client; + _response = client.GetSessionInternal(sessionId, $"{nameof(StartRenderingSessionOperation)}.{nameof(StartRenderingSessionOperation)}"); + } + + /// + /// Internal constructor. + /// + /// + /// + internal StartRenderingSessionOperation(RemoteRenderingClient client, Response response) + { + _client = client; + _response = response; + } + + /// + public override string Id => _response.Value.SessionId; + + /// + public override RenderingSession Value + { + get + { + return _response.Value; + } + } + + /// + public override bool HasCompleted + { + get { return (_response.Value.Status != RenderingSessionStatus.Starting); } + } + + /// + public override bool HasValue + { + get { return true; } + } + + /// + public override Response GetRawResponse() + { + return _response.GetRawResponse(); + } + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) + { + if (!HasCompleted) + { + _response = _client.GetSessionInternal(_response.Value.SessionId, $"{nameof(StartRenderingSessionOperation)}.{nameof(UpdateStatus)}", cancellationToken); + } + return _response.GetRawResponse(); + } + + /// + public async override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) + { + if (!HasCompleted) + { + _response = await _client.GetSessionInternalAsync(_response.Value.SessionId, $"{nameof(StartRenderingSessionOperation)}.{nameof(UpdateStatus)}", cancellationToken).ConfigureAwait(false); + } + return _response.GetRawResponse(); + } + + /// + public async override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) + { + return await WaitForCompletionAsync(TimeSpan.FromSeconds(10), cancellationToken).ConfigureAwait(false); + } + + /// + public async override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) + { + while (true) + { + await UpdateStatusAsync(cancellationToken).ConfigureAwait(false); + if (HasCompleted) + { + break; + } + await Task.Delay(pollingInterval, cancellationToken).ConfigureAwait(false); + } + return _response; + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/autorest.md b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/autorest.md new file mode 100644 index 000000000000..e13210f16377 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/autorest.md @@ -0,0 +1,8 @@ +# Generated code configuration + +Run `dotnet build /t:GenerateCode` to generate code. + +``` yaml +input-file: + - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/883556bcd11ea4cc7525668c3e156dee49bc5b86/specification/mixedreality/data-plane/Microsoft.MixedReality/preview/2021-01-01-preview/mr-arr.json +``` diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/properties/AssemblyInfo.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/properties/AssemblyInfo.cs new file mode 100644 index 000000000000..a6aac63d45b3 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/properties/AssemblyInfo.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +// Replace with test project/test project public key and uncomment to make internal members visible to +// your test project. If not needed, this can be deleted. +// [assembly: InternalsVisibleTo("Azure.Template.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.MixedReality")] diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/Azure.MixedReality.RemoteRendering.Tests.csproj b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/Azure.MixedReality.RemoteRendering.Tests.csproj new file mode 100644 index 000000000000..1d96da999fbd --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/Azure.MixedReality.RemoteRendering.Tests.csproj @@ -0,0 +1,22 @@ + + + $(RequiredTargetFrameworks) + + + + + + + + + + + + + + + + + + + diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/RemoteRenderingLiveTests.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/RemoteRenderingLiveTests.cs new file mode 100644 index 000000000000..7383ca156627 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/RemoteRenderingLiveTests.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; +using NUnit.Framework; +using System; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.MixedReality.RemoteRendering.Tests +{ + public class RemoteRenderingLiveTests : RecordedTestBase + { + public RemoteRenderingLiveTests(bool isAsync) : + base(isAsync/*, RecordedTestMode.Record*/) + { + } + + [RecordedTest] + public async Task TestSimpleConversion() + { + var client = GetClient(); + + Uri storageUri = new Uri($"https://{TestEnvironment.StorageAccountName}.blob.core.windows.net/{TestEnvironment.BlobContainerName}"); + + AssetConversionInputOptions input = new AssetConversionInputOptions(storageUri, "testBox.fbx") + { + // We use SAS for live testing, as there can be a delay before DRAM-based access is available for new accounts. + StorageContainerReadListSas = TestEnvironment.SasToken, + BlobPrefix = "Input" + }; + AssetConversionOutputOptions output = new AssetConversionOutputOptions(storageUri) + { + StorageContainerWriteSas = TestEnvironment.SasToken, + BlobPrefix = "Output" + }; + AssetConversionOptions conversionOptions = new AssetConversionOptions(input, output); + + string conversionId = Recording.Random.NewGuid().ToString(); + + AssetConversionOperation conversionOperation = await client.StartConversionAsync(conversionId, conversionOptions); + Assert.AreEqual(conversionId, conversionOperation.Id); + Assert.AreEqual(conversionOptions.InputOptions.RelativeInputAssetPath, conversionOperation.Value.Options.InputOptions.RelativeInputAssetPath); + Assert.AreNotEqual(AssetConversionStatus.Failed, conversionOperation.Value.Status); + + AssetConversion conversion = await client.GetConversionAsync(conversionId); + Assert.AreEqual(conversion.ConversionId, conversionId); + Assert.AreNotEqual(AssetConversionStatus.Failed, conversion.Status); + + AssetConversion conversion2 = await conversionOperation.WaitForCompletionAsync(); + Assert.AreEqual(conversionId, conversion2.ConversionId); + Assert.AreEqual(AssetConversionStatus.Succeeded, conversion2.Status); + Assert.IsTrue(conversionOperation.Value.Output.OutputAssetUri.EndsWith("Output/testBox.arrAsset")); + + bool foundConversion = false; + await foreach (var s in client.GetConversionsAync()) + { + if (s.ConversionId == conversionId) + { + foundConversion = true; + } + } + Assert.IsTrue(foundConversion); + } + + [RecordedTest] + public void TestFailedConversionsNoAccess() + { + var client = GetClient(); + + Uri storageUri = new Uri($"https://{TestEnvironment.StorageAccountName}.blob.core.windows.net/{TestEnvironment.BlobContainerName}"); + + AssetConversionInputOptions input = new AssetConversionInputOptions(storageUri, "testBox.fbx") + { + // Do not provide SAS access to the container, and assume the test account is not linked to the storage. + BlobPrefix = "Input" + }; + AssetConversionOutputOptions output = new AssetConversionOutputOptions(storageUri) + { + BlobPrefix = "Output" + }; + AssetConversionOptions conversionOptions = new AssetConversionOptions(input, output); + + string conversionId = Recording.Random.NewGuid().ToString(); + + RequestFailedException ex = Assert.ThrowsAsync(() => client.StartConversionAsync(conversionId, conversionOptions)); + Assert.AreEqual(ex.Status, 400); + // Error accessing connected storage account due to insufficient permissions. Check if the Mixed Reality resource has correct permissions assigned + Assert.IsTrue(ex.Message.ToLower().Contains("storage")); + Assert.IsTrue(ex.Message.ToLower().Contains("permissions")); + } + + [RecordedTest] + public async Task TestFailedConversionsMissingAsset() + { + var client = GetClient(); + + Uri storageUri = new Uri($"https://{TestEnvironment.StorageAccountName}.blob.core.windows.net/{TestEnvironment.BlobContainerName}"); + + AssetConversionInputOptions input = new AssetConversionInputOptions(storageUri, "boxWhichDoesNotExist.fbx") + { + // We use SAS for live testing, as there can be a delay before DRAM-based access is available for new accounts. + StorageContainerReadListSas = TestEnvironment.SasToken, + BlobPrefix = "Input" + }; + AssetConversionOutputOptions output = new AssetConversionOutputOptions(storageUri) + { + StorageContainerWriteSas = TestEnvironment.SasToken, + BlobPrefix = "Output" + }; + AssetConversionOptions conversionOptions = new AssetConversionOptions(input, output); + + string conversionId = Recording.Random.NewGuid().ToString(); + + AssetConversionOperation conversionOperation = await client.StartConversionAsync(conversionId, conversionOptions); + AssetConversion conversion = await conversionOperation.WaitForCompletionAsync(); + Assert.AreEqual(AssetConversionStatus.Failed, conversion.Status); + Assert.IsNotNull(conversion.Error); + // Invalid input provided. Check logs in output container for details. + Assert.IsTrue(conversion.Error.Message.ToLower().Contains("invalid input")); + Assert.IsTrue(conversion.Error.Message.ToLower().Contains("logs")); + } + + [RecordedTest] + public async Task TestSimpleSession() + { + var client = GetClient(); + + RenderingSessionOptions options = new RenderingSessionOptions(TimeSpan.FromMinutes(4), RenderingServerSize.Standard); + + string sessionId = Recording.Random.NewGuid().ToString(); + + StartRenderingSessionOperation startSessionOperation = await client.StartSessionAsync(sessionId, options); + Assert.IsTrue(startSessionOperation.HasValue); + Assert.AreEqual(options.Size, startSessionOperation.Value.Size); + Assert.AreEqual(sessionId, startSessionOperation.Value.SessionId); + + RenderingSession sessionProperties = await client.GetSessionAsync(sessionId); + Assert.AreEqual(startSessionOperation.Value.CreatedOn, sessionProperties.CreatedOn); + + UpdateSessionOptions updateOptions = new UpdateSessionOptions(TimeSpan.FromMinutes(5)); + + RenderingSession updatedSession = await client.UpdateSessionAsync(sessionId, updateOptions); + Assert.AreEqual(updatedSession.MaxLeaseTime, TimeSpan.FromMinutes(5)); + + RenderingSession readyRenderingSession = await startSessionOperation.WaitForCompletionAsync(); + Assert.IsTrue((readyRenderingSession.MaxLeaseTime == TimeSpan.FromMinutes(4)) || (readyRenderingSession.MaxLeaseTime == TimeSpan.FromMinutes(5))); + Assert.IsNotNull(readyRenderingSession.Host); + Assert.IsNotNull(readyRenderingSession.ArrInspectorPort); + Assert.IsNotNull(readyRenderingSession.HandshakePort); + Assert.AreEqual(readyRenderingSession.Size, options.Size); + + UpdateSessionOptions updateOptions2 = new UpdateSessionOptions(TimeSpan.FromMinutes(6)); + Assert.AreEqual(TimeSpan.FromMinutes(6), updateOptions2.MaxLeaseTime); + + bool foundSession = false; + await foreach (var s in client.GetSessionsAsync()) + { + if (s.SessionId == sessionId) + { + foundSession = true; + } + } + Assert.IsTrue(foundSession); + await client.StopSessionAsync(sessionId); + + RenderingSession stoppedRenderingSession = await client.GetSessionAsync(sessionId); + Assert.AreEqual(RenderingSessionStatus.Stopped, stoppedRenderingSession.Status); + } + + [RecordedTest] + public void TestFailedSessionRequest() + { + var client = GetClient(); + + // Make an invalid request (negative lease time). + RenderingSessionOptions options = new RenderingSessionOptions(TimeSpan.FromMinutes(-4), RenderingServerSize.Standard); + + string sessionId = Recording.Random.NewGuid().ToString(); + + RequestFailedException ex = Assert.ThrowsAsync(() => client.StartSessionAsync(sessionId, options)); + Assert.AreEqual(ex.Status, 400); + + // The maxLeaseTimeMinutes value cannot be negative + Assert.IsTrue(ex.Message.ToLower().Contains("lease")); + Assert.IsTrue(ex.Message.ToLower().Contains("negative")); + } + + private RemoteRenderingClient GetClient() + { + RemoteRenderingAccount account = new RemoteRenderingAccount(new Guid(TestEnvironment.AccountId), TestEnvironment.AccountDomain); + Uri serviceEndpoint = new Uri(TestEnvironment.ServiceEndpoint); + + var options = InstrumentClientOptions(new RemoteRenderingClientOptions()); + + // We don't need to test communication with the STS Authentication Library, so in playback + // we use a code-path which does not attempt to contact that service. + RemoteRenderingClient client; + if (Mode != RecordedTestMode.Playback) + { + AzureKeyCredential accountKeyCredential = new AzureKeyCredential(TestEnvironment.AccountKey); + client = new RemoteRenderingClient(serviceEndpoint, account, accountKeyCredential, options); + } + else + { + AccessToken artificialToken = new AccessToken("TestToken", DateTimeOffset.MaxValue); + client = new RemoteRenderingClient(serviceEndpoint, account, artificialToken, options); + } + return InstrumentClient(client); + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/RemoteRenderingTestEnvironment.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/RemoteRenderingTestEnvironment.cs new file mode 100644 index 000000000000..54113317cb77 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/RemoteRenderingTestEnvironment.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; +using System; + +namespace Azure.MixedReality.RemoteRendering.Tests +{ + public class RemoteRenderingTestEnvironment : TestEnvironment + { + /// + /// Gets the account domain. + /// + /// + /// Set the MIXEDREALITY_ARR_ACCOUNT_DOMAIN environment variable. + /// + public string AccountDomain => GetRecordedVariable("ARR_ACCOUNT_DOMAIN"); + + /// + /// Gets the account identifier. + /// + /// + /// Set the MIXEDREALITY_ARR_ACCOUNT_ID environment variable. + /// + public string AccountId => GetRecordedVariable("ARR_ACCOUNT_ID"); + + /// + /// Gets the account key. + /// + /// + /// Set the MIXEDREALITY_ARR_ACCOUNT_KEY environment variable. + /// + public string AccountKey => GetRecordedVariable("ARR_ACCOUNT_KEY", options => options.IsSecret()); + + /// + /// Gets the service endpoint. + /// + /// + /// Set the MIXEDREALITY_ARR_SERVICE_ENDPOINT environment variable. + /// + public string ServiceEndpoint => GetRecordedVariable("ARR_SERVICE_ENDPOINT"); + + /// + /// Gets the storage account name used by conversion tests. + /// + /// + /// Set the MIXEDREALITY_ARR_STORAGE_ACCOUNT_NAME environment variable. + /// + public string StorageAccountName => GetRecordedVariable("ARR_STORAGE_ACCOUNT_NAME"); + + /// + /// Gets the blob container name used by the conversion tests. + /// + /// + /// Set the MIXEDREALITY_ARR_BLOB_CONTAINER_NAME environment variable. + /// + public string BlobContainerName => GetRecordedVariable("ARR_BLOB_CONTAINER_NAME"); + + /// + /// Get a SAS token which entitles the service to access storage. + /// + /// + /// Set the MIXEDREALITY_ARR_SAS_TOKEN environment variable. + /// We use SAS for live testing, as there can be a delay before DRAM-based access is available. + /// + public string SasToken => GetRecordedVariable("ARR_SAS_TOKEN", options => options.IsSecret()); + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/Samples/RemoteRenderingConvertAssetSample.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/Samples/RemoteRenderingConvertAssetSample.cs new file mode 100644 index 000000000000..38bef3465b09 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/Samples/RemoteRenderingConvertAssetSample.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.MixedReality.RemoteRendering.Tests.Samples +{ + // These tests assume that the storage account is accessible from the remote rendering account. + // See https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account + // Since the roles can take a while to propagate, we do not live test these samples. + + public class RemoteRenderingConvertAssetSample : SamplesBase + { + private RemoteRenderingClient GetClient() + { + Guid accountId = new Guid(TestEnvironment.AccountId); + string accountDomain = TestEnvironment.AccountDomain; + string accountKey = TestEnvironment.AccountKey; + Uri remoteRenderingEndpoint = new Uri(TestEnvironment.ServiceEndpoint); + + RemoteRenderingAccount account = new RemoteRenderingAccount(accountId, accountDomain); + AzureKeyCredential accountKeyCredential = new AzureKeyCredential(accountKey); + + RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, account, accountKeyCredential); + return client; + } + + [Test] + [Explicit("This test assume DRAM is set up, so we do not run them live.")] + public void ConvertSimpleAsset() + { + RemoteRenderingClient client = GetClient(); + + Uri storageUri = new Uri($"https://{TestEnvironment.StorageAccountName}.blob.core.windows.net/{TestEnvironment.BlobContainerName}"); + + #region Snippet:StartAnAssetConversion + + AssetConversionInputOptions inputOptions = new AssetConversionInputOptions(storageUri, "box.fbx"); + AssetConversionOutputOptions outputOptions = new AssetConversionOutputOptions(storageUri); + AssetConversionOptions conversionOptions = new AssetConversionOptions(inputOptions, outputOptions); + + // A randomly generated GUID is a good choice for a conversionId. + string conversionId = Guid.NewGuid().ToString(); + + AssetConversionOperation conversionOperation = client.StartConversion(conversionId, conversionOptions); + + #endregion Snippet:StartAnAssetConversion + #region Snippet:QueryAssetConversion + + AssetConversion conversion = conversionOperation.WaitForCompletionAsync().Result; + if (conversion.Status == AssetConversionStatus.Succeeded) + { + Console.WriteLine($"Conversion succeeded: Output written to {conversion.Output.OutputAssetUri}"); + } + else if (conversion.Status == AssetConversionStatus.Failed) + { + Console.WriteLine($"Conversion failed: {conversion.Error.Code} {conversion.Error.Message}"); + } + + #endregion Snippet:QueryAssetConversion + } + + [Test] + [Explicit("This test assume DRAM is set up, so we do not run them live.")] + public void ConvertMoreComplexAsset() + { + RemoteRenderingClient client = GetClient(); + + Uri inputStorageUri = new Uri($"https://{TestEnvironment.StorageAccountName}.blob.core.windows.net/{TestEnvironment.BlobContainerName}"); + Uri outputStorageUri = new Uri($"https://{TestEnvironment.StorageAccountName}.blob.core.windows.net/{TestEnvironment.BlobContainerName}"); + + #region Snippet:StartAComplexAssetConversion + AssetConversionInputOptions inputOptions = new AssetConversionInputOptions(inputStorageUri, "bicycle.gltf") + { + BlobPrefix = "Bicycle" + }; + AssetConversionOutputOptions outputOptions = new AssetConversionOutputOptions(outputStorageUri) + { + BlobPrefix = "ConvertedBicycle" + }; + AssetConversionOptions conversionOptions = new AssetConversionOptions(inputOptions, outputOptions); + + string conversionId = Guid.NewGuid().ToString(); + + AssetConversionOperation conversionOperation = client.StartConversion(conversionId, conversionOptions); + #endregion Snippet:StartAComplexAssetConversion + + AssetConversion conversion = conversionOperation.WaitForCompletionAsync().Result; + if (conversion.Status == AssetConversionStatus.Succeeded) + { + Console.WriteLine($"Conversion succeeded: Output written to {conversion.Output.OutputAssetUri}"); + } + else if (conversion.Status == AssetConversionStatus.Failed) + { + Console.WriteLine($"Conversion failed: {conversion.Error.Code} {conversion.Error.Message}"); + } + } + + [Test] + [Explicit("This test assume DRAM is set up, so we do not run them live.")] + public void GetConversions() + { + RemoteRenderingClient client = GetClient(); + + Console.WriteLine("Successful conversions since yesterday:"); + #region Snippet:GetConversions + + foreach (var conversion in client.GetConversions()) + { + if ((conversion.Status == AssetConversionStatus.Succeeded) && (conversion.CreatedOn > DateTimeOffset.Now.AddDays(-1))) + { + Console.WriteLine($"output asset URI: {conversion.Output.OutputAssetUri}"); + } + } + + #endregion Snippet:GetConversions + } + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/Samples/RemoteRenderingCreateSessionSample.cs b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/Samples/RemoteRenderingCreateSessionSample.cs new file mode 100644 index 000000000000..1588388cb126 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/Samples/RemoteRenderingCreateSessionSample.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core.TestFramework; +using NUnit.Framework; +using System.Threading; +using Azure.Core; +using Azure.Identity; +using System.Reflection.Emit; +using System.Threading.Tasks; + +namespace Azure.MixedReality.RemoteRendering.Tests.Samples +{ + public class RemoteRenderingCreateSessionSample : SamplesBase + { + /// + /// Demonstrates how to obtain a client with an AzureKeyCredential. + /// Methods which demonstrate other authentication schemes are at the bottom of the file. + /// + /// + private RemoteRenderingClient GetClientWithAccountKey() + { + Guid accountId = new Guid(TestEnvironment.AccountId); + string accountDomain = TestEnvironment.AccountDomain; + string accountKey = TestEnvironment.AccountKey; + Uri remoteRenderingEndpoint = new Uri(TestEnvironment.ServiceEndpoint); + + #region Snippet:CreateAClient + RemoteRenderingAccount account = new RemoteRenderingAccount(accountId, accountDomain); + AzureKeyCredential accountKeyCredential = new AzureKeyCredential(accountKey); + + RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, account, accountKeyCredential); + #endregion Snippet:CreateAClient + return client; + } + + [Test] + [Explicit("To avoid launching too many sessions during testing, we rely on the live tests.")] + public void CreateSession() + { + RemoteRenderingClient client = GetClientWithAccountKey(); + + #region Snippet:CreateASession + + RenderingSessionOptions options = new RenderingSessionOptions(TimeSpan.FromMinutes(30), RenderingServerSize.Standard); + + // A randomly generated GUID is a good choice for a sessionId. + string sessionId = Guid.NewGuid().ToString(); + + StartRenderingSessionOperation startSessionOperation = client.StartSession(sessionId, options); + + RenderingSession newSession = startSessionOperation.WaitForCompletionAsync().Result; + if (newSession.Status == RenderingSessionStatus.Ready) + { + Console.WriteLine($"Session {sessionId} is ready."); + } + else if (newSession.Status == RenderingSessionStatus.Error) + { + Console.WriteLine($"Session {sessionId} encountered an error: {newSession.Error.Code} {newSession.Error.Message}"); + } + + #endregion Snippet:CreateASession + + // Use the session here. + // ... + + // The session will automatically timeout, but in this sample we also demonstrate how to shut it down explicitly. + #region Snippet:StopSession + + client.StopSession(sessionId); + + #endregion Snippet:StopSession + } + + [Test] + [Explicit("To avoid launching too many sessions during testing, we rely on the live tests.")] + public void QueryAndUpdateASession() + { + RemoteRenderingClient client = GetClientWithAccountKey(); + + string sessionId = Guid.NewGuid().ToString(); + + RenderingSessionOptions settings = new RenderingSessionOptions(TimeSpan.FromMinutes(30), RenderingServerSize.Standard); + + RenderingSession newSession = client.StartSession(sessionId, settings).WaitForCompletionAsync().Result; + + #region Snippet:UpdateSession + + RenderingSession currentSession = client.GetSession(sessionId); + + if (currentSession.MaxLeaseTime - DateTimeOffset.Now.Subtract(currentSession.CreatedOn.Value) < TimeSpan.FromMinutes(2)) + { + TimeSpan newLeaseTime = currentSession.MaxLeaseTime.Value.Add(TimeSpan.FromMinutes(30)); + + UpdateSessionOptions longerLeaseSettings = new UpdateSessionOptions(newLeaseTime); + + client.UpdateSession(sessionId, longerLeaseSettings); + } + + #endregion Snippet:UpdateSession + + client.StopSession(sessionId); + } + + [Test] + [Explicit("To avoid launching too many sessions during testing, we rely on the live tests.")] + public void GetInformationAboutSessions() + { + RemoteRenderingClient client = GetClientWithAccountKey(); + + // Ensure there's at least one session to query. + string sessionId = Guid.NewGuid().ToString(); + RenderingSessionOptions settings = new RenderingSessionOptions(TimeSpan.FromMinutes(30), RenderingServerSize.Standard); + client.StartSession(sessionId, settings); + Thread.Sleep(TimeSpan.FromSeconds(10)); + + #region Snippet:ListSessions + + foreach (var properties in client.GetSessions()) + { + if (properties.Status == RenderingSessionStatus.Starting) + { + Console.WriteLine($"Session \"{properties.SessionId}\" is starting."); + } + else if (properties.Status == RenderingSessionStatus.Ready) + { + Console.WriteLine($"Session \"{properties.SessionId}\" is ready at host {properties.Host}"); + } + } + + #endregion Snippet:ListSessions + + client.StopSession(sessionId); + } + + #region Other ways of authenticating the RemoteRenderingClient. + + private RemoteRenderingClient GetClientWithAAD() + { + Guid accountId = new Guid(TestEnvironment.AccountId); + string accountDomain = TestEnvironment.AccountDomain; + string tenantId = TestEnvironment.TenantId; + string clientId = TestEnvironment.ClientId; + string clientSecret = TestEnvironment.ClientSecret; + Uri remoteRenderingEndpoint = new Uri(TestEnvironment.ServiceEndpoint); + + #region Snippet:CreateAClientWithAAD + RemoteRenderingAccount account = new RemoteRenderingAccount(accountId, accountDomain); + + TokenCredential credential = new ClientSecretCredential(tenantId, clientId, clientSecret, new TokenCredentialOptions + { + AuthorityHost = new Uri($"https://login.microsoftonline.com/{tenantId}") + }); + + RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, account, credential); + #endregion Snippet:CreateAClientWithAAD + return client; + } + + private RemoteRenderingClient GetClientWithDeviceCode() + { + Guid accountId = new Guid(TestEnvironment.AccountId); + string accountDomain = TestEnvironment.AccountDomain; + string tenantId = TestEnvironment.TenantId; + string clientId = TestEnvironment.ClientId; + Uri remoteRenderingEndpoint = new Uri(TestEnvironment.ServiceEndpoint); + + #region Snippet:CreateAClientWithDeviceCode + RemoteRenderingAccount account = new RemoteRenderingAccount(accountId, accountDomain); + + Task deviceCodeCallback(DeviceCodeInfo deviceCodeInfo, CancellationToken cancellationToken) + { + Console.WriteLine(deviceCodeInfo.Message); + return Task.FromResult(0); + } + + TokenCredential credential = new DeviceCodeCredential(deviceCodeCallback, tenantId, clientId, new TokenCredentialOptions + { + AuthorityHost = new Uri($"https://login.microsoftonline.com/{tenantId}"), + }); + + RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, account, credential); + #endregion Snippet:CreateAClientWithDeviceCode + return client; + } + + private RemoteRenderingClient GetClientWithDefaultAzureCredential() + { + Guid accountId = new Guid(TestEnvironment.AccountId); + string accountDomain = TestEnvironment.AccountDomain; + Uri remoteRenderingEndpoint = new Uri(TestEnvironment.ServiceEndpoint); + + #region Snippet:CreateAClientWithAzureCredential + RemoteRenderingAccount account = new RemoteRenderingAccount(accountId, accountDomain); + TokenCredential credential = new DefaultAzureCredential(includeInteractiveCredentials: true); + + RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, account, credential); + #endregion Snippet:CreateAClientWithAzureCredential + + return client; + } + + private AccessToken GetMixedRealityAccessTokenFromWebService() + { + return new AccessToken("TokenObtainedFromStsClientRunningInWebservice", DateTimeOffset.MaxValue); + } + + private RemoteRenderingClient GetClientWithStaticAccessToken() + { + Guid accountId = new Guid(TestEnvironment.AccountId); + string accountDomain = TestEnvironment.AccountDomain; + Uri remoteRenderingEndpoint = new Uri(TestEnvironment.ServiceEndpoint); + + #region Snippet:CreateAClientWithStaticAccessToken + RemoteRenderingAccount account = new RemoteRenderingAccount(accountId, accountDomain); + + // GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves + // a Mixed Reality access token from a web service. The web service would use the + // MixedRealityStsClient and credentials to obtain an access token to be returned + // to the client. + AccessToken accessToken = GetMixedRealityAccessTokenFromWebService(); + + RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, account, accessToken); + #endregion Snippet:CreateAClientWithStaticAccessToken + + return client; + } + + #endregion + } +} diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedConversionsMissingAsset.json b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedConversionsMissingAsset.json new file mode 100644 index 000000000000..486cf7694dd2 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedConversionsMissingAsset.json @@ -0,0 +1,295 @@ +{ + "Entries": [ + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/78c4ad59-21e6-74b1-0339-c23bfe785096?api-version=2021-01-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "361", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "51abb5474b11d9e7a7cab12da671467d", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "storageContainerReadListSas": "Sanitized", + "blobPrefix": "Input", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "storageContainerWriteSas": "Sanitized", + "blobPrefix": "Output" + } + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "460", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:50:24 GMT", + "MS-CV": "KscKar7\u002Bfkm9qUxZWpBUmQ.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "78c4ad59-21e6-74b1-0339-c23bfe785096", + "creationTime": "2021-01-29T15:50:24.931576Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": null, + "status": "NotStarted" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/78c4ad59-21e6-74b1-0339-c23bfe785096?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "ced01aa2895fd071503b6ef6a3f6f12e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "460", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:50:24 GMT", + "MS-CV": "KN2iZiwbOkSlp7JoJ2EfHg.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "78c4ad59-21e6-74b1-0339-c23bfe785096", + "creationTime": "2021-01-29T15:50:24.931576Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": null, + "status": "NotStarted" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/78c4ad59-21e6-74b1-0339-c23bfe785096?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "bca1646acfdc0e6cc5ebd01c6f83cd92", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "457", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:50:35 GMT", + "MS-CV": "yTvL8aA/zEaDNxPz9rpgyA.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "78c4ad59-21e6-74b1-0339-c23bfe785096", + "creationTime": "2021-01-29T15:50:24.931576Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": null, + "status": "Running" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/78c4ad59-21e6-74b1-0339-c23bfe785096?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "e39845f282a7bd3644db00d5dcf136b1", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "457", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:50:45 GMT", + "MS-CV": "zV8/n6RPTEmVbyig/pbGnw.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "78c4ad59-21e6-74b1-0339-c23bfe785096", + "creationTime": "2021-01-29T15:50:24.931576Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": null, + "status": "Running" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/78c4ad59-21e6-74b1-0339-c23bfe785096?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "42c383d88acfd2a0adc20874b85560cd", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "457", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:50:55 GMT", + "MS-CV": "7CxeyE\u002Bxgk2q0jQ7kOPGjQ.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "78c4ad59-21e6-74b1-0339-c23bfe785096", + "creationTime": "2021-01-29T15:50:24.931576Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": null, + "status": "Running" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/78c4ad59-21e6-74b1-0339-c23bfe785096?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "5e03dc6e0d5de8862de47800cf9731d4", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "566", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:51:06 GMT", + "MS-CV": "Kn4vCLxnVU\u002BBcLBefmY3NQ.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "78c4ad59-21e6-74b1-0339-c23bfe785096", + "creationTime": "2021-01-29T15:50:24.931576Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": { + "code": "ConversionProcessFailed", + "message": "Invalid input provided. Check logs in output container for details." + }, + "status": "Failed" + } + } + ], + "Variables": { + "ARR_ACCOUNT_DOMAIN": "westeurope.mixedreality.azure.com", + "ARR_ACCOUNT_ID": "1b405859-8af9-47e6-941d-9205163c0f63", + "ARR_ACCOUNT_KEY": "Sanitized", + "ARR_BLOB_CONTAINER_NAME": "test", + "ARR_SAS_TOKEN": "Sanitized", + "ARR_SERVICE_ENDPOINT": "https://remoterendering.westeurope.mixedreality.azure.com", + "ARR_STORAGE_ACCOUNT_NAME": "sdktest", + "RandomSeed": "165246516" + } +} \ No newline at end of file diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedConversionsMissingAssetAsync.json b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedConversionsMissingAssetAsync.json new file mode 100644 index 000000000000..b17133713fde --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedConversionsMissingAssetAsync.json @@ -0,0 +1,295 @@ +{ + "Entries": [ + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/32be1788-d889-dd5c-01d5-690927a183ad?api-version=2021-01-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "361", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "cae2d87d9dac22428012f166d368a2ab", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "storageContainerReadListSas": "Sanitized", + "blobPrefix": "Input", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "storageContainerWriteSas": "Sanitized", + "blobPrefix": "Output" + } + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "461", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:55:21 GMT", + "MS-CV": "IWMCeBODkkO7co6QXDh9Kw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "32be1788-d889-dd5c-01d5-690927a183ad", + "creationTime": "2021-01-29T16:55:21.2477337Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": null, + "status": "NotStarted" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/32be1788-d889-dd5c-01d5-690927a183ad?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "6991848fa8aae15f77c14db85394d43f", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "461", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:55:21 GMT", + "MS-CV": "Cu4yt47HU0CyENymUbdkNw.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "32be1788-d889-dd5c-01d5-690927a183ad", + "creationTime": "2021-01-29T16:55:21.2477337Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": null, + "status": "NotStarted" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/32be1788-d889-dd5c-01d5-690927a183ad?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "80da75c962eaeb28d49bb176e7f60999", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "458", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:55:31 GMT", + "MS-CV": "90yMsjB69UqKDShFqHtaYA.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "32be1788-d889-dd5c-01d5-690927a183ad", + "creationTime": "2021-01-29T16:55:21.2477337Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": null, + "status": "Running" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/32be1788-d889-dd5c-01d5-690927a183ad?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "a27abe331910d502790152ea4f8acfec", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "458", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:55:43 GMT", + "MS-CV": "2WfhNM5\u002BlUqLjz4w3ecLLw.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "32be1788-d889-dd5c-01d5-690927a183ad", + "creationTime": "2021-01-29T16:55:21.2477337Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": null, + "status": "Running" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/32be1788-d889-dd5c-01d5-690927a183ad?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "5e9db23e228d2cc05ca6950ff6e8fa81", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "458", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:55:53 GMT", + "MS-CV": "ChgfYsWwrUmG5sow2wrLiA.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "32be1788-d889-dd5c-01d5-690927a183ad", + "creationTime": "2021-01-29T16:55:21.2477337Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": null, + "status": "Running" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/32be1788-d889-dd5c-01d5-690927a183ad?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "9585b3b7311aaf2f720506e9103d9b49", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "567", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:04 GMT", + "MS-CV": "iiDMMmUya0OVUNZhbcOdwg.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "32be1788-d889-dd5c-01d5-690927a183ad", + "creationTime": "2021-01-29T16:55:21.2477337Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": { + "code": "ConversionProcessFailed", + "message": "Invalid input provided. Check logs in output container for details." + }, + "status": "Failed" + } + } + ], + "Variables": { + "ARR_ACCOUNT_DOMAIN": "westeurope.mixedreality.azure.com", + "ARR_ACCOUNT_ID": "1b405859-8af9-47e6-941d-9205163c0f63", + "ARR_ACCOUNT_KEY": "Sanitized", + "ARR_BLOB_CONTAINER_NAME": "test", + "ARR_SAS_TOKEN": "Sanitized", + "ARR_SERVICE_ENDPOINT": "https://remoterendering.westeurope.mixedreality.azure.com", + "ARR_STORAGE_ACCOUNT_NAME": "sdktest", + "RandomSeed": "1156420939" + } +} \ No newline at end of file diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedConversionsNoAccess.json b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedConversionsNoAccess.json new file mode 100644 index 000000000000..b4d73b862f73 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedConversionsNoAccess.json @@ -0,0 +1,57 @@ +{ + "Entries": [ + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/6a27bf37-5009-7103-745a-5ed572f66c08?api-version=2021-01-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "267", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "750598dbad47b20c49b040563e8cbcab", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output" + } + } + }, + "StatusCode": 400, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "206", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:49:14 GMT", + "MS-CV": "1ZKa7etFS02Ejuo3kLRV/g.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "error": { + "code": "DelegatedResourceAccessError", + "message": "Error accessing connected storage account due to insufficient permissions. Check if the Mixed Reality resource has correct permissions assigned." + } + } + } + ], + "Variables": { + "ARR_ACCOUNT_DOMAIN": "westeurope.mixedreality.azure.com", + "ARR_ACCOUNT_ID": "1b405859-8af9-47e6-941d-9205163c0f63", + "ARR_ACCOUNT_KEY": "Sanitized", + "ARR_BLOB_CONTAINER_NAME": "test", + "ARR_SERVICE_ENDPOINT": "https://remoterendering.westeurope.mixedreality.azure.com", + "ARR_STORAGE_ACCOUNT_NAME": "sdktest", + "RandomSeed": "1312090656" + } +} \ No newline at end of file diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedConversionsNoAccessAsync.json b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedConversionsNoAccessAsync.json new file mode 100644 index 000000000000..cc439d0a6365 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedConversionsNoAccessAsync.json @@ -0,0 +1,57 @@ +{ + "Entries": [ + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/19d7136a-d3d7-5543-f3e0-40826771ed64?api-version=2021-01-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "267", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "ae455548c9334fc8c7e601580548e68e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output" + } + } + }, + "StatusCode": 400, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "206", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:05 GMT", + "MS-CV": "2HSbPZWm8kugd\u002B8DJEJUVg.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "error": { + "code": "DelegatedResourceAccessError", + "message": "Error accessing connected storage account due to insufficient permissions. Check if the Mixed Reality resource has correct permissions assigned." + } + } + } + ], + "Variables": { + "ARR_ACCOUNT_DOMAIN": "westeurope.mixedreality.azure.com", + "ARR_ACCOUNT_ID": "1b405859-8af9-47e6-941d-9205163c0f63", + "ARR_ACCOUNT_KEY": "Sanitized", + "ARR_BLOB_CONTAINER_NAME": "test", + "ARR_SERVICE_ENDPOINT": "https://remoterendering.westeurope.mixedreality.azure.com", + "ARR_STORAGE_ACCOUNT_NAME": "sdktest", + "RandomSeed": "248496077" + } +} \ No newline at end of file diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedSessionRequest.json b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedSessionRequest.json new file mode 100644 index 000000000000..e0f3d90591c8 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedSessionRequest.json @@ -0,0 +1,49 @@ +{ + "Entries": [ + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/b9d789d8-f33c-ef5d-1ca8-9ad6bd4f2f89?api-version=2021-01-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "44", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "36533518d579fe46fcf92d6140ee4083", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "maxLeaseTimeMinutes": -4, + "size": "Standard" + }, + "StatusCode": 400, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "140", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:07:43 GMT", + "MS-CV": "\u002B4U9n\u002B1jNUS1W/ipHGuszw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "error": { + "code": "BadRequest", + "message": "The maxLeaseTimeMinutes value cannot be negative.", + "details": null, + "target": null, + "innerError": null + } + } + } + ], + "Variables": { + "ARR_ACCOUNT_DOMAIN": "westeurope.mixedreality.azure.com", + "ARR_ACCOUNT_ID": "1b405859-8af9-47e6-941d-9205163c0f63", + "ARR_ACCOUNT_KEY": "Sanitized", + "ARR_SERVICE_ENDPOINT": "https://remoterendering.westeurope.mixedreality.azure.com", + "RandomSeed": "1753515542" + } +} \ No newline at end of file diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedSessionRequestAsync.json b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedSessionRequestAsync.json new file mode 100644 index 000000000000..711c646790c3 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestFailedSessionRequestAsync.json @@ -0,0 +1,49 @@ +{ + "Entries": [ + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/68f60e79-3598-022a-f15e-d70865761208?api-version=2021-01-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "44", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "77d7b75b7a8f1874901781753ae7e77c", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "maxLeaseTimeMinutes": -4, + "size": "Standard" + }, + "StatusCode": 400, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "140", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:05 GMT", + "MS-CV": "Gp2huRjj7USvpS9bSVK0SA.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "error": { + "code": "BadRequest", + "message": "The maxLeaseTimeMinutes value cannot be negative.", + "details": null, + "target": null, + "innerError": null + } + } + } + ], + "Variables": { + "ARR_ACCOUNT_DOMAIN": "westeurope.mixedreality.azure.com", + "ARR_ACCOUNT_ID": "1b405859-8af9-47e6-941d-9205163c0f63", + "ARR_ACCOUNT_KEY": "Sanitized", + "ARR_SERVICE_ENDPOINT": "https://remoterendering.westeurope.mixedreality.azure.com", + "RandomSeed": "1854915036" + } +} \ No newline at end of file diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestSimpleConversion.json b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestSimpleConversion.json new file mode 100644 index 000000000000..3a0a469e88c3 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestSimpleConversion.json @@ -0,0 +1,410 @@ +{ + "Entries": [ + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/e82aeb36-4e40-1ddc-9f58-99cb4310706b?api-version=2021-01-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "348", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "4539cd84e2a554e17e98ef7b9aa7ff7c", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "storageContainerReadListSas": "Sanitized", + "blobPrefix": "Input", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "storageContainerWriteSas": "Sanitized", + "blobPrefix": "Output" + } + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "435", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:54:30 GMT", + "MS-CV": "ZYQOysUDHEeWoUr1YBzycg.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "e82aeb36-4e40-1ddc-9f58-99cb4310706b", + "creationTime": "2021-01-29T15:54:31.0391846Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "error": null, + "status": "NotStarted" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/e82aeb36-4e40-1ddc-9f58-99cb4310706b?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "ed7828fa023d111af2ac66a1895bcf78", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "435", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:54:31 GMT", + "MS-CV": "RohKxnRFvUOorCEzrU3tKA.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "e82aeb36-4e40-1ddc-9f58-99cb4310706b", + "creationTime": "2021-01-29T15:54:31.0391846Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "error": null, + "status": "NotStarted" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/e82aeb36-4e40-1ddc-9f58-99cb4310706b?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "79e1ac1ff10a533c09d569a85f6082f8", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "435", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:54:31 GMT", + "MS-CV": "3hCg7X/9A02aUBxtQ\u002BopSw.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "e82aeb36-4e40-1ddc-9f58-99cb4310706b", + "creationTime": "2021-01-29T15:54:31.0391846Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "error": null, + "status": "NotStarted" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/e82aeb36-4e40-1ddc-9f58-99cb4310706b?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "1ad11c598297812db32753f87c40cb23", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "432", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:54:42 GMT", + "MS-CV": "3cIaQxrtgEmtl7fqH1bdTA.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "e82aeb36-4e40-1ddc-9f58-99cb4310706b", + "creationTime": "2021-01-29T15:54:31.0391846Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "error": null, + "status": "Running" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/e82aeb36-4e40-1ddc-9f58-99cb4310706b?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "ee5c76c985c50972ec24e4689972b192", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "432", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:54:52 GMT", + "MS-CV": "tn6e6qQjPUu/bKYcn2apdw.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "e82aeb36-4e40-1ddc-9f58-99cb4310706b", + "creationTime": "2021-01-29T15:54:31.0391846Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "error": null, + "status": "Running" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/e82aeb36-4e40-1ddc-9f58-99cb4310706b?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "6c476d29b4899ce07e60c6e29d43d7c8", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "432", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:55:02 GMT", + "MS-CV": "h9yMFR2HAUKBKeEl66RLhQ.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "e82aeb36-4e40-1ddc-9f58-99cb4310706b", + "creationTime": "2021-01-29T15:54:31.0391846Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "error": null, + "status": "Running" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/e82aeb36-4e40-1ddc-9f58-99cb4310706b?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "e9df460a9304d332aac72d739ec5e840", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "531", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:55:13 GMT", + "MS-CV": "RjUb6F1h40SdtK7hLnxQGA.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "e82aeb36-4e40-1ddc-9f58-99cb4310706b", + "creationTime": "2021-01-29T15:54:31.0391846Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "output": { + "outputAssetUri": "https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset" + }, + "error": null, + "status": "Succeeded" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "0ecec0765ef8149995bf7065be906ba9", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "1133", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 15:55:13 GMT", + "MS-CV": "yy0kxcCwmkS5BubKW\u002B/EmA.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "conversions": [ + { + "id": "78c4ad59-21e6-74b1-0339-c23bfe785096", + "creationTime": "2021-01-29T15:50:24.931576Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": { + "code": "ConversionProcessFailed", + "message": "Invalid input provided. Check logs in output container for details." + }, + "status": "Failed" + }, + { + "id": "e82aeb36-4e40-1ddc-9f58-99cb4310706b", + "creationTime": "2021-01-29T15:54:31.0391846Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "output": { + "outputAssetUri": "https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset" + }, + "error": null, + "status": "Succeeded" + } + ], + "@nextLink": null + } + } + ], + "Variables": { + "ARR_ACCOUNT_DOMAIN": "westeurope.mixedreality.azure.com", + "ARR_ACCOUNT_ID": "1b405859-8af9-47e6-941d-9205163c0f63", + "ARR_ACCOUNT_KEY": "Sanitized", + "ARR_BLOB_CONTAINER_NAME": "test", + "ARR_SAS_TOKEN": "Sanitized", + "ARR_SERVICE_ENDPOINT": "https://remoterendering.westeurope.mixedreality.azure.com", + "ARR_STORAGE_ACCOUNT_NAME": "sdktest", + "RandomSeed": "1028316188" + } +} \ No newline at end of file diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestSimpleConversionAsync.json b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestSimpleConversionAsync.json new file mode 100644 index 000000000000..73d0573a499e --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestSimpleConversionAsync.json @@ -0,0 +1,452 @@ +{ + "Entries": [ + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/4ea8e22b-670f-ba60-f9f4-84a5510fff63?api-version=2021-01-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "348", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "d1f15c19444b83be5d05b7e130f3f052", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "storageContainerReadListSas": "Sanitized", + "blobPrefix": "Input", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "storageContainerWriteSas": "Sanitized", + "blobPrefix": "Output" + } + } + }, + "StatusCode": 201, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "435", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:06 GMT", + "MS-CV": "b2nhyylVh0GK9OYVD/XohQ.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "4ea8e22b-670f-ba60-f9f4-84a5510fff63", + "creationTime": "2021-01-29T16:56:06.2807835Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "error": null, + "status": "NotStarted" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/4ea8e22b-670f-ba60-f9f4-84a5510fff63?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "55df0348d118b7e5adf07b8d8508697d", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "435", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:06 GMT", + "MS-CV": "rnx43fh7kkqexK2S8Pp14Q.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "4ea8e22b-670f-ba60-f9f4-84a5510fff63", + "creationTime": "2021-01-29T16:56:06.2807835Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "error": null, + "status": "NotStarted" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/4ea8e22b-670f-ba60-f9f4-84a5510fff63?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "93006bd0b67ae7f52424f10aaf7e8905", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "435", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:06 GMT", + "MS-CV": "UysCIztmjUqi3EMwb5R3dQ.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "4ea8e22b-670f-ba60-f9f4-84a5510fff63", + "creationTime": "2021-01-29T16:56:06.2807835Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "error": null, + "status": "NotStarted" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/4ea8e22b-670f-ba60-f9f4-84a5510fff63?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "4e5c3203a92f474a763a235bc830fe54", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "432", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:17 GMT", + "MS-CV": "hG2R1RFvfUCQEJCKxfcnAg.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "4ea8e22b-670f-ba60-f9f4-84a5510fff63", + "creationTime": "2021-01-29T16:56:06.2807835Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "error": null, + "status": "Running" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/4ea8e22b-670f-ba60-f9f4-84a5510fff63?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "c5103a9b5df392d70df831f3e0db072f", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "432", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:27 GMT", + "MS-CV": "7gaNOGNXbUiessfJNjiipQ.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "4ea8e22b-670f-ba60-f9f4-84a5510fff63", + "creationTime": "2021-01-29T16:56:06.2807835Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "error": null, + "status": "Running" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/4ea8e22b-670f-ba60-f9f4-84a5510fff63?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "538a75671bac274e20b91c40939a1ef3", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "432", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:37 GMT", + "MS-CV": "U5RXjujTYU6TEeRBvBMlEQ.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "4ea8e22b-670f-ba60-f9f4-84a5510fff63", + "creationTime": "2021-01-29T16:56:06.2807835Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "error": null, + "status": "Running" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions/4ea8e22b-670f-ba60-f9f4-84a5510fff63?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "756e9c26c46da5125aca40377856669a", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "531", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:48 GMT", + "MS-CV": "jBCmYeHULkmZke6t1Ns9fg.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "4ea8e22b-670f-ba60-f9f4-84a5510fff63", + "creationTime": "2021-01-29T16:56:06.2807835Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "output": { + "outputAssetUri": "https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset" + }, + "error": null, + "status": "Succeeded" + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/conversions?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "52f3f433aaa680a8ece9a43a4197fe73", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "2233", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:48 GMT", + "MS-CV": "Pk6lqjsi/US5\u002BoCD3sGdwQ.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "conversions": [ + { + "id": "78c4ad59-21e6-74b1-0339-c23bfe785096", + "creationTime": "2021-01-29T15:50:24.931576Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": { + "code": "ConversionProcessFailed", + "message": "Invalid input provided. Check logs in output container for details." + }, + "status": "Failed" + }, + { + "id": "e82aeb36-4e40-1ddc-9f58-99cb4310706b", + "creationTime": "2021-01-29T15:54:31.0391846Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "output": { + "outputAssetUri": "https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset" + }, + "error": null, + "status": "Succeeded" + }, + { + "id": "32be1788-d889-dd5c-01d5-690927a183ad", + "creationTime": "2021-01-29T16:55:21.2477337Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "boxWhichDoesNotExist.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "boxWhichDoesNotExist.arrAsset" + } + }, + "error": { + "code": "ConversionProcessFailed", + "message": "Invalid input provided. Check logs in output container for details." + }, + "status": "Failed" + }, + { + "id": "4ea8e22b-670f-ba60-f9f4-84a5510fff63", + "creationTime": "2021-01-29T16:56:06.2807835Z", + "settings": { + "inputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Input/", + "relativeInputAssetPath": "testBox.fbx" + }, + "outputLocation": { + "storageContainerUri": "https://sdktest.blob.core.windows.net/test", + "blobPrefix": "Output/", + "outputAssetFilename": "testBox.arrAsset" + } + }, + "output": { + "outputAssetUri": "https://sdktest.blob.core.windows.net/test/Output/testBox.arrAsset" + }, + "error": null, + "status": "Succeeded" + } + ], + "@nextLink": null + } + } + ], + "Variables": { + "ARR_ACCOUNT_DOMAIN": "westeurope.mixedreality.azure.com", + "ARR_ACCOUNT_ID": "1b405859-8af9-47e6-941d-9205163c0f63", + "ARR_ACCOUNT_KEY": "Sanitized", + "ARR_BLOB_CONTAINER_NAME": "test", + "ARR_SAS_TOKEN": "Sanitized", + "ARR_SERVICE_ENDPOINT": "https://remoterendering.westeurope.mixedreality.azure.com", + "ARR_STORAGE_ACCOUNT_NAME": "sdktest", + "RandomSeed": "1295767883" + } +} \ No newline at end of file diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestSimpleSession.json b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestSimpleSession.json new file mode 100644 index 000000000000..5ee3a2df93f7 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestSimpleSession.json @@ -0,0 +1,826 @@ +{ + "Entries": [ + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "43", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "09fa23e199be36860aa25bca3657f5f2", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "maxLeaseTimeMinutes": 4, + "size": "Standard" + }, + "StatusCode": 201, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:04:29 GMT", + "MS-CV": "cMGAhl1\u002B\u002BECkmWIec9Ht/w.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 4, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "182d94e75546c2abb0f9074d87a712f3", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:04:29 GMT", + "MS-CV": "yyrIVkSp1kKMimi\u002B6kxmLw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 4, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "25", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "63be29171290593a097c97519f1a4110", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "maxLeaseTimeMinutes": 5 + }, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:04:29 GMT", + "MS-CV": "EWbFKvVrH0OnGb3W5XGhSQ.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "3448c20d11c38bd7773758c49138ae62", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:04:29 GMT", + "MS-CV": "iy0z1fUbt0OyppwyvkVSgg.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "0db367909198d46159d40fc9bd592395", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:04:39 GMT", + "MS-CV": "WiAf1YaFbEmGfnt8JpfCwQ.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "c440f7b8dd5f05305132eb59b976c7d0", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:04:50 GMT", + "MS-CV": "uKc7z8fYyUeZ5uganFkF\u002Bw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "37c135cd34677b776173daef020ece1e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:05:00 GMT", + "MS-CV": "9df2MsTD6U\u002BFavGyniOUNw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "9a0cc314e9f8b30337aebb66a5081be3", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:05:10 GMT", + "MS-CV": "POtMCmkV\u002BEWT2HmwXxqEAA.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "88fb3e0ceb98832e80c463eb02400243", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:05:20 GMT", + "MS-CV": "IRzuRORQsE\u002BiRSpBwwZ88w.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "f644cd642d6ae4d8310d00b97910d558", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:05:31 GMT", + "MS-CV": "CAYnb2gFA0aVsmOkzbuPlw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "c3e2f7574612298694881a338617b1f6", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:05:41 GMT", + "MS-CV": "0DQ4MPYrf0aE9T6zgK8l4w.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "d80277ab25c4df786617568aeb75096f", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:05:51 GMT", + "MS-CV": "8VYoijAHr0a\u002ByPEigoqBNw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "0a930aef3f5d1d30461b61e112a45d1a", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:06:01 GMT", + "MS-CV": "/em/BHyT\u002B06najQvLZQydQ.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "010d095cfc0e32947e035dfbeffc3e1f", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:06:11 GMT", + "MS-CV": "a1yV4UPCaU2rR4dps9b8xA.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "7b44aa7fa6836c9947e491a8c397ccc1", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:06:22 GMT", + "MS-CV": "ZxBMlG\u002Blq02CPwXBeqFQnA.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "e22d3cb90767f26176618b5ae1342d4a", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:06:32 GMT", + "MS-CV": "GHOi2mMhLU6VwrPmJ/7Qeg.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "686241dde260b69670a1ba296beb6ee7", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:06:42 GMT", + "MS-CV": "WadJ5Ap4i0i94WjXff4NOw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "b3419c365cce77b8495205221a3e8a12", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:06:52 GMT", + "MS-CV": "g6f3qsfY40iOJleX5wYimQ.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "81cb46b66435d661a57671c54d37878a", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "368", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:07:02 GMT", + "MS-CV": "OXkPmwuzP0\u002B/Eu4fIEAZDw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 55669, + "handshakePort": 53197, + "elapsedTimeMinutes": 0, + "hostname": "977007394-13adf859-28b6-4b7f-a0c2-13f4497c15ef.remoterendering.vm.westeurope.mixedreality.azure.com", + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Ready", + "teraflops": 10.6, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "4524a4f27af3817b89ea1e0ddd739b31", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "383", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:07:03 GMT", + "MS-CV": "bnjTkQH8nkmpX6DYYOI1zA.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "sessions": [ + { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 55669, + "handshakePort": 53197, + "elapsedTimeMinutes": 0, + "hostname": "977007394-13adf859-28b6-4b7f-a0c2-13f4497c15ef.remoterendering.vm.westeurope.mixedreality.azure.com", + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Ready", + "teraflops": 10.6, + "error": null + } + ] + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d/:stop?api-version=2021-01-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "2473a817ec1fd1b23a6a0d58eaf22912", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Date": "Fri, 29 Jan 2021 16:07:03 GMT", + "MS-CV": "wj8FR62lhk6h1ut1QboSgw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "76307acb44193c1fca4af84a4553f932", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:07:03 GMT", + "MS-CV": "Pf1D4038c0qKtBX4jFTfgw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "a2b38ff2-fbf4-78e5-6702-b52fc9f12a1d", + "creationTime": "2021-01-29T16:04:29.1569219\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Stopped", + "teraflops": 10.6, + "error": null + } + } + ], + "Variables": { + "ARR_ACCOUNT_DOMAIN": "westeurope.mixedreality.azure.com", + "ARR_ACCOUNT_ID": "1b405859-8af9-47e6-941d-9205163c0f63", + "ARR_ACCOUNT_KEY": "Sanitized", + "ARR_SERVICE_ENDPOINT": "https://remoterendering.westeurope.mixedreality.azure.com", + "RandomSeed": "1129536075" + } +} \ No newline at end of file diff --git a/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestSimpleSessionAsync.json b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestSimpleSessionAsync.json new file mode 100644 index 000000000000..0cba6508c9a0 --- /dev/null +++ b/sdk/mixedreality/Azure.MixedReality.RemoteRendering/tests/SessionRecords/RemoteRenderingLiveTests/TestSimpleSessionAsync.json @@ -0,0 +1,863 @@ +{ + "Entries": [ + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "43", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "757a96293a28eaf21c75894ac5055d3f", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "maxLeaseTimeMinutes": 4, + "size": "Standard" + }, + "StatusCode": 201, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:49 GMT", + "MS-CV": "zGXxTxpo2USgtwah5tXCFA.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 4, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "5409bfeda713327ce8033bb9d31d2498", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:49 GMT", + "MS-CV": "xoS9zTl0gEKECssetQhm0A.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 4, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "25", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "80c2e6703e9366e3c4c3af8f6f790529", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "maxLeaseTimeMinutes": 5 + }, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:49 GMT", + "MS-CV": "BSfNjbXsu02iQmNc1XzgFw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "44fe16008d0581ea19488d25ff3817fe", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:49 GMT", + "MS-CV": "gFbx8I7WkkSq7sfUI5Ty9A.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "ded9f051dd42aeacdba38f50f7ecc26e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:56:59 GMT", + "MS-CV": "rsEpnADl3Em8lz00c6XgnA.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "bcb811fde01fe392fc40664ab0bd668b", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:57:09 GMT", + "MS-CV": "HXH1gYcEe029is98QIjmjQ.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "7e3eb0ab279f23e66a4f6862fd9a892d", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:57:19 GMT", + "MS-CV": "5Dz5py/U8EaRa9uiNdD4Vg.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "ed271f865a7f71df5ef6e1017661fd1e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:57:30 GMT", + "MS-CV": "ZMR5YB9PNE2CK9aQtTyJqA.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "47a4043c43add6cf2a9552cf782fe562", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:57:40 GMT", + "MS-CV": "hATpLI5P9U\u002BA6\u002B0ccr7WwA.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "91c438b67996510cd1cd20a945e5ad08", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:57:50 GMT", + "MS-CV": "284IEswq40WB/LjcUqq1pA.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "f926495142f5427f5050c2ea080ff82e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:58:00 GMT", + "MS-CV": "XmEn\u002BpQAcUeamAR/7zea4Q.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "3d4a7f106c9cc287f85376e022259045", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:58:10 GMT", + "MS-CV": "rKv5gzQbhEm4Jwga\u002Bzmz5w.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "2e7e49e7ec09746cb9814145b62148c1", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:58:20 GMT", + "MS-CV": "SuWmIPTPg0iiKZZD\u002BADwkw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "c698f2d46f9ae56cc26301a2cc9f1f2a", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:58:31 GMT", + "MS-CV": "WXzeiduJg0ysH5j7DGhpPQ.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "be027dbfca91242512d6841a2a410cd6", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:58:41 GMT", + "MS-CV": "S5RZ4bma3E\u002Bu99bmmCSo9A.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "300bb40aca8d78aadd986ba5ebcaa71a", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:58:51 GMT", + "MS-CV": "d\u002BGX41EankmdYs3a79uFEw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "39861762891e0930cc74b3c4ea51bb81", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:59:01 GMT", + "MS-CV": "ckQDcn/9wkGY41McWZhupg.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "18972a57ee93f59dd28ae1f85f7f3848", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:59:12 GMT", + "MS-CV": "nnkaW0ajpUa6w6gyvNQo9g.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "12b86a2ed2bb80b78402631817e58d8b", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:59:22 GMT", + "MS-CV": "RZNSc3PPAUuiG16LC9/ggw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Starting", + "teraflops": 0.0, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "c04eeadd8f3273867a916794a837aa4d", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "368", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:59:32 GMT", + "MS-CV": "JbvhVSaNokWgM2Prv/\u002Bk2g.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 51615, + "handshakePort": 57384, + "elapsedTimeMinutes": 0, + "hostname": "977007394-f2c4e8e7-5068-49eb-83c3-8a3e61fd1795.remoterendering.vm.westeurope.mixedreality.azure.com", + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Ready", + "teraflops": 10.6, + "error": null + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "80966a3ba89884c5721693918a84ddec", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Cache-Control": "no-store, no-cache", + "Content-Length": "383", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:59:32 GMT", + "MS-CV": "/Lp3aXYl9kGlRU2bIiBsdw.0", + "Pragma": "no-cache", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "sessions": [ + { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 51615, + "handshakePort": 57384, + "elapsedTimeMinutes": 0, + "hostname": "977007394-f2c4e8e7-5068-49eb-83c3-8a3e61fd1795.remoterendering.vm.westeurope.mixedreality.azure.com", + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Ready", + "teraflops": 10.6, + "error": null + } + ] + } + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe/:stop?api-version=2021-01-01-preview", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "751b55fc78309e15e345982a6b23d84c", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Date": "Fri, 29 Jan 2021 16:59:33 GMT", + "MS-CV": "aQ9sr5pwmke9YPdvIopXgg.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://remoterendering.westeurope.mixedreality.azure.com/accounts/1b405859-8af9-47e6-941d-9205163c0f63/sessions/ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe?api-version=2021-01-01-preview", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": [ + "azsdk-net-MixedReality.RemoteRendering/1.0.0-alpha.20210129.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "acdc16570d4f34f324c94d1bfbf5e8f5", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "api-supported-versions": "2021-01-01-preview", + "Content-Length": "265", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 29 Jan 2021 16:59:33 GMT", + "MS-CV": "KLguLlAd30a13oVayPcOCw.0", + "X-Content-Type-Options": "nosniff" + }, + "ResponseBody": { + "id": "ccaeb6a0-f904-cac4-2e5e-56eb030fe1fe", + "creationTime": "2021-01-29T16:56:49.0823888\u002B00:00", + "arrInspectorPort": 0, + "handshakePort": 0, + "elapsedTimeMinutes": 0, + "hostname": null, + "maxLeaseTimeMinutes": 5, + "size": "Standard", + "status": "Stopped", + "teraflops": 10.6, + "error": null + } + } + ], + "Variables": { + "ARR_ACCOUNT_DOMAIN": "westeurope.mixedreality.azure.com", + "ARR_ACCOUNT_ID": "1b405859-8af9-47e6-941d-9205163c0f63", + "ARR_ACCOUNT_KEY": "Sanitized", + "ARR_SERVICE_ENDPOINT": "https://remoterendering.westeurope.mixedreality.azure.com", + "RandomSeed": "1598068433" + } +} \ No newline at end of file diff --git a/sdk/mixedreality/TestResources/testBox.fbx b/sdk/mixedreality/TestResources/testBox.fbx new file mode 100644 index 000000000000..13b967f33315 --- /dev/null +++ b/sdk/mixedreality/TestResources/testBox.fbx @@ -0,0 +1,346 @@ +; FBX 7.5.0 project file +; ---------------------------------------------------- + +FBXHeaderExtension: { + FBXHeaderVersion: 1003 + FBXVersion: 7500 + CreationTimeStamp: { + Version: 1000 + Year: 2021 + Month: 1 + Day: 24 + Hour: 10 + Minute: 15 + Second: 0 + Millisecond: 529 + } + Creator: "FBX SDK/FBX Plugins version 2018.1.1" + SceneInfo: "SceneInfo::GlobalInfo", "UserData" { + Type: "UserData" + Version: 100 + MetaData: { + Version: 100 + Title: "Exported .fbx from Lift" + Subject: "fbx" + Author: "" + Keywords: "Microsoft Community Paint" + Revision: "rev. 1.0" + Comment: "" + } + Properties70: { + P: "DocumentUrl", "KString", "Url", "", "testBox.fbx" + P: "SrcDocumentUrl", "KString", "Url", "", "testBox.fbx" + P: "Original", "Compound", "", "" + P: "Original|ApplicationVendor", "KString", "", "", "" + P: "Original|ApplicationName", "KString", "", "", "" + P: "Original|ApplicationVersion", "KString", "", "", "" + P: "Original|DateTime_GMT", "DateTime", "", "", "" + P: "Original|FileName", "KString", "", "", "" + P: "LastSaved", "Compound", "", "" + P: "LastSaved|ApplicationVendor", "KString", "", "", "" + P: "LastSaved|ApplicationName", "KString", "", "", "" + P: "LastSaved|ApplicationVersion", "KString", "", "", "" + P: "LastSaved|DateTime_GMT", "DateTime", "", "", "" + } + } +} +GlobalSettings: { + Version: 1000 + Properties70: { + P: "UpAxis", "int", "Integer", "",1 + P: "UpAxisSign", "int", "Integer", "",1 + P: "FrontAxis", "int", "Integer", "",2 + P: "FrontAxisSign", "int", "Integer", "",1 + P: "CoordAxis", "int", "Integer", "",0 + P: "CoordAxisSign", "int", "Integer", "",1 + P: "OriginalUpAxis", "int", "Integer", "",-1 + P: "OriginalUpAxisSign", "int", "Integer", "",1 + P: "UnitScaleFactor", "double", "Number", "",100 + P: "OriginalUnitScaleFactor", "double", "Number", "",1 + P: "AmbientColor", "ColorRGB", "Color", "",0,0,0 + P: "DefaultCamera", "KString", "", "", "Producer Perspective" + P: "TimeMode", "enum", "", "",0 + P: "TimeProtocol", "enum", "", "",2 + P: "SnapOnFrameMode", "enum", "", "",0 + P: "TimeSpanStart", "KTime", "Time", "",0 + P: "TimeSpanStop", "KTime", "Time", "",46186158000 + P: "CustomFrameRate", "double", "Number", "",-1 + P: "TimeMarker", "Compound", "", "" + P: "CurrentTimeMarker", "int", "Integer", "",-1 + } +} + +; Documents Description +;------------------------------------------------------------------ + +Documents: { + Count: 1 + Document: 2520542649728, "Scene", "Scene" { + Properties70: { + P: "SourceObject", "object", "", "" + P: "ActiveAnimStackName", "KString", "", "", "" + } + RootNode: 0 + } +} + +; Document References +;------------------------------------------------------------------ + +References: { +} + +; Object definitions +;------------------------------------------------------------------ + +Definitions: { + Version: 100 + Count: 4 + ObjectType: "GlobalSettings" { + Count: 1 + } + ObjectType: "Model" { + Count: 1 + PropertyTemplate: "FbxNode" { + Properties70: { + P: "QuaternionInterpolate", "enum", "", "",0 + P: "RotationOffset", "Vector3D", "Vector", "",0,0,0 + P: "RotationPivot", "Vector3D", "Vector", "",0,0,0 + P: "ScalingOffset", "Vector3D", "Vector", "",0,0,0 + P: "ScalingPivot", "Vector3D", "Vector", "",0,0,0 + P: "TranslationActive", "bool", "", "",0 + P: "TranslationMin", "Vector3D", "Vector", "",0,0,0 + P: "TranslationMax", "Vector3D", "Vector", "",0,0,0 + P: "TranslationMinX", "bool", "", "",0 + P: "TranslationMinY", "bool", "", "",0 + P: "TranslationMinZ", "bool", "", "",0 + P: "TranslationMaxX", "bool", "", "",0 + P: "TranslationMaxY", "bool", "", "",0 + P: "TranslationMaxZ", "bool", "", "",0 + P: "RotationOrder", "enum", "", "",0 + P: "RotationSpaceForLimitOnly", "bool", "", "",0 + P: "RotationStiffnessX", "double", "Number", "",0 + P: "RotationStiffnessY", "double", "Number", "",0 + P: "RotationStiffnessZ", "double", "Number", "",0 + P: "AxisLen", "double", "Number", "",10 + P: "PreRotation", "Vector3D", "Vector", "",0,0,0 + P: "PostRotation", "Vector3D", "Vector", "",0,0,0 + P: "RotationActive", "bool", "", "",0 + P: "RotationMin", "Vector3D", "Vector", "",0,0,0 + P: "RotationMax", "Vector3D", "Vector", "",0,0,0 + P: "RotationMinX", "bool", "", "",0 + P: "RotationMinY", "bool", "", "",0 + P: "RotationMinZ", "bool", "", "",0 + P: "RotationMaxX", "bool", "", "",0 + P: "RotationMaxY", "bool", "", "",0 + P: "RotationMaxZ", "bool", "", "",0 + P: "InheritType", "enum", "", "",0 + P: "ScalingActive", "bool", "", "",0 + P: "ScalingMin", "Vector3D", "Vector", "",0,0,0 + P: "ScalingMax", "Vector3D", "Vector", "",1,1,1 + P: "ScalingMinX", "bool", "", "",0 + P: "ScalingMinY", "bool", "", "",0 + P: "ScalingMinZ", "bool", "", "",0 + P: "ScalingMaxX", "bool", "", "",0 + P: "ScalingMaxY", "bool", "", "",0 + P: "ScalingMaxZ", "bool", "", "",0 + P: "GeometricTranslation", "Vector3D", "Vector", "",0,0,0 + P: "GeometricRotation", "Vector3D", "Vector", "",0,0,0 + P: "GeometricScaling", "Vector3D", "Vector", "",1,1,1 + P: "MinDampRangeX", "double", "Number", "",0 + P: "MinDampRangeY", "double", "Number", "",0 + P: "MinDampRangeZ", "double", "Number", "",0 + P: "MaxDampRangeX", "double", "Number", "",0 + P: "MaxDampRangeY", "double", "Number", "",0 + P: "MaxDampRangeZ", "double", "Number", "",0 + P: "MinDampStrengthX", "double", "Number", "",0 + P: "MinDampStrengthY", "double", "Number", "",0 + P: "MinDampStrengthZ", "double", "Number", "",0 + P: "MaxDampStrengthX", "double", "Number", "",0 + P: "MaxDampStrengthY", "double", "Number", "",0 + P: "MaxDampStrengthZ", "double", "Number", "",0 + P: "PreferedAngleX", "double", "Number", "",0 + P: "PreferedAngleY", "double", "Number", "",0 + P: "PreferedAngleZ", "double", "Number", "",0 + P: "LookAtProperty", "object", "", "" + P: "UpVectorProperty", "object", "", "" + P: "Show", "bool", "", "",1 + P: "NegativePercentShapeSupport", "bool", "", "",1 + P: "DefaultAttributeIndex", "int", "Integer", "",-1 + P: "Freeze", "bool", "", "",0 + P: "LODBox", "bool", "", "",0 + P: "Lcl Translation", "Lcl Translation", "", "A",0,0,0 + P: "Lcl Rotation", "Lcl Rotation", "", "A",0,0,0 + P: "Lcl Scaling", "Lcl Scaling", "", "A",1,1,1 + P: "Visibility", "Visibility", "", "A",1 + P: "Visibility Inheritance", "Visibility Inheritance", "", "",1 + } + } + } + ObjectType: "Material" { + Count: 1 + PropertyTemplate: "FbxSurfacePhong" { + Properties70: { + P: "ShadingModel", "KString", "", "", "Phong" + P: "MultiLayer", "bool", "", "",0 + P: "EmissiveColor", "Color", "", "A",0,0,0 + P: "EmissiveFactor", "Number", "", "A",1 + P: "AmbientColor", "Color", "", "A",0.2,0.2,0.2 + P: "AmbientFactor", "Number", "", "A",1 + P: "DiffuseColor", "Color", "", "A",0.8,0.8,0.8 + P: "DiffuseFactor", "Number", "", "A",1 + P: "Bump", "Vector3D", "Vector", "",0,0,0 + P: "NormalMap", "Vector3D", "Vector", "",0,0,0 + P: "BumpFactor", "double", "Number", "",1 + P: "TransparentColor", "Color", "", "A",0,0,0 + P: "TransparencyFactor", "Number", "", "A",0 + P: "DisplacementColor", "ColorRGB", "Color", "",0,0,0 + P: "DisplacementFactor", "double", "Number", "",1 + P: "VectorDisplacementColor", "ColorRGB", "Color", "",0,0,0 + P: "VectorDisplacementFactor", "double", "Number", "",1 + P: "SpecularColor", "Color", "", "A",0.2,0.2,0.2 + P: "SpecularFactor", "Number", "", "A",1 + P: "ShininessExponent", "Number", "", "A",20 + P: "ReflectionColor", "Color", "", "A",0,0,0 + P: "ReflectionFactor", "Number", "", "A",1 + } + } + } + ObjectType: "Geometry" { + Count: 1 + PropertyTemplate: "FbxMesh" { + Properties70: { + P: "Color", "ColorRGB", "Color", "",0.8,0.8,0.8 + P: "BBoxMin", "Vector3D", "Vector", "",0,0,0 + P: "BBoxMax", "Vector3D", "Vector", "",0,0,0 + P: "Primary Visibility", "bool", "", "",1 + P: "Casts Shadows", "bool", "", "",1 + P: "Receive Shadows", "bool", "", "",1 + } + } + } +} + +; Object properties +;------------------------------------------------------------------ + +Objects: { + Geometry: 2520544655040, "Geometry::mesh_id43", "Mesh" { + Properties70: { + P: "BBoxMin", "Vector3D", "Vector", "",-100,-100,-100 + P: "BBoxMax", "Vector3D", "Vector", "",100,100,100 + } + Vertices: *72 { + a: 100,100,-100,-100,-100,-100,-100,100,-100,100,-100,-100,-100,100,100,100,-100,100,100,100,100,-100,-100,100,100,100,100,100,-100,-100,100,100,-100,100,-100,100,-100,100,-100,-100,-100,100,-100,100,100,-100,-100,-100,-100,100,-100,100,100,100,100,100,-100,-100,100,100,-100,-100,100,100,-100,-100,100,-100,100,-100,-100,-100 + } + PolygonVertexIndex: *36 { + a: 0,1,-3,0,3,-2,4,5,-7,4,7,-6,8,9,-11,8,11,-10,12,13,-15,12,15,-14,16,17,-19,16,19,-18,20,21,-23,20,23,-22 + } + GeometryVersion: 124 + LayerElementNormal: 0 { + Version: 102 + Name: "" + MappingInformationType: "ByVertice" + ReferenceInformationType: "Direct" + Normals: *72 { + a: 0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0 + } + NormalsW: *24 { + a: 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + } + } + LayerElementColor: 0 { + Version: 101 + Name: "VertexColors" + MappingInformationType: "ByVertice" + ReferenceInformationType: "IndexToDirect" + Colors: *96 { + a: 0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1,0.980392156862745,0.843137254901961,0.388235294117647,1 + } + } + LayerElementUV: 0 { + Version: 101 + Name: "" + MappingInformationType: "ByVertice" + ReferenceInformationType: "Direct" + } + LayerElementMaterial: 0 { + Version: 101 + Name: "" + MappingInformationType: "AllSame" + ReferenceInformationType: "IndexToDirect" + Materials: *1 { + a: 0 + } + } + Layer: 0 { + Version: 100 + LayerElement: { + Type: "LayerElementNormal" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementMaterial" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementColor" + TypedIndex: 0 + } + LayerElement: { + Type: "LayerElementUV" + TypedIndex: 0 + } + } + } + Model: 2520544652560, "Model::root", "Mesh" { + Version: 232 + Properties70: { + P: "ScalingMax", "Vector3D", "Vector", "",0,0,0 + P: "GeometricTranslation", "Vector3D", "Vector", "",0.029182942584157,0.0412420704960823,0.200006887316704 + P: "GeometricRotation", "Vector3D", "Vector", "",19.5286376895952,-30.3983310953995,0 + P: "GeometricScaling", "Vector3D", "Vector", "",0.00176811746427344,0.00159080407945701,0.00159080401671689 + P: "DefaultAttributeIndex", "int", "Integer", "",0 + } + Shading: T + Culling: "CullingOff" + } + Material: 2520544654560, "Material::Material_50", "" { + Version: 102 + ShadingModel: "phong" + MultiLayer: 0 + Properties70: { + P: "DiffuseColor", "Color", "", "A",0.992156862745098,0.925490196078431,0.650980392156863 + P: "SpecularColor", "Color", "", "A",0.0352941176470588,0.0352941176470588,0.0352941176470588 + P: "ShininessExponent", "Number", "", "A",62.8694496154785 + P: "Emissive", "Vector3D", "Vector", "",0,0,0 + P: "Ambient", "Vector3D", "Vector", "",0.2,0.2,0.2 + P: "Diffuse", "Vector3D", "Vector", "",0.992156862745098,0.925490196078431,0.650980392156863 + P: "Specular", "Vector3D", "Vector", "",0.0352941176470588,0.0352941176470588,0.0352941176470588 + P: "Shininess", "double", "Number", "",62.8694496154785 + P: "Opacity", "double", "Number", "",1 + P: "Reflectivity", "double", "Number", "",0 + } + } +} + +; Object connections +;------------------------------------------------------------------ + +Connections: { + + ;Model::root, Model::RootNode + C: "OO",2520544652560,0 + + ;Geometry::mesh_id43, Model::root + C: "OO",2520544655040,2520544652560 + + ;Material::Material_50, Model::root + C: "OO",2520544654560,2520544652560 +} +;Takes section +;---------------------------------------------------- + +Takes: { + Current: "" +} diff --git a/sdk/mixedreality/test-resources-post.ps1 b/sdk/mixedreality/test-resources-post.ps1 new file mode 100644 index 000000000000..ec8a2d9ed462 --- /dev/null +++ b/sdk/mixedreality/test-resources-post.ps1 @@ -0,0 +1,30 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +# This script is used to generate the Test Configuration file for Storage live tests. +# It is invoked by the https://github.com/Azure/azure-sdk-for-net/blob/master/eng/New-TestResources.ps1 +# script after the ARM template, defined in https://github.com/Azure/azure-sdk-for-net/blob/arm-template-storage/sdk/storage/test-resources.json, +# is finished being deployed. The ARM template is responsible for creating the Storage accounts needed for live tests. + +param ( + [hashtable] $DeploymentOutputs, + [string] $TenantId, + [string] $TestApplicationId, + [string] $TestApplicationSecret +) + +# outputs from the ARM deployment passed in from New-TestResources +$StorageAccountName = $DeploymentOutputs['MIXEDREALITY_ARR_STORAGE_ACCOUNT_NAME'] +$StorageAccountKey = $DeploymentOutputs['MIXEDREALITY_ARR_STORAGE_ACCOUNT_KEY'] +$BlobContainerName = $DeploymentOutputs['MIXEDREALITY_ARR_BLOB_CONTAINER_NAME'] + +$LocalFilePath = Join-Path $PSScriptRoot "TestResources\testBox.fbx" +$TargetBlob = "Input/testBox.fbx" + +Write-Verbose ( "Copying test asset to blob storage") + +$StorageContext = New-AzStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey + +$blob = Set-AzStorageBlobContent -File $LocalFilePath -Blob $TargetBlob -Container $BlobContainerName -Context $StorageContext -Force + +Write-Verbose ("Test asset successfully copied to blob storage") diff --git a/sdk/mixedreality/test-resources.json b/sdk/mixedreality/test-resources.json index 0caa1e9c9db6..30e81531cdfd 100644 --- a/sdk/mixedreality/test-resources.json +++ b/sdk/mixedreality/test-resources.json @@ -1,33 +1,49 @@ { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", - "parameters": { - "baseName": { - "type": "string", - "defaultValue": "[resourceGroup().name]", - "metadata": { - "description": "The base resource name." - } - }, - "tenantId": { - "type": "string", - "defaultValue": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "metadata": { - "description": "The tenant ID to which the application and resources belong." - } - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "The location of the resource. By default, this is the same as the resource group." - } - } + "parameters": { + "baseName": { + "type": "string", + "defaultValue": "[resourceGroup().name]", + "metadata": { + "description": "The base resource name." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "metadata": { + "description": "The tenant ID to which the application and resources belong." + } }, - "variables": { - "apiVersion": "2020-05-01", - "asaAccountName": "[concat(parameters('baseName'), '-asa-account')]" + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "The location of the resource. By default, this is the same as the resource group." + } }, + "baseTime": { + "type": "string", + "defaultValue": "[utcNow('u')]" + } + }, + "variables": { + "apiVersion": "2020-05-01", + "asaAccountName": "[concat(parameters('baseName'), '-asa-account')]", + "arrApiVersion": "2020-04-06-preview", + "arrAccountName": "[concat(parameters('baseName'), '-arr-account')]", + "storageApiVersion": "2019-06-01", + "storageAccountName": "[parameters('baseName')]", + "blobContainerName": "test", + "blobContainerResourceName": "[concat(variables('storageAccountName'), '/default/', variables('blobContainerName'))]", + "sasProperties": { + "signedPermission": "rwl", + "signedExpiry": "[dateTimeAdd(parameters('baseTime'), 'P1D')]", + "signedResource": "c", + "canonicalizedResource": "[concat('/blob/', variables('storageAccountName'), '/', variables('blobContainerName'))]" + } + }, "resources": [ { "type": "Microsoft.MixedReality/spatialAnchorsAccounts", @@ -35,6 +51,45 @@ "apiVersion": "[variables('apiVersion')]", "location": "[parameters('location')]", "properties": {} + }, + { + "type": "Microsoft.MixedReality/remoteRenderingAccounts", + "name": "[variables('arrAccountName')]", + "apiVersion": "[variables('arrApiVersion')]", + "location": "[parameters('location')]", + "properties": {}, + "identity": { "type": "systemAssigned" } + }, + { + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "[variables('storageApiVersion')]", + "name": "[variables('storageAccountName')]", + "location": "[parameters('location')]", + "sku": { + "name": "Standard_RAGRS", + "tier": "Standard" + }, + "kind": "StorageV2", + "properties": { + "supportsHttpsTrafficOnly": true, + "encryption": { + "keySource": "Microsoft.Storage", + "services": { + "blob": { + "enabled": true + } + }, + }, + "accessTier": "Hot" + } + }, + { + "type": "Microsoft.Storage/storageAccounts/blobServices/containers", + "apiVersion": "[variables('storageApiVersion')]", + "name": "[variables('blobContainerResourceName')]", + "dependsOn": [ + "[variables('storageAccountName')]" + ] } ], "outputs": { @@ -49,6 +104,38 @@ "MIXEDREALITY_ACCOUNT_KEY": { "type": "string", "value": "[listKeys(resourceId('Microsoft.MixedReality/spatialAnchorsAccounts', variables('asaAccountName')), variables('apiVersion')).primaryKey]" - } + }, + "MIXEDREALITY_ARR_ACCOUNT_ID": { + "type": "string", + "value": "[reference(variables('arrAccountName')).accountId]" + }, + "MIXEDREALITY_ARR_ACCOUNT_DOMAIN": { + "type": "string", + "value": "[reference(variables('arrAccountName')).accountDomain]" + }, + "MIXEDREALITY_ARR_ACCOUNT_KEY": { + "type": "string", + "value": "[listKeys(resourceId('Microsoft.MixedReality/remoteRenderingAccounts', variables('arrAccountName')), variables('arrApiVersion')).primaryKey]" + }, + "MIXEDREALITY_ARR_STORAGE_ACCOUNT_NAME": { + "type": "string", + "value": "[variables('storageAccountName')]" + }, + "MIXEDREALITY_ARR_STORAGE_ACCOUNT_KEY": { + "type": "string", + "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), variables('storageApiVersion')).keys[0].value]" + }, + "MIXEDREALITY_ARR_BLOB_CONTAINER_NAME": { + "type": "string", + "value": "[variables('blobContainerName')]" + }, + "MIXEDREALITY_ARR_SAS_TOKEN": { + "type": "string", + "value": "[listServiceSas(variables('storageAccountName'), variables('storageApiVersion'), variables('sasProperties')).serviceSasToken]" + }, + "MIXEDREALITY_ARR_SERVICE_ENDPOINT": { + "type": "string", + "value": "[concat('https://remoterendering.', parameters('location'), '.mixedreality.azure.com')]" + } } } \ No newline at end of file