From f93b1b59ed1790b3f523da0724d20f1c100abb3e Mon Sep 17 00:00:00 2001 From: Gerry Tan Date: Thu, 22 May 2025 11:32:06 +1000 Subject: [PATCH 1/5] terraform: add new version 2025-06-01-preview --- .../2023-07-01-preview/ExportTerraform.json | 5 +- .../2025-06-01-preview/ExportTerraform.json | 20 + .../2025-06-01-preview/ListOperations.json | 34 ++ .../main.tsp | 10 +- .../models.tsp | 14 +- .../routes.tsp | 13 +- .../examples/ExportTerraform.json | 5 +- .../preview/2023-07-01-preview/export.json | 6 + .../examples/ExportTerraform.json | 20 + .../examples/ListOperations.json | 34 ++ .../preview/2025-06-01-preview/export.json | 501 ++++++++++++++++++ 11 files changed, 642 insertions(+), 20 deletions(-) create mode 100644 specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json create mode 100644 specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ListOperations.json create mode 100644 specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json create mode 100644 specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ListOperations.json create mode 100644 specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/export.json diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json index 77a494c8ef16..61a5d55c6a6e 100644 --- a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json +++ b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json @@ -12,8 +12,9 @@ "responses": { "202": { "headers": { - "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview" + "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview" } } } -} \ No newline at end of file +} diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json new file mode 100644 index 000000000000..03d4b8f98e3d --- /dev/null +++ b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json @@ -0,0 +1,20 @@ +{ + "title": "ExportTerraform", + "operationId": "Terraform_ExportTerraform", + "parameters": { + "api-version": "2025-06-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "body": { + "type": "ExportResourceGroup", + "resourceGroupName": "rg1" + } + }, + "responses": { + "202": { + "headers": { + "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview" + } + } + } +} diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ListOperations.json b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ListOperations.json new file mode 100644 index 000000000000..807881a92cf3 --- /dev/null +++ b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ListOperations.json @@ -0,0 +1,34 @@ +{ + "title": "Get a list of operations for a resource provider", + "operationId": "Operations_List", + "parameters": { + "subscriptionId": "12345678-1234-1234-12345678abc", + "api-version": "2025-06-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.AzureTerraform/operations/read", + "display": { + "provider": "Microsoft AzureTerraform", + "resource": "Azure Terraform Resource Provider", + "operation": "ListOperations", + "description": "Lists all of the available RP operations." + } + }, + { + "name": "Microsoft.AzureTerraform/exportTerraform/action", + "display": { + "provider": "Microsoft AzureTerraform", + "resource": "Azure Terraform Resource Provider", + "operation": "ExportTerraform", + "description": "Exports the Terraform configuration used for the specified scope." + } + } + ] + } + } + } +} diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/main.tsp b/specification/terraform/Microsoft.AzureTerraform.Management/main.tsp index 761bbf59b7a0..6ef45265a795 100644 --- a/specification/terraform/Microsoft.AzureTerraform.Management/main.tsp +++ b/specification/terraform/Microsoft.AzureTerraform.Management/main.tsp @@ -11,10 +11,6 @@ import "@azure-tools/typespec-azure-resource-manager"; import "./models.tsp"; import "./routes.tsp"; -using TypeSpec.Rest; -using TypeSpec.Http; -using Azure.ResourceManager.Foundations; -using Azure.Core; using Azure.ResourceManager; using TypeSpec.Versioning; @@ -31,4 +27,10 @@ enum Versions { @useDependency(Azure.Core.Versions.v1_0_Preview_2) @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) v2023_07_01_preview: "2023-07-01-preview", + + @doc("The 2025-06-01-preview API version.") + @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5) + v2025_06_01_preview: "2025-06-01-preview", } diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/models.tsp b/specification/terraform/Microsoft.AzureTerraform.Management/models.tsp index 3e511c6bae52..148e53838b0a 100644 --- a/specification/terraform/Microsoft.AzureTerraform.Management/models.tsp +++ b/specification/terraform/Microsoft.AzureTerraform.Management/models.tsp @@ -2,13 +2,11 @@ import "@typespec/rest"; import "@typespec/http"; import "@azure-tools/typespec-azure-core"; import "@azure-tools/typespec-azure-resource-manager"; - -using TypeSpec.Rest; -using TypeSpec.Http; +import "@typespec/versioning"; using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Foundations; -using OpenAPI; +using TypeSpec.Versioning; namespace Microsoft.AzureTerraform; @@ -64,6 +62,14 @@ model BaseExportModel { @doc("Mask sensitive attributes in the Terraform configuration") maskSensitive?: boolean = true; + + @added(Versions.v2025_06_01_preview) + @doc("Exclude resources from being exported based on the Azure resource ID pattern (case-insensitive regexp)") + excludeAzureResource?: string[]; + + @added(Versions.v2025_06_01_preview) + @doc("Exclude resources from being exported based on the Terraform resource type") + excludeTerraformResource?: string[]; } @doc("Export parameter for resources queried by ARG (Azure Resource Graph)") diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp b/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp index b989c729e631..559b3b8ecc92 100644 --- a/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp +++ b/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp @@ -1,16 +1,10 @@ import "@azure-tools/typespec-azure-core"; -import "@typespec/rest"; -import "./models.tsp"; import "@azure-tools/typespec-azure-resource-manager"; import "@azure-tools/typespec-client-generator-core"; +import "./models.tsp"; -using TypeSpec.Rest; -using TypeSpec.Http; using Azure.Core; -using Azure.ClientGenerator.Core; using Azure.ResourceManager; -using Azure.ResourceManager.Foundations; -using OpenAPI; namespace Microsoft.AzureTerraform; @@ -24,7 +18,10 @@ interface Terraform { @useFinalStateVia("azure-async-operation") exportTerraform is ArmProviderActionAsync< BaseExportModel, - ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders>, + ArmAcceptedLroResponse< + "Resource operation accepted.", + LroHeaders + > | TerraformOperationStatus, Scope = SubscriptionActionScope, LroHeaders = LroHeaders >; diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json index 77a494c8ef16..61a5d55c6a6e 100644 --- a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json @@ -12,8 +12,9 @@ "responses": { "202": { "headers": { - "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview" + "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview" } } } -} \ No newline at end of file +} diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json index 566512e521b6..d45f844d6bac 100644 --- a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json @@ -112,6 +112,12 @@ } ], "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TerraformOperationStatus" + } + }, "202": { "description": "Resource operation accepted.", "headers": { diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json new file mode 100644 index 000000000000..03d4b8f98e3d --- /dev/null +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json @@ -0,0 +1,20 @@ +{ + "title": "ExportTerraform", + "operationId": "Terraform_ExportTerraform", + "parameters": { + "api-version": "2025-06-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "body": { + "type": "ExportResourceGroup", + "resourceGroupName": "rg1" + } + }, + "responses": { + "202": { + "headers": { + "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview" + } + } + } +} diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ListOperations.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ListOperations.json new file mode 100644 index 000000000000..807881a92cf3 --- /dev/null +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ListOperations.json @@ -0,0 +1,34 @@ +{ + "title": "Get a list of operations for a resource provider", + "operationId": "Operations_List", + "parameters": { + "subscriptionId": "12345678-1234-1234-12345678abc", + "api-version": "2025-06-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.AzureTerraform/operations/read", + "display": { + "provider": "Microsoft AzureTerraform", + "resource": "Azure Terraform Resource Provider", + "operation": "ListOperations", + "description": "Lists all of the available RP operations." + } + }, + { + "name": "Microsoft.AzureTerraform/exportTerraform/action", + "display": { + "provider": "Microsoft AzureTerraform", + "resource": "Azure Terraform Resource Provider", + "operation": "ExportTerraform", + "description": "Exports the Terraform configuration used for the specified scope." + } + } + ] + } + } + } +} diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/export.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/export.json new file mode 100644 index 000000000000..b24f9878a449 --- /dev/null +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/export.json @@ -0,0 +1,501 @@ +{ + "swagger": "2.0", + "info": { + "title": "AzureTerraformResourceProviderClient", + "version": "2025-06-01-preview", + "description": "The Azure Terraform management API provides a RESTful set of web services that used to manage your Azure Terraform resources.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "host": "management.azure.com", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow.", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "tags": [ + { + "name": "Operations" + }, + { + "name": "Terraform" + }, + { + "name": "ExportTerraform" + } + ], + "paths": { + "/providers/Microsoft.AzureTerraform/operations": { + "get": { + "operationId": "Operations_List", + "tags": [ + "Operations" + ], + "description": "List the operations for the provider", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Azure operation completed successfully.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/OperationListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get a list of operations for a resource provider": { + "$ref": "./examples/ListOperations.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureTerraform/exportTerraform": { + "post": { + "operationId": "Terraform_ExportTerraform", + "tags": [ + "Terraform", + "ExportTerraform" + ], + "description": "Exports the Terraform configuration of the specified resource(s).", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "body", + "in": "body", + "description": "The request body", + "required": true, + "schema": { + "$ref": "#/definitions/BaseExportModel" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TerraformOperationStatus" + } + }, + "202": { + "description": "Resource operation accepted.", + "headers": { + "Azure-AsyncOperation": { + "type": "string", + "format": "uri", + "description": "A link to the status monitor" + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + }, + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "ExportTerraform": { + "$ref": "./examples/ExportTerraform.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + } + } + }, + "definitions": { + "Azure.ResourceManager.ResourceProvisioningState": { + "type": "string", + "description": "The provisioning state of a resource type.", + "enum": [ + "Succeeded", + "Failed", + "Canceled" + ], + "x-ms-enum": { + "name": "ResourceProvisioningState", + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Resource has been created." + }, + { + "name": "Failed", + "value": "Failed", + "description": "Resource creation failed." + }, + { + "name": "Canceled", + "value": "Canceled", + "description": "Resource creation was canceled." + } + ] + }, + "readOnly": true + }, + "BaseExportModel": { + "type": "object", + "description": "The base export parameter", + "properties": { + "type": { + "$ref": "#/definitions/Type", + "description": "The parameter type" + }, + "targetProvider": { + "type": "string", + "description": "The target Azure Terraform Provider", + "default": "azurerm", + "enum": [ + "azurerm", + "azapi" + ], + "x-ms-enum": { + "name": "targetProvider", + "modelAsString": true, + "values": [ + { + "name": "azurerm", + "value": "azurerm", + "description": "https://registry.terraform.io/providers/hashicorp/azurerm/latest" + }, + { + "name": "azapi", + "value": "azapi", + "description": "https://registry.terraform.io/providers/Azure/azapi/latest" + } + ] + } + }, + "fullProperties": { + "type": "boolean", + "description": "Whether to output all non-computed properties in the generated Terraform configuration? This probably needs manual modifications to make it valid", + "default": true + }, + "maskSensitive": { + "type": "boolean", + "description": "Mask sensitive attributes in the Terraform configuration", + "default": true + }, + "excludeAzureResource": { + "type": "array", + "description": "Exclude resources from being exported based on the Azure resource ID pattern (case-insensitive regexp)", + "items": { + "type": "string" + } + }, + "excludeTerraformResource": { + "type": "array", + "description": "Exclude resources from being exported based on the Terraform resource type", + "items": { + "type": "string" + } + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, + "ExportQuery": { + "type": "object", + "description": "Export parameter for resources queried by ARG (Azure Resource Graph)", + "properties": { + "query": { + "type": "string", + "description": "The ARG where predicate. Note that you can combine multiple conditions in one `where` predicate, e.g. `resourceGroup =~ \"my-rg\" and type =~ \"microsoft.network/virtualnetworks\"`" + }, + "namePattern": { + "type": "string", + "description": "The name pattern of the Terraform resources", + "default": "res-" + }, + "recursive": { + "type": "boolean", + "description": "Whether to recursively list child resources of the query result", + "default": false + }, + "table": { + "type": "string", + "description": "The ARG table name", + "default": "Resources" + }, + "authorizationScopeFilter": { + "$ref": "#/definitions/authorizationScopeFilter", + "description": "The ARG Scope Filter parameter" + } + }, + "required": [ + "query" + ], + "allOf": [ + { + "$ref": "#/definitions/BaseExportModel" + } + ], + "x-ms-discriminator-value": "ExportQuery" + }, + "ExportResource": { + "type": "object", + "description": "Export parameter for individual resources.", + "properties": { + "resourceIds": { + "type": "array", + "description": "The id of the resource to be exported", + "items": { + "type": "string", + "format": "arm-id", + "description": "A type definition that refers the id to an Azure Resource Manager resource." + } + }, + "resourceName": { + "type": "string", + "description": "The Terraform resource name. Only works when `resourceIds` contains only one item.", + "default": "res-0" + }, + "resourceType": { + "type": "string", + "description": "The Terraform resource type. Only works when `resourceIds` contains only one item." + }, + "namePattern": { + "type": "string", + "description": "The name pattern of the Terraform resources", + "default": "res-" + } + }, + "required": [ + "resourceIds" + ], + "allOf": [ + { + "$ref": "#/definitions/BaseExportModel" + } + ], + "x-ms-discriminator-value": "ExportResource" + }, + "ExportResourceGroup": { + "type": "object", + "description": "Export parameter for a resource group", + "properties": { + "resourceGroupName": { + "type": "string", + "description": "The name of the resource group to be exported" + }, + "namePattern": { + "type": "string", + "description": "The name pattern of the Terraform resources", + "default": "res-" + } + }, + "required": [ + "resourceGroupName" + ], + "allOf": [ + { + "$ref": "#/definitions/BaseExportModel" + } + ], + "x-ms-discriminator-value": "ExportResourceGroup" + }, + "ExportResult": { + "type": "object", + "description": "The Terraform export result", + "properties": { + "configuration": { + "type": "string", + "description": "The Terraform configuration content" + }, + "import": { + "type": "string", + "description": "The Terraform import blocks for the current export, which users can use to run \"terraform plan\" with to import the resources" + }, + "skippedResources": { + "type": "array", + "description": "A list of Azure resources which are not exported to Terraform due to there is no corresponding resources in Terraform", + "items": { + "type": "string", + "format": "arm-id", + "description": "A type definition that refers the id to an Azure Resource Manager resource." + } + }, + "errors": { + "type": "array", + "description": "A list of errors derived during exporting each resource", + "items": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorDetail" + }, + "x-ms-identifiers": [] + } + } + }, + "TerraformOperationStatus": { + "type": "object", + "description": "The status of the LRO operation.", + "properties": { + "properties": { + "$ref": "#/definitions/ExportResult", + "description": "RP-specific properties for the operationStatus resource, only appears when operation ended with Succeeded status", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/Azure.ResourceManager.ResourceProvisioningState", + "description": "The operation status" + }, + "id": { + "type": "string", + "description": "The unique identifier for the operationStatus resource" + }, + "name": { + "type": "string", + "description": "The name of the operationStatus resource", + "readOnly": true + }, + "startTime": { + "type": "string", + "format": "date-time", + "description": "Operation start time", + "readOnly": true + }, + "endTime": { + "type": "string", + "format": "date-time", + "description": "Operation complete time", + "readOnly": true + }, + "percentComplete": { + "type": "number", + "format": "double", + "description": "The progress made toward completing the operation", + "readOnly": true + }, + "error": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorDetail", + "description": "Errors that occurred if the operation ended with Canceled or Failed status", + "readOnly": true + } + }, + "required": [ + "status", + "id" + ] + }, + "Type": { + "type": "string", + "description": "The parameter type", + "enum": [ + "ExportResource", + "ExportResourceGroup", + "ExportQuery" + ], + "x-ms-enum": { + "name": "Type", + "modelAsString": true, + "values": [ + { + "name": "ExportResource", + "value": "ExportResource" + }, + { + "name": "ExportResourceGroup", + "value": "ExportResourceGroup" + }, + { + "name": "ExportQuery", + "value": "ExportQuery" + } + ] + } + }, + "authorizationScopeFilter": { + "type": "string", + "description": "The Azure Resource Graph Authorization Scope Filter parameter", + "enum": [ + "AtScopeAndBelow", + "AtScopeAndAbove", + "AtScopeAboveAndBelow", + "AtScopeExact" + ], + "x-ms-enum": { + "name": "authorizationScopeFilter", + "modelAsString": true, + "values": [ + { + "name": "AtScopeAndBelow", + "value": "AtScopeAndBelow", + "description": "Returns assignments for the given scope and all child scopes." + }, + { + "name": "AtScopeAndAbove", + "value": "AtScopeAndAbove", + "description": "Returns assignments for the given scope and all parent scopes, but not child scopes." + }, + { + "name": "AtScopeAboveAndBelow", + "value": "AtScopeAboveAndBelow", + "description": "Returns assignments for the given scope, all parent scopes, and all child scopes." + }, + { + "name": "AtScopeExact", + "value": "AtScopeExact", + "description": "Returns assignments only for the given scope; no parent or child scopes are included." + } + ] + } + } + }, + "parameters": {} +} From 534e98e4e40c6874be8e2fa718780321b82bbb31 Mon Sep 17 00:00:00 2001 From: Gerry Tan Date: Fri, 30 May 2025 11:46:02 +1000 Subject: [PATCH 2/5] GitHub checks Fix - Fix Swagger Avocado - Only specify 200 response in new version --- .../Microsoft.AzureTerraform.Management/routes.tsp | 6 ++++++ .../preview/2023-07-01-preview/export.json | 12 ------------ specification/terraform/resource-manager/readme.md | 12 ++++++++++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp b/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp index 559b3b8ecc92..2e4681bf6612 100644 --- a/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp +++ b/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp @@ -1,10 +1,12 @@ import "@azure-tools/typespec-azure-core"; import "@azure-tools/typespec-azure-resource-manager"; import "@azure-tools/typespec-client-generator-core"; +import "@typespec/versioning"; import "./models.tsp"; using Azure.Core; using Azure.ResourceManager; +using TypeSpec.Versioning; namespace Microsoft.AzureTerraform; @@ -16,6 +18,10 @@ interface Terraform { @doc("Exports the Terraform configuration of the specified resource(s).") @tag("ExportTerraform") @useFinalStateVia("azure-async-operation") + @returnTypeChangedFrom( + Versions.v2025_06_01_preview, + ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders> + ) exportTerraform is ArmProviderActionAsync< BaseExportModel, ArmAcceptedLroResponse< diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json index d45f844d6bac..9ddba31fdfb5 100644 --- a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json @@ -112,12 +112,6 @@ } ], "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TerraformOperationStatus" - } - }, "202": { "description": "Resource operation accepted.", "headers": { @@ -136,12 +130,6 @@ "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." } } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" - } } }, "x-ms-examples": { diff --git a/specification/terraform/resource-manager/readme.md b/specification/terraform/resource-manager/readme.md index 788c501825b4..6251b4d82f3f 100644 --- a/specification/terraform/resource-manager/readme.md +++ b/specification/terraform/resource-manager/readme.md @@ -29,10 +29,9 @@ title: AzureTerraformManagementClient description: AzureTerraform Client openapi-type: arm openapi-subtype: providerHub -tag: package-2023-07-01-preview +tag: package-2025-06-01-preview ``` - ### Tag: package-2023-07-01-preview These settings apply only when `--tag=package-2023-07-01-preview` is specified on the command line. @@ -42,6 +41,15 @@ input-file: - Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json ``` +### Tag: package-2025-06-01-preview + +These settings apply only when `--tag=package-2025-06-01-preview` is specified on the command line. + +```yaml $(tag) == 'package-2025-06-01-preview' +input-file: + - Microsoft.AzureTerraform/preview/2025-06-01-preview/export.json +``` + --- # Code Generation From 04815a9d480935c9b1f22506abb3f1e3c8f50fa0 Mon Sep 17 00:00:00 2001 From: Gerry Tan Date: Fri, 30 May 2025 14:04:17 +1000 Subject: [PATCH 3/5] Add 200 responses to back all versions --- .../2023-07-01-preview/ExportTerraform.json | 16 ++++++++++++++++ .../2025-06-01-preview/ExportTerraform.json | 16 ++++++++++++++++ .../routes.tsp | 6 ------ .../examples/ExportTerraform.json | 16 ++++++++++++++++ .../preview/2023-07-01-preview/export.json | 12 ++++++++++++ .../examples/ExportTerraform.json | 16 ++++++++++++++++ 6 files changed, 76 insertions(+), 6 deletions(-) diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json index 61a5d55c6a6e..c1e2315cfd7e 100644 --- a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json +++ b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json @@ -15,6 +15,22 @@ "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview", "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview" } + }, + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", + "startTime": "2025-05-30T03:55:32.4347873Z", + "endTime": "2025-05-30T03:55:37.1210179Z", + "status": "Succeeded", + "name": "00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/", + "properties": { + "configuration": "terraform {\n required_providers {\n azurerm = {\n source = \"azurerm\"\n version = \"4.24.0\"\n }\n }\n}\nprovider \"azurerm\" {\n features {}\n}\nresource \"azurerm_resource_group\" \"res-0\" {\n location = \"australiaeast\"\n managed_by = \"\"\n name = \"rg1\"\n tags = {}\n}\n", + "errors": null, + "import": "import {\n id = \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1\"\n to = azurerm_resource_group.res-0\n}\n", + "skippedResources": null + } + } } } } diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json index 03d4b8f98e3d..6f6f4649b032 100644 --- a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json +++ b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json @@ -15,6 +15,22 @@ "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview", "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview" } + }, + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", + "startTime": "2025-05-30T03:55:32.4347873Z", + "endTime": "2025-05-30T03:55:37.1210179Z", + "status": "Succeeded", + "name": "00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/", + "properties": { + "configuration": "terraform {\n required_providers {\n azurerm = {\n source = \"azurerm\"\n version = \"4.24.0\"\n }\n }\n}\nprovider \"azurerm\" {\n features {}\n}\nresource \"azurerm_resource_group\" \"res-0\" {\n location = \"australiaeast\"\n managed_by = \"\"\n name = \"rg1\"\n tags = {}\n}\n", + "errors": null, + "import": "import {\n id = \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1\"\n to = azurerm_resource_group.res-0\n}\n", + "skippedResources": null + } + } } } } diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp b/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp index 2e4681bf6612..559b3b8ecc92 100644 --- a/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp +++ b/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp @@ -1,12 +1,10 @@ import "@azure-tools/typespec-azure-core"; import "@azure-tools/typespec-azure-resource-manager"; import "@azure-tools/typespec-client-generator-core"; -import "@typespec/versioning"; import "./models.tsp"; using Azure.Core; using Azure.ResourceManager; -using TypeSpec.Versioning; namespace Microsoft.AzureTerraform; @@ -18,10 +16,6 @@ interface Terraform { @doc("Exports the Terraform configuration of the specified resource(s).") @tag("ExportTerraform") @useFinalStateVia("azure-async-operation") - @returnTypeChangedFrom( - Versions.v2025_06_01_preview, - ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders> - ) exportTerraform is ArmProviderActionAsync< BaseExportModel, ArmAcceptedLroResponse< diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json index 61a5d55c6a6e..c1e2315cfd7e 100644 --- a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json @@ -15,6 +15,22 @@ "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview", "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview" } + }, + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", + "startTime": "2025-05-30T03:55:32.4347873Z", + "endTime": "2025-05-30T03:55:37.1210179Z", + "status": "Succeeded", + "name": "00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/", + "properties": { + "configuration": "terraform {\n required_providers {\n azurerm = {\n source = \"azurerm\"\n version = \"4.24.0\"\n }\n }\n}\nprovider \"azurerm\" {\n features {}\n}\nresource \"azurerm_resource_group\" \"res-0\" {\n location = \"australiaeast\"\n managed_by = \"\"\n name = \"rg1\"\n tags = {}\n}\n", + "errors": null, + "import": "import {\n id = \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1\"\n to = azurerm_resource_group.res-0\n}\n", + "skippedResources": null + } + } } } } diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json index 9ddba31fdfb5..d45f844d6bac 100644 --- a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json @@ -112,6 +112,12 @@ } ], "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/TerraformOperationStatus" + } + }, "202": { "description": "Resource operation accepted.", "headers": { @@ -130,6 +136,12 @@ "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." } } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + } } }, "x-ms-examples": { diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json index 03d4b8f98e3d..6f6f4649b032 100644 --- a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json @@ -15,6 +15,22 @@ "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview", "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview" } + }, + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", + "startTime": "2025-05-30T03:55:32.4347873Z", + "endTime": "2025-05-30T03:55:37.1210179Z", + "status": "Succeeded", + "name": "00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/", + "properties": { + "configuration": "terraform {\n required_providers {\n azurerm = {\n source = \"azurerm\"\n version = \"4.24.0\"\n }\n }\n}\nprovider \"azurerm\" {\n features {}\n}\nresource \"azurerm_resource_group\" \"res-0\" {\n location = \"australiaeast\"\n managed_by = \"\"\n name = \"rg1\"\n tags = {}\n}\n", + "errors": null, + "import": "import {\n id = \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1\"\n to = azurerm_resource_group.res-0\n}\n", + "skippedResources": null + } + } } } } From c9d1e79d0ba4d107b405015c68c58034b67950dd Mon Sep 17 00:00:00 2001 From: Gerry Tan Date: Fri, 30 May 2025 14:23:15 +1000 Subject: [PATCH 4/5] Removed stray prop from example, simplified start and end time --- .../examples/2023-07-01-preview/ExportTerraform.json | 5 ++--- .../examples/2025-06-01-preview/ExportTerraform.json | 5 ++--- .../preview/2023-07-01-preview/examples/ExportTerraform.json | 5 ++--- .../preview/2025-06-01-preview/examples/ExportTerraform.json | 5 ++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json index c1e2315cfd7e..57b5629c0242 100644 --- a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json +++ b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json @@ -19,11 +19,10 @@ "200": { "body": { "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "startTime": "2025-05-30T03:55:32.4347873Z", - "endTime": "2025-05-30T03:55:37.1210179Z", + "startTime": "2025-05-30T03:55:32.40Z", + "endTime": "2025-05-30T03:55:37.10", "status": "Succeeded", "name": "00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/", "properties": { "configuration": "terraform {\n required_providers {\n azurerm = {\n source = \"azurerm\"\n version = \"4.24.0\"\n }\n }\n}\nprovider \"azurerm\" {\n features {}\n}\nresource \"azurerm_resource_group\" \"res-0\" {\n location = \"australiaeast\"\n managed_by = \"\"\n name = \"rg1\"\n tags = {}\n}\n", "errors": null, diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json index 6f6f4649b032..382d854fbc52 100644 --- a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json +++ b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json @@ -19,11 +19,10 @@ "200": { "body": { "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "startTime": "2025-05-30T03:55:32.4347873Z", - "endTime": "2025-05-30T03:55:37.1210179Z", + "startTime": "2025-05-30T03:55:32.40Z", + "endTime": "2025-05-30T03:55:37.10", "status": "Succeeded", "name": "00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/", "properties": { "configuration": "terraform {\n required_providers {\n azurerm = {\n source = \"azurerm\"\n version = \"4.24.0\"\n }\n }\n}\nprovider \"azurerm\" {\n features {}\n}\nresource \"azurerm_resource_group\" \"res-0\" {\n location = \"australiaeast\"\n managed_by = \"\"\n name = \"rg1\"\n tags = {}\n}\n", "errors": null, diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json index c1e2315cfd7e..57b5629c0242 100644 --- a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json @@ -19,11 +19,10 @@ "200": { "body": { "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "startTime": "2025-05-30T03:55:32.4347873Z", - "endTime": "2025-05-30T03:55:37.1210179Z", + "startTime": "2025-05-30T03:55:32.40Z", + "endTime": "2025-05-30T03:55:37.10", "status": "Succeeded", "name": "00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/", "properties": { "configuration": "terraform {\n required_providers {\n azurerm = {\n source = \"azurerm\"\n version = \"4.24.0\"\n }\n }\n}\nprovider \"azurerm\" {\n features {}\n}\nresource \"azurerm_resource_group\" \"res-0\" {\n location = \"australiaeast\"\n managed_by = \"\"\n name = \"rg1\"\n tags = {}\n}\n", "errors": null, diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json index 6f6f4649b032..382d854fbc52 100644 --- a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json @@ -19,11 +19,10 @@ "200": { "body": { "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "startTime": "2025-05-30T03:55:32.4347873Z", - "endTime": "2025-05-30T03:55:37.1210179Z", + "startTime": "2025-05-30T03:55:32.40Z", + "endTime": "2025-05-30T03:55:37.10", "status": "Succeeded", "name": "00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/", "properties": { "configuration": "terraform {\n required_providers {\n azurerm = {\n source = \"azurerm\"\n version = \"4.24.0\"\n }\n }\n}\nprovider \"azurerm\" {\n features {}\n}\nresource \"azurerm_resource_group\" \"res-0\" {\n location = \"australiaeast\"\n managed_by = \"\"\n name = \"rg1\"\n tags = {}\n}\n", "errors": null, From e34e6a283875dd8197296f7da1f75517e4179f1d Mon Sep 17 00:00:00 2001 From: Gerry Tan Date: Fri, 30 May 2025 15:36:23 +1000 Subject: [PATCH 5/5] Remove 200 response from /exportTerraform --- .../2023-07-01-preview/ExportTerraform.json | 15 --------------- .../2025-06-01-preview/ExportTerraform.json | 15 --------------- .../routes.tsp | 5 +---- .../examples/ExportTerraform.json | 15 --------------- .../preview/2023-07-01-preview/export.json | 6 ------ .../examples/ExportTerraform.json | 15 --------------- .../preview/2025-06-01-preview/export.json | 6 ------ 7 files changed, 1 insertion(+), 76 deletions(-) diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json index 57b5629c0242..61a5d55c6a6e 100644 --- a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json +++ b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2023-07-01-preview/ExportTerraform.json @@ -15,21 +15,6 @@ "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview", "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview" } - }, - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "startTime": "2025-05-30T03:55:32.40Z", - "endTime": "2025-05-30T03:55:37.10", - "status": "Succeeded", - "name": "00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "properties": { - "configuration": "terraform {\n required_providers {\n azurerm = {\n source = \"azurerm\"\n version = \"4.24.0\"\n }\n }\n}\nprovider \"azurerm\" {\n features {}\n}\nresource \"azurerm_resource_group\" \"res-0\" {\n location = \"australiaeast\"\n managed_by = \"\"\n name = \"rg1\"\n tags = {}\n}\n", - "errors": null, - "import": "import {\n id = \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1\"\n to = azurerm_resource_group.res-0\n}\n", - "skippedResources": null - } - } } } } diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json index 382d854fbc52..03d4b8f98e3d 100644 --- a/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json +++ b/specification/terraform/Microsoft.AzureTerraform.Management/examples/2025-06-01-preview/ExportTerraform.json @@ -15,21 +15,6 @@ "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview", "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview" } - }, - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "startTime": "2025-05-30T03:55:32.40Z", - "endTime": "2025-05-30T03:55:37.10", - "status": "Succeeded", - "name": "00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "properties": { - "configuration": "terraform {\n required_providers {\n azurerm = {\n source = \"azurerm\"\n version = \"4.24.0\"\n }\n }\n}\nprovider \"azurerm\" {\n features {}\n}\nresource \"azurerm_resource_group\" \"res-0\" {\n location = \"australiaeast\"\n managed_by = \"\"\n name = \"rg1\"\n tags = {}\n}\n", - "errors": null, - "import": "import {\n id = \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1\"\n to = azurerm_resource_group.res-0\n}\n", - "skippedResources": null - } - } } } } diff --git a/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp b/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp index 559b3b8ecc92..25c47e9948be 100644 --- a/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp +++ b/specification/terraform/Microsoft.AzureTerraform.Management/routes.tsp @@ -18,10 +18,7 @@ interface Terraform { @useFinalStateVia("azure-async-operation") exportTerraform is ArmProviderActionAsync< BaseExportModel, - ArmAcceptedLroResponse< - "Resource operation accepted.", - LroHeaders - > | TerraformOperationStatus, + ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders>, Scope = SubscriptionActionScope, LroHeaders = LroHeaders >; diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json index 57b5629c0242..61a5d55c6a6e 100644 --- a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/ExportTerraform.json @@ -15,21 +15,6 @@ "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview", "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2023-07-01-preview" } - }, - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "startTime": "2025-05-30T03:55:32.40Z", - "endTime": "2025-05-30T03:55:37.10", - "status": "Succeeded", - "name": "00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "properties": { - "configuration": "terraform {\n required_providers {\n azurerm = {\n source = \"azurerm\"\n version = \"4.24.0\"\n }\n }\n}\nprovider \"azurerm\" {\n features {}\n}\nresource \"azurerm_resource_group\" \"res-0\" {\n location = \"australiaeast\"\n managed_by = \"\"\n name = \"rg1\"\n tags = {}\n}\n", - "errors": null, - "import": "import {\n id = \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1\"\n to = azurerm_resource_group.res-0\n}\n", - "skippedResources": null - } - } } } } diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json index d45f844d6bac..566512e521b6 100644 --- a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/export.json @@ -112,12 +112,6 @@ } ], "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TerraformOperationStatus" - } - }, "202": { "description": "Resource operation accepted.", "headers": { diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json index 382d854fbc52..03d4b8f98e3d 100644 --- a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/examples/ExportTerraform.json @@ -15,21 +15,6 @@ "Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview", "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000?api-version=2025-06-01-preview" } - }, - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.AzureTerraform/operationStatuses/00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "startTime": "2025-05-30T03:55:32.40Z", - "endTime": "2025-05-30T03:55:37.10", - "status": "Succeeded", - "name": "00000000-0000-0000-0000-000000000000*0000000000000000000000000000000000000000000000000000000000000000", - "properties": { - "configuration": "terraform {\n required_providers {\n azurerm = {\n source = \"azurerm\"\n version = \"4.24.0\"\n }\n }\n}\nprovider \"azurerm\" {\n features {}\n}\nresource \"azurerm_resource_group\" \"res-0\" {\n location = \"australiaeast\"\n managed_by = \"\"\n name = \"rg1\"\n tags = {}\n}\n", - "errors": null, - "import": "import {\n id = \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1\"\n to = azurerm_resource_group.res-0\n}\n", - "skippedResources": null - } - } } } } diff --git a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/export.json b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/export.json index b24f9878a449..e69045f0fa2f 100644 --- a/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/export.json +++ b/specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2025-06-01-preview/export.json @@ -112,12 +112,6 @@ } ], "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/TerraformOperationStatus" - } - }, "202": { "description": "Resource operation accepted.", "headers": {