diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index e577ec096484..756fb84c0f15 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -50,7 +50,8 @@ dependencies: '@rush-temp/keyvault-keys': file:projects/keyvault-keys.tgz '@rush-temp/keyvault-secrets': file:projects/keyvault-secrets.tgz '@rush-temp/logger': file:projects/logger.tgz - '@rush-temp/mixedreality-authentication': file:projects/mixedreality-authentication.tgz + '@rush-temp/mixed-reality-authentication': file:projects/mixed-reality-authentication.tgz + '@rush-temp/mixed-reality-remote-rendering': file:projects/mixed-reality-remote-rendering.tgz '@rush-temp/mock-hub': file:projects/mock-hub.tgz '@rush-temp/monitor-opentelemetry-exporter': file:projects/monitor-opentelemetry-exporter.tgz '@rush-temp/monitor-query': file:projects/monitor-query.tgz @@ -10423,7 +10424,7 @@ packages: integrity: sha512-nYl70rSzi6HROwq6Tby45FL6Wfr0bIIL75bIBdgOoNqZ4Jbjrtghfx+iElia55MMylPZ5Zc+yYaBwOKf2wld4Q== tarball: file:projects/logger.tgz version: 0.0.0 - file:projects/mixedreality-authentication.tgz: + file:projects/mixed-reality-authentication.tgz: dependencies: '@azure/core-tracing': 1.0.0-preview.12 '@microsoft/api-extractor': 7.7.11 @@ -10461,10 +10462,54 @@ packages: typescript: 4.2.4 util: 0.12.4 dev: false - name: '@rush-temp/mixedreality-authentication' + name: '@rush-temp/mixed-reality-authentication' resolution: integrity: sha512-Dah2yhabK5HI4F06xOEqvf+iUXgLPdtJXFBVgIQy1+KFICPCqM0PMc0olF3nG/4KEo2t3Q2397KQLdRlfeUm2w== - tarball: file:projects/mixedreality-authentication.tgz + tarball: file:projects/mixed-reality-authentication.tgz + version: 0.0.0 + file:projects/mixed-reality-remote-rendering.tgz: + dependencies: + '@azure/identity': 1.3.0 + '@microsoft/api-extractor': 7.7.11 + '@types/chai': 4.2.19 + '@types/chai-as-promised': 7.1.4 + '@types/mocha': 7.0.2 + '@types/node': 12.20.15 + '@types/uuid': 8.3.0 + chai: 4.3.4 + chai-as-promised: 7.1.1_chai@4.3.4 + cross-env: 7.0.3 + dotenv: 8.6.0 + eslint: 7.29.0 + inherits: 2.0.4 + karma: 6.3.4 + karma-chrome-launcher: 3.1.0 + karma-coverage: 2.0.3 + karma-edge-launcher: 0.4.2_karma@6.3.4 + karma-env-preprocessor: 0.1.1 + karma-firefox-launcher: 1.3.0 + karma-ie-launcher: 1.0.0_karma@6.3.4 + karma-json-preprocessor: 0.3.3_karma@6.3.4 + karma-json-to-file-reporter: 1.0.1 + karma-junit-reporter: 2.0.1_karma@6.3.4 + karma-mocha: 2.0.1 + karma-mocha-reporter: 2.2.5_karma@6.3.4 + mocha: 7.2.0 + mocha-junit-reporter: 1.23.3_mocha@7.2.0 + nyc: 14.1.1 + prettier: 1.19.1 + rimraf: 3.0.2 + rollup: 1.32.1 + tslib: 2.3.0 + typedoc: 0.15.2 + typescript: 4.2.4 + util: 0.12.4 + uuid: 8.3.2 + dev: false + name: '@rush-temp/mixed-reality-remote-rendering' + resolution: + integrity: sha512-C8rmlojMOh5Fei9q15a3kKN3kNioe/SJLK+JtmVMdz3vNUnaotSRGNvSnZ9xCDBeSpujnjiNOY2YbAF12iOGBA== + tarball: file:projects/mixed-reality-remote-rendering.tgz version: 0.0.0 file:projects/mock-hub.tgz: dependencies: @@ -11956,7 +12001,7 @@ packages: dev: false name: '@rush-temp/web-pubsub' resolution: - integrity: sha512-KzxOCN28tIw0iRDU4HUJ3S3wEcHv/WdKeA29HKgcFMb2DxK2EFvuX6Ih+jAI/M9LYp5Kpwni26AoZTW3KBlENw== + integrity: sha512-NEgAqwtqpS48OPZ9oNnVcyOUBN9+cdG8bmcyFPVcH69lHkGVUKUTWlYQKAer1xuBZbdvZrw7l8UjrFtpnVCqaw== tarball: file:projects/web-pubsub.tgz version: 0.0.0 registry: '' @@ -12012,7 +12057,8 @@ specifiers: '@rush-temp/keyvault-keys': file:./projects/keyvault-keys.tgz '@rush-temp/keyvault-secrets': file:./projects/keyvault-secrets.tgz '@rush-temp/logger': file:./projects/logger.tgz - '@rush-temp/mixedreality-authentication': file:./projects/mixedreality-authentication.tgz + '@rush-temp/mixed-reality-authentication': file:./projects/mixed-reality-authentication.tgz + '@rush-temp/mixed-reality-remote-rendering': file:./projects/mixed-reality-remote-rendering.tgz '@rush-temp/mock-hub': file:./projects/mock-hub.tgz '@rush-temp/monitor-opentelemetry-exporter': file:./projects/monitor-opentelemetry-exporter.tgz '@rush-temp/monitor-query': file:./projects/monitor-query.tgz diff --git a/dataplane.code-workspace b/dataplane.code-workspace index c4631d5b7e7b..88804c88d9db 100644 --- a/dataplane.code-workspace +++ b/dataplane.code-workspace @@ -261,8 +261,8 @@ "path": "sdk/digitaltwins/digital-twins-core" }, { - "name": "mixedreality-authentication", - "path": "sdk/mixedreality/mixedreality-authentication" + "name": "mixed-reality-authentication", + "path": "sdk/mixedreality/mixed-reality-authentication" }, { "name": "attestation", @@ -277,6 +277,10 @@ }, { "path": "sdk/web-pubsub/web-pubsub-express" + }, + { + "name": "mixed-reality-remote-rendering", + "path": "sdk/remoterendering/mixed-reality-remote-rendering" } ], "settings": { diff --git a/rush.json b/rush.json index c8b941b088ee..b9f02cfd039d 100644 --- a/rush.json +++ b/rush.json @@ -751,8 +751,8 @@ "versionPolicyName": "test" }, { - "packageName": "@azure/mixedreality-authentication", - "projectFolder": "sdk/mixedreality/mixedreality-authentication", + "packageName": "@azure/mixed-reality-authentication", + "projectFolder": "sdk/mixedreality/mixed-reality-authentication", "versionPolicyName": "client" }, { @@ -789,6 +789,11 @@ "packageName": "@azure-tests/perf-app-configuration", "projectFolder": "sdk/appconfiguration/perf-tests/app-configuration", "versionPolicyName": "test" + }, + { + "packageName": "@azure/mixed-reality-remote-rendering", + "projectFolder": "sdk/remoterendering/mixed-reality-remote-rendering", + "versionPolicyName": "client" } ] } diff --git a/sdk/mixedreality/ci.yml b/sdk/mixedreality/ci.yml index 9f3a61d98a9a..27bc16c0f621 100644 --- a/sdk/mixedreality/ci.yml +++ b/sdk/mixedreality/ci.yml @@ -26,5 +26,5 @@ extends: parameters: ServiceDirectory: mixedreality Artifacts: - - name: azure-mixedreality-authentication + - name: azure-mixed-reality-authentication safeName: azuremixedrealityauthentication diff --git a/sdk/mixedreality/mixedreality-authentication/.nycrc b/sdk/mixedreality/mixed-reality-authentication/.nycrc similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/.nycrc rename to sdk/mixedreality/mixed-reality-authentication/.nycrc diff --git a/sdk/mixedreality/mixedreality-authentication/CHANGELOG.md b/sdk/mixedreality/mixed-reality-authentication/CHANGELOG.md similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/CHANGELOG.md rename to sdk/mixedreality/mixed-reality-authentication/CHANGELOG.md diff --git a/sdk/mixedreality/mixedreality-authentication/LICENSE b/sdk/mixedreality/mixed-reality-authentication/LICENSE similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/LICENSE rename to sdk/mixedreality/mixed-reality-authentication/LICENSE diff --git a/sdk/mixedreality/mixedreality-authentication/README.md b/sdk/mixedreality/mixed-reality-authentication/README.md similarity index 91% rename from sdk/mixedreality/mixedreality-authentication/README.md rename to sdk/mixedreality/mixed-reality-authentication/README.md index 81ebfe64c804..b736ae915e8d 100644 --- a/sdk/mixedreality/mixedreality-authentication/README.md +++ b/sdk/mixedreality/mixed-reality-authentication/README.md @@ -5,10 +5,10 @@ token service (STS) for authentication. This package supports exchanging Mixed R token from the STS that can be used to access Mixed Reality services. Key links: -- [Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/) -- [Package (NPM)](https://www.npmjs.com/package/@azure/mixedreality-authentication) -- [API reference documentation](https://aka.ms/azsdk/js/mixedreality-authentication/docs) -- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples) +- [Source code](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixed-reality-authentication/) | +- [Package (NPM)](https://www.npmjs.com/package/@azure/mixed-reality-authentication) | +- [API reference documentation](https://aka.ms/azsdk/js/mixed-reality-authentication/docs) | +- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixed-reality-authentication/samples) ![Mixed Reality service authentication diagram](https://docs.microsoft.com/azure/spatial-anchors/concepts/media/spatial-anchors-authentication-overview.png) @@ -26,12 +26,12 @@ Key links: - [Azure Spatial Anchors](https://docs.microsoft.com/azure/spatial-anchors/) - Familiarity with the authentication and credential concepts from the [Azure Identity library][azure_identity]. -### Install the `@azure/mixedreality-authentication` package +### Install the `@azure/mixed-reality-authentication` package Install the Azure Mixed Reality Authentication client library for JavaScript with `npm`: ```bash -npm install @azure/mixedreality-authentication +npm install @azure/mixed-reality-authentication ``` ### Create and authenticate a `MixedRealityStsClient` @@ -63,7 +63,7 @@ Once you have an account key, you can use the `AzureKeyCredential` class to auth ```js const { AzureKeyCredential } = require("@azure/core-auth"); -const { MixedRealityStsClient } = require("@azure/mixedreality-authentication"); +const { MixedRealityStsClient } = require("@azure/mixed-reality-authentication"); const accountId = ""; const accountDomain = ""; @@ -96,7 +96,7 @@ Set the values of the client ID, tenant ID, and client secret of the AAD applica `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. ```js -const { MixedRealityStsClient } = require("@azure/mixedreality-authentication"); +const { MixedRealityStsClient } = require("@azure/mixed-reality-authentication"); const { DefaultAzureCredential } = require("@azure/identity"); const client = new MixedRealityStsClient(accountId, accountDomain, new DefaultAzureCredential()); @@ -122,7 +122,7 @@ The return value for a successful call to `getToken` is an `GetTokenResponse`, w ```js const { AzureKeyCredential } = require("@azure/core-auth"); -const { MixedRealityStsClient } = require("@azure/mixedreality-authentication"); +const { MixedRealityStsClient } = require("@azure/mixed-reality-authentication"); const accountId = ""; const accountDomain = ""; @@ -175,7 +175,7 @@ For more detailed instructions on how to enable logs, you can look at the [@azur ## Next steps Please take a look at the -[samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/samples) +[samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixed-reality-authentication/samples) directory for detailed examples on how to use this library. ## Contributing @@ -207,4 +207,4 @@ build and test the code. [register_aad_app]: https://docs.microsoft.com/azure/spatial-anchors/concepts/authentication [defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixedreality-authentication%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%mixedreality%2Fmixed-reality-authentication%2FREADME.png) diff --git a/sdk/mixedreality/mixedreality-authentication/api-extractor.json b/sdk/mixedreality/mixed-reality-authentication/api-extractor.json similarity index 89% rename from sdk/mixedreality/mixedreality-authentication/api-extractor.json rename to sdk/mixedreality/mixed-reality-authentication/api-extractor.json index 643ca5ed1a56..5ca71b6aada1 100644 --- a/sdk/mixedreality/mixedreality-authentication/api-extractor.json +++ b/sdk/mixedreality/mixed-reality-authentication/api-extractor.json @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "./types/mixedreality-authentication.d.ts" + "publicTrimmedFilePath": "./types/mixed-reality-authentication.d.ts" }, "messages": { "tsdocMessageReporting": { diff --git a/sdk/mixedreality/mixedreality-authentication/karma.conf.js b/sdk/mixedreality/mixed-reality-authentication/karma.conf.js similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/karma.conf.js rename to sdk/mixedreality/mixed-reality-authentication/karma.conf.js diff --git a/sdk/mixedreality/mixedreality-authentication/package.json b/sdk/mixedreality/mixed-reality-authentication/package.json similarity index 94% rename from sdk/mixedreality/mixedreality-authentication/package.json rename to sdk/mixedreality/mixed-reality-authentication/package.json index 0686b4a5be8a..6928860e9f0b 100644 --- a/sdk/mixedreality/mixedreality-authentication/package.json +++ b/sdk/mixedreality/mixed-reality-authentication/package.json @@ -1,5 +1,5 @@ { - "name": "@azure/mixedreality-authentication", + "name": "@azure/mixed-reality-authentication", "version": "1.0.0-beta.1", "description": "Azure client library for Mixed Reality authentication.", "sdk-type": "client", @@ -8,7 +8,7 @@ "browser": { "./dist-esm/test/utils/env.js": "./dist-esm/test/utils/env.browser.js" }, - "types": "types/mixedreality-authentication.d.ts", + "types": "types/mixed-reality-authentication.d.ts", "scripts": { "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1", @@ -26,7 +26,7 @@ "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixedreality-authentication-lintReport.html || exit 0", + "lint": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o mixed-reality-authentication-lintReport.html || exit 0", "pack": "npm pack 2>&1", "prebuild": "npm run clean", "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", @@ -40,14 +40,14 @@ "files": [ "dist/", "dist-esm/src/", - "types/mixedreality-authentication.d.ts", + "types/mixed-reality-authentication.d.ts", "README.md", "LICENSE" ], "repository": { "type": "git", "url": "github:Azure/azure-sdk-for-js", - "directory": "sdk/mixedreality/mixedreality-authentication" + "directory": "sdk/mixedreality/mixed-reality-authentication" }, "engines": { "node": ">=12.0.0" @@ -63,7 +63,7 @@ "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/", + "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixed-reality-authentication/", "sideEffects": false, "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "dependencies": { diff --git a/sdk/mixedreality/mixedreality-authentication/recordings/browsers/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.json b/sdk/mixedreality/mixed-reality-authentication/recordings/browsers/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.json similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/recordings/browsers/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.json rename to sdk/mixedreality/mixed-reality-authentication/recordings/browsers/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.json diff --git a/sdk/mixedreality/mixedreality-authentication/recordings/node/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.js b/sdk/mixedreality/mixed-reality-authentication/recordings/node/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.js similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/recordings/node/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.js rename to sdk/mixedreality/mixed-reality-authentication/recordings/node/accountkey_mixedrealitystsclient_functional_tests/recording_get_token.js diff --git a/sdk/mixedreality/mixedreality-authentication/review/mixedreality-authentication.api.md b/sdk/mixedreality/mixed-reality-authentication/review/mixed-reality-authentication.api.md similarity index 94% rename from sdk/mixedreality/mixedreality-authentication/review/mixedreality-authentication.api.md rename to sdk/mixedreality/mixed-reality-authentication/review/mixed-reality-authentication.api.md index fbd87949da07..dae0897f348e 100644 --- a/sdk/mixedreality/mixedreality-authentication/review/mixedreality-authentication.api.md +++ b/sdk/mixedreality/mixed-reality-authentication/review/mixed-reality-authentication.api.md @@ -1,4 +1,4 @@ -## API Report File for "@azure/mixedreality-authentication" +## API Report File for "@azure/mixed-reality-authentication" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). diff --git a/sdk/mixedreality/mixedreality-authentication/rollup.config.js b/sdk/mixedreality/mixed-reality-authentication/rollup.config.js similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/rollup.config.js rename to sdk/mixedreality/mixed-reality-authentication/rollup.config.js diff --git a/sdk/mixedreality/mixedreality-authentication/sample.env b/sdk/mixedreality/mixed-reality-authentication/sample.env similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/sample.env rename to sdk/mixedreality/mixed-reality-authentication/sample.env diff --git a/sdk/mixedreality/mixedreality-authentication/samples-dev/getToken.ts b/sdk/mixedreality/mixed-reality-authentication/samples-dev/getToken.ts similarity index 93% rename from sdk/mixedreality/mixedreality-authentication/samples-dev/getToken.ts rename to sdk/mixedreality/mixed-reality-authentication/samples-dev/getToken.ts index 82a8ff7ea6db..8ea1054675a7 100644 --- a/sdk/mixedreality/mixedreality-authentication/samples-dev/getToken.ts +++ b/sdk/mixedreality/mixed-reality-authentication/samples-dev/getToken.ts @@ -7,7 +7,7 @@ */ import { AzureKeyCredential } from "@azure/core-auth"; -import { MixedRealityStsClient } from "@azure/mixedreality-authentication"; +import { MixedRealityStsClient } from "@azure/mixed-reality-authentication"; // Load the .env file if it exists import * as dotenv from "dotenv"; diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/README.md b/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/README.md similarity index 95% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/README.md rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/README.md index 5a46d70d4816..032d47e1e59f 100644 --- a/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/README.md +++ b/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/README.md @@ -6,7 +6,7 @@ products: - azure - azure-remote-rendering - azure-spatial-anchors -urlFragment: mixedreality-authentication-javascript +urlFragment: mixed-reality-authentication-javascript --- # Azure Mixed Reality Authentication client library samples for JavaScript @@ -63,10 +63,10 @@ npx cross-env MIXEDREALITY_ACCOUNT_DOMAIN="" MIXEDR Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[gettoken]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/getToken.js +[gettoken]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/getToken.js [apiref]: https://docs.microsoft.com/javascript/api/ [freesub]: https://azure.microsoft.com/free/ [createinstance_azureobjectanchorsaccount]: https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account [createinstance_azureremoterenderingaccount]: https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup [createinstance_azurespatialanchorsaccount]: https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/README.md +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixed-reality-authentication/README.md diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/getToken.js b/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/getToken.js similarity index 93% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/getToken.js rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/getToken.js index 3a4c1ecb0f81..6c294aab24bc 100644 --- a/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/getToken.js +++ b/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/getToken.js @@ -7,7 +7,7 @@ */ const { AzureKeyCredential } = require("@azure/core-auth"); -const { MixedRealityStsClient } = require("@azure/mixedreality-authentication"); +const { MixedRealityStsClient } = require("@azure/mixed-reality-authentication"); // Load the .env file if it exists const dotenv = require("dotenv"); diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/package.json b/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/package.json similarity index 74% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/package.json rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/package.json index 94d306a779e4..d1690265db1a 100644 --- a/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/package.json +++ b/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/package.json @@ -1,5 +1,5 @@ { - "name": "azure-mixedreality-authentication-samples-js", + "name": "azure-mixed-reality-authentication-samples-js", "private": true, "version": "1.0.0", "description": "Azure Mixed Reality Authentication client library samples for JavaScript", @@ -9,7 +9,7 @@ "repository": { "type": "git", "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/mixedreality/mixedreality-authentication" + "directory": "sdk/mixedreality/mixed-reality-authentication" }, "keywords": [ "azure", @@ -22,9 +22,9 @@ "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixed-reality-authentication", "dependencies": { - "@azure/mixedreality-authentication": "next", + "@azure/mixed-reality-authentication": "next", "dotenv": "latest", "@azure/core-auth": "^1.3.0" } diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/sample.env b/sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/sample.env similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/javascript/sample.env rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/javascript/sample.env diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/README.md b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/README.md similarity index 95% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/README.md rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/README.md index 35945536cfad..1c60c6d7cff2 100644 --- a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/README.md +++ b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/README.md @@ -6,7 +6,7 @@ products: - azure - azure-remote-rendering - azure-spatial-anchors -urlFragment: mixedreality-authentication-typescript +urlFragment: mixed-reality-authentication-typescript --- # Azure Mixed Reality Authentication client library samples for TypeScript @@ -75,11 +75,11 @@ npx cross-env MIXEDREALITY_ACCOUNT_DOMAIN="" MIXEDR Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[gettoken]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/src/getToken.ts +[gettoken]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/src/getToken.ts [apiref]: https://docs.microsoft.com/javascript/api/ [freesub]: https://azure.microsoft.com/free/ [createinstance_azureobjectanchorsaccount]: https://docs.microsoft.com/azure/object-anchors/quickstarts/get-started-model-conversion#create-an-object-anchors-account [createinstance_azureremoterenderingaccount]: https://docs.microsoft.com/azure/remote-rendering/quickstarts/convert-model#azure-setup [createinstance_azurespatialanchorsaccount]: https://docs.microsoft.com/azure/spatial-anchors/quickstarts/get-started-hololens?tabs=azure-portal#create-a-spatial-anchors-resource -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication/README.md +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixed-reality-authentication/README.md [typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/package.json b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/package.json similarity index 77% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/package.json rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/package.json index e0ead17f9494..45b4627cb0be 100644 --- a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/package.json +++ b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/package.json @@ -1,5 +1,5 @@ { - "name": "azure-mixedreality-authentication-samples-ts", + "name": "azure-mixed-reality-authentication-samples-ts", "private": true, "version": "1.0.0", "description": "Azure Mixed Reality Authentication client library samples for TypeScript", @@ -13,7 +13,7 @@ "repository": { "type": "git", "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/mixedreality/mixedreality-authentication" + "directory": "sdk/mixedreality/mixed-reality-authentication" }, "keywords": [ "azure", @@ -26,9 +26,9 @@ "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixedreality-authentication", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mixedreality/mixed-reality-authentication", "dependencies": { - "@azure/mixedreality-authentication": "next", + "@azure/mixed-reality-authentication": "next", "dotenv": "latest", "@azure/core-auth": "^1.3.0" }, diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/sample.env b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/sample.env similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/sample.env rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/sample.env diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/src/getToken.ts b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/src/getToken.ts similarity index 93% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/src/getToken.ts rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/src/getToken.ts index 82a8ff7ea6db..8ea1054675a7 100644 --- a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/src/getToken.ts +++ b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/src/getToken.ts @@ -7,7 +7,7 @@ */ import { AzureKeyCredential } from "@azure/core-auth"; -import { MixedRealityStsClient } from "@azure/mixedreality-authentication"; +import { MixedRealityStsClient } from "@azure/mixed-reality-authentication"; // Load the .env file if it exists import * as dotenv from "dotenv"; diff --git a/sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/tsconfig.json b/sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/tsconfig.json similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/samples/v1/typescript/tsconfig.json rename to sdk/mixedreality/mixed-reality-authentication/samples/v1/typescript/tsconfig.json diff --git a/sdk/mixedreality/mixedreality-authentication/snippets/prerequisites.md b/sdk/mixedreality/mixed-reality-authentication/snippets/prerequisites.md similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/snippets/prerequisites.md rename to sdk/mixedreality/mixed-reality-authentication/snippets/prerequisites.md diff --git a/sdk/mixedreality/mixedreality-authentication/src/constants.ts b/sdk/mixedreality/mixed-reality-authentication/src/constants.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/constants.ts rename to sdk/mixedreality/mixed-reality-authentication/src/constants.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/generated/index.ts b/sdk/mixedreality/mixed-reality-authentication/src/generated/index.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/generated/index.ts rename to sdk/mixedreality/mixed-reality-authentication/src/generated/index.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/generated/mixedRealityStsRestClient.ts b/sdk/mixedreality/mixed-reality-authentication/src/generated/mixedRealityStsRestClient.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/generated/mixedRealityStsRestClient.ts rename to sdk/mixedreality/mixed-reality-authentication/src/generated/mixedRealityStsRestClient.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/generated/mixedRealityStsRestClientContext.ts b/sdk/mixedreality/mixed-reality-authentication/src/generated/mixedRealityStsRestClientContext.ts similarity index 95% rename from sdk/mixedreality/mixedreality-authentication/src/generated/mixedRealityStsRestClientContext.ts rename to sdk/mixedreality/mixed-reality-authentication/src/generated/mixedRealityStsRestClientContext.ts index 34754d0eb484..e2e0f8a7d4cc 100644 --- a/sdk/mixedreality/mixedreality-authentication/src/generated/mixedRealityStsRestClientContext.ts +++ b/sdk/mixedreality/mixed-reality-authentication/src/generated/mixedRealityStsRestClientContext.ts @@ -9,7 +9,7 @@ import * as coreHttp from "@azure/core-http"; import { MixedRealityStsRestClientOptionalParams } from "./models"; -const packageName = "@azure/mixedreality-authentication"; +const packageName = "@azure/mixed-reality-authentication"; const packageVersion = "1.0.0"; /** @hidden */ diff --git a/sdk/mixedreality/mixedreality-authentication/src/generated/models/index.ts b/sdk/mixedreality/mixed-reality-authentication/src/generated/models/index.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/generated/models/index.ts rename to sdk/mixedreality/mixed-reality-authentication/src/generated/models/index.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/generated/models/mappers.ts b/sdk/mixedreality/mixed-reality-authentication/src/generated/models/mappers.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/generated/models/mappers.ts rename to sdk/mixedreality/mixed-reality-authentication/src/generated/models/mappers.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/generated/models/parameters.ts b/sdk/mixedreality/mixed-reality-authentication/src/generated/models/parameters.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/generated/models/parameters.ts rename to sdk/mixedreality/mixed-reality-authentication/src/generated/models/parameters.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/index.ts b/sdk/mixedreality/mixed-reality-authentication/src/index.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/index.ts rename to sdk/mixedreality/mixed-reality-authentication/src/index.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/logger.ts b/sdk/mixedreality/mixed-reality-authentication/src/logger.ts similarity index 71% rename from sdk/mixedreality/mixedreality-authentication/src/logger.ts rename to sdk/mixedreality/mixed-reality-authentication/src/logger.ts index 918266dccda0..85e0b3e014b1 100644 --- a/sdk/mixedreality/mixedreality-authentication/src/logger.ts +++ b/sdk/mixedreality/mixed-reality-authentication/src/logger.ts @@ -8,4 +8,4 @@ import { createClientLogger, AzureLogger } from "@azure/logger"; * * @internal */ -export const logger: AzureLogger = createClientLogger("mixedreality-authentication"); +export const logger: AzureLogger = createClientLogger("mixed-reality-authentication"); diff --git a/sdk/mixedreality/mixedreality-authentication/src/mixedRealityStsClient.ts b/sdk/mixedreality/mixed-reality-authentication/src/mixedRealityStsClient.ts similarity index 98% rename from sdk/mixedreality/mixedreality-authentication/src/mixedRealityStsClient.ts rename to sdk/mixedreality/mixed-reality-authentication/src/mixedRealityStsClient.ts index 40602413be32..943c765dd012 100644 --- a/sdk/mixedreality/mixedreality-authentication/src/mixedRealityStsClient.ts +++ b/sdk/mixedreality/mixed-reality-authentication/src/mixedRealityStsClient.ts @@ -93,7 +93,7 @@ export class MixedRealityStsClient { options.customEndpointUrl || constructAuthenticationEndpointFromDomain(accountDomain); // The below code helps us set a proper User-Agent header on all requests - const libInfo = `azsdk-js-mixedreality-authentication/${SDK_VERSION}`; + const libInfo = `azsdk-js-mixed-reality-authentication/${SDK_VERSION}`; if (!options.userAgentOptions) { options.userAgentOptions = {}; diff --git a/sdk/mixedreality/mixedreality-authentication/src/models/auth.ts b/sdk/mixedreality/mixed-reality-authentication/src/models/auth.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/models/auth.ts rename to sdk/mixedreality/mixed-reality-authentication/src/models/auth.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/models/mappers.ts b/sdk/mixedreality/mixed-reality-authentication/src/models/mappers.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/models/mappers.ts rename to sdk/mixedreality/mixed-reality-authentication/src/models/mappers.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/models/options.ts b/sdk/mixedreality/mixed-reality-authentication/src/models/options.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/models/options.ts rename to sdk/mixedreality/mixed-reality-authentication/src/models/options.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/tracing.ts b/sdk/mixedreality/mixed-reality-authentication/src/tracing.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/tracing.ts rename to sdk/mixedreality/mixed-reality-authentication/src/tracing.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/util/authenticationEndpoint.ts b/sdk/mixedreality/mixed-reality-authentication/src/util/authenticationEndpoint.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/util/authenticationEndpoint.ts rename to sdk/mixedreality/mixed-reality-authentication/src/util/authenticationEndpoint.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/util/base64.ts b/sdk/mixedreality/mixed-reality-authentication/src/util/base64.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/util/base64.ts rename to sdk/mixedreality/mixed-reality-authentication/src/util/base64.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/util/cv.ts b/sdk/mixedreality/mixed-reality-authentication/src/util/cv.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/util/cv.ts rename to sdk/mixedreality/mixed-reality-authentication/src/util/cv.ts diff --git a/sdk/mixedreality/mixedreality-authentication/src/util/jwt.ts b/sdk/mixedreality/mixed-reality-authentication/src/util/jwt.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/src/util/jwt.ts rename to sdk/mixedreality/mixed-reality-authentication/src/util/jwt.ts diff --git a/sdk/mixedreality/mixedreality-authentication/swagger/README.md b/sdk/mixedreality/mixed-reality-authentication/swagger/README.md similarity index 94% rename from sdk/mixedreality/mixedreality-authentication/swagger/README.md rename to sdk/mixedreality/mixed-reality-authentication/swagger/README.md index 5bc7121db644..848b0e3f173c 100644 --- a/sdk/mixedreality/mixedreality-authentication/swagger/README.md +++ b/sdk/mixedreality/mixed-reality-authentication/swagger/README.md @@ -7,7 +7,7 @@ Run `rushx generate:client` to generate code. ## Configuration ```yaml -package-name: "@azure/mixedreality-authentication" +package-name: "@azure/mixed-reality-authentication" title: MixedRealityStsRestClient description: Mixed Reality Authentication client generate-metadata: false diff --git a/sdk/mixedreality/mixedreality-authentication/test/authenticationEndpoint.spec.ts b/sdk/mixedreality/mixed-reality-authentication/test/authenticationEndpoint.spec.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/test/authenticationEndpoint.spec.ts rename to sdk/mixedreality/mixed-reality-authentication/test/authenticationEndpoint.spec.ts diff --git a/sdk/mixedreality/mixedreality-authentication/test/jwt.spec.ts b/sdk/mixedreality/mixed-reality-authentication/test/jwt.spec.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/test/jwt.spec.ts rename to sdk/mixedreality/mixed-reality-authentication/test/jwt.spec.ts diff --git a/sdk/mixedreality/mixedreality-authentication/test/mixedRealityStsClient.spec.ts b/sdk/mixedreality/mixed-reality-authentication/test/mixedRealityStsClient.spec.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/test/mixedRealityStsClient.spec.ts rename to sdk/mixedreality/mixed-reality-authentication/test/mixedRealityStsClient.spec.ts diff --git a/sdk/mixedreality/mixedreality-authentication/test/utils/env.browser.ts b/sdk/mixedreality/mixed-reality-authentication/test/utils/env.browser.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/test/utils/env.browser.ts rename to sdk/mixedreality/mixed-reality-authentication/test/utils/env.browser.ts diff --git a/sdk/mixedreality/mixedreality-authentication/test/utils/env.ts b/sdk/mixedreality/mixed-reality-authentication/test/utils/env.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/test/utils/env.ts rename to sdk/mixedreality/mixed-reality-authentication/test/utils/env.ts diff --git a/sdk/mixedreality/mixedreality-authentication/test/utils/recordedClient.ts b/sdk/mixedreality/mixed-reality-authentication/test/utils/recordedClient.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/test/utils/recordedClient.ts rename to sdk/mixedreality/mixed-reality-authentication/test/utils/recordedClient.ts diff --git a/sdk/mixedreality/mixedreality-authentication/test/utils/tokenCredentialHelper.ts b/sdk/mixedreality/mixed-reality-authentication/test/utils/tokenCredentialHelper.ts similarity index 100% rename from sdk/mixedreality/mixedreality-authentication/test/utils/tokenCredentialHelper.ts rename to sdk/mixedreality/mixed-reality-authentication/test/utils/tokenCredentialHelper.ts diff --git a/sdk/mixedreality/mixedreality-authentication/tests.yml b/sdk/mixedreality/mixed-reality-authentication/tests.yml similarity index 81% rename from sdk/mixedreality/mixedreality-authentication/tests.yml rename to sdk/mixedreality/mixed-reality-authentication/tests.yml index 38fa41d3d7d5..d11bcfa759dd 100644 --- a/sdk/mixedreality/mixedreality-authentication/tests.yml +++ b/sdk/mixedreality/mixed-reality-authentication/tests.yml @@ -3,7 +3,7 @@ trigger: none stages: - template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: - PackageName: "@azure/mixedreality-authentication" + PackageName: "@azure/mixed-reality-authentication" ServiceDirectory: mixedreality Location: eastus2 MatrixFilters: diff --git a/sdk/mixedreality/mixedreality-authentication/tsconfig.json b/sdk/mixedreality/mixed-reality-authentication/tsconfig.json similarity index 78% rename from sdk/mixedreality/mixedreality-authentication/tsconfig.json rename to sdk/mixedreality/mixed-reality-authentication/tsconfig.json index 1735773d0ef6..6e3555ecac6e 100644 --- a/sdk/mixedreality/mixedreality-authentication/tsconfig.json +++ b/sdk/mixedreality/mixed-reality-authentication/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "./dist-esm", "declarationDir": "./types", "paths": { - "@azure/mixedreality-authentication": ["./src/index"] + "@azure/mixed-reality-authentication": ["./src/index"] } }, "include": ["src/**/*.ts", "test/**/*.ts", "samples-dev/**/*.ts"] diff --git a/sdk/remoterendering/TestResources/testBox.fbx b/sdk/remoterendering/TestResources/testBox.fbx new file mode 100644 index 000000000000..13b967f33315 --- /dev/null +++ b/sdk/remoterendering/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/remoterendering/ci.yml b/sdk/remoterendering/ci.yml new file mode 100644 index 000000000000..425edbddb2af --- /dev/null +++ b/sdk/remoterendering/ci.yml @@ -0,0 +1,32 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - main + - release/* + - hotfix/* + paths: + include: + - sdk/remoterendering/ + +pr: + branches: + include: + - master + - main + - feature/* + - release/* + - hotfix/* + paths: + include: + - sdk/remoterendering/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: remoterendering + Artifacts: + - name: azure-mixed-reality-remote-rendering + safeName: azuremixedrealityremoterendering diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/.gitignore b/sdk/remoterendering/mixed-reality-remote-rendering/.gitignore new file mode 100644 index 000000000000..92f24649d57f --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/.gitignore @@ -0,0 +1,2 @@ +samples +.vscode \ No newline at end of file diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/.nycrc b/sdk/remoterendering/mixed-reality-remote-rendering/.nycrc new file mode 100644 index 000000000000..320eddfeffb9 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/.nycrc @@ -0,0 +1,19 @@ +{ + "include": [ + "dist-esm/src/**/*.js" + ], + "exclude": [ + "**/*.d.ts", + "dist-esm/src/generated/*" + ], + "reporter": [ + "text-summary", + "html", + "cobertura" + ], + "exclude-after-remap": false, + "sourceMap": true, + "produce-source-map": true, + "instrument": true, + "all": true + } diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/CHANGELOG.md b/sdk/remoterendering/mixed-reality-remote-rendering/CHANGELOG.md new file mode 100644 index 000000000000..967eb9e0f2c0 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Initial release. diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/LICENSE b/sdk/remoterendering/mixed-reality-remote-rendering/LICENSE new file mode 100644 index 000000000000..ea8fb1516028 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/README.md b/sdk/remoterendering/mixed-reality-remote-rendering/README.md new file mode 100644 index 000000000000..f51d937ccece --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/README.md @@ -0,0 +1,390 @@ +# Azure Remote Rendering client library for JavaScript + +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 + +### Currently supported environments + +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge, and Firefox. + +### 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. + +### Install the `@azure/mixed-reality-remote-rendering` package + +Install the Template client library for JavaScript with `npm`: + +```bash +npm install @azure/mixed-reality-remote-rendering +``` + +### Browser support + +#### JavaScript Bundle + +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +#### CORS + +This library cannot be used to make direct calls to the Azure Remote Rendering service from a browser. +Please refer to [this document](https://github.com/Azure/azure-sdk-for-js/blob/main/samples/cors/ts/README.md) for guidance. + +### Authenticate the client + +Constructing a remote rendering client requires an authenticated account, and a remote rendering endpoint. +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`. +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: + +```typescript Snippet:CreateAClient +const credential = new AzureKeyCredential(accountKey); + +const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); +``` + +#### Authenticating with an AAD client secret + +Use the `ClientSecretCredential` object to perform client secret authentication. + +```typescript Snippet:CreateAClientWithAAD +let credential = new ClientSecretCredential(tenantId, clientId, clientSecret, { + authorityHost: "https://login.microsoftonline.com/" + tenantId +}); + +const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); +``` + +#### Authenticating a user using device code authentication + +Use the `DeviceCodeCredential` object to perform device code authentication. + +```typescript Snippet:CreateAClientWithDeviceCode +let deviceCodeCallback = (deviceCodeInfo: DeviceCodeInfo) => { + console.debug(deviceCodeInfo.message); + console.log(deviceCodeInfo.message); +}; + +let credential = new DeviceCodeCredential(tenantId, clientId, deviceCodeCallback, { + authorityHost: "https://login.microsoftonline.com/" + tenantId +}); + +const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, 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: + +```typescript Snippet:CreateAClientWithAzureCredential +let credential = new DefaultAzureCredential(); + +return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential, { + authenticationEndpointUrl: "https://sts.mixedreality.azure.com" +}); +``` + +#### 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-js/tree/main/sdk/mixedreality/mixed-reality-authentication) +to be used with a Mixed Reality client library: + +```typescript Snippet:CreateAClientWithStaticAccessToken +// 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. +const accessToken = GetMixedRealityAccessTokenFromWebService(); + +RemoteRenderingClient client = new RemoteRenderingClient(remoteRenderingEndpoint, accountId, 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. + +```typescript Snippet:StartAnAssetConversion +const inputSettings: AssetConversionInputSettings = { + storageContainerUrl, + relativeInputAssetPath: "box.fbx" +}; +const outputSettings: AssetConversionOutputSettings = { + storageContainerUrl +}; +const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + +// A randomly generated UUID is a good choice for a conversionId. +const conversionId = uuid(); + +const conversionPoller: AssetConversionPollerLike = await client.beginConversion( + conversionId, + conversionSettings +); +``` + +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 `inputStorageUrl` 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: + +```typescript Snippet:StartAComplexAssetConversion + const inputSettings: AssetConversionInputSettings = { + storageContainerUrl: inputStorageUrl, + blobPrefix: "Bicycle" + relativeInputAssetPath: "bicycle.gltf" + }; + const outputSettings: AssetConversionOutputSettings = { + storageContainerUrl: outputStorageUrl, + blobPrefix: "ConvertedBicycle" + }; + const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + + const conversionId = uuid(); + + const conversionPoller: AssetConversionPollerLike = await client.beginConversion( + conversionId, + conversionSettings + ); +``` + +> 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 the conversionPoller returned by beginConversion to poll regularly until the conversion has finished or failed. +The default polling period is 10 seconds. + +```typescript Snippet:QueryConversionStatus +const conversion = await conversionPoller.pollUntilDone(); + +console.log("== Check results =="); + +if (conversion.status === "Succeeded") { + console.log("Conversion succeeded: Output written to " + conversion.output?.outputAssetUrl); +} else if (conversion.status === "Failed") { + console.log("Conversion failed: " + conversion.error.code + " " + conversion.error.message); +} +``` + +Note that the state of a AssetConversionPollerLike can be serialized by calling conversionPoller.toString(). +That value can later be passed into beginConversion as a `resumeFrom` value, to construct a new poller +which carries on from where the earlier one left off: + +```typescript +const serializedPollerString = conversionPoller.toString(); +// ... +const resumedPoller = client.beginConversion({ resumeFrom: serializedPollerString }); +``` + +### 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. + +```typescript Snippet:ListConversions +for await (const conversion of client.listConversions()) { + if (conversion.status === "Succeeded") { + console.log( + `Conversion ${conversion.conversionId} succeeded: Output written to ${conversion.output?.outputAssetUrl}` + ); + } else if (conversion.status === "Failed") { + console.log( + `Conversion ${conversion.conversionId} failed: ${conversion.error.code} ${conversion.error.message}` + ); + } +} +``` + +### 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. + +```typescript Snippet:CreateASession +const sessionSettings: RenderingSessionSettings = { + maxLeaseTimeInMinutes: 4, + size: "Standard" +}; + +// A randomly generated UUID is a good choice for a conversionId. +const sessionId = uuid(); + +const sessionPoller: RenderingSessionPollerLike = await client.beginSession( + sessionId, + sessionSettings +); +``` + +Note that the state of a RenderingSessionPollerLike can be serialized by calling toString(). +That value can later be passed into beginSession as a `resumeFrom` value, to construct a new poller +which carries on from where the earlier one left off: + +```typescript +const serializedPollerString = sessionPoller.toString(); +// ... +const resumedPoller = client.beginSession({ resumeFrom: serializedPollerString }); +``` + +### 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. + +```typescript Snippet:UpdateSession +/// When the lease is within 2 minutes of expiring, extend it by 15 minutes. +let currentSession = await client.getSession(sessionId); +if (currentSession.status == "Ready") { + if ( + currentSession.maxLeaseTimeInMinutes - + (Date.now() - currentSession.properties.createdOn.valueOf()) / 60000 < + 2 + ) { + let newLeaseTime = currentSession.maxLeaseTimeInMinutes + 15; + + await client.updateSession(sessionId, { maxLeaseTimeInMinutes: newLeaseTime }); + } +} +``` + +### 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. + +```typescript Snippet:ListSessions +for await (const session of client.listSessions()) { + console.log(`Session ${session.sessionId} is ${session.status}`); +} +``` + +### Stop a session + +The following code will stop a running session with given id. + +```typescript Snippet:StopSession +client.endSession(sessionId); +``` + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +import { setLogLevel } from "@azure/logger"; + +setLogLevel("info"); +``` + +### Azure Remote Rendering 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 + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Ftemplate%2Ftemplate%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/api-extractor.json b/sdk/remoterendering/mixed-reality-remote-rendering/api-extractor.json new file mode 100644 index 000000000000..fb4a9ef9f374 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "types/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/mixed-reality-remote-rendering.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/karma.conf.js b/sdk/remoterendering/mixed-reality-remote-rendering/karma.conf.js new file mode 100644 index 000000000000..eb0da13b1f69 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/karma.conf.js @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// https://github.com/karma-runner/karma-chrome-launcher +process.env.CHROME_BIN = require("puppeteer").executablePath(); +require("dotenv").config(); +const { + jsonRecordingFilterFunction, + isPlaybackMode, + isSoftRecordMode, + isRecordMode +} = require("@azure/test-utils-recorder"); + +module.exports = function(config) { + config.set({ + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: "./", + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ["mocha"], + + plugins: [ + "karma-mocha", + "karma-mocha-reporter", + "karma-chrome-launcher", + "karma-edge-launcher", + "karma-firefox-launcher", + "karma-ie-launcher", + "karma-env-preprocessor", + "karma-coverage", + "karma-junit-reporter", + "karma-json-to-file-reporter", + "karma-json-preprocessor" + ], + + // list of files / patterns to load in the browser + files: [ + "dist-test/index.browser.js", + { pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true } + ].concat(isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : []), + + // list of files / patterns to exclude + exclude: [], + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + "**/*.js": ["env"], + "recordings/browsers/**/*.json": ["json"], + // IMPORTANT: COMMENT following line if you want to debug in your browsers!! + // Preprocess source file to calculate code coverage, however this will make source file unreadable + "test-browser/index.js": ["coverage"] + }, + + envPreprocessor: [ + "TEST_MODE", + "REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME", + "REMOTERENDERING_ARR_BLOB_CONTAINER_NAME", + "REMOTERENDERING_ARR_ACCOUNT_KEY", + "REMOTERENDERING_ARR_ACCOUNT_DOMAIN", + "REMOTERENDERING_ARR_ACCOUNT_ID", + "REMOTERENDERING_ARR_SAS_TOKEN", + "REMOTERENDERING_ARR_SERVICE_ENDPOINT", + "AZURE_CLIENT_ID", + "AZURE_CLIENT_SECRET", + "AZURE_TENANT_ID" + ], + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ["mocha", "coverage", "junit", "json-to-file"], + + coverageReporter: { + // specify a common output directory + dir: "coverage-browser/", + reporters: [{ type: "json", subdir: ".", file: "coverage.json" }] + }, + + junitReporter: { + outputDir: "", // results will be saved as $outputDir/$browserName.xml + outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile + suite: "", // suite will become the package name attribute in xml testsuite element + useBrowserName: false, // add browser name to report and classes names + nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element + classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element + properties: {} // key value pair of properties to add to the section of the report + }, + + jsonToFileReporter: { + filter: jsonRecordingFilterFunction, + outputPath: "." + }, + + // web server port + port: 9876, + + // enable / disable colors in the output (reporters and logs) + colors: true, + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: false, + + // --no-sandbox allows our tests to run in Linux without having to change the system. + // --disable-web-security allows us to authenticate from the browser without having to write tests using interactive auth, which would be far more complex. + browsers: ["ChromeHeadlessNoSandbox"], + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: "ChromeHeadless", + flags: ["--no-sandbox", "--disable-web-security"] + } + }, + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: true, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: 1, + + browserNoActivityTimeout: 1000000, + browserDisconnectTimeout: 10000, + browserDisconnectTolerance: 3, + browserConsoleLogOptions: { + terminal: !isRecordMode() + }, + + client: { + mocha: { + // change Karma's debug.html to the mocha web reporter + reporter: "html", + timeout: "600000" + } + } + }); +}; diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/package.json b/sdk/remoterendering/mixed-reality-remote-rendering/package.json new file mode 100644 index 000000000000..eba3943debf0 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/package.json @@ -0,0 +1,140 @@ +{ + "name": "@azure/mixed-reality-remote-rendering", + "version": "1.0.0-beta.1", + "description": "Example project for learning how to build a client library", + "sdk-type": "client", + "main": "dist/index.js", + "module": "dist-esm/src/index.js", + "browser": { + "./dist-esm/test/utils/env.js": "./dist-esm/test/utils/env.browser.js" + }, + "types": "types/mixed-reality-remote-rendering.d.ts", + "//metadata": { + "constantPaths": [ + { + "path": "src/generated/generatedClientContext.ts", + "prefix": "packageVersion" + }, + { + "path": "src/constants.ts", + "prefix": "SDK_VERSION" + } + ] + }, + "scripts": { + "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", + "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1", + "build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1", + "build:test": "tsc -p . && rollup -c 2>&1", + "build": "tsc -p . && rollup -c 2>&1 && api-extractor run --local", + "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"", + "clean": "rimraf dist dist-* test-dist temp types *.tgz *.log", + "docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src", + "build:samples": "echo Obsolete.", + "execute:samples": "dev-tool samples run samples-dev", + "extract-api": "tsc -p . && api-extractor run --local", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"", + "generate:client": "autorest --typescript --v3 swagger", + "integration-test:browser": "karma start --single-run", + "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", + "lint": "eslint package.json api-extractor.json src test --ext .ts", + "pack": "npm pack 2>&1", + "prebuild": "npm run clean", + "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", + "test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node", + "test": "npm run build:test && npm run unit-test && npm run integration-test", + "unit-test:browser": "karma start --single-run", + "unit-test:node": "mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}/*.spec.ts\"", + "unit-test": "npm run unit-test:node && npm run unit-test:browser" + }, + "files": [ + "dist/", + "dist-esm/src/", + "types/mixed-reality-remote-rendering.d.ts", + "README.md", + "LICENSE" + ], + "repository": "github:Azure/azure-sdk-for-js", + "engines": { + "node": ">=12.0.0" + }, + "keywords": [ + "azure", + "cloud", + "typescript" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/remoterendering/mixed-reality-remote-rendering/README.md", + "sideEffects": false, + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "dependencies": { + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.0.3", + "@azure/core-client": "^1.0.0", + "@azure/core-tracing": "1.0.0-preview.12", + "@azure/logger": "^1.0.0", + "tslib": "^2.2.0", + "@azure/mixed-reality-authentication": "1.0.0-beta.1", + "@azure/core-lro": "^2.0.0", + "@azure/abort-controller": "^1.0.0", + "@azure/core-paging": "^1.1.1", + "@azure/core-util": "^1.0.0-beta.1" + }, + "devDependencies": { + "@azure/dev-tool": "^1.0.0", + "@azure/eslint-plugin-azure-sdk": "^3.0.0", + "@azure/identity": "^1.1.0", + "@azure/test-utils-recorder": "^1.0.0", + "@microsoft/api-extractor": "7.7.11", + "@types/chai": "^4.1.6", + "@types/chai-as-promised": "^7.1.0", + "@types/mocha": "^7.0.2", + "@types/node": "^12.0.0", + "chai": "^4.2.0", + "chai-as-promised": "^7.1.1", + "cross-env": "^7.0.2", + "dotenv": "^8.2.0", + "eslint": "^7.15.0", + "inherits": "^2.0.3", + "karma": "^6.2.0", + "karma-chrome-launcher": "^3.0.0", + "karma-coverage": "^2.0.0", + "karma-edge-launcher": "^0.4.2", + "karma-env-preprocessor": "^0.1.1", + "karma-firefox-launcher": "^1.1.0", + "karma-ie-launcher": "^1.0.0", + "karma-json-preprocessor": "^0.3.3", + "karma-json-to-file-reporter": "^1.0.1", + "karma-junit-reporter": "^2.0.1", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", + "mocha": "^7.1.1", + "mocha-junit-reporter": "^1.18.0", + "nyc": "^14.0.0", + "prettier": "^1.16.4", + "rimraf": "^3.0.0", + "rollup": "^1.16.3", + "typedoc": "0.15.2", + "typescript": "~4.2.0", + "util": "^0.12.1", + "@types/uuid": "^8.0.0", + "uuid": "^8.3.0" + }, + "//sampleConfiguration": { + "productName": "Azure Remote Rendering", + "productSlugs": [ + "azure", + "azure-mixed-reality-remote-rendering" + ], + "requiredResources": { + "Azure Remote Rendering account": "https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account", + "Azure Storage account": "https://docs.microsoft.com/azure/storage/common/storage-account-create" + } + } +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_can_convert_successfully.json b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_can_convert_successfully.json new file mode 100644 index 000000000000..82bc2290e0e7 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_can_convert_successfully.json @@ -0,0 +1,246 @@ +{ + "recordings": [ + { + "method": "GET", + "url": "https://sts.eastus2.mixedreality.azure.com/Accounts/00000000-1111-2222-3333-444455556666/token", + "query": { + "api-version": "2019-02-28-preview" + }, + "requestBody": null, + "status": 200, + "response": "{\"AccessToken\":\"\"}", + "responseHeaders": { + "cache-control": "no-store,no-cache", + "content-length": "1219", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:20 GMT", + "ms-cv": "JoTdFOWwl02T1cQKRpIi0g.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "PUT", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": "{\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"storageContainerReadListSas\":\"arr_sas_token\",\"blobPrefix\":\"Input\",\"relativeInputAssetPath\":\"testBox.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"storageContainerWriteSas\":\"arr_sas_token\",\"blobPrefix\":\"Output\"}}}", + "status": 201, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "429", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:21 GMT", + "ms-cv": "yrDX1oKYo0W5tvKDAtXkZA.0", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "429", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:21 GMT", + "ms-cv": "CtcKYqdpYkC39WTiSu9wAA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "429", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:22 GMT", + "ms-cv": "nuj7LuwRoUOIrlYEzkYwSQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "429", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:22 GMT", + "ms-cv": "Sw0fbqprbkOcbfrilQ4C4g.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "426", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:32 GMT", + "ms-cv": "UlsRwsueUE2O5jKPAUVdXQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "426", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:42 GMT", + "ms-cv": "/5ZZA2Jw+0K3lTHdyllDfQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "426", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 13:59:53 GMT", + "ms-cv": "VBBeMJ86i0KCD17V07LtFQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "426", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:03 GMT", + "ms-cv": "Ume7qfVkY0SB/gpvQSku7g.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "426", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:13 GMT", + "ms-cv": "w3nAW/S4DUS9DH8dSzTe5Q.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979116029500129", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "525", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:23 GMT", + "ms-cv": "zxBm6loxFUeBCLn/zYMjug.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"conversions\":[{\"id\":\"9456e78f-4e86-45d5-9a3a-42f32d98ebfa\",\"creationTime\":\"2021-04-30T09:42:54.4006831Z\",\"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\":\"4bd0faf2-7279-4351-8255-ff7b1852aa77\",\"creationTime\":\"2021-04-30T11:04:28.3608266Z\",\"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\":\"5853b38a-a174-44e4-9018-7c324e2d2ba7\",\"creationTime\":\"2021-04-30T11:17:01.4900529Z\",\"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\":\"9e063aff-0aeb-4ca5-8796-b708680fcf32\",\"creationTime\":\"2021-04-30T11:25:43.4274107Z\",\"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\":\"conversionId161978216546004121\",\"creationTime\":\"2021-04-30T11:29:27.2323156Z\",\"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\":\"conversionId161978242766201357\",\"creationTime\":\"2021-04-30T11:33:47.8966192Z\",\"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\":\"conversionId161978289255208378\",\"creationTime\":\"2021-04-30T11:41:35.9073281Z\",\"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\":\"conversionId161978296301000875\",\"creationTime\":\"2021-04-30T11:42:43.2118581Z\",\"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\":\"a6faf3bc-3c10-4ce3-9548-545da9ef2423\",\"creationTime\":\"2021-04-30T11:49:50.4940039Z\",\"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\":\"b57d6ad3-0077-478b-967a-0219a0fab5cc\",\"creationTime\":\"2021-04-30T13:12:21.8193622Z\",\"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\":\"conversionId161979083179608548\",\"creationTime\":\"2021-04-30T13:53:53.963195Z\",\"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\":\"conversionId161979089851105096\",\"creationTime\":\"2021-04-30T13:54:58.578215Z\",\"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\":\"conversionId161979116029500129\",\"creationTime\":\"2021-04-30T13:59:22.0599934Z\",\"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}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "7014", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:24 GMT", + "ms-cv": "NwuvQ+Mp4E+5JXGIyAKl9w.0", + "x-content-type-options": "nosniff" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "conversionId": "conversionId161979116029500129" + }, + "newDate": {} + }, + "hash": "8c0a0f10068e4ab75bfa4fbdfe2c94e8" +} \ No newline at end of file diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json new file mode 100644 index 000000000000..9eae1a724741 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_can_start_a_session.json @@ -0,0 +1,522 @@ +{ + "recordings": [ + { + "method": "GET", + "url": "https://sts.eastus2.mixedreality.azure.com/Accounts/00000000-1111-2222-3333-444455556666/token", + "query": { + "api-version": "2019-02-28-preview" + }, + "requestBody": null, + "status": 200, + "response": "{\"AccessToken\":\"\"}", + "responseHeaders": { + "cache-control": "no-store,no-cache", + "content-length": "1219", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:25:12 GMT", + "ms-cv": "GosT3yrFvEGhrMFkLF5lNg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "PUT", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": "{\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\"}", + "status": 201, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:25:12 GMT", + "ms-cv": "LTuW12JFFEm+UKgF3x2QQw.0", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:25:12 GMT", + "ms-cv": "4tkw8z/oeUOmGi3+utVOiQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:25:12 GMT", + "ms-cv": "6V6hCHTY1kmLlMqY3EHfgQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":4,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:25:13 GMT", + "ms-cv": "TeueQf8ea0GuUt1OtnLmfA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "PATCH", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": "{\"maxLeaseTimeMinutes\":5}", + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:25:13 GMT", + "ms-cv": "tWPQOWC+kUuY+elyrKekuA.0", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:25:13 GMT", + "ms-cv": "eTIcaCajoUq+cBJNcxn/dw.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:25:23 GMT", + "ms-cv": "E8n6+Yik4UCbM1BIdZdiHA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:25:33 GMT", + "ms-cv": "zBb5TsEX7U2UUKs8PYYFsQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:25:43 GMT", + "ms-cv": "JAyP8EXQkkS9JFKoES8qCg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:25:53 GMT", + "ms-cv": "5ZzVF4nbJkunDR2GbwCJZg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:26:04 GMT", + "ms-cv": "HtjmR/YTK0WcaF3pNlyYfw.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:26:14 GMT", + "ms-cv": "UGzm000Ln0m4/y6Y6AJQXg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:26:24 GMT", + "ms-cv": "gZtDcfZFeEO4xm+EgjUoPA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:26:34 GMT", + "ms-cv": "TB5QKoLZ5ES8Ie14RNAKbQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:26:44 GMT", + "ms-cv": "nM/WMntuck6W1CbetiAU/g.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:26:54 GMT", + "ms-cv": "PDS5L+Hwc0mT6ld50LFSUA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:27:05 GMT", + "ms-cv": "poMrrttI40WihLhoMy6YSQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:27:15 GMT", + "ms-cv": "f8amqtPpW06pG/PP7N3gcg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:27:25 GMT", + "ms-cv": "vjaWrhECOkGmzIeQXetgAg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:27:35 GMT", + "ms-cv": "CwVYM19JCkKYcvA8YoZnLw.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:27:45 GMT", + "ms-cv": "288e3aUeNkyA67KXC+rgCA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"elapsedTimeMinutes\":0,\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Starting\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "172", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:27:55 GMT", + "ms-cv": "25kXfI5RKkqRSsVmSJABqw.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"arrInspectorPort\":59540,\"handshakePort\":62073,\"elapsedTimeMinutes\":0,\"hostname\":\"1362320837-d19c5c2e-86ed-466d-8708-66a1a6369157.remoterendering.vm.eastus2.mixedreality.azure.com\",\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Ready\",\"teraflops\":8.1}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "343", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:28:06 GMT", + "ms-cv": "8CP7b3Co2U+ai2tRwncMNA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"sessions\":[{\"id\":\"sessionId162100951102003468\",\"creationTime\":\"2021-05-14T16:25:13.5686988+00:00\",\"arrInspectorPort\":59540,\"handshakePort\":62073,\"elapsedTimeMinutes\":0,\"hostname\":\"1362320837-d19c5c2e-86ed-466d-8708-66a1a6369157.remoterendering.vm.eastus2.mixedreality.azure.com\",\"maxLeaseTimeMinutes\":5,\"size\":\"Standard\",\"status\":\"Ready\",\"teraflops\":8.1}]}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "358", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 14 May 2021 16:28:08 GMT", + "ms-cv": "UcZ/VjtHr0+rn1nWXsmknQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "POST", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100951102003468/:stop", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 204, + "response": "", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "date": "Fri, 14 May 2021 16:28:08 GMT", + "ms-cv": "Lb3FjYvR8EOY0RNe8EvKGg.0", + "x-content-type-options": "nosniff" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "sessionId": "sessionId162100951102003468" + }, + "newDate": {} + }, + "hash": "9fb044520b5b46cc5068e1f2a4812c78" +} \ No newline at end of file diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.json b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.json new file mode 100644 index 000000000000..14cb6a604959 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.json @@ -0,0 +1,48 @@ +{ + "recordings": [ + { + "method": "GET", + "url": "https://sts.eastus2.mixedreality.azure.com/Accounts/00000000-1111-2222-3333-444455556666/token", + "query": { + "api-version": "2019-02-28-preview" + }, + "requestBody": null, + "status": 200, + "response": "{\"AccessToken\":\"\"}", + "responseHeaders": { + "cache-control": "no-store,no-cache", + "content-length": "1219", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:24 GMT", + "ms-cv": "E4zeGZyCGUKoKzKkkrWKfQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "PUT", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122504808396", + "query": { + "api-version": "2021-01-01" + }, + "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\"}}}", + "status": 403, + "response": "{\"error\":{\"code\":\"DelegatedResourceAccessError\",\"message\":\"Error accessing connected storage account due to insufficient permissions. Check if the Mixed Reality resource has correct permissions assigned. Documentation on how to link Remote Rendering Accounts to storage can be found here: https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts.\"}}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "390", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:24 GMT", + "ms-cv": "T+PTfj+/w02sOtxv+AzD9g.0", + "x-content-type-options": "nosniff" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "conversionId": "conversionId161979122504808396" + }, + "newDate": {} + }, + "hash": "5448f09c89c3f5531d50d3a4a5de8701" +} \ No newline at end of file diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.json b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.json new file mode 100644 index 000000000000..8882f4b0c1ec --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.json @@ -0,0 +1,48 @@ +{ + "recordings": [ + { + "method": "GET", + "url": "https://sts.eastus2.mixedreality.azure.com/Accounts/00000000-1111-2222-3333-444455556666/token", + "query": { + "api-version": "2019-02-28-preview" + }, + "requestBody": null, + "status": 200, + "response": "{\"AccessToken\":\"\"}", + "responseHeaders": { + "cache-control": "no-store,no-cache", + "content-length": "1219", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:06:19 GMT", + "ms-cv": "PS9kmyHmkE2Tp/PrwQsW1w.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "PUT", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979157852807991", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": "{\"maxLeaseTimeMinutes\":-4,\"size\":\"Standard\"}", + "status": 400, + "response": "{\"error\":{\"code\":\"BadRequest\",\"message\":\"The maxLeaseTimeMinutes value cannot be negative.\"}}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "93", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:06:18 GMT", + "ms-cv": "rh7nOOuilkWXYdZegwmKzQ.0", + "x-content-type-options": "nosniff" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "sessionId": "sessionId161979157852807991" + }, + "newDate": {} + }, + "hash": "4e7adffdfb7597f9d798eeab931c41cb" +} \ No newline at end of file diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.json b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.json new file mode 100644 index 000000000000..43085ef7d482 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/browsers/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.json @@ -0,0 +1,408 @@ +{ + "recordings": [ + { + "method": "GET", + "url": "https://sts.eastus2.mixedreality.azure.com/Accounts/00000000-1111-2222-3333-444455556666/token", + "query": { + "api-version": "2019-02-28-preview" + }, + "requestBody": null, + "status": 200, + "response": "{\"AccessToken\":\"\"}", + "responseHeaders": { + "cache-control": "no-store,no-cache", + "content-length": "1219", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:25 GMT", + "ms-cv": "Npo8/OTjr0iwBq+vtU5AWg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "PUT", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": "{\"settings\":{\"inputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"storageContainerReadListSas\":\"arr_sas_token\",\"blobPrefix\":\"Input\",\"relativeInputAssetPath\":\"boxWhichDoesNotExist.fbx\"},\"outputLocation\":{\"storageContainerUri\":\"https://sdktest.blob.core.windows.net/test\",\"storageContainerWriteSas\":\"arr_sas_token\",\"blobPrefix\":\"Output\"}}}", + "status": 201, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:25 GMT", + "ms-cv": "dfGa1hAO3kuow0EPp0Hntg.0", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:26 GMT", + "ms-cv": "Dht9xqItcEeFCaMaW7Ecag.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:26 GMT", + "ms-cv": "nKuoCkQTwkWt7d7nV2oaNg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:27 GMT", + "ms-cv": "vxm/zCt3AUC08zmNtTwNnw.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:27 GMT", + "ms-cv": "W7OJK4V4zUWGKsGrtymyxA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:37 GMT", + "ms-cv": "fZsPAka8u0e3hpUluHfBpA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:47 GMT", + "ms-cv": "DGpyWKsEgE66NusR+bgVLg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:00:58 GMT", + "ms-cv": "OQL//nowdEamEt4CiCKj9w.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:01:08 GMT", + "ms-cv": "7bYo+TXKe0eLRdg8uIC1+A.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:01:18 GMT", + "ms-cv": "Un63wOUwhEySNoIV3dusJQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "455", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:01:28 GMT", + "ms-cv": "FfXe7zFwak+IJs04eYT7oA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "452", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:01:39 GMT", + "ms-cv": "PMMzeSVg/kKOWYaD1l9AsA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "452", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:01:49 GMT", + "ms-cv": "c9d5189xEkOQ51Xu9tR6VQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "452", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:01:59 GMT", + "ms-cv": "cP0IhFwFTUCrrMNDcUCFLg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "452", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:09 GMT", + "ms-cv": "V811OpkkIkCqQXA4KJnnPA.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "452", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:20 GMT", + "ms-cv": "0By2gZeBSEal7QGr5mTnWQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "452", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:30 GMT", + "ms-cv": "KnS6IzzqkEmoqdno2Mjphg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "452", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:40 GMT", + "ms-cv": "/7fR3lVHtUqp0iXxNrXaSQ.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + }, + { + "method": "GET", + "url": "https://remoterendering.eastus2.mixedreality.azure.com/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979122585102248", + "query": { + "api-version": "2021-01-01" + }, + "requestBody": null, + "status": 200, + "response": "{\"id\":\"conversionId161979122585102248\",\"creationTime\":\"2021-04-30T14:00:25.9571606Z\",\"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\"}", + "responseHeaders": { + "api-supported-versions": "2021-01-01-preview, 2021-01-01", + "cache-control": "no-store,no-cache", + "content-length": "561", + "content-type": "application/json; charset=utf-8", + "date": "Fri, 30 Apr 2021 14:02:51 GMT", + "ms-cv": "O0/cWQXTJ0yn/Eeg35naPg.0", + "pragma": "no-cache", + "x-content-type-options": "nosniff" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "conversionId": "conversionId161979122585102248" + }, + "newDate": {} + }, + "hash": "4efe19ec8e60c3195f7266f8389d63c8" +} \ No newline at end of file diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js new file mode 100644 index 000000000000..282e8335821d --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_can_convert_successfully.js @@ -0,0 +1,259 @@ +let nock = require('nock'); + +module.exports.hash = "15351b68172a2a7defdf4f33342ade03"; + +module.exports.testInfo = {"uniqueName":{"conversionId":"conversionId161979083179608548"},"newDate":{}} + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Fri, 30 Apr 2021 13:53:52 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'hLKiQk2b6kizt8jQ8JvE4g.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .put('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548', {"settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerReadListSas":"arr_sas_token","blobPrefix":"Input","relativeInputAssetPath":"testBox.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerWriteSas":"arr_sas_token","blobPrefix":"Output"}}}) + .query(true) + .reply(201, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:53:53 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '428', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'DDi+ubROTEu0aE1SNhJD3A.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') + .query(true) + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:53:53 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '428', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'MvGf6F9Nz0m4i15pE1M+wQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') + .query(true) + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:53:53 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '428', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'jgxsOMIX1kix9UpTTpQ7IQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') + .query(true) + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:53:53 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '428', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'Xg0RBqUtaEeSeI/LC49TIw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') + .query(true) + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:03 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '425', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'Gn3enW/73EyOxMcoUWPaIw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') + .query(true) + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:14 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '425', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'xS7ApSxOCUK/Q6PDoVDisg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') + .query(true) + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:24 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '425', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'EniRq3UL00WusW1BElYY4w.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') + .query(true) + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:34 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '425', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'ycUTD3OImUitbOwJ9Nb++Q.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') + .query(true) + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:44 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '425', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'heKLRAtPw0u1YXF2YNWs9Q.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979083179608548') + .query(true) + .reply(200, {"id":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:55 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '524', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '/znX+vvagUqPszc5AZNohg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions') + .query(true) + .reply(200, {"conversions":[{"id":"9456e78f-4e86-45d5-9a3a-42f32d98ebfa","creationTime":"2021-04-30T09:42:54.4006831Z","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":"4bd0faf2-7279-4351-8255-ff7b1852aa77","creationTime":"2021-04-30T11:04:28.3608266Z","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":"5853b38a-a174-44e4-9018-7c324e2d2ba7","creationTime":"2021-04-30T11:17:01.4900529Z","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":"9e063aff-0aeb-4ca5-8796-b708680fcf32","creationTime":"2021-04-30T11:25:43.4274107Z","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":"conversionId161978216546004121","creationTime":"2021-04-30T11:29:27.2323156Z","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":"conversionId161978242766201357","creationTime":"2021-04-30T11:33:47.8966192Z","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":"conversionId161978289255208378","creationTime":"2021-04-30T11:41:35.9073281Z","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":"conversionId161978296301000875","creationTime":"2021-04-30T11:42:43.2118581Z","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":"a6faf3bc-3c10-4ce3-9548-545da9ef2423","creationTime":"2021-04-30T11:49:50.4940039Z","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":"b57d6ad3-0077-478b-967a-0219a0fab5cc","creationTime":"2021-04-30T13:12:21.8193622Z","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":"conversionId161979083179608548","creationTime":"2021-04-30T13:53:53.963195Z","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}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:55 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '5927', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '/Vs8TjEAAEagOBhmF6bWuA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js new file mode 100644 index 000000000000..80d177b3a29e --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_can_start_a_session.js @@ -0,0 +1,559 @@ +let nock = require('nock'); + +module.exports.hash = "6822ea4489dc148fe8ffad7a20806d2e"; + +module.exports.testInfo = {"uniqueName":{"sessionId":"sessionId162100057722809393"},"newDate":{}} + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Fri, 14 May 2021 13:56:18 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'StoLqdra6E6J9q/Z6klbQw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .put('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393', {"maxLeaseTimeMinutes":4,"size":"Standard"}) + .query(true) + .reply(201, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:56:18 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'v/hmx7jChUekfRnVpoUcvA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:56:19 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'NwwLFYnb8kGLLuWCZe1cwg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:56:19 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '1OjlEFvxlE2Yn6DoyhX9Kw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":4,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:56:19 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'pPeVjDnhxkaVx2aIWh8f+g.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .patch('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393', {"maxLeaseTimeMinutes":5}) + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:56:19 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'rjw2qlWGKUCwlg+i+P2Hfg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:56:19 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '649zDlT9Y0uItMTv2mQeKQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:56:29 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'k8YZTsk310ufmMfxENLvZQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:56:39 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'bh/drvAcZkqHmKhXokg1UA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:56:50 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'oAtprrz3CEqHhKgq2Ni3lQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:57:00 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'slr2aRBDaEW/MDwnH2l3nQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:57:10 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'Bbql6LXQi0ea+sRkBy1kCQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:57:20 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'vKQgIz8sXk+D6HgrpHMC3A.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:57:30 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'tseH83iVdU+C7iwj868amw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:57:40 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'e5mT5c9hs0WvbD08D1hyiQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:57:50 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'JPPEqu6Sg0qcTZ2M5++8Kw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:58:00 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '35UaDa4VH0en+7GZ0a0FhA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:58:11 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'cUyV+gZbvkyFhDwoTJZ5Mw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:58:21 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'ZPZk0deNz06QwgMRBGigbg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:58:31 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'rQDIt0prXU2YUPh/NrzvnA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:58:41 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'sgp5XAyFBUKmcJUzhp2ZUA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:58:51 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '8Pej+Y57WEOo+UclfCHh4w.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","elapsedTimeMinutes":0,"maxLeaseTimeMinutes":5,"size":"Standard","status":"Starting"}, [ + 'Date', + 'Fri, 14 May 2021 13:59:01 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '172', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '7uCLGpQpS0mJfSX3mT3XKA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393') + .query(true) + .reply(200, {"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","arrInspectorPort":50830,"handshakePort":61353,"elapsedTimeMinutes":0,"hostname":"1362320837-4b5f741c-707f-43fd-87dc-3e048677f9b8.remoterendering.vm.eastus2.mixedreality.azure.com","maxLeaseTimeMinutes":5,"size":"Standard","status":"Ready","teraflops":8.1}, [ + 'Date', + 'Fri, 14 May 2021 13:59:12 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '343', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'w+ckxqtEPkOyRAm+4uq6Rg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/sessions') + .query(true) + .reply(200, {"sessions":[{"id":"sessionId162100057722809393","creationTime":"2021-05-14T13:56:19.7826038+00:00","arrInspectorPort":50830,"handshakePort":61353,"elapsedTimeMinutes":0,"hostname":"1362320837-4b5f741c-707f-43fd-87dc-3e048677f9b8.remoterendering.vm.eastus2.mixedreality.azure.com","maxLeaseTimeMinutes":5,"size":"Standard","status":"Ready","teraflops":8.1}]}, [ + 'Date', + 'Fri, 14 May 2021 13:59:12 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '358', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'iXCkt2k7zkeXydGX34/J1A.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .post('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId162100057722809393/:stop') + .query(true) + .reply(204, "", [ + 'Date', + 'Fri, 14 May 2021 13:59:12 GMT', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'H9Zlro+/A02pHNmVJtrnJg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js new file mode 100644 index 000000000000..da8c25d51525 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_throws_correct_exception_on_no_access.js @@ -0,0 +1,43 @@ +let nock = require('nock'); + +module.exports.hash = "4482e74cdede34465d36732c60dae28f"; + +module.exports.testInfo = {"uniqueName":{"conversionId":"conversionId161979089668904294"},"newDate":{}} + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:56 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + '6jeOh+NNn0e+G1+Br9J+Fw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .put('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089668904294', {"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"}}}) + .query(true) + .reply(403, {"error":{"code":"DelegatedResourceAccessError","message":"Error accessing connected storage account due to insufficient permissions. Check if the Mixed Reality resource has correct permissions assigned. Documentation on how to link Remote Rendering Accounts to storage can be found here: https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts."}}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:57 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '390', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'r8XnpG1A40uqRYi4xrhhZg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js new file mode 100644 index 000000000000..a268d15b6fac --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_throws_the_correct_exception_on_invalid_session_properties.js @@ -0,0 +1,43 @@ +let nock = require('nock'); + +module.exports.hash = "acef1917e9635185f91a50bd8cf382ef"; + +module.exports.testInfo = {"uniqueName":{"sessionId":"sessionId161979114585506877"},"newDate":{}} + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Fri, 30 Apr 2021 13:59:05 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'EYS/fr9qGECyJWUZ+i/4aw.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .put('/accounts/00000000-1111-2222-3333-444455556666/sessions/sessionId161979114585506877', {"maxLeaseTimeMinutes":-4,"size":"Standard"}) + .query(true) + .reply(400, {"error":{"code":"BadRequest","message":"The maxLeaseTimeMinutes value cannot be negative."}}, [ + 'Date', + 'Fri, 30 Apr 2021 13:59:06 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '93', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'yWZb5GN80UC+N/AhYPyjpg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js new file mode 100644 index 000000000000..e74d35e22ba0 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/recordings/node/remoterendering_functional_tests/recording_will_fail_in_the_correct_way_on_missing_asset.js @@ -0,0 +1,285 @@ +let nock = require('nock'); + +module.exports.hash = "98eb3da984f30ffa04babd4ee34a4e41"; + +module.exports.testInfo = {"uniqueName":{"conversionId":"conversionId161979089851105096"},"newDate":{}} + +nock('https://sts.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/Accounts/00000000-1111-2222-3333-444455556666/token') + .query(true) + .reply(200, {"AccessToken":""}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:58 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1219', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'MS-CV', + 'QYkqnFqHRECeTNx0003F0A.0', + 'X-Content-Type-Options', + 'nosniff' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .put('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096', {"settings":{"inputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerReadListSas":"arr_sas_token","blobPrefix":"Input","relativeInputAssetPath":"boxWhichDoesNotExist.fbx"},"outputLocation":{"storageContainerUri":"https://sdktest.blob.core.windows.net/test","storageContainerWriteSas":"arr_sas_token","blobPrefix":"Output"}}}) + .query(true) + .reply(201, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:57 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '454', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '/Vo8M/0qokSNbs7XzDXwvQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') + .query(true) + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:57 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '454', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'CsLrtMoPvEihGk7pSjwWpw.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') + .query(true) + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:58 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '454', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '83qR9O3Dk0epgo4n6E6ETg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') + .query(true) + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:58 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '454', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'B7097SyzHEGVc2Zj6pdH9Q.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') + .query(true) + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:54:58 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '454', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'glzsHqrWY0GXQel1fPnPUQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') + .query(true) + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:55:08 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '451', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'TnUNzUuA9EW3YFIMBPkRuQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') + .query(true) + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:55:18 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '451', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + '3TsdGsK1J06wF8i4u8x+YA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') + .query(true) + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:55:29 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '451', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'FhW+XJwwakiC52FVnK0M5A.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') + .query(true) + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:55:39 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '451', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'jSJRlFZg6U+rqICAFgUrdQ.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') + .query(true) + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:55:49 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '451', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'PPde9mNykkakSIxPxKMgYg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') + .query(true) + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:56:00 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '451', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'mPT+16K3g0K7DDCawJTCpA.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); + +nock('https://remoterendering.eastus2.mixedreality.azure.com:443', {"encodedQueryParams":true}) + .get('/accounts/00000000-1111-2222-3333-444455556666/conversions/conversionId161979089851105096') + .query(true) + .reply(200, {"id":"conversionId161979089851105096","creationTime":"2021-04-30T13:54:58.578215Z","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"}, [ + 'Date', + 'Fri, 30 Apr 2021 13:56:10 GMT', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '560', + 'Cache-Control', + 'no-store,no-cache', + 'Pragma', + 'no-cache', + 'X-Content-Type-Options', + 'nosniff', + 'MS-CV', + 'xnmxgHrsRUW0RnQ2tYczRg.0', + 'api-supported-versions', + '2021-01-01-preview, 2021-01-01' +]); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/review/mixed-reality-remote-rendering.api.md b/sdk/remoterendering/mixed-reality-remote-rendering/review/mixed-reality-remote-rendering.api.md new file mode 100644 index 000000000000..3b9ab75d7e45 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/review/mixed-reality-remote-rendering.api.md @@ -0,0 +1,276 @@ +## API Report File for "@azure/mixed-reality-remote-rendering" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { AccessToken } from '@azure/core-auth'; +import { AzureKeyCredential } from '@azure/core-auth'; +import { CommonClientOptions } from '@azure/core-client'; +import { OperationOptions } from '@azure/core-client'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { PollerLike } from '@azure/core-lro'; +import { PollOperationState } from '@azure/core-lro'; +import { TokenCredential } from '@azure/core-auth'; + +// @public +export type AssetConversion = NonStartedAssetConversion | RunningAssetConversion | SucceededAssetConversion | FailedAssetConversion | CancelledAssetConversion; + +// @public +export interface AssetConversionBase { + conversionId: string; + createdOn: Date; + settings: AssetConversionSettings; +} + +// @public +export interface AssetConversionInputSettings { + blobPrefix?: string; + relativeInputAssetPath: string; + storageContainerReadListSas?: string; + storageContainerUrl: string; +} + +// @public +export interface AssetConversionOperationState extends PollOperationState { + latestResponse: AssetConversion; +} + +// @public +export interface AssetConversionOutput { + readonly outputAssetUrl?: string; +} + +// @public +export interface AssetConversionOutputSettings { + blobPrefix?: string; + outputAssetFilename?: string; + storageContainerUrl: string; + storageContainerWriteSas?: string; +} + +// @public +export type AssetConversionPollerLike = PollerLike; + +// @public +export interface AssetConversionPollerOptions { + intervalInMs?: number; +} + +// @public +export interface AssetConversionSettings { + inputSettings: AssetConversionInputSettings; + outputSettings: AssetConversionOutputSettings; +} + +// @public +export type AssetConversionStatus = string; + +// @public +export type BeginConversionOptions = AssetConversionPollerOptions & OperationOptions; + +// @public +export type BeginSessionOptions = RenderingSessionPollerOptions & OperationOptions; + +// @public +export interface CancelledAssetConversion extends AssetConversionBase { + status: "Cancelled"; +} + +// @public +export type EndSessionOptions = OperationOptions; + +// @public +export interface ErrorRenderingSession extends RenderingSessionBase { + readonly error: RemoteRenderingServiceError; + partialProperties: PartialRenderingSessionProperties; + status: "Error"; +} + +// @public +export interface ExpiredRenderingSession extends RenderingSessionBase { + properties: RenderingSessionProperties; + status: "Expired"; +} + +// @public +export interface FailedAssetConversion extends AssetConversionBase { + error: RemoteRenderingServiceError; + status: "Failed"; +} + +// @public +export type GetConversionOptions = OperationOptions; + +// @public +export type GetSessionOptions = OperationOptions; + +// @public +export enum KnownAssetConversionStatus { + Cancelled = "Cancelled", + Failed = "Failed", + NotStarted = "NotStarted", + Running = "Running", + Succeeded = "Succeeded" +} + +// @public +export enum KnownRenderingServerSize { + Premium = "Premium", + Standard = "Standard" +} + +// @public +export enum KnownRenderingSessionStatus { + Error = "Error", + Expired = "Expired", + Ready = "Ready", + Starting = "Starting", + Stopped = "Stopped" +} + +// @public +export type ListConversionsOptions = OperationOptions; + +// @public +export type ListSessionsOptions = OperationOptions; + +// @public +export interface NonStartedAssetConversion extends AssetConversionBase { + status: "NotStarted"; +} + +// @public +export interface PartialRenderingSessionProperties { + readonly arrInspectorPort?: number; + readonly createdOn?: Date; + readonly elapsedTimeInMinutes?: number; + readonly handshakePort?: number; + readonly host?: string; + readonly teraflops?: number; +} + +// @public +export interface ReadyRenderingSession extends RenderingSessionBase { + properties: RenderingSessionProperties; + status: "Ready"; +} + +// @public +export class RemoteRenderingClient { + constructor(endpoint: string, accountId: string, accountDomain: string, credential: AzureKeyCredential, options?: RemoteRenderingClientOptions); + constructor(endpoint: string, accountId: string, accountDomain: string, credential: TokenCredential, options?: RemoteRenderingClientOptions); + constructor(endpoint: string, accountId: string, credential: AccessToken, options?: RemoteRenderingClientOptions); + beginConversion(conversionId: string, assetConversionSettings: AssetConversionSettings, options?: BeginConversionOptions): Promise; + beginConversion(options: ResumeBeginConversionOptions): Promise; + beginSession(sessionId: string, settings: RenderingSessionSettings, options?: BeginSessionOptions): Promise; + beginSession(options: ResumeBeginSessionOptions): Promise; + endSession(sessionId: string, options?: EndSessionOptions): Promise; + getConversion(conversionId: string, options?: GetConversionOptions): Promise; + getSession(sessionId: string, options?: GetSessionOptions): Promise; + listConversions(options?: ListConversionsOptions): PagedAsyncIterableIterator; + listSessions(options?: ListSessionsOptions): PagedAsyncIterableIterator; + updateSession(sessionId: string, settings: UpdateSessionSettings, options?: UpdateSessionOptions): Promise; +} + +// @public +export interface RemoteRenderingClientOptions extends CommonClientOptions { + authenticationEndpointUrl?: string; +} + +// @public +export class RemoteRenderingServiceError extends Error { + constructor(message: string, code: string); + code: string; + details?: RemoteRenderingServiceError[]; + innerError?: RemoteRenderingServiceError; + target?: string; +} + +// @public +export type RenderingServerSize = string; + +// @public +export type RenderingSession = StartingRenderingSession | ReadyRenderingSession | ErrorRenderingSession | ExpiredRenderingSession | StoppedRenderingSession; + +// @public +export interface RenderingSessionBase { + maxLeaseTimeInMinutes: number; + sessionId: string; + size: RenderingServerSize; +} + +// @public +export interface RenderingSessionOperationState extends PollOperationState { + latestResponse: RenderingSession; +} + +// @public +export type RenderingSessionPollerLike = PollerLike; + +// @public +export interface RenderingSessionPollerOptions { + intervalInMs?: number; +} + +// @public +export interface RenderingSessionProperties { + readonly arrInspectorPort: number; + readonly createdOn: Date; + readonly elapsedTimeInMinutes: number; + readonly handshakePort: number; + readonly host: string; + readonly teraflops: number; +} + +// @public +export interface RenderingSessionSettings { + maxLeaseTimeInMinutes: number; + size: RenderingServerSize; +} + +// @public +export type ResumeBeginConversionOptions = BeginConversionOptions & { + resumeFrom: string; +}; + +// @public +export type ResumeBeginSessionOptions = BeginSessionOptions & { + resumeFrom: string; +}; + +// @public +export interface RunningAssetConversion extends AssetConversionBase { + status: "Running"; +} + +// @public +export interface StartingRenderingSession extends RenderingSessionBase { + partialProperties: PartialRenderingSessionProperties; + status: "Starting"; +} + +// @public +export interface StoppedRenderingSession extends RenderingSessionBase { + partialProperties: PartialRenderingSessionProperties; + status: "Stopped"; +} + +// @public +export interface SucceededAssetConversion extends AssetConversionBase { + readonly output: AssetConversionOutput; + status: "Succeeded"; +} + +// @public +export type UpdateSessionOptions = OperationOptions; + +// @public +export interface UpdateSessionSettings { + maxLeaseTimeInMinutes: number; +} + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/rollup.config.js b/sdk/remoterendering/mixed-reality-remote-rendering/rollup.config.js new file mode 100644 index 000000000000..5d7deee44c14 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/rollup.config.js @@ -0,0 +1,3 @@ +import { makeConfig } from "@azure/dev-tool/shared-config/rollup"; + +export default makeConfig(require("./package.json")); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/sample.env b/sdk/remoterendering/mixed-reality-remote-rendering/sample.env new file mode 100644 index 000000000000..42de27e71c0a --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/sample.env @@ -0,0 +1,53 @@ +# Used in most samples. Retrieve these values from the Azure Portal. + +# To use Azure Remote Rendering, you need a Remote Rendering Account. +# This is created in a specific domain. + +REMOTERENDERING_ARR_ACCOUNT_ID="" +REMOTERENDERING_ARR_ACCOUNT_DOMAIN="" + +# The easiest way to authenticate the account, is with an account key. + +REMOTERENDERING_ARR_ACCOUNT_KEY="" + +# A more sophisticated way to authenticate is using Azure AD as a service principal +# for role-based authentication in the tokenAuth sample. +# +# See the documentation for `EnvironmentCredential` at the following link: +# https://docs.microsoft.com/javascript/api/@azure/identity/environmentcredential + +# REMOTERENDERING_TENANT_ID="" +# REMOTERENDERING_CLIENT_ID="" +# REMOTERENDERING_CLIENT_SECRET="" + +# The remote rendering endpoint, which determines the region in which the service performs its work. +# For converting assets, it is preferable to pick a region close to the storage containing the assets. +# 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. + +REMOTERENDERING_ARR_SERVICE_ENDPOINT="" + +# For sample which perform conversion, these define the storage account which carry the assets. + +REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME="" +REMOTERENDERING_ARR_BLOB_CONTAINER_NAME="" + +# The recommended way of providing ARR with access to a storage account is to link them +# to the Remote Rendering account. See: +# https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts +# Since it can take a little time for the linking to propagate, the tests use SAS tokens instead +# to provide access to blob storage. + +REMOTERENDERING_ARR_SAS_TOKEN="" + +# Some samples can use these, but if they are not defined the samples will fall back to the +# ones defined above. + +# REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME2="" +# REMOTERENDERING_ARR_BLOB_CONTAINER_NAME2="" + +# Our tests assume that TEST_MODE is "playback" by default. You can change it +# to "record" to generate new recordings, or "live" to bypass the recorder +# entirely. + +# TEST_MODE="playback" diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/listConversions.ts b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/listConversions.ts new file mode 100644 index 000000000000..54c953ee7493 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/listConversions.ts @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * @summary Demonstrates using the Azure Remote Rendering SDK to list conversions. + */ + +/// + +import { RemoteRenderingClient } from "@azure/mixed-reality-remote-rendering"; +import { AzureKeyCredential } from "@azure/core-auth"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set this environment variables or edit the following values +const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; +const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; +const accountKey = process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || ""; +const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; + +export async function main() { + console.log("== Convert an asset example =="); + + console.log("== Creating a client =="); + + let credential = new AzureKeyCredential(accountKey); + + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); + + console.log("== Starting listing conversions =="); + + for await (const conversion of client.listConversions()) { + if (conversion.status === "Succeeded") { + console.log( + `Conversion ${conversion.conversionId} succeeded: Output written to ${conversion.output?.outputAssetUrl}` + ); + } else if (conversion.status === "Failed") { + console.log( + `Conversion ${conversion.conversionId} failed: ${conversion.error.code} ${conversion.error.message}` + ); + } + } + + console.log("== All conversions listed =="); +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/listSessions.ts b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/listSessions.ts new file mode 100644 index 000000000000..32f2c705ac3b --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/listSessions.ts @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * @summary Demonstrates using the Azure Remote Rendering SDK to list conversions. + */ + +/// + +import { RemoteRenderingClient } from "@azure/mixed-reality-remote-rendering"; +import { AzureKeyCredential } from "@azure/core-auth"; +import { delay } from "@azure/core-util"; + +import { v4 as uuid } from "uuid"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set this environment variables or edit the following values +const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; +const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; +const accountKey = process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || ""; +const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; + +export async function main() { + console.log("== Convert an asset example =="); + + console.log("== Creating a client =="); + + let credential = new AzureKeyCredential(accountKey); + + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); + + console.log("== Creating a test session to query =="); + + const sessionId: string = uuid(); + await client.beginSession(sessionId, { + maxLeaseTimeInMinutes: 5, + size: "Standard" + }); + await delay(10000); + + console.log("== Starting listing sessions =="); + + for await (const session of client.listSessions()) { + if (session.status === "Starting") { + console.log(`Session ${session.sessionId} is starting`); + } else if (session.status === "Ready") { + console.log(`Session ${session.sessionId} is ready`); + } + } + + console.log("== All sessions listed =="); + + console.log("== Stop the test session =="); + + await client.endSession(sessionId); +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/moreComplexConversion.ts b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/moreComplexConversion.ts new file mode 100644 index 000000000000..921fa4e32ef9 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/moreComplexConversion.ts @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * @summary Demonstrates using the Azure Remote Rendering SDK to convert an asset. + */ + +/// + +import { v4 as uuid } from "uuid"; + +import { + RemoteRenderingClient, + AssetConversionInputSettings, + AssetConversionOutputSettings, + AssetConversionSettings, + AssetConversionPollerLike, + AssetConversion +} from "@azure/mixed-reality-remote-rendering"; +import { + DeviceCodeCredential, + DeviceCodeInfo, + ClientSecretCredential, + DefaultAzureCredential +} from "@azure/identity"; +import { AzureKeyCredential } from "@azure/core-auth"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set this environment variables or edit the following values +const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; +const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; +const accountKey = process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || ""; + +const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; +const storageAccountName = + process.env["REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME"] || ""; +const blobContainerName = + process.env["REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"] || ""; +// Fall back to the same storage account. +const storageAccountName2 = + process.env["REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME2"] || storageAccountName; +// Fall back to the same blob container. +const blobContainerName2 = + process.env["REMOTERENDERING_ARR_BLOB_CONTAINER_NAME2"] || blobContainerName; + +const tenantId = process.env["REMOTERENDERING_TENANT_ID"] || ""; +const clientId = process.env["REMOTERENDERING_CLIENT_ID"] || ""; +const clientSecret = process.env["REMOTERENDERING_CLIENT_SECRET"] || ""; + +export function getClientWithAccountKey() { + const credential = new AzureKeyCredential(accountKey); + + return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); +} + +export function getClientWithAAD() { + const credential = new ClientSecretCredential(tenantId, clientId, clientSecret, { + authorityHost: "https://login.microsoftonline.com/" + tenantId + }); + + return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential, { + authenticationEndpointUrl: "https://sts.mixedreality.azure.com" + }); +} + +export function getClientWithDeviceCode() { + const deviceCodeCallback = (deviceCodeInfo: DeviceCodeInfo) => { + console.debug(deviceCodeInfo.message); + console.log(deviceCodeInfo.message); + }; + + const credential = new DeviceCodeCredential(tenantId, clientId, deviceCodeCallback, { + authorityHost: "https://login.microsoftonline.com/" + tenantId + }); + + return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential, { + authenticationEndpointUrl: "https://sts.mixedreality.azure.com/mixedreality.signin" + }); +} + +export function getClientWithDefaultAzureCredential() { + const credential = new DefaultAzureCredential(); + + return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential, { + authenticationEndpointUrl: "https://sts.mixedreality.azure.com" + }); +} + +export async function main() { + console.log("== Convert a more complex asset example =="); + + console.log("== Creating a client =="); + + const client = getClientWithAccountKey(); + + const inputStorageUrl = + "https://" + storageAccountName + ".blob.core.windows.net/" + blobContainerName; + const outputStorageUrl = + "https://" + storageAccountName2 + ".blob.core.windows.net/" + blobContainerName2; + + const inputSettings: AssetConversionInputSettings = { + storageContainerUrl: inputStorageUrl, + blobPrefix: "Bicycle", + relativeInputAssetPath: "bicycle.gltf" + }; + const outputSettings: AssetConversionOutputSettings = { + storageContainerUrl: outputStorageUrl, + blobPrefix: "ConvertedBicycle" + }; + const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + + const conversionId = uuid(); + + const conversionPoller: AssetConversionPollerLike = await client.beginConversion( + conversionId, + conversionSettings + ); + + console.log("== Polling =="); + + const conversion: AssetConversion = await conversionPoller.pollUntilDone(); + + console.log("== Check results =="); + + // Use a string for the enum. + if (conversion.status === "Succeeded") { + console.log("Conversion succeeded: Output written to " + conversion.output?.outputAssetUrl); + } else if (conversion.status === "Failed") { + console.log("Conversion failed: " + conversion.error.code + " " + conversion.error.message); + } +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/session.ts b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/session.ts new file mode 100644 index 000000000000..805b49be1a97 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/session.ts @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * @summary Demonstrates using the Azure Remote Rendering SDK to start a session. + */ + +/// + +import { v4 as uuid } from "uuid"; + +import { + RemoteRenderingClient, + RenderingSessionSettings, + RenderingSessionPollerLike, + RenderingSession +} from "@azure/mixed-reality-remote-rendering"; +import { AzureKeyCredential } from "@azure/core-auth"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set this environment variables or edit the following values +const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; +const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; +const accountKey = process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || ""; + +const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; + +export async function main() { + console.log("== Start a session example =="); + + console.log("== Creating a client =="); + + let credential = new AzureKeyCredential(accountKey); + + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); + + console.log("== Starting the session =="); + + const sessionSettings: RenderingSessionSettings = { + maxLeaseTimeInMinutes: 4, + size: "Standard" + }; + + // A randomly generated UUID is a good choice for a conversionId. + const sessionId = uuid(); + + const sessionPoller: RenderingSessionPollerLike = await client.beginSession( + sessionId, + sessionSettings + ); + + console.log("== Polling =="); + + const session: RenderingSession = await sessionPoller.pollUntilDone(); + + console.log("== Check results =="); + + if (session.status == "Ready") { + console.log("The rendering session is ready"); + } else if (session.status == "Error") { + console.log("The rendering session encountered an error: " + session.error.message); + } + + client.endSession(sessionId); +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/simpleConversion.ts b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/simpleConversion.ts new file mode 100644 index 000000000000..c7e0511241eb --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/samples-dev/simpleConversion.ts @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * @summary Demonstrates using the Azure Remote Rendering SDK to convert an asset. + */ + +/// + +import { v4 as uuid } from "uuid"; + +import { + RemoteRenderingClient, + AssetConversionInputSettings, + AssetConversionOutputSettings, + AssetConversionSettings, + AssetConversionPollerLike, + AssetConversion +} from "@azure/mixed-reality-remote-rendering"; +import { AzureKeyCredential } from "@azure/core-auth"; + +// Load the .env file if it exists +import * as dotenv from "dotenv"; +dotenv.config(); + +// You will need to set this environment variables or edit the following values +const accountDomain = process.env["REMOTERENDERING_ARR_ACCOUNT_DOMAIN"] || ""; +const accountId = process.env["REMOTERENDERING_ARR_ACCOUNT_ID"] || ""; +const accountKey = process.env["REMOTERENDERING_ARR_ACCOUNT_KEY"] || ""; +const serviceEndpoint = process.env["REMOTERENDERING_ARR_SERVICE_ENDPOINT"] || ""; +const storageAccountName = + process.env["REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME"] || ""; +const blobContainerName = + process.env["REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"] || ""; + +export async function main() { + console.log("== Convert an asset example =="); + + console.log("== Creating a client =="); + + let credential = new AzureKeyCredential(accountKey); + + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); + + let storageContainerUrl = + "https://" + storageAccountName + ".blob.core.windows.net/" + blobContainerName; + + console.log("== Starting the conversion =="); + + const inputSettings: AssetConversionInputSettings = { + storageContainerUrl, + relativeInputAssetPath: "box.fbx" + }; + const outputSettings: AssetConversionOutputSettings = { + storageContainerUrl + }; + const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + + // A randomly generated UUID is a good choice for a conversionId. + const conversionId = uuid(); + + const conversionPoller: AssetConversionPollerLike = await client.beginConversion( + conversionId, + conversionSettings + ); + + console.log("== Polling =="); + + const conversion: AssetConversion = await conversionPoller.pollUntilDone(); + + console.log("== Check results =="); + + if (conversion.status === "Succeeded") { + console.log("Conversion succeeded: Output written to " + conversion.output?.outputAssetUrl); + } else if (conversion.status === "Failed") { + console.log("Conversion failed: " + conversion.error.code + " " + conversion.error.message); + } +} + +main().catch((err) => { + console.error("The sample encountered an error:", err); +}); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/authenticationEndpoint.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/authenticationEndpoint.ts new file mode 100644 index 000000000000..9885f03acd09 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/authenticationEndpoint.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/** + * Constructs the authentication endpoint from a Mixed Reality account domain. + * @internal + * @param accountDomain - The Mixed Reality account domain. + */ +export function constructAuthenticationEndpointFromDomain(accountDomain: string): string { + return `https://sts.${accountDomain}`; +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/mixedRealityAccountKeyCredential.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/mixedRealityAccountKeyCredential.ts new file mode 100644 index 000000000000..8e7640ee279d --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/mixedRealityAccountKeyCredential.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { KeyCredential, AccessToken, GetTokenOptions, TokenCredential } from "@azure/core-auth"; + +const maxTimestampMs = 8640000000000000; + +/** + * Represents an object used for Mixed Reality account key authentication. + * @internal + */ +export class MixedRealityAccountKeyCredential implements TokenCredential { + private readonly accountKey: KeyCredential; + + /** + * Creates an instance of a MixedRealityAccountKeyCredential. + * @param accountId - The Mixed Reality service account identifier. + * @param accountKey - The Mixed Reality service account primary or secondary key. + */ + constructor(public readonly accountId: string, accountKey: string | KeyCredential) { + if (typeof accountKey === "string") { + this.accountKey = { key: accountKey }; + } else { + this.accountKey = accountKey; + } + } + + /** + * Gets the token provided by this credential. + * + * This method is called automatically by Azure SDK client libraries. You may call this method + * directly, but you must also handle token caching and token refreshing. + * + * @param scopes - The list of scopes for which the token will have access. + * @param options - The options used to configure any requests this + * TokenCredential implementation might make. + */ + getToken(_scopes: string | string[], _options?: GetTokenOptions): Promise { + const result: AccessToken = { + expiresOnTimestamp: maxTimestampMs, + token: `${this.accountId}:${this.accountKey.key}` + }; + + return Promise.resolve(result); + } +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/mixedRealityTokenCredential.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/mixedRealityTokenCredential.ts new file mode 100644 index 000000000000..eb7f5477fbae --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/mixedRealityTokenCredential.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-auth"; + +import { + MixedRealityStsClient, + MixedRealityStsClientOptions +} from "@azure/mixed-reality-authentication"; + +/** + * Represents a token credential that can be used to access a Mixed Reality service. + * @internal + */ +export class MixedRealityTokenCredential implements TokenCredential { + private stsClient: MixedRealityStsClient; + + constructor( + accountId: string, + accountDomain: string, + credential: TokenCredential, + options: MixedRealityStsClientOptions + ) { + this.stsClient = new MixedRealityStsClient(accountId, accountDomain, credential, options); + } + + getToken(_scopes: string | string[], options?: GetTokenOptions): Promise { + return this.stsClient.getToken(options); + } +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/staticAccessTokenCredential.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/staticAccessTokenCredential.ts new file mode 100644 index 000000000000..e2866cc654ac --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/authentication/staticAccessTokenCredential.ts @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-auth"; + +/** + * Represents a static access token credential. + * @internal + */ +export class StaticAccessTokenCredential implements TokenCredential { + private token: AccessToken; + + constructor(token: AccessToken) { + this.token = token; + } + + getToken(_scopes: string | string[], _options?: GetTokenOptions): Promise { + return Promise.resolve(this.token); + } +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/constants.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/constants.ts new file mode 100644 index 000000000000..47dc16dd0f7c --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/constants.ts @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +export const SDK_VERSION: string = "1.0.0-beta.1"; diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/index.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/index.ts new file mode 100644 index 000000000000..e02f01cceb13 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/index.ts @@ -0,0 +1,12 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./models"; +export { RemoteRenderingRestClient } from "./remoteRenderingRestClient"; +export { RemoteRenderingRestClientContext } from "./remoteRenderingRestClientContext"; +export * from "./operationsInterfaces"; diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/index.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/index.ts new file mode 100644 index 000000000000..89d764582bcc --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/index.ts @@ -0,0 +1,459 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +/** Request to start a conversion */ +export interface CreateConversionSettings { + /** Conversion settings describe the origin of input files and destination of output files. */ + settings: AssetConversionSettings; +} + +/** Conversion settings describe the origin of input files and destination of output files. */ +export interface AssetConversionSettings { + /** Conversion input settings describe the origin of conversion input. */ + inputSettings: AssetConversionInputSettings; + /** Conversion output settings describe the destination of conversion output. */ + outputSettings: AssetConversionOutputSettings; +} + +/** Conversion input settings describe the origin of conversion input. */ +export interface AssetConversionInputSettings { + /** The URI of the Azure blob storage container containing the input model. */ + storageContainerUrl: string; + /** An Azure blob storage container shared access signature giving read and list access to the storage container. Optional. If not provided, the Azure Remote Rendering account needs to be linked with the storage account containing the blob container. See https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts for details. For security purposes this field will never be filled out in responses bodies. */ + storageContainerReadListSas?: string; + /** Only Blobs starting with this prefix will be downloaded to perform the conversion. Optional. If not provided, all Blobs from the container will be downloaded. */ + blobPrefix?: string; + /** The relative path starting at blobPrefix (or at the container root if blobPrefix is not provided) to the input model. Must point to a file with a supported file format ending. See https://docs.microsoft.com/azure/remote-rendering/how-tos/conversion/model-conversion for details. */ + relativeInputAssetPath: string; +} + +/** Conversion output settings describe the destination of conversion output. */ +export interface AssetConversionOutputSettings { + /** The URI of the Azure blob storage container where the result of the conversion should be written to. */ + storageContainerUrl: string; + /** An Azure blob storage container shared access signature giving write access to the storage container. Optional. If not provided, the Azure Remote Rendering account needs to be linked with the storage account containing the blob container. See https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts for details. For security purposes this field will never be filled out in responses bodies. */ + storageContainerWriteSas?: string; + /** A prefix which gets prepended in front of all files produced by the conversion process. Will be treated as a virtual folder. Optional. If not provided, output files will be stored at the container root. */ + blobPrefix?: string; + /** The file name of the output asset. Must end in '.arrAsset'. Optional. If not provided, file name will the same name as the input asset, with '.arrAsset' extension */ + outputAssetFilename?: string; +} + +/** The properties of the conversion. */ +export interface Conversion { + /** The ID of the conversion supplied when the conversion was created. */ + conversionId: string; + /** Conversion settings describe the origin of input files and destination of output files. */ + settings: AssetConversionSettings; + /** + * Information about the output of a successful conversion. Only present when the status of the conversion is 'Succeeded'. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly output?: AssetConversionOutput; + /** The error object containing details about the conversion failure. */ + error: RemoteRenderingServiceErrorInternal | null; + /** The status of the conversion. Terminal states are 'Cancelled', 'Failed', and 'Succeeded'. */ + status: AssetConversionStatus; + /** The time when the conversion was created. Date and time in ISO 8601 format. */ + createdOn: Date; +} + +/** Information about the output of a successful conversion. Only present when the status of the conversion is 'Succeeded'. */ +export interface AssetConversionOutput { + /** + * URI of the asset generated by the conversion process. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly outputAssetUrl?: string; +} + +/** The error object containing details of why the request failed. */ +export interface RemoteRenderingServiceErrorInternal { + /** Error code. */ + code: string; + /** A human-readable representation of the error. */ + message: string; + /** + * An array of details about specific errors that led to this reported error. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: RemoteRenderingServiceErrorInternal[]; + /** + * The target of the particular error (e.g., the name of the property in error). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * An object containing more specific information than the current object about the error. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly innerError?: RemoteRenderingServiceErrorInternal; +} + +/** The error response containing details of why the request failed. */ +export interface ErrorResponse { + /** The error object containing details of why the request failed. */ + error: RemoteRenderingServiceErrorInternal; +} + +/** List of conversions. */ +export interface ConversionList { + /** The list of conversions. */ + conversions: Conversion[]; + /** + * If more conversions are available this field will contain 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. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Settings of the session to be created. */ +export interface RenderingSessionSettings { + /** The time in minutes the session will run after reaching the 'Ready' state. It has to be between 0 and 1440. */ + maxLeaseTimeInMinutes: number; + /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ + size: RenderingServerSize; +} + +/** The properties of a rendering session. */ +export interface SessionProperties { + /** The ID of the session supplied when the session was created. */ + sessionId: string; + /** + * The TCP port at which the Azure Remote Rendering Inspector tool is hosted. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly arrInspectorPort?: number; + /** + * The TCP port used for the handshake when establishing a connection. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly handshakePort?: number; + /** + * Amount of time in minutes the session is or was in the 'Ready' state. Time is rounded down to a full minute. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly elapsedTimeInMinutes?: number; + /** + * The hostname under which the rendering session is reachable. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly host?: string; + /** + * The time in minutes the session will run after reaching the 'Ready' state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly maxLeaseTimeInMinutes?: number; + /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ + size: RenderingServerSize; + /** The status of the rendering session. Terminal states are 'Error', 'Expired', and 'Stopped'. */ + status: RenderingSessionStatus; + /** + * The computational power of the rendering session GPU measured in teraflops. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly teraflops?: number; + /** + * The error object containing details about the rendering session startup failure. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: RemoteRenderingServiceErrorInternal; + /** + * The time when the rendering session was created. Date and time in ISO 8601 format. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly createdOn?: Date; +} + +/** Settings used to update the session. */ +export interface UpdateSessionSettings { + /** Update to the time the session will run after it reached the 'Ready' state. It has to be larger than the current value of maxLeaseTimeMinutes and less than 1440. */ + maxLeaseTimeInMinutes: number; +} + +/** The result of a list sessions request. */ +export interface SessionsList { + /** The list of rendering sessions. Does not include sessions in 'Stopped' state. */ + sessions: SessionProperties[]; + /** + * If more rendering sessions are available this field will contain a URL where the next batch of sessions can be requested. This URL will need the same authentication as all calls to the Azure Remote Rendering API. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Defines headers for RemoteRendering_createConversion operation. */ +export interface RemoteRenderingCreateConversionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; +} + +/** Defines headers for RemoteRendering_createConversion operation. */ +export interface RemoteRenderingCreateConversionExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; +} + +/** Defines headers for RemoteRendering_getConversion operation. */ +export interface RemoteRenderingGetConversionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; + /** Time in seconds when the status of this conversion should be polled again */ + retryAfter?: number; +} + +/** Defines headers for RemoteRendering_getConversion operation. */ +export interface RemoteRenderingGetConversionExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Defines headers for RemoteRendering_listConversions operation. */ +export interface RemoteRenderingListConversionsHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; +} + +/** Defines headers for RemoteRendering_listConversions operation. */ +export interface RemoteRenderingListConversionsExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting errors to the Azure Remote Rendering team. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Defines headers for RemoteRendering_createSession operation. */ +export interface RemoteRenderingCreateSessionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; +} + +/** Defines headers for RemoteRendering_createSession operation. */ +export interface RemoteRenderingCreateSessionExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; +} + +/** Defines headers for RemoteRendering_getSession operation. */ +export interface RemoteRenderingGetSessionExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Defines headers for RemoteRendering_updateSession operation. */ +export interface RemoteRenderingUpdateSessionExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Defines headers for RemoteRendering_stopSession operation. */ +export interface RemoteRenderingStopSessionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; +} + +/** Defines headers for RemoteRendering_stopSession operation. */ +export interface RemoteRenderingStopSessionExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Defines headers for RemoteRendering_listSessions operation. */ +export interface RemoteRenderingListSessionsExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Defines headers for RemoteRendering_listConversionsNext operation. */ +export interface RemoteRenderingListConversionsNextHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; +} + +/** Defines headers for RemoteRendering_listConversionsNext operation. */ +export interface RemoteRenderingListConversionsNextExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting errors to the Azure Remote Rendering team. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Defines headers for RemoteRendering_listSessionsNext operation. */ +export interface RemoteRenderingListSessionsNextExceptionHeaders { + /** Microsoft Correlation Vector. Include this value when reporting issues. */ + mscv?: string; + /** Describes the error encountered while trying to authenticate the resource. */ + wWWAuthenticate?: string; +} + +/** Known values of {@link AssetConversionStatus} that the service accepts. */ +export enum KnownAssetConversionStatus { + /** The conversion was created but hasn't started. */ + NotStarted = "NotStarted", + /** The conversion is running. */ + Running = "Running", + /** The conversion was cancelled. This is a terminal state. */ + Cancelled = "Cancelled", + /** The conversion has failed. Check the 'error' field for more details. This is a terminal state. */ + Failed = "Failed", + /** The conversion has succeeded. Check the 'output' field for output asset location. This is a terminal state. */ + Succeeded = "Succeeded" +} + +/** + * Defines values for AssetConversionStatus. \ + * {@link KnownAssetConversionStatus} can be used interchangeably with AssetConversionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotStarted**: The conversion was created but hasn't started. \ + * **Running**: The conversion is running. \ + * **Cancelled**: The conversion was cancelled. This is a terminal state. \ + * **Failed**: The conversion has failed. Check the 'error' field for more details. This is a terminal state. \ + * **Succeeded**: The conversion has succeeded. Check the 'output' field for output asset location. This is a terminal state. + */ +export type AssetConversionStatus = string; + +/** Known values of {@link RenderingServerSize} that the service accepts. */ +export enum KnownRenderingServerSize { + /** Standard rendering session size. */ + Standard = "Standard", + /** Premium rendering session size. */ + Premium = "Premium" +} + +/** + * Defines values for RenderingServerSize. \ + * {@link KnownRenderingServerSize} can be used interchangeably with RenderingServerSize, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Standard**: Standard rendering session size. \ + * **Premium**: Premium rendering session size. + */ +export type RenderingServerSize = string; + +/** Known values of {@link RenderingSessionStatus} that the service accepts. */ +export enum KnownRenderingSessionStatus { + /** The rendering session has encountered an error, and is unusable. This is a terminal state. */ + Error = "Error", + /** The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. */ + Expired = "Expired", + /** The rendering session is starting, but not accepting incoming connections yet. */ + Starting = "Starting", + /** The rendering session is ready for incoming connections. */ + Ready = "Ready", + /** The rendering session has been stopped with the 'Stop Session' operation. This is a terminal state. */ + Stopped = "Stopped" +} + +/** + * Defines values for RenderingSessionStatus. \ + * {@link KnownRenderingSessionStatus} can be used interchangeably with RenderingSessionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Error**: The rendering session has encountered an error, and is unusable. This is a terminal state. \ + * **Expired**: The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. \ + * **Starting**: The rendering session is starting, but not accepting incoming connections yet. \ + * **Ready**: The rendering session is ready for incoming connections. \ + * **Stopped**: The rendering session has been stopped with the 'Stop Session' operation. This is a terminal state. + */ +export type RenderingSessionStatus = string; + +/** Optional parameters. */ +export interface RemoteRenderingCreateConversionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createConversion operation. */ +export type RemoteRenderingCreateConversionResponse = RemoteRenderingCreateConversionHeaders & + Conversion; + +/** Optional parameters. */ +export interface RemoteRenderingGetConversionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getConversion operation. */ +export type RemoteRenderingGetConversionResponse = RemoteRenderingGetConversionHeaders & + Conversion; + +/** Optional parameters. */ +export interface RemoteRenderingListConversionsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listConversions operation. */ +export type RemoteRenderingListConversionsResponse = RemoteRenderingListConversionsHeaders & + ConversionList; + +/** Optional parameters. */ +export interface RemoteRenderingCreateSessionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createSession operation. */ +export type RemoteRenderingCreateSessionResponse = SessionProperties; + +/** Optional parameters. */ +export interface RemoteRenderingGetSessionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getSession operation. */ +export type RemoteRenderingGetSessionResponse = SessionProperties; + +/** Optional parameters. */ +export interface RemoteRenderingUpdateSessionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the updateSession operation. */ +export type RemoteRenderingUpdateSessionResponse = SessionProperties; + +/** Optional parameters. */ +export interface RemoteRenderingStopSessionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the stopSession operation. */ +export type RemoteRenderingStopSessionResponse = RemoteRenderingStopSessionHeaders; + +/** Optional parameters. */ +export interface RemoteRenderingListSessionsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listSessions operation. */ +export type RemoteRenderingListSessionsResponse = SessionsList; + +/** Optional parameters. */ +export interface RemoteRenderingListConversionsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listConversionsNext operation. */ +export type RemoteRenderingListConversionsNextResponse = RemoteRenderingListConversionsNextHeaders & + ConversionList; + +/** Optional parameters. */ +export interface RemoteRenderingListSessionsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listSessionsNext operation. */ +export type RemoteRenderingListSessionsNextResponse = SessionsList; + +/** Optional parameters. */ +export interface RemoteRenderingRestClientOptionalParams + extends coreClient.ServiceClientOptions { + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/mappers.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/mappers.ts new file mode 100644 index 000000000000..d8daf838a4c8 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/mappers.ts @@ -0,0 +1,735 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +export const CreateConversionSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CreateConversionSettings", + modelProperties: { + settings: { + serializedName: "settings", + type: { + name: "Composite", + className: "AssetConversionSettings" + } + } + } + } +}; + +export const AssetConversionSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AssetConversionSettings", + modelProperties: { + inputSettings: { + serializedName: "inputLocation", + type: { + name: "Composite", + className: "AssetConversionInputSettings" + } + }, + outputSettings: { + serializedName: "outputLocation", + type: { + name: "Composite", + className: "AssetConversionOutputSettings" + } + } + } + } +}; + +export const AssetConversionInputSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AssetConversionInputSettings", + modelProperties: { + storageContainerUrl: { + serializedName: "storageContainerUri", + required: true, + type: { + name: "String" + } + }, + storageContainerReadListSas: { + serializedName: "storageContainerReadListSas", + type: { + name: "String" + } + }, + blobPrefix: { + serializedName: "blobPrefix", + type: { + name: "String" + } + }, + relativeInputAssetPath: { + serializedName: "relativeInputAssetPath", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const AssetConversionOutputSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AssetConversionOutputSettings", + modelProperties: { + storageContainerUrl: { + serializedName: "storageContainerUri", + required: true, + type: { + name: "String" + } + }, + storageContainerWriteSas: { + serializedName: "storageContainerWriteSas", + type: { + name: "String" + } + }, + blobPrefix: { + serializedName: "blobPrefix", + type: { + name: "String" + } + }, + outputAssetFilename: { + serializedName: "outputAssetFilename", + type: { + name: "String" + } + } + } + } +}; + +export const Conversion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Conversion", + modelProperties: { + conversionId: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + settings: { + serializedName: "settings", + type: { + name: "Composite", + className: "AssetConversionSettings" + } + }, + output: { + serializedName: "output", + type: { + name: "Composite", + className: "AssetConversionOutput" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "RemoteRenderingServiceErrorInternal" + } + }, + status: { + serializedName: "status", + required: true, + type: { + name: "String" + } + }, + createdOn: { + serializedName: "creationTime", + required: true, + type: { + name: "DateTime" + } + } + } + } +}; + +export const AssetConversionOutput: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AssetConversionOutput", + modelProperties: { + outputAssetUrl: { + serializedName: "outputAssetUri", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingServiceErrorInternal: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingServiceErrorInternal", + modelProperties: { + code: { + serializedName: "code", + required: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + required: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RemoteRenderingServiceErrorInternal" + } + } + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + innerError: { + serializedName: "innerError", + type: { + name: "Composite", + className: "RemoteRenderingServiceErrorInternal" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "RemoteRenderingServiceErrorInternal" + } + } + } + } +}; + +export const ConversionList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConversionList", + modelProperties: { + conversions: { + serializedName: "conversions", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Conversion" + } + } + } + }, + nextLink: { + serializedName: "@nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const RenderingSessionSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RenderingSessionSettings", + modelProperties: { + maxLeaseTimeInMinutes: { + serializedName: "maxLeaseTimeMinutes", + required: true, + type: { + name: "Number" + } + }, + size: { + serializedName: "size", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const SessionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SessionProperties", + modelProperties: { + sessionId: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + arrInspectorPort: { + constraints: { + InclusiveMaximum: 65534, + InclusiveMinimum: 49152 + }, + serializedName: "arrInspectorPort", + readOnly: true, + type: { + name: "Number" + } + }, + handshakePort: { + constraints: { + InclusiveMaximum: 65534, + InclusiveMinimum: 49152 + }, + serializedName: "handshakePort", + readOnly: true, + type: { + name: "Number" + } + }, + elapsedTimeInMinutes: { + serializedName: "elapsedTimeMinutes", + readOnly: true, + type: { + name: "Number" + } + }, + host: { + serializedName: "hostname", + readOnly: true, + type: { + name: "String" + } + }, + maxLeaseTimeInMinutes: { + serializedName: "maxLeaseTimeMinutes", + readOnly: true, + type: { + name: "Number" + } + }, + size: { + serializedName: "size", + required: true, + type: { + name: "String" + } + }, + status: { + serializedName: "status", + required: true, + type: { + name: "String" + } + }, + teraflops: { + serializedName: "teraflops", + readOnly: true, + type: { + name: "Number" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "RemoteRenderingServiceErrorInternal" + } + }, + createdOn: { + serializedName: "creationTime", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + +export const UpdateSessionSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UpdateSessionSettings", + modelProperties: { + maxLeaseTimeInMinutes: { + serializedName: "maxLeaseTimeMinutes", + required: true, + type: { + name: "Number" + } + } + } + } +}; + +export const SessionsList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SessionsList", + modelProperties: { + sessions: { + serializedName: "sessions", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SessionProperties" + } + } + } + }, + nextLink: { + serializedName: "@nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingCreateConversionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingCreateConversionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingCreateConversionExceptionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingCreateConversionExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingGetConversionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingGetConversionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + } + } + } +}; + +export const RemoteRenderingGetConversionExceptionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingGetConversionExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingListConversionsHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingListConversionsHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingListConversionsExceptionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingListConversionsExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingCreateSessionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingCreateSessionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingCreateSessionExceptionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingCreateSessionExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingGetSessionExceptionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingGetSessionExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingUpdateSessionExceptionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingUpdateSessionExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingStopSessionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingStopSessionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingStopSessionExceptionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingStopSessionExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingListSessionsExceptionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingListSessionsExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingListConversionsNextHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingListConversionsNextHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingListConversionsNextExceptionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingListConversionsNextExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; + +export const RemoteRenderingListSessionsNextExceptionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RemoteRenderingListSessionsNextExceptionHeaders", + modelProperties: { + mscv: { + serializedName: "ms-cv", + type: { + name: "String" + } + }, + wWWAuthenticate: { + serializedName: "www-authenticate", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/parameters.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/parameters.ts new file mode 100644 index 000000000000..de4379990874 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/models/parameters.ts @@ -0,0 +1,126 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter +} from "@azure/core-client"; +import { + CreateConversionSettings as CreateConversionSettingsMapper, + RenderingSessionSettings as RenderingSessionSettingsMapper, + UpdateSessionSettings as UpdateSessionSettingsMapper +} from "./mappers"; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" + } + } +}; + +export const body: OperationParameter = { + parameterPath: "body", + mapper: CreateConversionSettingsMapper +}; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } +}; + +export const endpoint: OperationURLParameter = { + parameterPath: "endpoint", + mapper: { + serializedName: "endpoint", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2021-01-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const accountId: OperationURLParameter = { + parameterPath: "accountId", + mapper: { + serializedName: "account_id", + required: true, + type: { + name: "Uuid" + } + } +}; + +export const conversionId: OperationURLParameter = { + parameterPath: "conversionId", + mapper: { + serializedName: "conversion_id", + required: true, + type: { + name: "String" + } + } +}; + +export const body1: OperationParameter = { + parameterPath: "body", + mapper: RenderingSessionSettingsMapper +}; + +export const sessionId: OperationURLParameter = { + parameterPath: "sessionId", + mapper: { + serializedName: "session_id", + required: true, + type: { + name: "String" + } + } +}; + +export const body2: OperationParameter = { + parameterPath: "body", + mapper: UpdateSessionSettingsMapper +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operations/index.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operations/index.ts new file mode 100644 index 000000000000..80a01585d4b1 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operations/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./remoteRendering"; diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operations/remoteRendering.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operations/remoteRendering.ts new file mode 100644 index 000000000000..daa069b025ae --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operations/remoteRendering.ts @@ -0,0 +1,627 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { RemoteRendering } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { RemoteRenderingRestClientContext } from "../remoteRenderingRestClientContext"; +import { + CreateConversionSettings, + RemoteRenderingCreateConversionOptionalParams, + RemoteRenderingCreateConversionResponse, + RemoteRenderingGetConversionOptionalParams, + RemoteRenderingGetConversionResponse, + RemoteRenderingListConversionsOptionalParams, + RemoteRenderingListConversionsResponse, + RenderingSessionSettings, + RemoteRenderingCreateSessionOptionalParams, + RemoteRenderingCreateSessionResponse, + RemoteRenderingGetSessionOptionalParams, + RemoteRenderingGetSessionResponse, + UpdateSessionSettings, + RemoteRenderingUpdateSessionOptionalParams, + RemoteRenderingUpdateSessionResponse, + RemoteRenderingStopSessionOptionalParams, + RemoteRenderingStopSessionResponse, + RemoteRenderingListSessionsOptionalParams, + RemoteRenderingListSessionsResponse, + RemoteRenderingListConversionsNextOptionalParams, + RemoteRenderingListConversionsNextResponse, + RemoteRenderingListSessionsNextOptionalParams, + RemoteRenderingListSessionsNextResponse +} from "../models"; + +/** Class representing a RemoteRendering. */ +export class RemoteRenderingImpl implements RemoteRendering { + private readonly client: RemoteRenderingRestClientContext; + + /** + * Initialize a new instance of the class RemoteRendering class. + * @param client Reference to the service client + */ + constructor(client: RemoteRenderingRestClientContext) { + this.client = client; + } + + /** + * Creates a conversion using an asset stored in an Azure Blob Storage account. + * @param accountId The Azure Remote Rendering account ID. + * @param conversionId 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. + * @param body Request body configuring the settings for an asset conversion. + * @param options The options parameters. + */ + createConversion( + accountId: string, + conversionId: string, + body: CreateConversionSettings, + options?: RemoteRenderingCreateConversionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { accountId, conversionId, body, options }, + createConversionOperationSpec + ); + } + + /** + * Gets the status of a particular conversion. + * @param accountId The Azure Remote Rendering account ID. + * @param conversionId 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. + * @param options The options parameters. + */ + getConversion( + accountId: string, + conversionId: string, + options?: RemoteRenderingGetConversionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { accountId, conversionId, options }, + getConversionOperationSpec + ); + } + + /** + * Gets a list of all conversions. + * @param accountId The Azure Remote Rendering account ID. + * @param options The options parameters. + */ + listConversions( + accountId: string, + options?: RemoteRenderingListConversionsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { accountId, options }, + listConversionsOperationSpec + ); + } + + /** + * Creates a new rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId 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. + * @param body Settings of the session to be created. + * @param options The options parameters. + */ + createSession( + accountId: string, + sessionId: string, + body: RenderingSessionSettings, + options?: RemoteRenderingCreateSessionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { accountId, sessionId, body, options }, + createSessionOperationSpec + ); + } + + /** + * Gets the properties of a particular rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId 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. + * @param options The options parameters. + */ + getSession( + accountId: string, + sessionId: string, + options?: RemoteRenderingGetSessionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { accountId, sessionId, options }, + getSessionOperationSpec + ); + } + + /** + * Updates the max lease time of a particular rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId 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. + * @param body Settings used to update the session. + * @param options The options parameters. + */ + updateSession( + accountId: string, + sessionId: string, + body: UpdateSessionSettings, + options?: RemoteRenderingUpdateSessionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { accountId, sessionId, body, options }, + updateSessionOperationSpec + ); + } + + /** + * Stops a particular rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId 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. + * @param options The options parameters. + */ + stopSession( + accountId: string, + sessionId: string, + options?: RemoteRenderingStopSessionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { accountId, sessionId, options }, + stopSessionOperationSpec + ); + } + + /** + * Gets a list of all rendering sessions. + * @param accountId The Azure Remote Rendering account ID. + * @param options The options parameters. + */ + listSessions( + accountId: string, + options?: RemoteRenderingListSessionsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { accountId, options }, + listSessionsOperationSpec + ); + } + + /** + * ListConversionsNext + * @param accountId The Azure Remote Rendering account ID. + * @param nextLink The nextLink from the previous successful call to the ListConversions method. + * @param options The options parameters. + */ + listConversionsNext( + accountId: string, + nextLink: string, + options?: RemoteRenderingListConversionsNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { accountId, nextLink, options }, + listConversionsNextOperationSpec + ); + } + + /** + * ListSessionsNext + * @param accountId The Azure Remote Rendering account ID. + * @param nextLink The nextLink from the previous successful call to the ListSessions method. + * @param options The options parameters. + */ + listSessionsNext( + accountId: string, + nextLink: string, + options?: RemoteRenderingListSessionsNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { accountId, nextLink, options }, + listSessionsNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createConversionOperationSpec: coreClient.OperationSpec = { + path: "/accounts/{account_id}/conversions/{conversion_id}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Conversion, + headersMapper: Mappers.RemoteRenderingCreateConversionHeaders + }, + 201: { + bodyMapper: Mappers.Conversion, + headersMapper: Mappers.RemoteRenderingCreateConversionHeaders + }, + 400: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingCreateConversionExceptionHeaders, + isError: true + }, + 401: { + headersMapper: Mappers.RemoteRenderingCreateConversionExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingCreateConversionExceptionHeaders, + isError: true + }, + 409: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingCreateConversionExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingCreateConversionExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + isError: true + } + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.conversionId + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const getConversionOperationSpec: coreClient.OperationSpec = { + path: "/accounts/{account_id}/conversions/{conversion_id}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Conversion, + headersMapper: Mappers.RemoteRenderingGetConversionHeaders + }, + 401: { + headersMapper: Mappers.RemoteRenderingGetConversionExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingGetConversionExceptionHeaders, + isError: true + }, + 404: { + headersMapper: Mappers.RemoteRenderingGetConversionExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingGetConversionExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingGetConversionExceptionHeaders, + isError: true + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.conversionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listConversionsOperationSpec: coreClient.OperationSpec = { + path: "/accounts/{account_id}/conversions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ConversionList, + headersMapper: Mappers.RemoteRenderingListConversionsHeaders + }, + 401: { + headersMapper: Mappers.RemoteRenderingListConversionsExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingListConversionsExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingListConversionsExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingListConversionsExceptionHeaders, + isError: true + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.endpoint, Parameters.accountId], + headerParameters: [Parameters.accept], + serializer +}; +const createSessionOperationSpec: coreClient.OperationSpec = { + path: "/accounts/{account_id}/sessions/{session_id}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.SessionProperties + }, + 201: { + bodyMapper: Mappers.SessionProperties, + headersMapper: Mappers.RemoteRenderingCreateSessionHeaders + }, + 400: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingCreateSessionExceptionHeaders, + isError: true + }, + 401: { + headersMapper: Mappers.RemoteRenderingCreateSessionExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingCreateSessionExceptionHeaders, + isError: true + }, + 409: { + bodyMapper: Mappers.ErrorResponse, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingCreateSessionExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingCreateSessionExceptionHeaders, + isError: true + } + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.sessionId + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const getSessionOperationSpec: coreClient.OperationSpec = { + path: "/accounts/{account_id}/sessions/{session_id}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SessionProperties + }, + 401: { + headersMapper: Mappers.RemoteRenderingGetSessionExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingGetSessionExceptionHeaders, + isError: true + }, + 404: { + headersMapper: Mappers.RemoteRenderingGetSessionExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingGetSessionExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingGetSessionExceptionHeaders, + isError: true + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.sessionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const updateSessionOperationSpec: coreClient.OperationSpec = { + path: "/accounts/{account_id}/sessions/{session_id}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.SessionProperties + }, + 401: { + headersMapper: Mappers.RemoteRenderingUpdateSessionExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingUpdateSessionExceptionHeaders, + isError: true + }, + 404: { + headersMapper: Mappers.RemoteRenderingUpdateSessionExceptionHeaders, + isError: true + }, + 422: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingUpdateSessionExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingUpdateSessionExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingUpdateSessionExceptionHeaders, + isError: true + } + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.sessionId + ], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", + serializer +}; +const stopSessionOperationSpec: coreClient.OperationSpec = { + path: "/accounts/{account_id}/sessions/{session_id}/:stop", + httpMethod: "POST", + responses: { + 204: { + headersMapper: Mappers.RemoteRenderingStopSessionHeaders + }, + 401: { + headersMapper: Mappers.RemoteRenderingStopSessionExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingStopSessionExceptionHeaders, + isError: true + }, + 404: { + headersMapper: Mappers.RemoteRenderingStopSessionExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingStopSessionExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingStopSessionExceptionHeaders, + isError: true + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.sessionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listSessionsOperationSpec: coreClient.OperationSpec = { + path: "/accounts/{account_id}/sessions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SessionsList + }, + 401: { + headersMapper: Mappers.RemoteRenderingListSessionsExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingListSessionsExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingListSessionsExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingListSessionsExceptionHeaders, + isError: true + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.endpoint, Parameters.accountId], + headerParameters: [Parameters.accept], + serializer +}; +const listConversionsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ConversionList, + headersMapper: Mappers.RemoteRenderingListConversionsNextHeaders + }, + 401: { + headersMapper: Mappers.RemoteRenderingListConversionsNextExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingListConversionsNextExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingListConversionsNextExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingListConversionsNextExceptionHeaders, + isError: true + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listSessionsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SessionsList + }, + 401: { + headersMapper: Mappers.RemoteRenderingListSessionsNextExceptionHeaders, + isError: true + }, + 403: { + headersMapper: Mappers.RemoteRenderingListSessionsNextExceptionHeaders, + isError: true + }, + 429: { + headersMapper: Mappers.RemoteRenderingListSessionsNextExceptionHeaders, + isError: true + }, + 500: { + bodyMapper: Mappers.ErrorResponse, + headersMapper: Mappers.RemoteRenderingListSessionsNextExceptionHeaders, + isError: true + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.endpoint, + Parameters.accountId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operationsInterfaces/index.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operationsInterfaces/index.ts new file mode 100644 index 000000000000..80a01585d4b1 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operationsInterfaces/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./remoteRendering"; diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operationsInterfaces/remoteRendering.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operationsInterfaces/remoteRendering.ts new file mode 100644 index 000000000000..d749a2d3557c --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/operationsInterfaces/remoteRendering.ts @@ -0,0 +1,161 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + CreateConversionSettings, + RemoteRenderingCreateConversionOptionalParams, + RemoteRenderingCreateConversionResponse, + RemoteRenderingGetConversionOptionalParams, + RemoteRenderingGetConversionResponse, + RemoteRenderingListConversionsOptionalParams, + RemoteRenderingListConversionsResponse, + RenderingSessionSettings, + RemoteRenderingCreateSessionOptionalParams, + RemoteRenderingCreateSessionResponse, + RemoteRenderingGetSessionOptionalParams, + RemoteRenderingGetSessionResponse, + UpdateSessionSettings, + RemoteRenderingUpdateSessionOptionalParams, + RemoteRenderingUpdateSessionResponse, + RemoteRenderingStopSessionOptionalParams, + RemoteRenderingStopSessionResponse, + RemoteRenderingListSessionsOptionalParams, + RemoteRenderingListSessionsResponse, + RemoteRenderingListConversionsNextOptionalParams, + RemoteRenderingListConversionsNextResponse, + RemoteRenderingListSessionsNextOptionalParams, + RemoteRenderingListSessionsNextResponse +} from "../models"; + +/** Interface representing a RemoteRendering. */ +export interface RemoteRendering { + /** + * Creates a conversion using an asset stored in an Azure Blob Storage account. + * @param accountId The Azure Remote Rendering account ID. + * @param conversionId 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. + * @param body Request body configuring the settings for an asset conversion. + * @param options The options parameters. + */ + createConversion( + accountId: string, + conversionId: string, + body: CreateConversionSettings, + options?: RemoteRenderingCreateConversionOptionalParams + ): Promise; + /** + * Gets the status of a particular conversion. + * @param accountId The Azure Remote Rendering account ID. + * @param conversionId 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. + * @param options The options parameters. + */ + getConversion( + accountId: string, + conversionId: string, + options?: RemoteRenderingGetConversionOptionalParams + ): Promise; + /** + * Gets a list of all conversions. + * @param accountId The Azure Remote Rendering account ID. + * @param options The options parameters. + */ + listConversions( + accountId: string, + options?: RemoteRenderingListConversionsOptionalParams + ): Promise; + /** + * Creates a new rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId 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. + * @param body Settings of the session to be created. + * @param options The options parameters. + */ + createSession( + accountId: string, + sessionId: string, + body: RenderingSessionSettings, + options?: RemoteRenderingCreateSessionOptionalParams + ): Promise; + /** + * Gets the properties of a particular rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId 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. + * @param options The options parameters. + */ + getSession( + accountId: string, + sessionId: string, + options?: RemoteRenderingGetSessionOptionalParams + ): Promise; + /** + * Updates the max lease time of a particular rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId 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. + * @param body Settings used to update the session. + * @param options The options parameters. + */ + updateSession( + accountId: string, + sessionId: string, + body: UpdateSessionSettings, + options?: RemoteRenderingUpdateSessionOptionalParams + ): Promise; + /** + * Stops a particular rendering session. + * @param accountId The Azure Remote Rendering account ID. + * @param sessionId 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. + * @param options The options parameters. + */ + stopSession( + accountId: string, + sessionId: string, + options?: RemoteRenderingStopSessionOptionalParams + ): Promise; + /** + * Gets a list of all rendering sessions. + * @param accountId The Azure Remote Rendering account ID. + * @param options The options parameters. + */ + listSessions( + accountId: string, + options?: RemoteRenderingListSessionsOptionalParams + ): Promise; + /** + * ListConversionsNext + * @param accountId The Azure Remote Rendering account ID. + * @param nextLink The nextLink from the previous successful call to the ListConversions method. + * @param options The options parameters. + */ + listConversionsNext( + accountId: string, + nextLink: string, + options?: RemoteRenderingListConversionsNextOptionalParams + ): Promise; + /** + * ListSessionsNext + * @param accountId The Azure Remote Rendering account ID. + * @param nextLink The nextLink from the previous successful call to the ListSessions method. + * @param options The options parameters. + */ + listSessionsNext( + accountId: string, + nextLink: string, + options?: RemoteRenderingListSessionsNextOptionalParams + ): Promise; +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/remoteRenderingRestClient.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/remoteRenderingRestClient.ts new file mode 100644 index 000000000000..83bfaa899776 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/remoteRenderingRestClient.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { RemoteRenderingImpl } from "./operations"; +import { RemoteRendering } from "./operationsInterfaces"; +import { RemoteRenderingRestClientContext } from "./remoteRenderingRestClientContext"; +import { RemoteRenderingRestClientOptionalParams } from "./models"; + +/** @internal */ +export class RemoteRenderingRestClient extends RemoteRenderingRestClientContext { + /** + * Initializes a new instance of the RemoteRenderingRestClient class. + * @param endpoint The endpoint to use e.g. https://remoterendering.eastus.mixedreality.azure.com. A + * list can be found at https://docs.microsoft.com/azure/remote-rendering/reference/regions. + * @param options The parameter options + */ + constructor( + endpoint: string, + options?: RemoteRenderingRestClientOptionalParams + ) { + super(endpoint, options); + this.remoteRendering = new RemoteRenderingImpl(this); + } + + remoteRendering: RemoteRendering; +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/remoteRenderingRestClientContext.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/remoteRenderingRestClientContext.ts new file mode 100644 index 000000000000..f0cd8195c871 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/generated/remoteRenderingRestClientContext.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { RemoteRenderingRestClientOptionalParams } from "./models"; + +/** @internal */ +export class RemoteRenderingRestClientContext extends coreClient.ServiceClient { + endpoint: string; + apiVersion: string; + + /** + * Initializes a new instance of the RemoteRenderingRestClientContext class. + * @param endpoint The endpoint to use e.g. https://remoterendering.eastus.mixedreality.azure.com. A + * list can be found at https://docs.microsoft.com/azure/remote-rendering/reference/regions. + * @param options The parameter options + */ + constructor( + endpoint: string, + options?: RemoteRenderingRestClientOptionalParams + ) { + if (endpoint === undefined) { + throw new Error("'endpoint' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: RemoteRenderingRestClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-mixed-reality-remote-rendering/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{endpoint}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.endpoint = endpoint; + + // Assigning values to Constant parameters + this.apiVersion = options.apiVersion || "2021-01-01"; + } +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/index.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/index.ts new file mode 100644 index 000000000000..97064c1ba05b --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/// +export * from "./remoteRenderingClient"; diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/internal/assetConversion.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/internal/assetConversion.ts new file mode 100644 index 000000000000..20f69c4ea008 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/internal/assetConversion.ts @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + Conversion, + AssetConversionSettings, + AssetConversionOutput, + KnownAssetConversionStatus +} from "../generated/models/index"; +import { + RemoteRenderingServiceError, + createRemoteRenderingServiceError +} from "../remoteRenderingServiceError"; + +/** Properties available for an AssetConversion in any state. */ +export interface AssetConversionBase { + /** The ID of the conversion supplied when the conversion was created. */ + conversionId: string; + /** Conversion settings describe the origin of input files and destination of output files. */ + settings: AssetConversionSettings; + /** The time when the conversion was created. Date and time in ISO 8601 format. */ + createdOn: Date; +} + +/** The conversion was created but hasn't started. */ +export interface NonStartedAssetConversion extends AssetConversionBase { + /** The conversion was created but hasn't started. */ + status: "NotStarted"; +} + +/** The conversion is running. */ +export interface RunningAssetConversion extends AssetConversionBase { + /** The conversion is running. */ + status: "Running"; +} + +/** The conversion has succeeded. */ +export interface SucceededAssetConversion extends AssetConversionBase { + /** The conversion has succeeded. This is a terminal state. */ + status: "Succeeded"; + /** + * Information about the output of a successful conversion. + */ + readonly output: AssetConversionOutput; +} + +/** The conversion has failed. Check the 'error' field for more details. */ +export interface FailedAssetConversion extends AssetConversionBase { + /** The conversion has failed. Check the 'error' field for more details. This is a terminal state. */ + status: "Failed"; + /** The error object containing details about the conversion failure. */ + error: RemoteRenderingServiceError; +} + +/** The conversion was cancelled. */ +export interface CancelledAssetConversion extends AssetConversionBase { + /** The conversion was cancelled. This is a terminal state. */ + status: "Cancelled"; +} + +/** A type representing the various states of a conversion. This is a tagged union with "status" as its discriminant property. */ +export type AssetConversion = + | NonStartedAssetConversion + | RunningAssetConversion + | SucceededAssetConversion + | FailedAssetConversion + | CancelledAssetConversion; + +/** + * Build an AssetConversion object from the conversion object returned by the service. + * @internal + */ +export function assetConversionFromConversion(conversion: Conversion): AssetConversion { + const baseProperties: AssetConversionBase = { + conversionId: conversion.conversionId, + settings: conversion.settings, + createdOn: conversion.createdOn + }; + switch (conversion.status) { + case KnownAssetConversionStatus.NotStarted: + return { + status: "NotStarted", + ...baseProperties + }; + case KnownAssetConversionStatus.Running: + return { + status: "Running", + ...baseProperties + }; + case KnownAssetConversionStatus.Succeeded: + return { + status: "Succeeded", + ...baseProperties, + output: conversion.output! + }; + case KnownAssetConversionStatus.Cancelled: + return { + status: "Cancelled", + ...baseProperties + }; + case KnownAssetConversionStatus.Failed: + return { + status: "Failed", + ...baseProperties, + error: createRemoteRenderingServiceError(conversion.error!) + }; + default: + throw new Error("Unrecognized AssetConversionStatus returned by the service"); + } +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/internal/commonQueries.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/internal/commonQueries.ts new file mode 100644 index 000000000000..a933b66a0269 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/internal/commonQueries.ts @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { OperationOptions } from "@azure/core-client"; +import { RemoteRendering } from "../generated/operationsInterfaces"; +import { createSpan } from "../tracing"; +import { SpanStatusCode } from "@azure/core-tracing"; +import { AssetConversion, assetConversionFromConversion } from "./assetConversion"; +import { RenderingSession, renderingSessionFromSessionProperties } from "./renderingSession"; + +/** + * Call getConversion on the service, wrapped in a tracing span with a provided name. + * @param tracingSpanName - The name to use for the span that wraps the call. + * @internal + */ +export async function getConversionInternal( + accountId: string, + operations: RemoteRendering, + conversionId: string, + tracingSpanName: string, + options?: OperationOptions +): Promise { + const { span, updatedOptions } = createSpan(tracingSpanName, { + conversionId: conversionId, + ...options + }); + + try { + const conversion = await operations.getConversion(accountId, conversionId, updatedOptions); + return assetConversionFromConversion(conversion); + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } +} + +/** + * Call getSession on the service, wrapped in a tracing span with a provided name. + * @param tracingSpanName - The name to use for the span that wraps the call. + * @internal + */ +export async function getSessionInternal( + accountId: string, + operations: RemoteRendering, + sessionId: string, + tracingSpanName: string, + options?: OperationOptions +): Promise { + const { span, updatedOptions } = createSpan(tracingSpanName, { + sessionId, + ...options + }); + + try { + const sessionProperties = await operations.getSession(accountId, sessionId, updatedOptions); + return renderingSessionFromSessionProperties(sessionProperties); + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } +} + +/** + * Call endSession on the service, wrapped in a tracing span with a provided name. + * @param tracingSpanName - The name to use for the span that wraps the call. + * @internal + */ +export async function endSessionInternal( + accountId: string, + operations: RemoteRendering, + sessionId: string, + tracingSpanName: string, + options?: OperationOptions +): Promise { + const { span, updatedOptions } = createSpan(tracingSpanName, { + conversionId: sessionId, + ...options + }); + + try { + await operations.stopSession(accountId, sessionId, updatedOptions); + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/internal/renderingSession.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/internal/renderingSession.ts new file mode 100644 index 000000000000..3e378b9e6c4b --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/internal/renderingSession.ts @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { + RenderingServerSize, + SessionProperties, + KnownRenderingSessionStatus +} from "../generated/index"; +import { + RemoteRenderingServiceError, + createRemoteRenderingServiceError +} from "../remoteRenderingServiceError"; + +/** Properties available for a rendering session in any state */ +export interface RenderingSessionBase { + /** The ID of the session supplied when the session was created. */ + sessionId: string; + /** The size of the server used for the rendering session. The size impacts the number of polygons the server can render. Refer to https://docs.microsoft.com/azure/remote-rendering/reference/vm-sizes for details. */ + size: RenderingServerSize; + /** The time in minutes the session will run after reaching the 'Ready' state. */ + maxLeaseTimeInMinutes: number; +} + +/** The properties of a complete rendering session */ +export interface RenderingSessionProperties { + /** + * The TCP port at which the Azure Remote Rendering Inspector tool is hosted. + */ + readonly arrInspectorPort: number; + /** + * The TCP port used for the handshake when establishing a connection. + */ + readonly handshakePort: number; + /** + * Amount of time in minutes the session is or was in the 'Ready' state. Time is rounded down to a full minute. + */ + readonly elapsedTimeInMinutes: number; + /** + * The hostname under which the rendering session is reachable. + */ + readonly host: string; + /** + * The computational power of the rendering session GPU measured in teraflops. + */ + readonly teraflops: number; + /** + * The time when the rendering session was created. Date and time in ISO 8601 format. + */ + readonly createdOn: Date; +} + +/** + * In certain RenderingSession states, some properties are available and some are not. + */ +export interface PartialRenderingSessionProperties { + /** + * The TCP port at which the Azure Remote Rendering Inspector tool is hosted. + */ + readonly arrInspectorPort?: number; + /** + * The TCP port used for the handshake when establishing a connection. + */ + readonly handshakePort?: number; + /** + * Amount of time in minutes the session is or was in the 'Ready' state. Time is rounded down to a full minute. + */ + readonly elapsedTimeInMinutes?: number; + /** + * The hostname under which the rendering session is reachable. + */ + readonly host?: string; + /** + * The computational power of the rendering session GPU measured in teraflops. + */ + readonly teraflops?: number; + /** + * The time when the rendering session was created. Date and time in ISO 8601 format. + */ + readonly createdOn?: Date; +} + +/** The rendering session is ready for incoming connections. */ +export interface ReadyRenderingSession extends RenderingSessionBase { + /** The rendering session is ready for incoming connections. */ + status: "Ready"; + /** + * The properties of the session. + */ + properties: RenderingSessionProperties; +} + +/** The rendering session has encountered an error, and is unusable. */ +export interface ErrorRenderingSession extends RenderingSessionBase { + /** The rendering session has encountered an error, and is unusable. This is a terminal state. */ + status: "Error"; + /** + * The error object containing details about the rendering session startup failure. + */ + readonly error: RemoteRenderingServiceError; + /** + * The properties of the session which had been set. + */ + partialProperties: PartialRenderingSessionProperties; +} + +/** The rendering session is starting, but not accepting incoming connections yet. */ +export interface StartingRenderingSession extends RenderingSessionBase { + /** The rendering session is starting, but not accepting incoming connections yet. */ + status: "Starting"; + /** + * The properties which are currently known about the session. + */ + partialProperties: PartialRenderingSessionProperties; +} + +/** The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. */ +export interface ExpiredRenderingSession extends RenderingSessionBase { + /** The rendering session enters the 'Expired' state when it has been in the 'Ready' state longer than its lease time. This is a terminal state. */ + status: "Expired"; + /** + * The properties of the session. + */ + properties: RenderingSessionProperties; +} + +/** The rendering session has been stopped with the 'Stop Session' operation. This is a terminal state. */ +export interface StoppedRenderingSession extends RenderingSessionBase { + /** The rendering session has been stopped with the 'Stop Session' operation. This is a terminal state. */ + status: "Stopped"; + /** + * The properties that were known about the session. + */ + partialProperties: PartialRenderingSessionProperties; +} + +/** Information about a rendering session. This is a tagged union with "status" as its discriminant property. */ +export type RenderingSession = + | StartingRenderingSession + | ReadyRenderingSession + | ErrorRenderingSession + | ExpiredRenderingSession + | StoppedRenderingSession; + +/** + * @internal + */ +function renderingSessionPropertiesFromSessionProperties( + session: SessionProperties +): RenderingSessionProperties { + return { + arrInspectorPort: session.arrInspectorPort!, + handshakePort: session.handshakePort!, + elapsedTimeInMinutes: session.elapsedTimeInMinutes!, + host: session.host!, + teraflops: session.teraflops!, + createdOn: session.createdOn! + }; +} + +/** + * @internal + */ +function partialRenderingSessionPropertiesFromSessionProperties( + session: SessionProperties +): PartialRenderingSessionProperties { + return { + arrInspectorPort: session.arrInspectorPort, + handshakePort: session.handshakePort, + elapsedTimeInMinutes: session.elapsedTimeInMinutes, + host: session.host, + teraflops: session.teraflops, + createdOn: session.createdOn + }; +} + +/** + * Build a RenderingSession object from the SessionProperties object returned by the service. + * @internal + */ +export function renderingSessionFromSessionProperties( + session: SessionProperties +): RenderingSession { + const baseProperties: RenderingSessionBase = { + sessionId: session.sessionId, + size: session.size, + maxLeaseTimeInMinutes: session.maxLeaseTimeInMinutes! + }; + switch (session.status) { + case KnownRenderingSessionStatus.Ready: + return { + status: "Ready", + ...baseProperties, + properties: renderingSessionPropertiesFromSessionProperties(session) + }; + case KnownRenderingSessionStatus.Starting: + return { + status: "Starting", + ...baseProperties, + partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) + }; + case KnownRenderingSessionStatus.Error: + return { + status: "Error", + ...baseProperties, + error: createRemoteRenderingServiceError(session.error!), + partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) + }; + case KnownRenderingSessionStatus.Expired: + return { + status: "Expired", + ...baseProperties, + properties: renderingSessionPropertiesFromSessionProperties(session) + }; + case KnownRenderingSessionStatus.Stopped: + return { + status: "Stopped", + ...baseProperties, + partialProperties: partialRenderingSessionPropertiesFromSessionProperties(session) + }; + default: + throw new Error("Unrecognized RenderingSessionStatus returned by the service"); + } +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/logger.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/logger.ts new file mode 100644 index 000000000000..0abaa79eb55d --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/logger.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { createClientLogger } from "@azure/logger"; + +/** + * The \@azure/logger configuration for this package. + * + * @internal + */ +export const logger = createClientLogger("mixed-reality-remote-rendering"); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/lro/assetConversionPoller.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/lro/assetConversionPoller.ts new file mode 100644 index 000000000000..876a9b7b06db --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/lro/assetConversionPoller.ts @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; +import { KnownAssetConversionStatus } from "../generated/models/index"; +import { RemoteRendering } from "../generated/operationsInterfaces"; +import { getConversionInternal } from "../internal/commonQueries"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { delay } from "@azure/core-util"; +import { AssetConversion } from "../internal/assetConversion"; + +/** + * Options to configure the poller for the beginConversion operation. + */ +export interface AssetConversionPollerOptions { + /** The interval between calls to poll the service for the status of a conversion. */ + intervalInMs?: number; +} + +/** + * The state carried by the poller for the beginConversion operation. + */ +export interface AssetConversionOperationState extends PollOperationState { + /** + * The latest response when querying the service. The conversion may or may not be completed. + */ + latestResponse: AssetConversion; +} + +/** + * @internal + */ +export class AssetConversionOperationStateImpl implements AssetConversionOperationState { + latestResponse: AssetConversion; + + constructor(conversionState: AssetConversion) { + this.latestResponse = conversionState; + } + + get isStarted(): boolean { + // The poller is always treated as started. + return true; + } + + get isCompleted(): boolean { + return ( + this.latestResponse.status !== KnownAssetConversionStatus.NotStarted && + this.latestResponse.status !== KnownAssetConversionStatus.Running + ); + } + + get isCancelled(): boolean { + // We don't support cancellation, so the poller is never treated as cancelled. + return false; + } + + get error(): Error | undefined { + if (this.latestResponse.status === "Failed") { + return this.latestResponse.error; + } + return undefined; + } + + get result(): AssetConversion { + return this.latestResponse; + } +} + +/** + * @internal + */ +class AssetConversionOperation + implements PollOperation { + private accountId: string; + private operations: RemoteRendering; + state: AssetConversionOperationState; + + constructor( + accountId: string, + operations: RemoteRendering, + state: AssetConversionOperationState + ) { + this.operations = operations; + this.accountId = accountId; + this.state = state; + } + + async update(_options?: { + abortSignal?: AbortSignalLike; + fireProgress?: (state: AssetConversionOperationState) => void; + }): Promise { + this.state.latestResponse = await getConversionInternal( + this.accountId, + this.operations, + this.state.latestResponse.conversionId, + "AssetConversionOperation-Update" + ); + return this; + } + + cancel(_options?: { abortSignal?: AbortSignalLike }): Promise { + return Promise.reject(new Error("Cancel operation is not supported.")); + } + + toString(): string { + return this.state.latestResponse.conversionId; + } +} + +/** + * @internal + */ +export class AssetConversionPoller extends Poller { + /** + * Defines how much time the poller is going to wait before making a new request to the service. + */ + public intervalInMs: number; + + constructor( + accountId: string, + operations: RemoteRendering, + assetConversion: AssetConversion, + options: AssetConversionPollerOptions + ) { + super( + new AssetConversionOperation( + accountId, + operations, + new AssetConversionOperationStateImpl(assetConversion) + ) + ); + this.intervalInMs = options.intervalInMs ? options.intervalInMs : 10000; + } + + /** + * The method used by the poller to wait before attempting to update its operation. + */ + async delay(): Promise { + return delay(this.intervalInMs); + } + + /** + * Gets the public state of the polling operation + */ + public getOperationState(): AssetConversionOperationState { + return this.operation.state; + } +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/lro/renderingSessionPoller.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/lro/renderingSessionPoller.ts new file mode 100644 index 000000000000..1394e00d4aca --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/lro/renderingSessionPoller.ts @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { PollOperationState, Poller, PollOperation } from "@azure/core-lro"; +import { KnownRenderingSessionStatus } from "../generated/models/index"; +import { getSessionInternal, endSessionInternal } from "../internal/commonQueries"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { RemoteRendering } from "../generated/operationsInterfaces"; +import { delay } from "@azure/core-util"; +import { RenderingSession } from "../internal/renderingSession"; + +/** + * Options to configure the poller for the beginSession operation. + */ +export interface RenderingSessionPollerOptions { + /** The interval between calls to poll the service for the status of a session. */ + intervalInMs?: number; +} + +/** + * The state carried by the poller for the beginSession operation. + */ +export interface RenderingSessionOperationState extends PollOperationState { + /** + * The latest response when querying the service. The session may or may not be ready. + */ + latestResponse: RenderingSession; +} + +/** + * @internal + */ +export class RenderingSessionOperationStateImpl implements RenderingSessionOperationState { + latestResponse: RenderingSession; + + constructor(conversionState: RenderingSession) { + this.latestResponse = conversionState; + } + + get isStarted(): boolean { + return true; + } + + get isCompleted(): boolean { + return this.latestResponse.status !== KnownRenderingSessionStatus.Starting; + } + + get isCancelled(): boolean { + return this.latestResponse.status === KnownRenderingSessionStatus.Stopped; + } + + get error(): Error | undefined { + if (this.latestResponse.status === "Error") { + return this.latestResponse.error; + } + return undefined; + } + + get result(): RenderingSession { + return this.latestResponse; + } +} + +/** + * @internal + */ +class RenderingSessionOperation + implements PollOperation { + private accountId: string; + private operations: RemoteRendering; + state: RenderingSessionOperationState; + + constructor( + accountId: string, + operations: RemoteRendering, + state: RenderingSessionOperationState + ) { + this.accountId = accountId; + this.operations = operations; + this.state = state; + } + + async update(_options?: { + abortSignal?: AbortSignalLike; + fireProgress?: (state: RenderingSessionOperationStateImpl) => void; + }): Promise { + this.state.latestResponse = await getSessionInternal( + this.accountId, + this.operations, + this.state.latestResponse.sessionId, + "RenderingSessionOperation-Update" + ); + return this; + } + + /** + * Attempts to cancel the underlying operation. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * It returns a promise that should be resolved with an updated version of the poller's operation. + * + * @param options - Optional properties passed to the operation's update method. + */ + async cancel(options?: { abortSignal?: AbortSignalLike }): Promise { + await endSessionInternal( + this.accountId, + this.operations, + this.state.latestResponse.sessionId, + "RenderingSessionOperation-Cancel", + options + ); + return this; + } + + /** + * Serializes the operation. + * Useful when wanting to create a poller that monitors an existing operation. + */ + toString(): string { + return this.state.latestResponse.sessionId; + } +} + +/** + * @internal + */ +export class RenderingSessionPoller extends Poller< + RenderingSessionOperationState, + RenderingSession +> { + /** + * Defines how much time the poller is going to wait before making a new request to the service. + */ + public intervalInMs: number = 10000; + + constructor( + accountId: string, + operations: RemoteRendering, + renderingSession: RenderingSession, + options: RenderingSessionPollerOptions + ) { + super( + new RenderingSessionOperation( + accountId, + operations, + new RenderingSessionOperationStateImpl(renderingSession) + ) + ); + this.intervalInMs = options.intervalInMs ? options.intervalInMs : 10000; + } + + /** + * The method used by the poller to wait before attempting to update its operation. + */ + async delay(): Promise { + return delay(this.intervalInMs); + } + + /** + * Gets the public state of the polling operation + */ + public getOperationState(): RenderingSessionOperationState { + return this.operation.state; + } +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/options.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/options.ts new file mode 100644 index 000000000000..c375123fe856 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/options.ts @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { CommonClientOptions } from "@azure/core-client"; + +/** + * Options to create the RemoteRenderingClient. + */ +export interface RemoteRenderingClientOptions extends CommonClientOptions { + /** + * Overrides the Mixed Reality STS service endpoint. + */ + authenticationEndpointUrl?: string; +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/remoteRenderingClient.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/remoteRenderingClient.ts new file mode 100644 index 000000000000..323065dc4bc2 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/remoteRenderingClient.ts @@ -0,0 +1,695 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { InternalPipelineOptions } from "@azure/core-rest-pipeline"; +import { OperationOptions } from "@azure/core-client"; +import { SpanStatusCode } from "@azure/core-tracing"; + +import { + AccessToken, + AzureKeyCredential, + isTokenCredential, + TokenCredential +} from "@azure/core-auth"; + +import { RemoteRenderingRestClient } from "./generated"; +import { + AssetConversionSettings, + RemoteRenderingRestClientOptionalParams, + RemoteRenderingCreateConversionResponse, + RenderingSessionSettings, + RemoteRenderingCreateSessionResponse, + UpdateSessionSettings +} from "./generated/models/index"; + +import { RemoteRenderingClientOptions } from "./options"; + +import { constructAuthenticationEndpointFromDomain } from "./authentication/authenticationEndpoint"; +import { MixedRealityTokenCredential } from "./authentication/mixedRealityTokenCredential"; +import { StaticAccessTokenCredential } from "./authentication/staticAccessTokenCredential"; +import { MixedRealityAccountKeyCredential } from "./authentication/mixedRealityAccountKeyCredential"; + +import { SDK_VERSION } from "./constants"; +import { logger } from "./logger"; +import { createSpan } from "./tracing"; + +import { PollerLike } from "@azure/core-lro"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; + +import { RemoteRenderingImpl } from "./generated/operations"; +import { + AssetConversionPoller, + AssetConversionOperationState, + AssetConversionPollerOptions +} from "./lro/assetConversionPoller"; +import { + RenderingSessionPoller, + RenderingSessionOperationState, + RenderingSessionPollerOptions +} from "./lro/renderingSessionPoller"; + +import { + endSessionInternal, + getConversionInternal, + getSessionInternal +} from "./internal/commonQueries"; + +import { + AssetConversion, + AssetConversionBase, + NonStartedAssetConversion, + RunningAssetConversion, + SucceededAssetConversion, + FailedAssetConversion, + CancelledAssetConversion, + assetConversionFromConversion +} from "./internal/assetConversion"; +import { + RenderingSession, + RenderingSessionBase, + RenderingSessionProperties, + PartialRenderingSessionProperties, + ReadyRenderingSession, + ErrorRenderingSession, + StartingRenderingSession, + ExpiredRenderingSession, + StoppedRenderingSession, + renderingSessionFromSessionProperties +} from "./internal/renderingSession"; + +export { + AssetConversion, + AssetConversionBase, + NonStartedAssetConversion, + RunningAssetConversion, + SucceededAssetConversion, + FailedAssetConversion, + CancelledAssetConversion, + AssetConversionOperationState, + AssetConversionSettings, + RenderingSession, + RenderingSessionSettings, + RenderingSessionOperationState, + RenderingSessionBase, + RenderingSessionProperties, + PartialRenderingSessionProperties, + ReadyRenderingSession, + ErrorRenderingSession, + StartingRenderingSession, + ExpiredRenderingSession, + StoppedRenderingSession, + UpdateSessionSettings, + RemoteRenderingClientOptions, + AssetConversionPollerOptions, + RenderingSessionPollerOptions +}; + +import { + AssetConversionInputSettings, + AssetConversionOutputSettings, + AssetConversionOutput, + AssetConversionStatus, + KnownAssetConversionStatus, + KnownRenderingSessionStatus, + RenderingServerSize, + KnownRenderingServerSize +} from "./generated/models/index"; + +import { RemoteRenderingServiceError } from "./remoteRenderingServiceError"; + +export { + AssetConversionInputSettings, + AssetConversionOutputSettings, + AssetConversionOutput, + AssetConversionStatus, + RemoteRenderingServiceError, + KnownAssetConversionStatus, + KnownRenderingSessionStatus, + RenderingServerSize, + KnownRenderingServerSize +}; + +/** The poller returned by the beginConversion operation. */ +export type AssetConversionPollerLike = PollerLike; + +/** Options to configure the beginConversion operation. */ +export type BeginConversionOptions = AssetConversionPollerOptions & OperationOptions; + +/** Options for resuming a pre-existing conversion operation. */ +export type ResumeBeginConversionOptions = BeginConversionOptions & { resumeFrom: string }; + +/** Options to configure the beginSession operation. */ +export type BeginSessionOptions = RenderingSessionPollerOptions & OperationOptions; + +/** Options for resuming a pre-existing session operation. */ +export type ResumeBeginSessionOptions = BeginSessionOptions & { resumeFrom: string }; + +/** Options to configure the updateSession operation. */ +export type UpdateSessionOptions = OperationOptions; + +/** Options to configure the getSession operation. */ +export type GetSessionOptions = OperationOptions; + +/** Options to configure the getConversion operation. */ +export type GetConversionOptions = OperationOptions; + +/** Options to configure the listConversions operation. */ +export type ListConversionsOptions = OperationOptions; + +/** Options to configure the endSession operation. */ +export type EndSessionOptions = OperationOptions; + +/** Options to configure the listSessions operation. */ +export type ListSessionsOptions = OperationOptions; + +/** The poller returned by the beginSession operation. */ +export type RenderingSessionPollerLike = PollerLike< + RenderingSessionOperationState, + RenderingSession +>; + +/** + * The client class used to interact with the App Configuration service. + */ +export class RemoteRenderingClient { + private accountId: string; + private client: RemoteRenderingRestClient; + private operations: RemoteRenderingImpl; + + /** + * Creates an instance of a RemoteRenderingClient. + * @param endpoint - The RemoteRendering endpoint to use. + * @param accountId - The Remote Rendering service account identifier. + * @param accountDomain - The Remote Rendering service account domain. + * @param keyCredential - The Remote Rendering service account primary or secondary key credential. + * @param options - Additional client options. + */ + constructor( + endpoint: string, + accountId: string, + accountDomain: string, + credential: AzureKeyCredential, + options?: RemoteRenderingClientOptions + ); + + /** + * Creates an instance of a RemoteRenderingClient. + * @param endpoint - The RemoteRendering endpoint to use. + * @param accountId - The Remote Rendering service account identifier. + * @param accountDomain - The Remote Rendering service account domain. + * @param credential - A token credential for authenticating the account with the Mixed Reality STS service. + * @param options - Additional client options. + */ + constructor( + endpoint: string, + accountId: string, + accountDomain: string, + credential: TokenCredential, + options?: RemoteRenderingClientOptions + ); + + /** + * Creates an instance of a RemoteRenderingClient. + * @param endpoint - The RemoteRendering endpoint to use. + * @param accountId - The Remote Rendering service account identifier. + * @param accountDomain - The Remote Rendering service account domain. + * @param credential - An access token obtained from the Mixed Reality STS service. + * @param options - Additional client options. + */ + constructor( + endpoint: string, + accountId: string, + credential: AccessToken, + options?: RemoteRenderingClientOptions + ); + + constructor(endpoint: string, accountId: string, ...args: Array) { + let tokenCredential: TokenCredential | null = null; + let options: RemoteRenderingClientOptions = {}; + + if (args.length === 0 || args.length > 3) { + throw new Error("Wrong number of arguments."); + } else if (!args[0]) { + throw new Error("Argument 3 cannot be null or empty."); + } else if (typeof args[0] === "object" && args.length <= 2) { + tokenCredential = new StaticAccessTokenCredential(args[0] as AccessToken); + if (args.length === 2) { + options = args[1]; + } + } else if (typeof args[0] === "string" && args.length >= 2 && args.length <= 3) { + const accountDomain: string = args[0]; + + let credential: TokenCredential; + + if (args[1] instanceof AzureKeyCredential) { + credential = new MixedRealityAccountKeyCredential(accountId, args[1]); + } else if (isTokenCredential(args[1])) { + credential = args[1]; + } else { + throw new Error("Argument 4 is not a supported type of credential."); + } + + const authenticationEndpoint = + options.authenticationEndpointUrl ?? + constructAuthenticationEndpointFromDomain(accountDomain); + const stsOptions = { customEndpointUrl: authenticationEndpoint }; + tokenCredential = new MixedRealityTokenCredential( + accountId, + accountDomain, + credential, + stsOptions + ); + if (args.length === 3) { + options = args[2]; + } + } else { + throw new Error("Argument 3 is invalid."); + } + + if (!endpoint) { + throw new Error("Argument cannot be null or empty: 'endpoint'."); + } + + if (!accountId) { + throw new Error("Argument cannot be null or empty: 'accountId'."); + } + + this.accountId = accountId; + + // The below code helps us set a proper User-Agent header on all requests + const libInfo = `azsdk-js-mixed-reality-remote-rendering/${SDK_VERSION}`; + + if (!options.userAgentOptions) { + options.userAgentOptions = {}; + } + + const userAgentOptions = { ...options.userAgentOptions }; + if (options.userAgentOptions.userAgentPrefix) { + userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`; + } else { + userAgentOptions.userAgentPrefix = libInfo; + } + + const internalPipelineOptions: InternalPipelineOptions = { + ...options, + userAgentOptions, + loggingOptions: { + logger: logger.info, + // This array contains header names we want to log that are not already + // included as safe. Unknown/unsafe headers are logged as "". + additionalAllowedHeaderNames: ["X-MRC-CV", "MS-CV"] + } + }; + + const clientOptions: RemoteRenderingRestClientOptionalParams = { + ...internalPipelineOptions, + endpoint: endpoint, + credential: tokenCredential, + credentialScopes: `${endpoint}/.default` + }; + + this.client = new RemoteRenderingRestClient(endpoint, clientOptions); + this.operations = new RemoteRenderingImpl(this.client); + } + + /** + * Creates a conversion using an asset stored in an Azure Blob Storage account. + * @param conversionId - 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. + * @param assetConversionSettings - Settings configuring the asset conversion. + * @param options - The options parameters. + */ + public async beginConversion( + conversionId: string, + assetConversionSettings: AssetConversionSettings, + options?: BeginConversionOptions + ): Promise; + + /** + * Obtains a poller corresponding to a conversion that was already started. + * @param options - The options parameters, carrying a resumeFrom value. + */ + public async beginConversion( + options: ResumeBeginConversionOptions + ): Promise; + + public async beginConversion( + conversionIdOrResumeOptions: string | ResumeBeginConversionOptions, + assetConversionSettings?: AssetConversionSettings, + options?: BeginConversionOptions + ): Promise { + let conversionId: string; + let settings: AssetConversionSettings; + let operationOptions: BeginConversionOptions; + if (typeof conversionIdOrResumeOptions === "string") { + conversionId = conversionIdOrResumeOptions; + settings = assetConversionSettings!; + operationOptions = options ?? {}; + } else { + const assetConversion: AssetConversion = await getConversionInternal( + this.accountId, + this.operations, + conversionIdOrResumeOptions.resumeFrom, + "RemoteRenderingClient-GetConversionPoller", + options + ); + + return new AssetConversionPoller( + this.accountId, + this.operations, + assetConversion, + conversionIdOrResumeOptions + ); + } + + const { span, updatedOptions } = createSpan("RemoteRenderingClient-BeginConversion", { + conversionId: conversionId, + ...options + }); + + try { + const conversion: RemoteRenderingCreateConversionResponse = await this.operations.createConversion( + this.accountId, + conversionId, + { settings: settings }, + updatedOptions + ); + + const poller = new AssetConversionPoller( + this.accountId, + this.operations, + assetConversionFromConversion(conversion), + operationOptions + ); + + await poller.poll(); + + return poller; + } catch (e) { + // There are different standard codes available for different errors: + // https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#status + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + + throw e; + } finally { + span.end(); + } + } + + /** + * Gets the status of a particular conversion. + * @param conversionId - The ID of a previously created conversion. + * @param options - The options parameters. + */ + public async getConversion( + conversionId: string, + options?: GetConversionOptions + ): Promise { + return getConversionInternal( + this.accountId, + this.operations, + conversionId, + "RemoteRenderingClient-GetConversion", + options + ); + } + + private async *getAllConversionsPagingPage( + options?: OperationOptions + ): AsyncIterableIterator { + let result = await this.operations.listConversions(this.accountId, options); + let assetConversionResult = Array.from(result.conversions).map(assetConversionFromConversion); + yield assetConversionResult; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this.operations.listConversionsNext( + this.accountId, + continuationToken, + options + ); + continuationToken = result.nextLink; + assetConversionResult = Array.from(result.conversions).map(assetConversionFromConversion); + yield assetConversionResult; + } + } + + private async *getAllConversionsPagingAll( + options?: OperationOptions + ): AsyncIterableIterator { + for await (const page of this.getAllConversionsPagingPage(options)) { + yield* page; + } + } + + /** + * Gets a list of all conversions. + * @param options - The options parameters. + */ + public listConversions( + options?: ListConversionsOptions + ): PagedAsyncIterableIterator { + const { span, updatedOptions } = createSpan("RemoteRenderingClient-ListConversion", { + ...options + }); + try { + const iter = this.getAllConversionsPagingAll(updatedOptions); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.getAllConversionsPagingPage(updatedOptions); + } + }; + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } + } + + /** + * Creates a new rendering session. + * @param sessionId - 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. + * @param settings - Settings of the session to be created. + * @param options - The options parameters. + */ + public async beginSession( + sessionId: string, + settings: RenderingSessionSettings, + options?: BeginSessionOptions + ): Promise; + + /** + * Obtains a poller for a pre-existing session + * @param options - The options parameters, carrying a resumeFrom value. + */ + public async beginSession( + options: ResumeBeginSessionOptions + ): Promise; + + public async beginSession( + sessionIdOrResumeOptions: string | ResumeBeginSessionOptions, + renderingSessionSettings?: RenderingSessionSettings, + options?: BeginSessionOptions + ): Promise { + let sessionId: string; + let settings: RenderingSessionSettings; + let operationOptions: BeginSessionOptions; + if (typeof sessionIdOrResumeOptions === "string") { + sessionId = sessionIdOrResumeOptions; + settings = renderingSessionSettings!; + operationOptions = options ?? {}; + } else { + const renderingSession: RenderingSession = await getSessionInternal( + this.accountId, + this.operations, + sessionIdOrResumeOptions.resumeFrom, + "RemoteRenderingClient-GetSessionPoller", + sessionIdOrResumeOptions + ); + return new RenderingSessionPoller( + this.accountId, + this.operations, + renderingSession, + sessionIdOrResumeOptions + ); + } + + const { span, updatedOptions } = createSpan("RemoteRenderingClient-BeginSession", { + conversionId: sessionId, + ...operationOptions + }); + + try { + const sessionProperties: RemoteRenderingCreateSessionResponse = await this.operations.createSession( + this.accountId, + sessionId, + settings, + updatedOptions + ); + + const poller = new RenderingSessionPoller( + this.accountId, + this.operations, + renderingSessionFromSessionProperties(sessionProperties), + operationOptions + ); + + // Do I want this? + await poller.poll(); + + return poller; + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } + } + + /** + * Gets the status of a particular session. + * @param sessionId - An ID uniquely identifying the 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. + * @param options - The options parameters. + */ + public async getSession( + sessionId: string, + options?: GetSessionOptions + ): Promise { + return getSessionInternal( + this.accountId, + this.operations, + sessionId, + "RemoteRenderingClient-GetSession", + options + ); + } + + /** + * Updates the max lease time of a particular rendering session. + * @param sessionId - 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. + * @param updateSessionSettings - Settings used to update the session. + * @param options - The options parameters. + */ + public async updateSession( + sessionId: string, + settings: UpdateSessionSettings, + options?: UpdateSessionOptions + ): Promise { + const { span, updatedOptions } = createSpan("RemoteRenderingClient-UpdateSession", { + conversionId: sessionId, + ...options + }); + + try { + const sessionProperties = await this.operations.updateSession( + this.accountId, + sessionId, + settings, + updatedOptions + ); + return renderingSessionFromSessionProperties(sessionProperties); + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } + } + + /** + * Stops a particular rendering session. + * @param sessionId - 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. + * @param options - The options parameters. + */ + public async endSession(sessionId: string, options?: EndSessionOptions): Promise { + return endSessionInternal( + this.accountId, + this.operations, + sessionId, + "RemoteRenderingClient-EndSession", + options + ); + } + + private async *getAllSessionsPagingPage( + options?: OperationOptions + ): AsyncIterableIterator { + let result = await this.operations.listSessions(this.accountId, options); + let sessions = Array.from(result.sessions).map(renderingSessionFromSessionProperties); + yield sessions; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this.operations.listSessionsNext(this.accountId, continuationToken, options); + continuationToken = result.nextLink; + sessions = Array.from(result.sessions).map(renderingSessionFromSessionProperties); + yield sessions; + } + } + + private async *getAllSessionsPagingAll( + options?: OperationOptions + ): AsyncIterableIterator { + for await (const page of this.getAllSessionsPagingPage(options)) { + yield* page; + } + } + + /** + * Gets a list of all sessions. + * @param options - The options parameters. + */ + public listSessions(options?: ListSessionsOptions): PagedAsyncIterableIterator { + const { span, updatedOptions } = createSpan("RemoteRenderingClient-ListConversion", { + ...options + }); + try { + const iter = this.getAllSessionsPagingAll(updatedOptions); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.getAllSessionsPagingPage(updatedOptions); + } + }; + } catch (e) { + span.setStatus({ + code: SpanStatusCode.ERROR, + message: e.message + }); + throw e; + } finally { + span.end(); + } + } +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/remoteRenderingServiceError.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/remoteRenderingServiceError.ts new file mode 100644 index 000000000000..74438ac29b25 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/remoteRenderingServiceError.ts @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { RemoteRenderingServiceErrorInternal } from "./generated"; + +/** Error object containing details about a conversion or session failure. */ +export class RemoteRenderingServiceError extends Error { + /** + * Create a RemoteRenderingServiceError with a message and code. + */ + constructor(message: string, code: string) { + super(message); + Object.setPrototypeOf(this, RemoteRenderingServiceError.prototype); + this.code = code; + this.name = "RemoteRenderingServiceError"; + } + + /** Error code. */ + code: string; + + /** + * An array of details about specific errors that led to this reported error. + */ + details?: RemoteRenderingServiceError[]; + + /** + * The target of the particular error (e.g., the name of the property in error). + */ + target?: string; + + /** + * An object containing more specific information than the current object about the error. + */ + innerError?: RemoteRenderingServiceError; +} + +/** Create a RemoteRenderingServiceError from a RemoteRenderingServiceErrorInternal */ +export function createRemoteRenderingServiceError( + serviceError: RemoteRenderingServiceErrorInternal +): RemoteRenderingServiceError { + const newError = new RemoteRenderingServiceError(serviceError.message, serviceError.code); + newError.details = serviceError.details?.map((x) => createRemoteRenderingServiceError(x)); + newError.target = serviceError.target; + newError.innerError = + serviceError.innerError === undefined + ? undefined + : createRemoteRenderingServiceError(serviceError.innerError!); + return newError; +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/src/tracing.ts b/sdk/remoterendering/mixed-reality-remote-rendering/src/tracing.ts new file mode 100644 index 000000000000..8a44b9a0bfb2 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/src/tracing.ts @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { createSpanFunction } from "@azure/core-tracing"; + +/** + * Creates a span using the global tracer. + * @internal + */ +export const createSpan = createSpanFunction({ + packagePrefix: "Azure.mixed-reality-remote-rendering", + namespace: "Microsoft.MixedReality" +}); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/swagger/README.md b/sdk/remoterendering/mixed-reality-remote-rendering/swagger/README.md new file mode 100644 index 000000000000..567ccb3ca817 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/swagger/README.md @@ -0,0 +1,208 @@ +# Azure Example TypeScript Protocol Layer + +> see https://aka.ms/autorest + +## Configuration + +```yaml +v3: true +package-name: "@azure/mixed-reality-remote-rendering" +title: RemoteRenderingRestClient +description: Azure Remote Rendering Client +generate-metadata: false +license-header: MICROSOFT_MIT_NO_VERSION +output-folder: ../ +source-code-folder-path: ./src/generated +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/2a65b0a2bbd9113b91c889f187d8778c2725c0b9/specification/mixedreality/data-plane/Microsoft.MixedReality/stable/2021-01-01/mr-arr.json +add-credentials: false +package-version: 1.0.0-beta.1 +disable-async-iterators: true +hide-clients: true +typescript: true +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion.properties.id + transform: > + $["x-ms-client-name"] = "conversionId"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion.properties.creationTime + transform: > + $["x-ms-client-name"] = "createdOn"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions + transform: > + $["AssetConversionOutput"] = $.conversion.properties.output; + $.conversion.properties["output"] = {"$ref": "#/definitions/AssetConversionOutput"}; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_settings + transform: > + $["x-ms-client-name"] = "AssetConversionSettings"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_settings.properties.inputLocation + transform: > + $["x-ms-client-name"] = "inputSettings"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_settings.properties.outputLocation + transform: > + $["x-ms-client-name"] = "outputSettings"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_input_settings + transform: > + $["x-ms-client-name"] = "AssetConversionInputSettings"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_input_settings.properties.storageContainerUri + transform: > + $["x-ms-client-name"] = "storageContainerUrl"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_output_settings + transform: > + $["x-ms-client-name"] = "AssetConversionOutputSettings"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_output_settings.properties.storageContainerUri + transform: > + $["x-ms-client-name"] = "storageContainerUrl"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.conversion_status + transform: > + $["x-ms-enum"].name = "AssetConversionStatus"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.AssetConversionOutput.properties.outputAssetUri + transform: > + $["x-ms-client-name"] = "outputAssetUrl"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.error + transform: > + $["x-ms-client-name"] = "RemoteRenderingServiceErrorInternal"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.session_properties.properties.id + transform: > + $["x-ms-client-name"] = "sessionId"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.session_properties.properties.elapsedTimeMinutes + transform: > + $["x-ms-client-name"] = "elapsedTimeInMinutes"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.session_properties.properties.hostname + transform: > + $["x-ms-client-name"] = "host"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.session_properties.properties.maxLeaseTimeMinutes + transform: > + $["x-ms-client-name"] = "maxLeaseTimeInMinutes"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.session_properties.properties.creationTime + transform: > + $["x-ms-client-name"] = "createdOn"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.session_size + transform: > + $["x-ms-enum"].name = "RenderingServerSize"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.create_session_settings + transform: > + $["x-ms-client-name"] = "RenderingSessionSettings"; + $.properties.maxLeaseTimeMinutes["x-ms-client-name"] = "maxLeaseTimeInMinutes" +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.session_status + transform: > + $["x-ms-enum"].name = "RenderingSessionStatus"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.update_session_settings + transform: > + $["x-ms-client-name"] = "UpdateSessionSettings"; +``` + +```yaml +directive: + - from: swagger-document + where: $.definitions.update_session_settings.properties.maxLeaseTimeMinutes + transform: > + $["x-ms-client-name"] = "maxLeaseTimeInMinutes"; +``` diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/test/public/remoteRenderingClient.spec.ts b/sdk/remoterendering/mixed-reality-remote-rendering/test/public/remoteRenderingClient.spec.ts new file mode 100644 index 000000000000..16e7ee135182 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/test/public/remoteRenderingClient.spec.ts @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { assert } from "chai"; +import { Context } from "mocha"; +import { Recorder } from "@azure/test-utils-recorder"; +import { RestError } from "@azure/core-rest-pipeline"; + +import { + RemoteRenderingClient, + AssetConversionInputSettings, + AssetConversionOutputSettings, + AssetConversionSettings, + AssetConversionPollerLike, + AssetConversion, + KnownAssetConversionStatus, + RenderingSessionPollerLike, + RenderingSessionSettings, + RenderingSession +} from "../../src"; +import { + AccessToken, + AzureKeyCredential, + TokenCredential, + GetTokenOptions +} from "@azure/core-auth"; +import { createClient, createRecorder, getEnv } from "../utils/recordedClient"; + +describe("RemoteRenderingClient construction", () => { + const accountDomain = "mixedreality.azure.com"; + const accountId = "00000000-0000-0000-0000-000000000000"; + const accountKey = "00000000-0000-0000-0000-000000000000"; + const serviceEndpoint = "https://remoterendering.mixedreality.azure.com"; + const keyCredential = new AzureKeyCredential(accountKey); + + it("can create", () => { + const client = new RemoteRenderingClient( + serviceEndpoint, + accountId, + accountDomain, + keyCredential + ); + + assert.isNotNull(client); + }); + + it("can create with AccessToken", () => { + const maxTimestampMs = 8640000000000000; + const accessToken: AccessToken = { expiresOnTimestamp: maxTimestampMs, token: `abcdefghijk` }; + const client = new RemoteRenderingClient(serviceEndpoint, accountId, accessToken); + + assert.isNotNull(client); + }); + + it("can create with TokenCredential", () => { + const tokenCredential: TokenCredential = { + getToken: (_scopes: string | string[], _options?: GetTokenOptions) => { + return Promise.resolve(null); + } + }; + const client = new RemoteRenderingClient( + serviceEndpoint, + accountId, + accountDomain, + tokenCredential + ); + + assert.isNotNull(client); + }); + + it("can create with invalid arguments", () => { + assert.throws( + () => new RemoteRenderingClient(undefined!, accountId, accountDomain, keyCredential), + "Argument cannot be null or empty: 'endpoint'." + ); + + assert.throws( + () => new RemoteRenderingClient(serviceEndpoint, undefined!, accountDomain, keyCredential), + "Argument cannot be null or empty: 'accountId'." + ); + + assert.throws( + () => new RemoteRenderingClient(serviceEndpoint, accountId, undefined!, keyCredential), + "Argument 3 cannot be null or empty." + ); + + assert.throws( + () => new RemoteRenderingClient(null!, accountId, accountDomain, keyCredential), + "Argument cannot be null or empty: 'endpoint'." + ); + + assert.throws( + () => new RemoteRenderingClient(serviceEndpoint, null!, accountDomain, keyCredential), + "Argument cannot be null or empty: 'accountId'." + ); + + assert.throws( + () => new RemoteRenderingClient(serviceEndpoint, accountId, null!, keyCredential), + "Argument 3 cannot be null or empty." + ); + }); +}); + +describe("RemoteRendering functional tests", () => { + let client: RemoteRenderingClient; + let recorder: Recorder; + + beforeEach(function(this: Context) { + recorder = createRecorder(this); + client = createClient(); + }); + + afterEach(async function() { + // Stop the recording. + await recorder.stop(); + }); + + it("can convert successfully", async () => { + const storageContainerUrl: string = + "https://" + + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + + ".blob.core.windows.net/" + + getEnv("REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"); + + const inputSettings: AssetConversionInputSettings = { + storageContainerUrl, + storageContainerReadListSas: getEnv("REMOTERENDERING_ARR_SAS_TOKEN"), + relativeInputAssetPath: "testBox.fbx", + blobPrefix: "Input" + }; + const outputSettings: AssetConversionOutputSettings = { + storageContainerUrl, + storageContainerWriteSas: getEnv("REMOTERENDERING_ARR_SAS_TOKEN"), + blobPrefix: "Output" + }; + const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + + const conversionId: string = recorder.getUniqueName("conversionId"); + + const conversionPoller: AssetConversionPollerLike = await client.beginConversion( + conversionId, + conversionSettings + ); + assert.equal(conversionPoller.getOperationState().latestResponse.conversionId, conversionId); + assert.equal( + conversionPoller.getOperationState().latestResponse.settings.inputSettings + .relativeInputAssetPath, + inputSettings.relativeInputAssetPath + ); + assert.notEqual( + conversionPoller.getOperationState().latestResponse.status, + KnownAssetConversionStatus.Failed + ); + + const conversion: AssetConversion = await client.getConversion(conversionId); + assert.equal(conversion.conversionId, conversionId); + assert.notEqual(conversion.status, "Failed"); + + const conversion2: AssetConversion = await conversionPoller.pollUntilDone(); + assert.equal(conversion2.conversionId, conversionId); + assert.equal(conversion2.status, "Succeeded"); + if (conversion2.status === "Succeeded") { + assert.isTrue(conversion2.output.outputAssetUrl?.endsWith("Output/testBox.arrAsset")); + } + + let foundConversion: boolean = false; + for await (const c of client.listConversions()) { + if (c.conversionId === conversionId) { + foundConversion = true; + } + } + assert.isTrue(foundConversion); + }); + + it("throws correct exception on no access", async () => { + const storageContainerUrl = + "https://" + + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + + ".blob.core.windows.net/" + + getEnv("REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"); + + // Do not provide SAS tokens + const inputSettings: AssetConversionInputSettings = { + storageContainerUrl, + relativeInputAssetPath: "testBox.fbx", + blobPrefix: "Input" + }; + const outputSettings: AssetConversionOutputSettings = { + storageContainerUrl, + blobPrefix: "Output" + }; + const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + + const conversionId = recorder.getUniqueName("conversionId"); + + let didThrowExpected: boolean = false; + try { + await client.beginConversion(conversionId, conversionSettings); + } catch (e) { + assert(e instanceof RestError); + if (e instanceof RestError) { + assert.isTrue(e.message.toLowerCase().includes("storage")); + assert.isTrue(e.message.toLowerCase().includes("permission")); + } + didThrowExpected = true; + } + assert.isTrue(didThrowExpected); + }); + + it("will fail in the correct way on missing asset", async () => { + const storageContainerUrl = + "https://" + + getEnv("REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME") + + ".blob.core.windows.net/" + + getEnv("REMOTERENDERING_ARR_BLOB_CONTAINER_NAME"); + + const inputSettings: AssetConversionInputSettings = { + storageContainerUrl, + storageContainerReadListSas: getEnv("REMOTERENDERING_ARR_SAS_TOKEN"), + relativeInputAssetPath: "boxWhichDoesNotExist.fbx", + blobPrefix: "Input" + }; + const outputSettings: AssetConversionOutputSettings = { + storageContainerUrl, + storageContainerWriteSas: getEnv("REMOTERENDERING_ARR_SAS_TOKEN"), + blobPrefix: "Output" + }; + const conversionSettings: AssetConversionSettings = { inputSettings, outputSettings }; + + const conversionId = recorder.getUniqueName("conversionId"); + + const conversionPoller: AssetConversionPollerLike = await client.beginConversion( + conversionId, + conversionSettings + ); + + const assetConversion: AssetConversion = await client.getConversion(conversionId); + assert.equal(assetConversion.conversionId, conversionId); + + const newPoller = await client.beginConversion({ resumeFrom: conversionPoller.toString() }); + assert.equal(newPoller.getOperationState().latestResponse.conversionId, conversionId); + + const conversion: AssetConversion = await conversionPoller.pollUntilDone(); + assert.equal(conversion.status, "Failed"); + if (conversion.status === "Failed") { + // Invalid input provided. Check logs in output container for details. + assert.isTrue(conversion.error.message.toLowerCase().includes("invalid input")); + assert.isTrue(conversion.error.message.toLowerCase().includes("logs")); + } + }); + + it("can start a session", async () => { + const sessionSettings: RenderingSessionSettings = { + maxLeaseTimeInMinutes: 4, + size: "Standard" + }; + const sessionId: string = recorder.getUniqueName("sessionId"); + + const sessionPoller: RenderingSessionPollerLike = await client.beginSession( + sessionId, + sessionSettings + ); + + assert.equal(sessionPoller.getOperationState().latestResponse.sessionId, sessionId); + assert.equal(sessionPoller.getOperationState().latestResponse.size, sessionSettings.size); + assert.equal( + sessionPoller.getOperationState().latestResponse.maxLeaseTimeInMinutes, + sessionSettings.maxLeaseTimeInMinutes + ); + assert.notEqual(sessionPoller.getOperationState().latestResponse.status, "Error"); + + const renderingSession = await client.getSession(sessionId); + assert.equal(renderingSession.sessionId, sessionId); + + const newPoller = await client.beginSession({ resumeFrom: sessionPoller.toString() }); + assert.equal(newPoller.getOperationState().latestResponse.sessionId, sessionId); + + const updatedSession: RenderingSession = await client.updateSession(sessionId, { + maxLeaseTimeInMinutes: 5 + }); + assert.equal(updatedSession.maxLeaseTimeInMinutes, 5); + + const readyRenderingSession: RenderingSession = await sessionPoller.pollUntilDone(); + + // beginSession does one interval of polling. If the session was ready within that time, then the poller + // would carry the earlier maxLeastTimeInMinutes value. + assert.isTrue( + readyRenderingSession.maxLeaseTimeInMinutes === 4 || + readyRenderingSession.maxLeaseTimeInMinutes === 5 + ); + + assert.equal(readyRenderingSession.status, "Ready"); + + let foundSession: boolean = false; + for await (const s of client.listSessions()) { + if (s.sessionId === sessionId) { + foundSession = true; + } + } + assert.isTrue(foundSession); + + await client.endSession(sessionId); + }); + + it("throws the correct exception on invalid session properties", async () => { + const sessionSettings: RenderingSessionSettings = { + maxLeaseTimeInMinutes: -4, + size: "Standard" + }; + const sessionId: string = recorder.getUniqueName("sessionId"); + + let didThrowExpected: boolean = false; + try { + await client.beginSession(sessionId, sessionSettings); + } catch (e) { + assert(e instanceof RestError); + if (e instanceof RestError) { + // The maxLeaseTimeMinutes value cannot be negative + assert.isTrue(e.message.toLowerCase().includes("lease")); + assert.isTrue(e.message.toLowerCase().includes("negative")); + } + didThrowExpected = true; + } + assert.isTrue(didThrowExpected); + }); +}); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/test/utils/env.browser.ts b/sdk/remoterendering/mixed-reality-remote-rendering/test/utils/env.browser.ts new file mode 100644 index 000000000000..fd2aca680c7b --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/test/utils/env.browser.ts @@ -0,0 +1,2 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/test/utils/env.ts b/sdk/remoterendering/mixed-reality-remote-rendering/test/utils/env.ts new file mode 100644 index 000000000000..0e06855b73ae --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/test/utils/env.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import * as dotenv from "dotenv"; + +dotenv.config(); diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/test/utils/recordedClient.ts b/sdk/remoterendering/mixed-reality-remote-rendering/test/utils/recordedClient.ts new file mode 100644 index 000000000000..dc724c690fb4 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/test/utils/recordedClient.ts @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { Context } from "mocha"; + +import { AccessToken, AzureKeyCredential } from "@azure/core-auth"; +import { + env, + record, + Recorder, + RecorderEnvironmentSetup, + isPlaybackMode +} from "@azure/test-utils-recorder"; + +import { RemoteRenderingClient } from "../../src"; +import "./env"; + +// When the recorder observes the values of these environment variables +// in any recorded HTTP request or response, it will replace them with +// the values they are mapped to below, which are not real account details. +const replaceableVariables: Record = { + REMOTERENDERING_ARR_ACCOUNT_DOMAIN: "eastus2.mixedreality.azure.com", + REMOTERENDERING_ARR_ACCOUNT_ID: "00000000-1111-2222-3333-444455556666", + REMOTERENDERING_ARR_ACCOUNT_KEY: "arr_account_key", + REMOTERENDERING_ARR_BLOB_CONTAINER_NAME: "test", + REMOTERENDERING_ARR_SAS_TOKEN: "arr_sas_token", + REMOTERENDERING_ARR_SERVICE_ENDPOINT: "https://remoterendering.eastus2.mixedreality.azure.com", + REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME: "sdktest" +}; + +export const environmentSetup: RecorderEnvironmentSetup = { + replaceableVariables, + queryParametersToSkip: [], + customizationsOnRecordings: [ + // Replace the recorded AccessToken value with a fake one. + (recording: string): string => + recording.replace(/"AccessToken":"[^"]*"/g, `"AccessToken":""`) + ] +}; + +export function getEnv(name: string): string { + // If a value exists on the real environment, use it, + // otherwise, try to use the default values from + // replaceableVariables + return env[name] ?? replaceableVariables[name]; +} + +export function createClient(): RemoteRenderingClient { + const serviceEndpoint = getEnv("REMOTERENDERING_ARR_SERVICE_ENDPOINT"); + const accountDomain = getEnv("REMOTERENDERING_ARR_ACCOUNT_DOMAIN"); + const accountId = getEnv("REMOTERENDERING_ARR_ACCOUNT_ID"); + const accountKey = getEnv("REMOTERENDERING_ARR_ACCOUNT_KEY"); + + if (isPlaybackMode()) { + // When playing back, we do not want to interact with the STS service, so we use + // the AccessToken auth path. + const maxTimestampMs = 8640000000000000; + const credential: AccessToken = { token: "", expiresOnTimestamp: maxTimestampMs }; + return new RemoteRenderingClient(serviceEndpoint, accountId, credential); + } else { + const credential: AzureKeyCredential = new AzureKeyCredential(accountKey); + return new RemoteRenderingClient(serviceEndpoint, accountId, accountDomain, credential); + } +} + +/** + * Creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export function createRecorder(context: Context): Recorder { + return record(context, environmentSetup); +} diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/tests.yml b/sdk/remoterendering/mixed-reality-remote-rendering/tests.yml new file mode 100644 index 000000000000..5c69d891ad48 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/tests.yml @@ -0,0 +1,10 @@ +trigger: none + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml + parameters: + PackageName: "@azure/mixed-reality-remote-rendering" + ServiceDirectory: remoterendering + Location: eastus2 + MatrixFilters: + - DependencyVersion=^$ diff --git a/sdk/remoterendering/mixed-reality-remote-rendering/tsconfig.json b/sdk/remoterendering/mixed-reality-remote-rendering/tsconfig.json new file mode 100644 index 000000000000..5b129befdb47 --- /dev/null +++ b/sdk/remoterendering/mixed-reality-remote-rendering/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../../tsconfig.package", + "compilerOptions": { + "outDir": "./dist-esm", + "declarationDir": "./types", + "paths": { + "@azure/mixed-reality-remote-rendering": ["./src/index"] + } + }, + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-samples", + "dist-esm", + "./samples/**/*.ts" + ], + "include": ["src/**/*.ts", "test/**/*.ts", "samples-dev/**/*.ts"] +} diff --git a/sdk/remoterendering/test-resources-post.ps1 b/sdk/remoterendering/test-resources-post.ps1 new file mode 100644 index 000000000000..73cc2b2e88e5 --- /dev/null +++ b/sdk/remoterendering/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-js/blob/main/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['REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME'] +$StorageAccountKey = $DeploymentOutputs['REMOTERENDERING_ARR_STORAGE_ACCOUNT_KEY'] +$BlobContainerName = $DeploymentOutputs['REMOTERENDERING_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/remoterendering/test-resources.json b/sdk/remoterendering/test-resources.json new file mode 100644 index 000000000000..9f69130b2ebb --- /dev/null +++ b/sdk/remoterendering/test-resources.json @@ -0,0 +1,119 @@ +{ + "$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." + } + }, + "baseTime": { + "type": "string", + "defaultValue": "[utcNow('u')]" + } + }, + "variables": { + "apiVersion": "2020-05-01", + "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/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": { + "REMOTERENDERING_ARR_ACCOUNT_ID": { + "type": "string", + "value": "[reference(variables('arrAccountName')).accountId]" + }, + "REMOTERENDERING_ARR_ACCOUNT_DOMAIN": { + "type": "string", + "value": "[reference(variables('arrAccountName')).accountDomain]" + }, + "REMOTERENDERING_ARR_ACCOUNT_KEY": { + "type": "string", + "value": "[listKeys(resourceId('Microsoft.MixedReality/remoteRenderingAccounts', variables('arrAccountName')), variables('arrApiVersion')).primaryKey]" + }, + "REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME": { + "type": "string", + "value": "[variables('storageAccountName')]" + }, + "REMOTERENDERING_ARR_STORAGE_ACCOUNT_KEY": { + "type": "string", + "value": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), variables('storageApiVersion')).keys[0].value]" + }, + "REMOTERENDERING_ARR_BLOB_CONTAINER_NAME": { + "type": "string", + "value": "[variables('blobContainerName')]" + }, + "REMOTERENDERING_ARR_SAS_TOKEN": { + "type": "string", + "value": "[listServiceSas(variables('storageAccountName'), variables('storageApiVersion'), variables('sasProperties')).serviceSasToken]" + }, + "REMOTERENDERING_ARR_SERVICE_ENDPOINT": { + "type": "string", + "value": "[concat('https://remoterendering.', parameters('location'), '.mixedreality.azure.com')]" + } + } +}