{ "swagger": "2.0", "info": { "title": "Microsoft PlaywrightTesting AuthManager Service API", "version": "2024-12-01", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "x-ms-parameterized-host": { "hostTemplate": "{endpoint}", "useSchemePrefix": false, "parameters": [ { "name": "endpoint", "in": "path", "description": "Supported Azure Playwright Service API Endpoints (protocol and hostname, for example:\n https://{region}.api.playwright.microsoft.com).", "required": true, "type": "string" } ] }, "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "OAuth2Auth": [ "https://playwright.microsoft.com/.default" ], "OAuth2Auth_": [ "https://playwright.microsoft.com/.default" ] } ], "securityDefinitions": { "OAuth2Auth": { "type": "oauth2", "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "https://playwright.microsoft.com/.default": "" } }, "OAuth2Auth_": { "type": "oauth2", "flow": "accessCode", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "https://playwright.microsoft.com/.default": "" }, "tokenUrl": "https://login.microsoftonline.com/common/v2.0/oauth2/token" } }, "tags": [], "paths": { "/accounts/{accountId}": { "get": { "operationId": "Accounts_Get", "description": "Get details of the Azure resource mapped to an account for the given account id. Authorization required is Bearer JWT Access token provided by EntraID.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "accountId", "in": "path", "description": "The account id.", "required": true, "type": "string", "maxLength": 64, "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/Microsoft.PlaywrightTesting.Shared.Account" }, "headers": { "x-ms-client-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, client-generated string identifier for the request." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Accounts_Get": { "$ref": "./examples/Accounts_Get.json" } } } }, "/accounts/{accountId}/access-tokens": { "get": { "operationId": "AccessTokens_List", "description": "Lists access-tokens for the given account id. It can use OData query params like $select, $filter, $orderby, $top and $skip. The default page size is 10. Use nextLink in response to fetch more objects in the list. Authorization required is Bearer JWT Access token provided by EntraID.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "accountId", "in": "path", "description": "The account id.", "required": true, "type": "string", "maxLength": 64, "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/PagedAccessToken" }, "headers": { "x-ms-client-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, client-generated string identifier for the request." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "AccessTokens_List": { "$ref": "./examples/AccessTokens_List.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/accounts/{accountId}/access-tokens/{accessTokenId}": { "get": { "operationId": "AccessTokens_Get", "description": "Gets an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "accountId", "in": "path", "description": "The account id.", "required": true, "type": "string", "maxLength": 64, "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" }, { "name": "accessTokenId", "in": "path", "description": "The access-token id.", "required": true, "type": "string", "format": "uuid", "maxLength": 64, "pattern": "[A-Za-z0-9]+(-[A-Za-z0-9]+)+" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/AccessToken" }, "headers": { "x-ms-client-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, client-generated string identifier for the request." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "AccessTokens_Get": { "$ref": "./examples/AccessTokens_Get.json" } } }, "put": { "operationId": "AccessTokens_CreateOrReplace", "description": "Creates an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "accountId", "in": "path", "description": "The account id.", "required": true, "type": "string", "maxLength": 64, "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" }, { "name": "accessTokenId", "in": "path", "description": "The access-token id.", "required": true, "type": "string", "format": "uuid", "maxLength": 64, "pattern": "[A-Za-z0-9]+(-[A-Za-z0-9]+)+" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" }, { "name": "resource", "in": "body", "description": "The resource instance.", "required": true, "schema": { "$ref": "#/definitions/AccessToken" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/AccessToken" }, "headers": { "x-ms-client-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, client-generated string identifier for the request." } } }, "201": { "description": "The request has succeeded and a new resource has been created as a result.", "schema": { "$ref": "#/definitions/AccessToken" }, "headers": { "x-ms-client-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, client-generated string identifier for the request." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "AccessTokens_CreateOrReplace": { "$ref": "./examples/AccessTokens_CreateOrReplace.json" } } }, "delete": { "operationId": "AccessTokens_Delete", "description": "Deletes an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "accountId", "in": "path", "description": "The account id.", "required": true, "type": "string", "maxLength": 64, "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" }, { "name": "accessTokenId", "in": "path", "description": "The access-token id.", "required": true, "type": "string", "format": "uuid", "maxLength": 64, "pattern": "[A-Za-z0-9]+(-[A-Za-z0-9]+)+" }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" } ], "responses": { "204": { "description": "There is no content to send for this request, but the headers may be useful. ", "headers": { "x-ms-client-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, client-generated string identifier for the request." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "AccessTokens_Delete": { "$ref": "./examples/AccessTokens_Delete.json" } } } }, "/accounts/{accountId}/browsers": { "get": { "operationId": "Accounts_GetBrowsers", "description": "Gets remote browsers corresponding to given account id and redirects the client for running Playwright tests. Authorization required is Bearer JWT Access token provided by EntraID or Microsoft Playwright Testing Service.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "accountId", "in": "path", "description": "The account id.", "required": true, "type": "string" }, { "name": "runId", "in": "query", "description": "The run id provided by client for corresponding remote test run.", "required": false, "type": "string" }, { "name": "os", "in": "query", "description": "The os provided by client for remote test runs.", "required": false, "type": "string", "default": "Linux", "enum": [ "Linux", "Windows" ], "x-ms-enum": { "name": "OS", "modelAsString": true, "values": [ { "name": "Linux", "value": "Linux", "description": "Linux OS." }, { "name": "Windows", "value": "Windows", "description": "Windows OS." } ] } }, { "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" } ], "responses": { "302": { "description": "Redirection", "headers": { "location": { "type": "string", "format": "uri", "description": "The redirect target URL to run test on remote browsers." }, "x-ms-client-request-id": { "type": "string", "format": "uuid", "description": "An opaque, globally-unique, client-generated string identifier for the request." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Accounts_GetBrowsers": { "$ref": "./examples/Accounts_GetBrowsers.json" } } } } }, "definitions": { "AccessToken": { "type": "object", "description": "Model of an access-token linked to an account.", "properties": { "id": { "$ref": "#/definitions/Azure.Core.uuid", "description": "The access-token id.", "maxLength": 64, "pattern": "[A-Za-z0-9]+(-[A-Za-z0-9]+)+", "readOnly": true }, "name": { "type": "string", "description": "The access-token name.", "minLength": 3, "maxLength": 64, "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$", "x-ms-mutability": [ "read", "create" ] }, "jwtToken": { "type": "string", "description": "The access-token value in JWT format.", "readOnly": true }, "createdAt": { "type": "string", "format": "date-time", "description": "The access-token createdAt utcDateTime.", "readOnly": true }, "expiryAt": { "type": "string", "format": "date-time", "description": "The access-token expiryAt utcDateTime.", "x-ms-mutability": [ "read", "create" ] }, "state": { "$ref": "#/definitions/AccessTokenState", "description": "The access-token state - Active | Expired.", "readOnly": true } }, "required": [ "id", "name", "createdAt", "expiryAt", "state" ] }, "AccessTokenState": { "type": "string", "description": "The access-token state.", "enum": [ "Active", "Expired" ], "x-ms-enum": { "name": "AccessTokenState", "modelAsString": true, "values": [ { "name": "Active", "value": "Active", "description": "The access-token is Active." }, { "name": "Expired", "value": "Expired", "description": "The access-token is Expired." } ] } }, "Azure.Core.Foundations.Error": { "type": "object", "description": "The error object.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error." }, "details": { "type": "array", "description": "An array of details about specific errors that led to this reported error.", "items": { "$ref": "#/definitions/Azure.Core.Foundations.Error" } }, "innererror": { "$ref": "#/definitions/Azure.Core.Foundations.InnerError", "description": "An object containing more specific information than the current object about the error." } }, "required": [ "code", "message" ] }, "Azure.Core.Foundations.ErrorResponse": { "type": "object", "description": "A response containing error details.", "properties": { "error": { "$ref": "#/definitions/Azure.Core.Foundations.Error", "description": "The error object." } }, "required": [ "error" ] }, "Azure.Core.Foundations.InnerError": { "type": "object", "description": "An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "innererror": { "$ref": "#/definitions/Azure.Core.Foundations.InnerError", "description": "Inner error." } } }, "Azure.Core.uuid": { "type": "string", "format": "uuid", "description": "Universally Unique Identifier" }, "Microsoft.PlaywrightTesting.Shared.Account": { "type": "object", "description": "An account is a parent resource for most of the other service resources. It's directly mapped to an Azure resource.", "properties": { "id": { "type": "string", "description": "The account id.", "maxLength": 64, "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+", "readOnly": true }, "resourceId": { "type": "string", "description": "The fully-qualified Azure resource id for the account.", "readOnly": true }, "name": { "type": "string", "description": "The account name.", "readOnly": true }, "state": { "$ref": "#/definitions/Microsoft.PlaywrightTesting.Shared.AccountState", "description": "The state of account - Active | Inactive", "readOnly": true }, "subscriptionId": { "$ref": "#/definitions/Azure.Core.uuid", "description": "The Azure subscription id for the account.", "readOnly": true }, "subscriptionState": { "$ref": "#/definitions/Microsoft.PlaywrightTesting.Shared.SubscriptionState", "description": "The Azure subscription state - Registered | Unregistered | Warned | Suspended | Deleted", "readOnly": true }, "tenantId": { "$ref": "#/definitions/Azure.Core.uuid", "description": "The Azure tenant id of the account.", "readOnly": true }, "location": { "type": "string", "description": "The account resource location in Azure, for eg. eastus, southeastasia.", "readOnly": true }, "regionalAffinity": { "type": "string", "description": "This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in the Azure region in which the workspace was initially created.", "default": "Enabled", "enum": [ "Enabled", "Disabled" ], "x-ms-enum": { "name": "EnablementStatus", "modelAsString": true, "values": [ { "name": "Enabled", "value": "Enabled", "description": "The feature is Enabled." }, { "name": "Disabled", "value": "Disabled", "description": "The feature is Disabled." } ] }, "readOnly": true }, "scalableExecution": { "type": "string", "description": "When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of parallel workers for a test run, significantly minimizing test completion durations.", "default": "Enabled", "enum": [ "Enabled", "Disabled" ], "x-ms-enum": { "name": "EnablementStatus", "modelAsString": true, "values": [ { "name": "Enabled", "value": "Enabled", "description": "The feature is Enabled." }, { "name": "Disabled", "value": "Disabled", "description": "The feature is Disabled." } ] }, "readOnly": true }, "reporting": { "type": "string", "description": "When enabled, this feature allows the workspace to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting.", "default": "Enabled", "enum": [ "Enabled", "Disabled" ], "x-ms-enum": { "name": "EnablementStatus", "modelAsString": true, "values": [ { "name": "Enabled", "value": "Enabled", "description": "The feature is Enabled." }, { "name": "Disabled", "value": "Disabled", "description": "The feature is Disabled." } ] }, "readOnly": true }, "localAuth": { "type": "string", "description": "When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations.", "default": "Disabled", "enum": [ "Enabled", "Disabled" ], "x-ms-enum": { "name": "EnablementStatus", "modelAsString": true, "values": [ { "name": "Enabled", "value": "Enabled", "description": "The feature is Enabled." }, { "name": "Disabled", "value": "Disabled", "description": "The feature is Disabled." } ] }, "readOnly": true } }, "required": [ "id", "resourceId", "name", "state", "subscriptionId", "subscriptionState", "tenantId", "location" ] }, "Microsoft.PlaywrightTesting.Shared.AccountState": { "type": "string", "description": "The account state.", "enum": [ "Active", "Inactive" ], "x-ms-enum": { "name": "AccountState", "modelAsString": true, "values": [ { "name": "Active", "value": "Active", "description": "The account is Active." }, { "name": "Inactive", "value": "Inactive", "description": "The account is Inactive." } ] } }, "Microsoft.PlaywrightTesting.Shared.SubscriptionState": { "type": "string", "description": "The Azure subscription state.", "enum": [ "Registered", "Warned", "Suspended", "Deleted", "Unregistered" ], "x-ms-enum": { "name": "SubscriptionState", "modelAsString": true, "values": [ { "name": "Registered", "value": "Registered", "description": "The subscription state is Registered." }, { "name": "Warned", "value": "Warned", "description": "The subscription state is Warned." }, { "name": "Suspended", "value": "Suspended", "description": "The subscription state is Suspended." }, { "name": "Deleted", "value": "Deleted", "description": "The subscription state is Deleted." }, { "name": "Unregistered", "value": "Unregistered", "description": "The subscription state is Unregistered." } ] } }, "PagedAccessToken": { "type": "object", "description": "Paged collection of AccessToken items", "properties": { "value": { "type": "array", "description": "The AccessToken items on this page", "items": { "$ref": "#/definitions/AccessToken" } }, "nextLink": { "type": "string", "format": "uri", "description": "The link to the next page of items" } }, "required": [ "value" ] } }, "parameters": { "Azure.Core.ClientRequestIdHeader": { "name": "x-ms-client-request-id", "in": "header", "description": "An opaque, globally-unique, client-generated string identifier for the request.", "required": false, "type": "string", "format": "uuid", "x-ms-parameter-location": "method", "x-ms-client-name": "clientRequestId" }, "Azure.Core.Foundations.ApiVersionParameter": { "name": "api-version", "in": "query", "description": "The API version to use for this operation.", "required": true, "type": "string", "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" } } }