From 4496ceb36cfeff7443f3570274c437acd72a5ded Mon Sep 17 00:00:00 2001 From: Aravind Bharatha Date: Tue, 21 Mar 2023 22:25:52 -0400 Subject: [PATCH] [Hub Generated] Review request for Microsoft.Help to add version preview/2023-01-01-preview (#23056) * Generate new Service for help * init commit microsoft.help-2023-01-01-preview * Updating swagger documentation #1 * Updating swagger documentation #2 * Adding suppressions for Help 2023-01-01-preview api * Adding suppressions for Help 2023-01-01-preview api #2 * removed unnecessary files * update examples --- ...ilityForDiagnosticWhenNameIsAvailable.json | 17 + ...tyForDiagnosticWhenNameIsNotAvailable.json | 19 + .../CreateDiagnosticForKeyVaultResource.json | 35 + .../GetDiagnosticForKeyVaultResource.json | 38 ++ ...DiscoverySolutionsForKeyVaultResource.json | 45 ++ .../examples/ListOperations.json | 33 + .../preview/2023-01-01-preview/help.json | 614 ++++++++++++++++++ .../help/resource-manager/readme.csharp.md | 15 + .../help/resource-manager/readme.go.md | 11 + specification/help/resource-manager/readme.md | 91 +++ .../help/resource-manager/readme.python.md | 18 + .../resource-manager/readme.typescript.md | 14 + 12 files changed, 950 insertions(+) create mode 100644 specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json create mode 100644 specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsNotAvailable.json create mode 100644 specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CreateDiagnosticForKeyVaultResource.json create mode 100644 specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/GetDiagnosticForKeyVaultResource.json create mode 100644 specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/ListDiscoverySolutionsForKeyVaultResource.json create mode 100644 specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/ListOperations.json create mode 100644 specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/help.json create mode 100644 specification/help/resource-manager/readme.csharp.md create mode 100644 specification/help/resource-manager/readme.go.md create mode 100644 specification/help/resource-manager/readme.md create mode 100644 specification/help/resource-manager/readme.python.md create mode 100644 specification/help/resource-manager/readme.typescript.md diff --git a/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json b/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json new file mode 100644 index 000000000000..fd094011c2b2 --- /dev/null +++ b/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "api-version": "2023-01-01-preview", + "scope": "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6", + "CheckNameAvailabilityRequest": { + "name": "sampleName", + "type": "Microsoft.Help/diagnostics" + } + }, + "responses": { + "200": { + "body": { + "nameAvailable": true + } + } + } +} diff --git a/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsNotAvailable.json b/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsNotAvailable.json new file mode 100644 index 000000000000..52764446e8ac --- /dev/null +++ b/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CheckNameAvailabilityForDiagnosticWhenNameIsNotAvailable.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2023-01-01-preview", + "scope": "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6", + "CheckNameAvailabilityRequest": { + "name": "sampleName", + "type": "Microsoft.Help/diagnostics" + } + }, + "responses": { + "200": { + "body": { + "nameAvailable": false, + "reason": "Name is already in use", + "message": "Name not available" + } + } + } +} diff --git a/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CreateDiagnosticForKeyVaultResource.json b/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CreateDiagnosticForKeyVaultResource.json new file mode 100644 index 000000000000..f10d3a361a45 --- /dev/null +++ b/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/CreateDiagnosticForKeyVaultResource.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "api-version": "2023-01-01-preview", + "scope": "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read", + "diagnosticsResourceName": "VMNotWorkingInsight", + "diagnosticItemRequest": { + "properties": { + "insights": [ + { + "solutionId": "SampleSolutionId", + "additionalParameters": { + "foo": "bar" + } + } + ], + "globalParameters": { + "startTime": "2020-07-01" + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read/providers/Microsoft.Help/diagnostics/VMNotWorkingInsight", + "name": "VMNotWorkingInsight", + "type": "Microsoft.Help/diagnostics", + "properties": { + "provisioningState": "Succeeded", + "acceptedAt": "2023-03-10T03:04:40Z" + } + } + } + } +} diff --git a/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/GetDiagnosticForKeyVaultResource.json b/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/GetDiagnosticForKeyVaultResource.json new file mode 100644 index 000000000000..998837706184 --- /dev/null +++ b/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/GetDiagnosticForKeyVaultResource.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "api-version": "2023-01-01-preview", + "scope": "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read", + "diagnosticsResourceName": "VMNotWorkingInsight" + }, + "responses": { + "200": { + "body": { + "id": "subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read/providers/Microsoft.Help/diagnostics/VMNotWorkingInsight", + "type": "VMNotWorkingInsight", + "name": "Microsoft.Help/diagnostics", + "properties": { + "acceptedAt": "2023-03-10T03:04:40Z", + "provisioningState": "Succeeded", + "diagnostics": [ + { + "solutionId": "sampleSolutionId", + "status": "Succeeded", + "insights": [ + { + "id": "InsightArticleId", + "title": "An example title for an Insight", + "results": "Article Content", + "importanceLevel": "Critical" + } + ], + "error": { + "code": "errorCode", + "message": "errorMessage" + } + } + ] + } + } + } + } +} diff --git a/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/ListDiscoverySolutionsForKeyVaultResource.json b/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/ListDiscoverySolutionsForKeyVaultResource.json new file mode 100644 index 000000000000..c25c8427d036 --- /dev/null +++ b/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/ListDiscoverySolutionsForKeyVaultResource.json @@ -0,0 +1,45 @@ +{ + "parameters": { + "api-version": "2023-01-01-preview", + "scope": "subscriptions/0d0fcd2e-c4fd-4349-8497-200edb3923c6/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "solutionId": "SampleSolutionId1", + "solutionType": "Diagnostics", + "description": "This is a diagnostic", + "requiredParameterSets": [ + [ + "ResourceUri" + ] + ] + }, + { + "solutionId": "SampleSolutionId2", + "solutionType": "Diagnostics", + "description": "This is another diagnostic", + "requiredParameterSets": [ + [ + "ResourceUri" + ] + ] + }, + { + "solutionId": "SampleSolutionId3", + "solutionType": "Diagnostics", + "description": "This is another testing diagnostic" + }, + { + "solutionId": "SampleSolutionId4", + "solutionType": "Diagnostics", + "description": "This is also another testing diagnostic" + } + ], + "nextLink": "nextLinkUrl" + } + } + } +} diff --git a/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/ListOperations.json b/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/ListOperations.json new file mode 100644 index 000000000000..3ae03407bc54 --- /dev/null +++ b/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/examples/ListOperations.json @@ -0,0 +1,33 @@ +{ + "parameters": { + "api-version": "2023-01-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.Help/diagnostics/read", + "isDataAction": false, + "display": { + "provider": "Microsoft.Diagnostics", + "resource": "Diagnostics", + "operation": "Create/Read a Diagnostic", + "description": "Created and Reads a diagnostic resource to troubleshoot an issue with a resource." + } + }, + { + "name": "Microsoft.Help/discoverySolutions/read", + "isDataAction": false, + "display": { + "provider": "Microsoft.Help", + "resource": "DiscoverySolutions", + "operation": "List of available solutions.", + "description": "Returns list of solutions based on ResourceType or ProblemClassficationId" + } + } + ] + } + } + } +} diff --git a/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/help.json b/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/help.json new file mode 100644 index 000000000000..dd150f6fdcb9 --- /dev/null +++ b/specification/help/resource-manager/Microsoft.Help/preview/2023-01-01-preview/help.json @@ -0,0 +1,614 @@ +{ + "swagger": "2.0", + "info": { + "title": "HelpRP", + "description": "Help RP provider", + "version": "2023-01-01-preview" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/providers/Microsoft.Help/operations": { + "get": { + "tags": [ + "operations" + ], + "description": "Returns list of operations.", + "operationId": "Operations_List", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Operation details.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "deprecated": false, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List All Operations": { + "$ref": "./examples/ListOperations.json" + } + } + } + }, + "/{scope}/providers/Microsoft.Help/checkNameAvailability": { + "post": { + "tags": [ + "diagnostics" + ], + "description": "This API is used to check the uniqueness of a resource name used for a diagnostic check.", + "operationId": "Diagnostics_CheckNameAvailability", + "parameters": [ + { + "$ref": "#/parameters/ScopeParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "CheckNameAvailabilityRequest", + "description": "The required parameters for availability check.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/CheckNameAvailabilityRequest" + } + } + ], + "responses": { + "200": { + "description": "Response for the availability of the requested resource name.", + "schema": { + "$ref": "#/definitions/CheckNameAvailabilityResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Example when name is available for a Diagnostic resource": { + "$ref": "./examples/CheckNameAvailabilityForDiagnosticWhenNameIsAvailable.json" + }, + "Example when name is not available for a Diagnostic resource": { + "$ref": "./examples/CheckNameAvailabilityForDiagnosticWhenNameIsNotAvailable.json" + } + } + } + }, + "/{scope}/providers/Microsoft.Help/diagnostics/{diagnosticsResourceName}": { + "put": { + "tags": [ + "diagnostics" + ], + "description": "

Overview:

Azure Help API programmatically helps you troubleshoot Azure issues and provides access to rich and powerful self-help solutions and diagnostics. Using the API, you can perform the following operations:
Solution DiscoveryLists the diagnostics for an Azure issue based on the prerequisites.
DiagnosticsCreate and Get diagnostics for issues with Azure resources based on prerequisites (see below).

Prerequisites for Diagnostics:

The diagnostics API is called after solutions discovery and returns diagnostic info for your Azure issue.

You must have reader access role at the resource level to create diagnostics.

'RequiredParameterSets' from Discovery Solutions API response has to be passed via 'properties.insights.additionalParameters' as a key-value pairs to Diagnostics Api.", + "operationId": "Diagnostics_Create", + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "parameters": [ + { + "$ref": "#/parameters/ScopeParameter" + }, + { + "$ref": "#/parameters/DiagnosticsResourceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "diagnosticResourceRequest", + "description": "The required request body for this insightResource invocation.", + "schema": { + "$ref": "#/definitions/DiagnosticResource" + } + } + ], + "responses": { + "201": { + "description": "Successful diagnostics invocation (may contain errors).", + "schema": { + "$ref": "#/definitions/DiagnosticResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Creates a Diagnostic for a KeyVault resource": { + "$ref": "./examples/CreateDiagnosticForKeyVaultResource.json" + } + } + }, + "get": { + "tags": [ + "diagnostics" + ], + "description": "

Overview:

Azure Help API programmatically helps you troubleshoot Azure issues and provides access to rich and powerful self-help solutions and diagnostics. Using the API, you can perform the following operations:
Solution DiscoveryLists the diagnostics for an Azure issue based on the prerequisites.
DiagnosticsCreate and Get diagnostics for issues with Azure resources based on prerequisites (see below).

Prerequisites for Diagnostics:

The diagnostics API is called after solutions discovery and returns diagnostic info for your Azure issue.

You must have reader access role at the resource level to get the diagnostics.

'RequiredParameterSets' from Discovery Solutions API response has to be passed via 'properties.insights.additionalParameters' as a key-value pairs to Diagnostics Api.", + "operationId": "Diagnostics_Get", + "parameters": [ + { + "$ref": "#/parameters/ScopeParameter" + }, + { + "$ref": "#/parameters/DiagnosticsResourceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful fetched insight diagnostic (may contain errors).", + "schema": { + "$ref": "#/definitions/DiagnosticResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Gets a Diagnostic for a KeyVault resource": { + "$ref": "./examples/GetDiagnosticForKeyVaultResource.json" + } + } + } + }, + "/{scope}/providers/Microsoft.Help/discoverySolutions": { + "get": { + "tags": [ + "discoverySolutions" + ], + "description": "

Overview:

Azure Help API programmatically helps you troubleshoot Azure issues and provides access to rich and powerful self-help solutions and diagnostics. Using the API, you can perform the following operations:
Solution DiscoveryLists the diagnostics for an Azure issue based on the prerequisites (see below).
DiagnosticsCreate and Get diagnostics for issues with Azure resources.

Prerequisites for solution discovery:

You can call the API to discover solutions with the following inputs:
i. Required inputs: resourceUri.
ii. Optional input: problemClassificationId.

This API enables discovery of diagnostics for a defined list of Azure support issues, and is not supported for all ProblemClassificationId(s) at the moment. For ProblemClassificationId(s) that are not supported, the API response will not return any diagnostics. You can use ProblemClassifications API to get the problem categories and ProblemClassificationId(s) reference.

You must have reader access role at the resource level to get the solutions.

Note: 'RequiredParameterSets' from Discovery Solutions API response has to be passed via 'properties.insights.additionalParameters' as an input to Diagnostics API.

", + "operationId": "DiscoverySolution_List", + "parameters": [ + { + "$ref": "#/parameters/ScopeParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/FilterParameter" + }, + { + "$ref": "#/parameters/SkipTokenParameter" + } + ], + "responses": { + "200": { + "description": "Successful fetched list of solution metadata.", + "schema": { + "$ref": "#/definitions/DiscoveryResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List DiscoverySolutions for a KeyVault resource": { + "$ref": "./examples/ListDiscoverySolutionsForKeyVaultResource.json" + } + } + } + } + }, + "definitions": { + "CheckNameAvailabilityResponse": { + "description": "Response for whether the requested resource name is available or not.", + "type": "object", + "properties": { + "nameAvailable": { + "description": "Returns true or false depending on the availability of the name", + "type": "boolean" + }, + "reason": { + "description": "Reason for why value is not available. This field is returned if nameAvailable is false.", + "type": "string" + }, + "message": { + "description": "Gets an error message explaining the 'reason' value with more details. This field is returned iif nameAvailable is false.", + "type": "string" + } + } + }, + "DiagnosticInvocation": { + "description": "Solution Invocation with additional params needed for invocation.", + "type": "object", + "properties": { + "solutionId": { + "description": "Solution Id to invoke.", + "type": "string" + }, + "additionalParameters": { + "description": "Additional parameters required to invoke the solutionId.", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "DiagnosticResource": { + "description": "Diagnostic resource", + "type": "object", + "x-ms-azure-resource": true, + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/DiagnosticResourceProperties", + "description": "Diagnostic Resource properties." + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" + } + ] + }, + "DiagnosticResourceProperties": { + "description": "Diagnostic resource properties.", + "type": "object", + "properties": { + "globalParameters": { + "description": "Global parameters that can be passed to all solutionIds.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "insights": { + "description": "SolutionIds that are needed to be invoked.", + "type": "array", + "items": { + "$ref": "#/definitions/DiagnosticInvocation" + }, + "x-ms-identifiers": [ + "solutionId" + ] + }, + "acceptedAt": { + "description": "Diagnostic Request Accepted time.", + "type": "string", + "readOnly": true + }, + "provisioningState": { + "description": "Status of diagnostic provisioning.", + "type": "string", + "readOnly": true, + "enum": [ + "Succeeded", + "PartialComplete", + "Failed", + "Canceled" + ], + "x-ms-enum": { + "name": "provisioningState", + "modelAsString": true, + "values": [ + { + "value": "Succeeded", + "description": "All Diagnostics in the Batch succeeded." + }, + { + "value": "PartialComplete", + "description": "Some Diagnostics are still running or failed." + }, + { + "value": "Failed", + "description": "All Diagnostics failed to run." + }, + { + "value": "Canceled", + "description": "When Diagnostic request gets canceled." + } + ] + } + }, + "diagnostics": { + "description": "Array of Diagnostics.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Diagnostic" + }, + "x-ms-identifiers": [ + "solutionId" + ] + } + } + }, + "Diagnostic": { + "description": "Properties returned with in an insight.", + "type": "object", + "properties": { + "solutionId": { + "description": "Solution Id", + "type": "string" + }, + "status": { + "$ref": "#/definitions/DiagnosticStatus" + }, + "insights": { + "description": "The problems (if any) detected by this insight.", + "type": "array", + "items": { + "$ref": "#/definitions/Insight" + }, + "x-ms-identifiers": [] + }, + "error": { + "$ref": "#/definitions/Error" + } + } + }, + "DiagnosticStatus": { + "description": "Denotes the status of the diagnostic resource.", + "type": "string", + "enum": [ + "Failed", + "MissingInputs", + "Running", + "Succeeded", + "Timeout" + ], + "x-ms-enum": { + "name": "Status", + "modelAsString": true, + "values": [ + { + "value": "Failed", + "description": "Diagnostic creation failed." + }, + { + "value": "MissingInputs", + "description": "Request is missing required inputs to run." + }, + { + "value": "Running", + "description": "Diagnostic is still running." + }, + { + "value": "Succeeded", + "description": "Diagnostic creation succeeded." + }, + { + "value": "Timeout", + "description": "Diagnostic was timed out." + } + ] + } + }, + "Insight": { + "description": "Detailed insights(s) obtained via the invocation of an insight diagnostic troubleshooter.", + "type": "object", + "properties": { + "id": { + "description": "Article id.", + "type": "string" + }, + "title": { + "description": "This insight's title.", + "type": "string" + }, + "results": { + "description": "Detailed result content.", + "type": "string" + }, + "importanceLevel": { + "description": "Importance level of the insight.", + "type": "string", + "enum": [ + "Critical", + "Warning", + "Information" + ], + "x-ms-enum": { + "name": "importanceLevel", + "modelAsString": true, + "values": [ + { + "value": "Critical", + "description": "A critical insight has been found after running the diagnostic." + }, + { + "value": "Warning", + "description": "A warning insight has been found after running the diagnostic." + }, + { + "value": "Information", + "description": "An information insight has been found after running the diagnostic." + } + ] + } + } + } + }, + "Error": { + "description": "Error definition.", + "type": "object", + "properties": { + "code": { + "description": "Service specific error code which serves as the substatus for the HTTP error code.", + "type": "string", + "readOnly": true + }, + "type": { + "description": "Service specific error type which serves as additional context for the error herein.", + "type": "string", + "readOnly": true + }, + "message": { + "description": "Description of the error.", + "type": "string", + "readOnly": true + }, + "details": { + "description": "An array of additional nested error response info objects, as described by this contract.", + "type": "array", + "items": { + "$ref": "#/definitions/Error" + }, + "x-ms-identifiers": [ + "type", + "message" + ] + } + } + }, + "DiscoveryResponse": { + "description": "Discovery response.", + "type": "object", + "properties": { + "value": { + "description": "The list of solution metadata.", + "type": "array", + "items": { + "$ref": "#/definitions/SolutionMetadata" + }, + "x-ms-identifiers": [ + "solutionId" + ] + }, + "nextLink": { + "description": "The link used to get the next page of solution metadata.", + "type": "string" + } + } + }, + "SolutionMetadata": { + "description": "Diagnostic solution metadata.", + "type": "object", + "properties": { + "solutionId": { + "description": "Solution Id.", + "type": "string" + }, + "solutionType": { + "description": "Solution Type.", + "type": "string" + }, + "description": { + "description": "A detailed description of solution.", + "type": "string" + }, + "requiredParameterSets": { + "description": "Required parameters for invoking this particular solution.", + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + }, + "x-ms-identifiers": [] + }, + "x-ms-identifiers": [] + } + } + } + }, + "parameters": { + "ScopeParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "This is an extension resource provider and only resource level extension is supported at the moment.", + "x-ms-parameter-location": "client", + "x-ms-skip-url-encoding": true + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version.", + "x-ms-parameter-location": "client" + }, + "DiagnosticsResourceNameParameter": { + "name": "diagnosticsResourceName", + "in": "path", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 100, + "pattern": "^[A-Za-z0-9-+@()_]+$", + "description": "Unique resource name for insight resources", + "x-ms-parameter-location": "client" + }, + "FilterParameter": { + "name": "$filter", + "description": "Can be used to filter solutionIds by 'ProblemClassificationId'. The filter supports only 'and' and 'eq' operators. Example: $filter=ProblemClassificationId eq '1ddda5b4-cf6c-4d4f-91ad-bc38ab0e811e' and ProblemClassificationId eq '0a9673c2-7af6-4e19-90d3-4ee2461076d9'.", + "in": "query", + "required": false, + "type": "string", + "x-ms-skip-url-encoding": true + }, + "SkipTokenParameter": { + "name": "$skiptoken", + "description": "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.", + "in": "query", + "required": false, + "type": "string" + } + } +} diff --git a/specification/help/resource-manager/readme.csharp.md b/specification/help/resource-manager/readme.csharp.md new file mode 100644 index 000000000000..e3781290f375 --- /dev/null +++ b/specification/help/resource-manager/readme.csharp.md @@ -0,0 +1,15 @@ +## C# + +These settings apply only when `--csharp` is specified on the command line. +Please also specify `--csharp-sdks-folder=`. + +```yaml $(csharp) +csharp: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + payload-flattening-threshold: 1 + clear-output-folder: true + client-side-validation: false + namespace: Microsoft.Help + output-folder: $(csharp-sdks-folder)/help/management/Microsoft.Help/GeneratedProtocol +``` diff --git a/specification/help/resource-manager/readme.go.md b/specification/help/resource-manager/readme.go.md new file mode 100644 index 000000000000..b277ac5805c1 --- /dev/null +++ b/specification/help/resource-manager/readme.go.md @@ -0,0 +1,11 @@ +## Go + +These settings apply only when `--go` is specified on the command line. + +```yaml $(go) && $(track2) +azure-arm: true +license-header: MICROSOFT_MIT_NO_VERSION +module-name: sdk/resourcemanager/help/armhelp +module: github.com/Azure/azure-sdk-for-go/$(module-name) +output-folder: $(go-sdk-folder)/$(module-name) +``` diff --git a/specification/help/resource-manager/readme.md b/specification/help/resource-manager/readme.md new file mode 100644 index 000000000000..de5ee47cfee7 --- /dev/null +++ b/specification/help/resource-manager/readme.md @@ -0,0 +1,91 @@ +# help + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for help. + +## Getting Started + +To build the SDKs for My API, simply install AutoRest via `npm` (`npm install -g autorest`) and then run: + +> `autorest readme.md` + +To see additional help and options, run: + +> `autorest --help` + +For other options on installation see [Installing AutoRest](https://aka.ms/autorest/install) on the AutoRest github page. + +--- + +## Configuration + +### Basic Information + +These are the global settings for the help. + +```yaml +openapi-type: arm +tag: package-2023-01-01-preview +``` + +### Tag: package-2023-01-01-preview + +These settings apply only when `--tag=package-2023-01-01-preview` is specified on the command line. + +```yaml $(tag) == 'package-2023-01-01-preview' +input-file: + - Microsoft.Help/preview/2023-01-01-preview/help.json +``` +--- + +# Suppression + +```yaml +directive: + - suppress: AllResourcesMustHaveDelete + reason: As a proxy only resource provider, we are creating virtual diagnostic solutions on existing resources instead of actually creating an resource. Thus, we do not support delete operation for our resource type. + from: help.json + - suppress: TopLevelResourcesListBySubscription + reason: We do not support top level resource; all resource types are virtual proxy only resource types. For instance, an example request path for diagnostics could be subscriptions/mySubscription/resourcegroups/myresourceGroup/providers/Microsoft.KeyVault/vaults/test-keyvault-non-read/providers/Microsoft.Help/diagnostics/VMNotWorkingInsight. + from: help.json +``` + +--- + +# Code Generation + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +```yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-python-track2 + - repo: azure-sdk-for-java + - repo: azure-sdk-for-go + - repo: azure-sdk-for-js + - repo: azure-resource-manager-schemas + - repo: azure-cli-extensions + - repo: azure-powershell +``` +## Az + +See configuration in [readme.az.md](./readme.az.md) + +## Go + +See configuration in [readme.go.md](./readme.go.md) + +## Python + +See configuration in [readme.python.md](./readme.python.md) + +## TypeScript + +See configuration in [readme.typescript.md](./readme.typescript.md) + +## CSharp + +See configuration in [readme.csharp.md](./readme.csharp.md) diff --git a/specification/help/resource-manager/readme.python.md b/specification/help/resource-manager/readme.python.md new file mode 100644 index 000000000000..045989f4f670 --- /dev/null +++ b/specification/help/resource-manager/readme.python.md @@ -0,0 +1,18 @@ +## Python + +These settings apply only when `--python` is specified on the command line. +Please also specify `--python-sdks-folder=`. + +``` yaml $(python) +azure-arm: true +license-header: MICROSOFT_MIT_NO_VERSION +package-name: azure-mgmt-help +namespace: azure.mgmt.help +package-version: 1.0.0b1 +clear-output-folder: true +``` + +``` yaml $(python) +no-namespace-folders: true +output-folder: $(python-sdks-folder)/help/azure-mgmt-help/azure/mgmt/help +``` diff --git a/specification/help/resource-manager/readme.typescript.md b/specification/help/resource-manager/readme.typescript.md new file mode 100644 index 000000000000..67d1d73e4e6c --- /dev/null +++ b/specification/help/resource-manager/readme.typescript.md @@ -0,0 +1,14 @@ +## TypeScript + +These settings apply only when `--typescript` is specified on the command line. +Please also specify `--typescript-sdks-folder=`. + +``` yaml $(typescript) +typescript: + azure-arm: true + package-name: "@azure/arm-help" + output-folder: "$(typescript-sdks-folder)/sdk/help/arm-help" + payload-flattening-threshold: 1 + clear-output-folder: true + generate-metadata: true +```