From e2d74312f1f301a090425cdb2765299ed703de14 Mon Sep 17 00:00:00 2001 From: Jinghua Zhu Date: Fri, 4 Feb 2022 23:31:15 +0800 Subject: [PATCH 01/18] Add Swagger spec of MICROSOFT.DASHBOARD for Public Preview --- .../examples/Grafana_Create.json | 85 ++ .../examples/Grafana_Delete.json | 13 + .../examples/Grafana_Get.json | 38 + .../examples/Grafana_List.json | 32 + .../examples/Grafana_ListByResourceGroup.json | 33 + .../examples/Grafana_Update.json | 39 + .../examples/Operations_List.json | 23 + .../preview/2021-09-01-preview/grafana.json | 748 ++++++++++++++++++ .../dashboard/resource-manager/readme.md | 36 + 9 files changed, 1047 insertions(+) create mode 100644 specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Create.json create mode 100644 specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Delete.json create mode 100644 specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Get.json create mode 100644 specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_List.json create mode 100644 specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_ListByResourceGroup.json create mode 100644 specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Update.json create mode 100644 specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Operations_List.json create mode 100644 specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json create mode 100644 specification/dashboard/resource-manager/readme.md diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Create.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Create.json new file mode 100644 index 000000000000..d32b526031bf --- /dev/null +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Create.json @@ -0,0 +1,85 @@ +{ + "parameters": { + "api-version": "2021-09-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "myResourceGroup", + "workspaceName": "myWorkspace", + "requestBody": { + "sku": { + "name": "Standard" + }, + "properties": { + "provisioningState": "Accepted", + "zoneRedundancy": "Enabled" + }, + "identity": { + "type": "systemAssigned" + }, + "tags": { + "Environment": "Dev" + }, + "location": "West US" + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/grafana/myWorkspace", + "name": "myWorkspace", + "type": "Microsoft.Dashboard/grafana", + "sku": { + "name": "Standard" + }, + "properties": { + "provisioningState": "Succeeded", + "grafanaVersion": "7.1", + "endpoint": "my.azgrafana.io", + "zoneRedundancy": "Enabled" + }, + "identity": { + "type": "SystemAssigned" + }, + "tags": { + "Environment": "Dev" + }, + "location": "West US", + "systemData": { + "createdBy": "string", + "createdByType": "User", + "createdAt": "2020-02-03T01:01:01.1075056Z", + "lastModifiedBy": "string", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-02-04T02:03:01.1974346Z" + } + } + }, + "201": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/grafana/myWorkspace", + "name": "myWorkspace", + "type": "Microsoft.Dashboard/grafana", + "sku": { + "name": "Standard" + }, + "properties": { + "provisioningState": "Accepted", + "grafanaVersion": "7.1", + "endpoint": "my.azgrafana.io", + "zoneRedundancy": "Enabled" + }, + "tags": { + "Environment": "Dev" + }, + "location": "West US", + "systemData": { + "createdBy": "string", + "createdByType": "User", + "createdAt": "2020-02-03T01:01:01.1075056Z", + "lastModifiedBy": "string", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-02-04T02:03:01.1974346Z" + } + } + } + } +} diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Delete.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Delete.json new file mode 100644 index 000000000000..82362f6340c1 --- /dev/null +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Delete.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "api-version": "2021-09-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "myResourceGroup", + "workspaceName": "myWorkspace" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Get.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Get.json new file mode 100644 index 000000000000..d02546640831 --- /dev/null +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Get.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "api-version": "2021-09-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "myResourceGroup", + "workspaceName": "myWorkspace" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/grafana/myWorkspace", + "name": "myWorkspace", + "type": "Microsoft.Dashboard/grafana", + "sku": { + "name": "Standard" + }, + "properties": { + "provisioningState": "Succeeded", + "grafanaVersion": "7.1", + "endpoint": "my.azgrafana.io", + "zoneRedundancy": "Enabled" + }, + "tags": { + "Environment": "Dev" + }, + "location": "West US", + "systemData": { + "createdBy": "string", + "createdByType": "User", + "createdAt": "2020-02-03T01:01:01.1075056Z", + "lastModifiedBy": "string", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-02-04T02:03:01.1974346Z" + } + } + } + } +} diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_List.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_List.json new file mode 100644 index 000000000000..de3a486126f3 --- /dev/null +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_List.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "api-version": "2021-09-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/grafana/myWorkspace", + "name": "myWorkspace", + "type": "Microsoft.Dashboard/grafana", + "sku": { + "name": "Standard" + }, + "properties": { + "provisioningState": "Succeeded", + "grafanaVersion": "7.1", + "endpoint": "my.azgrafana.io", + "zoneRedundancy": "Enabled" + }, + "tags": { + "Environment": "Dev" + }, + "location": "West US" + } + ] + } + } + } +} diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_ListByResourceGroup.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_ListByResourceGroup.json new file mode 100644 index 000000000000..a6b44de2051e --- /dev/null +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_ListByResourceGroup.json @@ -0,0 +1,33 @@ +{ + "parameters": { + "api-version": "2021-09-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "myResourceGroup" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/grafana/myWorkspace", + "name": "myWorkspace", + "type": "Microsoft.Dashboard/grafana", + "sku": { + "name": "Standard" + }, + "properties": { + "provisioningState": "Succeeded", + "grafanaVersion": "7.1", + "endpoint": "my.azgrafana.io", + "zoneRedundancy": "Enabled" + }, + "tags": { + "Environment": "Dev" + }, + "location": "West US" + } + ] + } + } + } +} diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Update.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Update.json new file mode 100644 index 000000000000..d9bb7947f587 --- /dev/null +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Update.json @@ -0,0 +1,39 @@ +{ + "parameters": { + "api-version": "2021-09-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "myResourceGroup", + "workspaceName": "myWorkspace", + "requestBody": { + "tags": { + "Environment": "Dev 2" + }, + "location": "West US", + "properties": { + "zoneRedundancy": "Enabled" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/grafana/myWorkspace", + "name": "myWorkspace", + "type": "Microsoft.Dashboard/grafana", + "sku": { + "name": "Standard" + }, + "properties": { + "provisioningState": "Succeeded", + "grafanaVersion": "7.1", + "endpoint": "my.azgrafana.io", + "zoneRedundancy": "Enabled" + }, + "tags": { + "Environment": "Dev 2" + }, + "location": "West US" + } + } + } +} diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Operations_List.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Operations_List.json new file mode 100644 index 000000000000..4e4c66a578e7 --- /dev/null +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Operations_List.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "api-version": "2021-09-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.Dashboard/grafana/write", + "display": { + "provider": "Microsoft.Dashboard", + "resource": "grafana", + "operation": "write", + "description": "Write grafana workspace resource" + } + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json new file mode 100644 index 000000000000..578463488f06 --- /dev/null +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json @@ -0,0 +1,748 @@ +{ + "swagger": "2.0", + "info": { + "title": "Microsoft.Dashboard", + "description": "The Microsoft.Dashboard Rest API spec.", + "version": "2021-09-01-preview" + }, + "paths": { + "/providers/Microsoft.Dashboard/operations": { + "get": { + "tags": [ + "GrafanaResource" + ], + "summary": "List all available API operations provided by Microsoft.Dashboard.", + "operationId": "Operations_List", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. Return all available API operations provided by Microsoft.Dashboard.", + "schema": { + "$ref": "#/definitions/OperationListResult" + } + }, + "default": { + "description": "Default error response.", + "schema": { + "$ref": "#/definitions/ResourceProviderDefaultErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Operations_List": { + "$ref": "./examples/Operations_List.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Dashboard/grafana": { + "get": { + "tags": [ + "GrafanaResource" + ], + "summary": "List all resources of workspaces for Grafana under the specified subscription.", + "operationId": "Grafana_List", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. Return all resources of workspaces for Grafana under the specified subscription.", + "schema": { + "$ref": "#/definitions/GrafanaResourceListResponse" + } + }, + "default": { + "description": "Default error response.", + "schema": { + "$ref": "#/definitions/ResourceProviderDefaultErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Grafana_List": { + "$ref": "./examples/Grafana_List.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana": { + "get": { + "tags": [ + "GrafanaResource" + ], + "summary": "List all resources of workspaces for Grafana under the specified resource group.", + "operationId": "Grafana_ListByResourceGroup", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. Return all resources of workspaces for Grafana under the given resource group.", + "schema": { + "$ref": "#/definitions/GrafanaResourceListResponse" + } + }, + "default": { + "description": "Default error response.", + "schema": { + "$ref": "#/definitions/ResourceProviderDefaultErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Grafana_ListByResourceGroup": { + "$ref": "./examples/Grafana_ListByResourceGroup.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}": { + "get": { + "tags": [ + "GrafanaResource" + ], + "summary": "Get the properties of a specific workspace for Grafana resource.", + "operationId": "Grafana_Get", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/WorkspaceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. Return the properties of the required workspace for Grafana resource.", + "schema": { + "$ref": "#/definitions/GrafanaResource" + } + }, + "default": { + "description": "Default error response.", + "schema": { + "$ref": "#/definitions/ResourceProviderDefaultErrorResponse" + } + } + }, + "x-ms-examples": { + "Grafana_Get": { + "$ref": "./examples/Grafana_Get.json" + } + } + }, + "put": { + "tags": [ + "GrafanaResource" + ], + "summary": "Create or update a workspace for Grafana resource. This API is idempotent, so user can either create a new grafana or update an existing grafana.", + "operationId": "Grafana_Create", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/WorkspaceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/GrafanaResource" + } + } + ], + "responses": { + "200": { + "description": "OK. Successfully create a workspace for Grafana resource.", + "schema": { + "$ref": "#/definitions/GrafanaResource" + } + }, + "201": { + "description": "Created. The operation was successfully started and will complete asynchronously.", + "schema": { + "$ref": "#/definitions/GrafanaResource" + } + }, + "default": { + "description": "Default error response.", + "schema": { + "$ref": "#/definitions/ResourceProviderDefaultErrorResponse" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-examples": { + "Grafana_Create": { + "$ref": "./examples/Grafana_Create.json" + } + } + }, + "patch": { + "tags": [ + "GrafanaResource" + ], + "summary": "Update a workspace for Grafana resource.", + "operationId": "Grafana_Update", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/WorkspaceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/GrafanaResourceUpdateParameters" + } + } + ], + "responses": { + "200": { + "description": "OK. Successfully update the workspace for Grafana resource.", + "schema": { + "$ref": "#/definitions/GrafanaResource" + } + }, + "default": { + "description": "Default error response.", + "schema": { + "$ref": "#/definitions/ResourceProviderDefaultErrorResponse" + } + } + }, + "x-ms-examples": { + "Grafana_Update": { + "$ref": "./examples/Grafana_Update.json" + } + } + }, + "delete": { + "tags": [ + "GrafanaResource" + ], + "summary": "Delete a workspace for Grafana resource.", + "operationId": "Grafana_Delete", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/WorkspaceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The workspace for Grafana resource is deleted." + }, + "202": { + "description": "Accepted. The operation is accepted and will be completed asynchronously." + }, + "204": { + "description": "No Content" + }, + "default": { + "description": "Default error response.", + "schema": { + "$ref": "#/definitions/ResourceProviderDefaultErrorResponse" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-examples": { + "Grafana_Delete": { + "$ref": "./examples/Grafana_Delete.json" + } + } + } + } + }, + "definitions": { + "CreatedByType": { + "description": "The type of identity that created the resource.", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ], + "type": "string", + "x-ms-enum": { + "modelAsString": true, + "name": "CreatedByType" + } + }, + "ErrorResponseBody": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "target": { + "type": "string" + }, + "details": { + "type": "array", + "x-ms-identifiers": [], + "items": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + } + }, + "GrafanaResource": { + "type": "object", + "description": "The grafana resource type.", + "x-ms-azure-resource": true, + "properties": { + "id": { + "description": "ARM id of the grafana resource", + "type": "string", + "readOnly": true + }, + "name": { + "description": "Name of the grafana resource.", + "type": "string", + "readOnly": true + }, + "type": { + "description": "The type of the grafana resource.", + "type": "string", + "readOnly": true + }, + "sku": { + "description": "The Sku of the grafana resource.", + "$ref": "#/definitions/ResourceSku" + }, + "properties": { + "description": "Properties specific to the grafana resource.", + "$ref": "#/definitions/GrafanaResourceProperties" + }, + "identity": { + "description": "The managed identity of the grafana resource.", + "$ref": "#/definitions/ManagedIdentity" + }, + "systemData": { + "description": "The system meta data relating to this grafana resource.", + "$ref": "#/definitions/SystemData" + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "location": { + "type": "string" + } + } + }, + "GrafanaResourceListResponse": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/GrafanaResource" + } + }, + "nextLink": { + "type": "string" + } + } + }, + "GrafanaResourceProperties": { + "type": "object", + "description": "Properties specific to the grafana resource.", + "properties": { + "provisioningState": { + "description": "Provisioning state of the resource.", + "$ref": "#/definitions/ProvisioningState" + }, + "grafanaVersion": { + "description": "The Grafana software version.", + "type": "string", + "readOnly": true + }, + "endpoint": { + "description": "The endpoint of the Grafana instance.", + "type": "string", + "readOnly": true + }, + "zoneRedundancy": { + "$ref": "#/definitions/ZoneRedundancy" + } + } + }, + "GrafanaResourcePropertiesUpdateParameters": { + "type": "object", + "properties": { + "zoneRedundancy": { + "description": "The high availability mode of the grafana resource.", + "$ref": "#/definitions/ZoneRedundancy" + } + } + }, + "GrafanaResourceUpdateParameters": { + "type": "object", + "description": "The parameters for a PATCH request to a grafana resource.", + "properties": { + "identity": { + "description": "The managed identity of the grafana resource.", + "$ref": "#/definitions/ManagedIdentity" + }, + "tags": { + "type": "object", + "description": "The new tags of the grafana resource.", + "additionalProperties": { + "type": "string" + } + }, + "location": { + "description": "The location of the grafana resource.", + "type": "string" + }, + "properties": { + "description": "Properties specific to the grafana resource.", + "$ref": "#/definitions/GrafanaResourcePropertiesUpdateParameters" + } + } + }, + "LastModifiedByType": { + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ], + "type": "string", + "x-ms-enum": { + "modelAsString": true, + "name": "LastModifiedByType" + } + }, + "ManagedIdentity": { + "description": "The managed identity of a resource.", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/ManagedIdentityTypes" + }, + "principalId": { + "description": "The principal id of the system assigned identity.", + "type": "string", + "readOnly": true + }, + "tenantId": { + "description": "The tenant id of the system assigned identity.", + "type": "string", + "readOnly": true + }, + "userAssignedIdentities": { + "description": "Dictionary of user assigned identities.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/UserAssignedIdentity" + } + } + } + }, + "ManagedIdentityTypes": { + "description": "The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the resource.", + "enum": [ + "None", + "SystemAssigned" + ], + "type": "string", + "x-ms-enum": { + "name": "IdentityType", + "modelAsString": true + } + }, + "OperationDisplay": { + "description": "The object that represents the operation.", + "type": "object", + "properties": { + "provider": { + "description": "Service provider, i.e., Microsoft.Dashboard.", + "type": "string" + }, + "resource": { + "description": "Type on which the operation is performed, e.g., 'grafana'.", + "type": "string" + }, + "operation": { + "description": "Operation type, e.g., read, write, delete, etc.", + "type": "string" + }, + "description": { + "description": "Description of the operation, e.g., 'Read grafana'.", + "type": "string" + } + } + }, + "OperationListResult": { + "description": "Result of GET request to list the Microsoft.Dashboard operations.", + "type": "object", + "properties": { + "value": { + "description": "List of operations supported by the Microsoft.Dashboard provider.", + "type": "array", + "x-ms-identifiers": [], + "items": { + "$ref": "#/definitions/OperationResult" + } + }, + "nextLink": { + "description": "URL to get the next set of operation list results if there are any.", + "type": "string" + } + } + }, + "OperationResult": { + "description": "A Microsoft.Dashboard REST API operation.", + "type": "object", + "properties": { + "name": { + "description": "Operation name, i.e., {provider}/{resource}/{operation}.", + "type": "string" + }, + "isDataAction": { + "description": "Indicates whether the operation applies to data-plane. Set \"true\" for data-plane operations and \"false\" for ARM/control-plane operations.", + "type": "boolean" + }, + "display": { + "$ref": "#/definitions/OperationDisplay" + } + } + }, + "ProvisioningState": { + "enum": [ + "Accepted", + "Creating", + "Updating", + "Deleting", + "Succeeded", + "Failed", + "Canceled", + "Deleted", + "NotSpecified" + ], + "type": "string", + "x-ms-enum": { + "modelAsString": true, + "name": "ProvisioningState" + } + }, + "ResourceProviderDefaultErrorResponse": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + }, + "ResourceSku": { + "required": [ + "name" + ], + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "SystemData": { + "type": "object", + "readOnly": true, + "properties": { + "createdBy": { + "type": "string" + }, + "createdByType": { + "$ref": "#/definitions/CreatedByType" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "lastModifiedBy": { + "type": "string" + }, + "lastModifiedByType": { + "$ref": "#/definitions/LastModifiedByType" + }, + "lastModifiedAt": { + "format": "date-time", + "type": "string" + } + } + }, + "ZoneRedundancy": { + "enum": [ + "Disabled", + "Enabled" + ], + "default": "Disabled", + "type": "string", + "x-ms-enum": { + "modelAsString": true, + "name": "ZoneRedundancy" + } + }, + "UserAssignedIdentity": { + "type": "object", + "properties": { + "principalId": { + "description": "The principal id of user assigned identity.", + "type": "string", + "readOnly": true + }, + "clientId": { + "description": "The client id of user assigned identity.", + "type": "string", + "readOnly": true + } + } + } + }, + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + }, + "description": "Azure Active Directory OAuth2 Flow" + } + }, + "parameters": { + "WorkspaceNameParameter": { + "in": "path", + "name": "workspaceName", + "description": "The name of Azure Managed Workspace for Grafana.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "default": "2021-09-01-preview", + "description": "The API version to be used with the HTTP request (e.g. YYYY-MM-DD).", + "minLength": 1 + }, + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "minLength": 1, + "x-ms-parameter-location": "method", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group. The name is case insensitive." + }, + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method", + "description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." + } + } +} diff --git a/specification/dashboard/resource-manager/readme.md b/specification/dashboard/resource-manager/readme.md new file mode 100644 index 000000000000..d04c5481381f --- /dev/null +++ b/specification/dashboard/resource-manager/readme.md @@ -0,0 +1,36 @@ +# Dashboard + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for Dashboard. + +--- +## Getting Started +To build the SDK for Dashboard, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: + +> `autorest` + +To see additional help and options, run: + +> `autorest --help` + +--- +## Configuration +### Basic Information +These are the global settings for the Dashboard API. + +```yaml +title: DashboardManagementClient +openapi-type: arm +openapi-subtype: rpaas +tag: package-2021-09-01-preview +``` + +### Tag: package-2021-09-01-preview + +These settings apply only when `--tag=package-2021-09-01-preview` is specified on the command line. + +``` yaml $(tag) == 'package-2021-09-01-preview' +input-file: + - Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json +``` From ee13e7bcfa06027b4e733f209236803ba012fc59 Mon Sep 17 00:00:00 2001 From: Jinghua Zhu Date: Fri, 4 Feb 2022 23:40:44 +0800 Subject: [PATCH 02/18] Add sdk files --- .../resource-manager/readme.csharp.md | 15 +++++++ .../dashboard/resource-manager/readme.go.md | 26 +++++++++++++ .../dashboard/resource-manager/readme.java.md | 33 ++++++++++++++++ .../resource-manager/readme.python.md | 39 +++++++++++++++++++ .../resource-manager/readme.typescript.md | 13 +++++++ 5 files changed, 126 insertions(+) create mode 100644 specification/dashboard/resource-manager/readme.csharp.md create mode 100644 specification/dashboard/resource-manager/readme.go.md create mode 100644 specification/dashboard/resource-manager/readme.java.md create mode 100644 specification/dashboard/resource-manager/readme.python.md create mode 100644 specification/dashboard/resource-manager/readme.typescript.md diff --git a/specification/dashboard/resource-manager/readme.csharp.md b/specification/dashboard/resource-manager/readme.csharp.md new file mode 100644 index 000000000000..40f6632677a7 --- /dev/null +++ b/specification/dashboard/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.Dashboard + output-folder: $(csharp-sdks-folder)/dashboard/management/Microsoft.Dashboard/src/Generated +``` diff --git a/specification/dashboard/resource-manager/readme.go.md b/specification/dashboard/resource-manager/readme.go.md new file mode 100644 index 000000000000..1031edfed174 --- /dev/null +++ b/specification/dashboard/resource-manager/readme.go.md @@ -0,0 +1,26 @@ +## Go + +These settings apply only when `--go` is specified on the command line. + +```yaml $(go) +go: + license-header: MICROSOFT_APACHE_NO_VERSION + namespace: dashboard + clear-output-folder: true +``` + +### Go multi-api + +``` yaml $(go) && $(multiapi) +batch: + - tag: package-2021-09-01-preview +``` + +### Tag: package-2021-09-01-preview and go + +These settings apply only when `--tag=package-2021-09-01-preview --go` is specified on the command line. +Please also specify `--go-sdks-folder=`. + +```yaml $(tag) == 'package-2021-09-01-preview' && $(go) +output-folder: $(go-sdks-folder)/services/preview/$(namespace)/mgmt/2021-09-01-preview/$(namespace) +``` diff --git a/specification/dashboard/resource-manager/readme.java.md b/specification/dashboard/resource-manager/readme.java.md new file mode 100644 index 000000000000..8f81a1c9b7cc --- /dev/null +++ b/specification/dashboard/resource-manager/readme.java.md @@ -0,0 +1,33 @@ +## Java + +These settings apply only when `--java` is specified on the command line. +Please also specify `--azure-libraries-for-java-folder=`. + +``` yaml $(java) +azure-arm: true +fluent: true +namespace: com.microsoft.azure.management.dashboard +license-header: MICROSOFT_MIT_NO_CODEGEN +payload-flattening-threshold: 1 +output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-dashboard +``` + +### Java multi-api + +``` yaml $(java) && $(multiapi) +batch: + - tag: package-2021-09-01-preview +``` + +### Tag: package-2021-09-01-preview and java + +These settings apply only when `--tag=package-2021-09-01-preview --java` is specified on the command line. +Please also specify `--azure-libraries-for-java=`. + +``` yaml $(tag) == 'package-2021-09-01-preview' && $(java) && $(multiapi) +java: + namespace: com.microsoft.azure.management.dashboard.v2021_09_01_preview + output-folder: $(azure-libraries-for-java-folder)/sdk/dashboard/mgmt-v2021_09_01_preview +regenerate-manager: true +generate-interface: true +``` \ No newline at end of file diff --git a/specification/dashboard/resource-manager/readme.python.md b/specification/dashboard/resource-manager/readme.python.md new file mode 100644 index 000000000000..11ab9bb189da --- /dev/null +++ b/specification/dashboard/resource-manager/readme.python.md @@ -0,0 +1,39 @@ +## 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-dashboard +package-version: 1.0.0 +no-namespace-folders: true +``` + +### Python Multi API Generation + +Generate all API versions currently shipped for this package. These settings apply only when `--multiapi` is specified on the command line. + +```yaml $(python) && $(multiapi) +clear-output-folder: true +batch: + - tag: package-2021-09-01-preview + - multiapiscript: true +``` + +```yaml $(multiapiscript) +output-folder: $(python-sdks-folder)/dashboard/azure-mgmt-dashboard/ +clear-output-folder: false +perform-load: false +``` + +### Tag: package-2021-09-01-preview and python + +These settings apply only when `--tag=package-2021-09-01-preview --python` is specified on the command line. Please also specify `--python-sdks-folder=`. + +``` yaml $(tag) == 'package-2021-09-01-preview' && $(python) +namespace: azure.mgmt.dashboard.v2021_09_01_preview +output-folder: $(python-sdks-folder)/dashboard/azure-mgmt-dashboard/v2021_09_01_preview +``` + diff --git a/specification/dashboard/resource-manager/readme.typescript.md b/specification/dashboard/resource-manager/readme.typescript.md new file mode 100644 index 000000000000..1cefcc6f9378 --- /dev/null +++ b/specification/dashboard/resource-manager/readme.typescript.md @@ -0,0 +1,13 @@ +## 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: "dashboard" + output-folder: "$(typescript-sdks-folder)/packages/dashboard" + payload-flattening-threshold: 1 + generate-metadata: true +``` From 3e9362be3070c761456480b9264bcda05133bf89 Mon Sep 17 00:00:00 2001 From: Jinghua Zhu Date: Mon, 7 Feb 2022 13:25:50 +0800 Subject: [PATCH 03/18] Use ErrorResponse from common-types --- .../preview/2021-09-01-preview/grafana.json | 57 +++++-------------- 1 file changed, 14 insertions(+), 43 deletions(-) diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json index 578463488f06..f34e6fa46c7d 100644 --- a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json @@ -29,9 +29,9 @@ } }, "default": { - "description": "Default error response.", + "description": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", "schema": { - "$ref": "#/definitions/ResourceProviderDefaultErrorResponse" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" } } }, @@ -71,9 +71,9 @@ } }, "default": { - "description": "Default error response.", + "description": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", "schema": { - "$ref": "#/definitions/ResourceProviderDefaultErrorResponse" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" } } }, @@ -116,9 +116,9 @@ } }, "default": { - "description": "Default error response.", + "description": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", "schema": { - "$ref": "#/definitions/ResourceProviderDefaultErrorResponse" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" } } }, @@ -164,9 +164,9 @@ } }, "default": { - "description": "Default error response.", + "description": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", "schema": { - "$ref": "#/definitions/ResourceProviderDefaultErrorResponse" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" } } }, @@ -223,9 +223,9 @@ } }, "default": { - "description": "Default error response.", + "description": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", "schema": { - "$ref": "#/definitions/ResourceProviderDefaultErrorResponse" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" } } }, @@ -280,9 +280,9 @@ } }, "default": { - "description": "Default error response.", + "description": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", "schema": { - "$ref": "#/definitions/ResourceProviderDefaultErrorResponse" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" } } }, @@ -326,9 +326,9 @@ "description": "No Content" }, "default": { - "description": "Default error response.", + "description": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", "schema": { - "$ref": "#/definitions/ResourceProviderDefaultErrorResponse" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" } } }, @@ -359,27 +359,6 @@ "name": "CreatedByType" } }, - "ErrorResponseBody": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - }, - "target": { - "type": "string" - }, - "details": { - "type": "array", - "x-ms-identifiers": [], - "items": { - "$ref": "#/definitions/ErrorResponseBody" - } - } - } - }, "GrafanaResource": { "type": "object", "description": "The grafana resource type.", @@ -624,14 +603,6 @@ "name": "ProvisioningState" } }, - "ResourceProviderDefaultErrorResponse": { - "type": "object", - "properties": { - "error": { - "$ref": "#/definitions/ErrorResponseBody" - } - } - }, "ResourceSku": { "required": [ "name" From d70e939c9351782bd8c073ba984b89df4320276b Mon Sep 17 00:00:00 2001 From: Jinghua Zhu Date: Mon, 7 Feb 2022 13:42:16 +0800 Subject: [PATCH 04/18] Update GrafanaResource to follow TrackedResources from common-types --- .../preview/2021-09-01-preview/grafana.json | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json index f34e6fa46c7d..1a7adda5d50b 100644 --- a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json @@ -399,10 +399,21 @@ "type": "object", "additionalProperties": { "type": "string" - } + }, + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "The tags for grafana resource." }, "location": { - "type": "string" + "type": "string", + "x-ms-mutability": [ + "read", + "create" + ], + "description": "The geo-location where the grafana resource lives" } } }, From c194446add0d0ae406a3f228663ed8b16fb87637 Mon Sep 17 00:00:00 2001 From: Jinghua Zhu <75519723+jinghzhu-msft@users.noreply.github.com> Date: Wed, 9 Feb 2022 21:45:44 +0800 Subject: [PATCH 05/18] Update specification/dashboard/resource-manager/readme.typescript.md Co-authored-by: Wei Dong <40835867+dw511214992@users.noreply.github.com> --- specification/dashboard/resource-manager/readme.typescript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/dashboard/resource-manager/readme.typescript.md b/specification/dashboard/resource-manager/readme.typescript.md index 1cefcc6f9378..07acf23d3108 100644 --- a/specification/dashboard/resource-manager/readme.typescript.md +++ b/specification/dashboard/resource-manager/readme.typescript.md @@ -7,7 +7,7 @@ Please also specify `--typescript-sdks-folder= Date: Wed, 9 Feb 2022 21:45:55 +0800 Subject: [PATCH 06/18] Update specification/dashboard/resource-manager/readme.typescript.md Co-authored-by: Wei Dong <40835867+dw511214992@users.noreply.github.com> --- specification/dashboard/resource-manager/readme.typescript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/dashboard/resource-manager/readme.typescript.md b/specification/dashboard/resource-manager/readme.typescript.md index 07acf23d3108..f4c6f6b22555 100644 --- a/specification/dashboard/resource-manager/readme.typescript.md +++ b/specification/dashboard/resource-manager/readme.typescript.md @@ -6,7 +6,7 @@ Please also specify `--typescript-sdks-folder= Date: Wed, 9 Feb 2022 21:46:06 +0800 Subject: [PATCH 07/18] Update specification/dashboard/resource-manager/readme.csharp.md Co-authored-by: Wei Dong <40835867+dw511214992@users.noreply.github.com> --- specification/dashboard/resource-manager/readme.csharp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/dashboard/resource-manager/readme.csharp.md b/specification/dashboard/resource-manager/readme.csharp.md index 40f6632677a7..03cd0509fc02 100644 --- a/specification/dashboard/resource-manager/readme.csharp.md +++ b/specification/dashboard/resource-manager/readme.csharp.md @@ -1,4 +1,4 @@ -## C +## C# These settings apply only when `--csharp` is specified on the command line. Please also specify `--csharp-sdks-folder=`. From c82c8f8a5bf1ee489d8161226726fc76b49a22a2 Mon Sep 17 00:00:00 2001 From: Jinghua Zhu Date: Fri, 11 Feb 2022 11:37:21 +0800 Subject: [PATCH 08/18] Remove location from PATCH --- .../2021-09-01-preview/examples/Grafana_Update.json | 4 ---- .../preview/2021-09-01-preview/grafana.json | 12 +----------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Update.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Update.json index d9bb7947f587..9da2de0de77d 100644 --- a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Update.json +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Grafana_Update.json @@ -7,10 +7,6 @@ "requestBody": { "tags": { "Environment": "Dev 2" - }, - "location": "West US", - "properties": { - "zoneRedundancy": "Enabled" } } }, diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json index 1a7adda5d50b..0d4b68ce6e3f 100644 --- a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json @@ -455,13 +455,7 @@ } }, "GrafanaResourcePropertiesUpdateParameters": { - "type": "object", - "properties": { - "zoneRedundancy": { - "description": "The high availability mode of the grafana resource.", - "$ref": "#/definitions/ZoneRedundancy" - } - } + "type": "object" }, "GrafanaResourceUpdateParameters": { "type": "object", @@ -478,10 +472,6 @@ "type": "string" } }, - "location": { - "description": "The location of the grafana resource.", - "type": "string" - }, "properties": { "description": "Properties specific to the grafana resource.", "$ref": "#/definitions/GrafanaResourcePropertiesUpdateParameters" From 8b23e559cad91cf2d8f7345b25824cf26878ccb9 Mon Sep 17 00:00:00 2001 From: Jinghua Zhu Date: Fri, 11 Feb 2022 14:56:35 +0800 Subject: [PATCH 09/18] Refer to OperationList from common types --- .../examples/Operations_List.json | 4 +- .../preview/2021-09-01-preview/grafana.json | 64 +++++++++++++++---- 2 files changed, 55 insertions(+), 13 deletions(-) diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Operations_List.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Operations_List.json index 4e4c66a578e7..c5edb7c9d92e 100644 --- a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Operations_List.json +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Operations_List.json @@ -13,7 +13,9 @@ "resource": "grafana", "operation": "write", "description": "Write grafana workspace resource" - } + }, + "origin": "User", + "actionType": "Internal" } ], "nextLink": null diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json index 0d4b68ce6e3f..22917b23e83d 100644 --- a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json @@ -345,6 +345,18 @@ } }, "definitions": { + "ActionType": { + "description": "Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "enum": [ + "Internal" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "modelAsString": true, + "name": "ActionType" + } + }, "CreatedByType": { "description": "The type of identity that created the resource.", "enum": [ @@ -530,29 +542,33 @@ } }, "OperationDisplay": { - "description": "The object that represents the operation.", + "description": "Localized display information for this particular operation.", "type": "object", "properties": { "provider": { - "description": "Service provider, i.e., Microsoft.Dashboard.", - "type": "string" + "description": "The localized friendly form of the resource provider name, i.e., Microsoft.Dashboard.", + "type": "string", + "readOnly": true }, "resource": { - "description": "Type on which the operation is performed, e.g., 'grafana'.", - "type": "string" + "description": "The localized friendly name of the resource type related to this operation, e.g., 'grafana'.", + "type": "string", + "readOnly": true }, "operation": { "description": "Operation type, e.g., read, write, delete, etc.", - "type": "string" + "type": "string", + "readOnly": true }, "description": { "description": "Description of the operation, e.g., 'Read grafana'.", - "type": "string" + "type": "string", + "readOnly": true } } }, "OperationListResult": { - "description": "Result of GET request to list the Microsoft.Dashboard operations.", + "description": "A list of REST API operations supported by Microsoft.Dashboard provider. It contains an URL link to get the next set of results.", "type": "object", "properties": { "value": { @@ -561,11 +577,13 @@ "x-ms-identifiers": [], "items": { "$ref": "#/definitions/OperationResult" - } + }, + "readOnly": true }, "nextLink": { "description": "URL to get the next set of operation list results if there are any.", - "type": "string" + "type": "string", + "readOnly": true } } }, @@ -575,17 +593,39 @@ "properties": { "name": { "description": "Operation name, i.e., {provider}/{resource}/{operation}.", - "type": "string" + "type": "string", + "readOnly": true }, "isDataAction": { "description": "Indicates whether the operation applies to data-plane. Set \"true\" for data-plane operations and \"false\" for ARM/control-plane operations.", - "type": "boolean" + "type": "boolean", + "readOnly": true }, "display": { "$ref": "#/definitions/OperationDisplay" + }, + "origin": { + "$ref": "#/definitions/Origin" + }, + "actionType": { + "$ref": "#/definitions/ActionType" } } }, + "Origin": { + "description": "The intended executor of the operation.", + "enum": [ + "user", + "system", + "user,system" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "modelAsString": true, + "name": "Origin" + } + }, "ProvisioningState": { "enum": [ "Accepted", From b63aa47b20a04399a28dc844faed0ad9f05bb782 Mon Sep 17 00:00:00 2001 From: Jinghua Zhu Date: Fri, 11 Feb 2022 15:11:04 +0800 Subject: [PATCH 10/18] Fix Swagger ModelValidation error --- .../preview/2021-09-01-preview/examples/Operations_List.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Operations_List.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Operations_List.json index c5edb7c9d92e..cf2cb2e7a4ad 100644 --- a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Operations_List.json +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/examples/Operations_List.json @@ -14,7 +14,7 @@ "operation": "write", "description": "Write grafana workspace resource" }, - "origin": "User", + "origin": "user", "actionType": "Internal" } ], From fb5752db20f3da3ec14b1422e26c62b5e98987ce Mon Sep 17 00:00:00 2001 From: Jinghua Zhu Date: Wed, 16 Feb 2022 01:05:26 +0800 Subject: [PATCH 11/18] Remove GrafanaResourcePropertiesUpdateParameters --- .../preview/2021-09-01-preview/grafana.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json index 22917b23e83d..85d244fc6f7e 100644 --- a/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json +++ b/specification/dashboard/resource-manager/Microsoft.Dashboard/preview/2021-09-01-preview/grafana.json @@ -466,9 +466,6 @@ } } }, - "GrafanaResourcePropertiesUpdateParameters": { - "type": "object" - }, "GrafanaResourceUpdateParameters": { "type": "object", "description": "The parameters for a PATCH request to a grafana resource.", @@ -483,10 +480,6 @@ "additionalProperties": { "type": "string" } - }, - "properties": { - "description": "Properties specific to the grafana resource.", - "$ref": "#/definitions/GrafanaResourcePropertiesUpdateParameters" } } }, From d474e5881c1d568b993e69ff0be0192fcf9e78e9 Mon Sep 17 00:00:00 2001 From: Jinghua Zhu <75519723+jinghzhu-msft@users.noreply.github.com> Date: Thu, 17 Feb 2022 13:54:34 +0800 Subject: [PATCH 12/18] Update specification/dashboard/resource-manager/readme.md Co-authored-by: Wei Dong <40835867+dw511214992@users.noreply.github.com> --- .../dashboard/resource-manager/readme.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/specification/dashboard/resource-manager/readme.md b/specification/dashboard/resource-manager/readme.md index d04c5481381f..ad6e0f650770 100644 --- a/specification/dashboard/resource-manager/readme.md +++ b/specification/dashboard/resource-manager/readme.md @@ -34,3 +34,22 @@ These settings apply only when `--tag=package-2021-09-01-preview` is specified o input-file: - Microsoft.Dashboard/preview/2021-09-01-preview/grafana.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-net + - repo: azure-sdk-for-python + - repo: azure-sdk-for-python-track2 + - repo: azure-sdk-for-go + - repo: azure-sdk-for-go-track2 + - repo: azure-resource-manager-schemas + - repo: azure-sdk-for-js + - repo: azure-sdk-for-java +``` From 31bf632601b16e424266bf751f610ab8f3155482 Mon Sep 17 00:00:00 2001 From: Jiefeng Chen <51037443+BigCat20196@users.noreply.github.com> Date: Thu, 17 Feb 2022 14:56:58 +0800 Subject: [PATCH 13/18] Update readme.python.md --- specification/dashboard/resource-manager/readme.python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/dashboard/resource-manager/readme.python.md b/specification/dashboard/resource-manager/readme.python.md index 11ab9bb189da..9e4342e1f3b0 100644 --- a/specification/dashboard/resource-manager/readme.python.md +++ b/specification/dashboard/resource-manager/readme.python.md @@ -7,7 +7,7 @@ Please also specify `--python-sdks-folder= Date: Thu, 17 Feb 2022 15:06:30 +0800 Subject: [PATCH 14/18] Update specification/dashboard/resource-manager/readme.go.md --- .../dashboard/resource-manager/readme.go.md | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/specification/dashboard/resource-manager/readme.go.md b/specification/dashboard/resource-manager/readme.go.md index 1031edfed174..6f4c7811b182 100644 --- a/specification/dashboard/resource-manager/readme.go.md +++ b/specification/dashboard/resource-manager/readme.go.md @@ -2,25 +2,10 @@ These settings apply only when `--go` is specified on the command line. -```yaml $(go) -go: - license-header: MICROSOFT_APACHE_NO_VERSION - namespace: dashboard - clear-output-folder: true -``` - -### Go multi-api - -``` yaml $(go) && $(multiapi) -batch: - - tag: package-2021-09-01-preview -``` - -### Tag: package-2021-09-01-preview and go - -These settings apply only when `--tag=package-2021-09-01-preview --go` is specified on the command line. -Please also specify `--go-sdks-folder=`. - -```yaml $(tag) == 'package-2021-09-01-preview' && $(go) -output-folder: $(go-sdks-folder)/services/preview/$(namespace)/mgmt/2021-09-01-preview/$(namespace) +```yaml $(go) && $(track2) +azure-arm: true +license-header: MICROSOFT_MIT_NO_VERSION +module-name: sdk/resourcemanager/dashboard/armdashboard +module: github.com/Azure/azure-sdk-for-go/$(module-name) +output-folder: $(go-sdk-folder)/$(module-name) ``` From f306deaa150033e5c4fa3e9ccb9a4a90af2d2885 Mon Sep 17 00:00:00 2001 From: Wei Dong <40835867+dw511214992@users.noreply.github.com> Date: Thu, 17 Feb 2022 15:06:58 +0800 Subject: [PATCH 15/18] Update specification/dashboard/resource-manager/readme.md --- specification/dashboard/resource-manager/readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/dashboard/resource-manager/readme.md b/specification/dashboard/resource-manager/readme.md index ad6e0f650770..512e55d624e5 100644 --- a/specification/dashboard/resource-manager/readme.md +++ b/specification/dashboard/resource-manager/readme.md @@ -47,7 +47,6 @@ swagger-to-sdk: - repo: azure-sdk-for-net - repo: azure-sdk-for-python - repo: azure-sdk-for-python-track2 - - repo: azure-sdk-for-go - repo: azure-sdk-for-go-track2 - repo: azure-resource-manager-schemas - repo: azure-sdk-for-js From 18173d99ad085ad1a57afbad94f808e8a2eebfa4 Mon Sep 17 00:00:00 2001 From: Jiefeng Chen <51037443+BigCat20196@users.noreply.github.com> Date: Thu, 17 Feb 2022 15:10:36 +0800 Subject: [PATCH 16/18] Update readme.python.md --- .../resource-manager/readme.python.md | 32 +++++-------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/specification/dashboard/resource-manager/readme.python.md b/specification/dashboard/resource-manager/readme.python.md index 9e4342e1f3b0..318a46d8c555 100644 --- a/specification/dashboard/resource-manager/readme.python.md +++ b/specification/dashboard/resource-manager/readme.python.md @@ -3,37 +3,21 @@ These settings apply only when `--python` is specified on the command line. Please also specify `--python-sdks-folder=`. -```yaml $(python) +``` yaml $(track2) azure-arm: true license-header: MICROSOFT_MIT_NO_VERSION package-name: azure-mgmt-dashboard -package-version: 1.0.0b1 no-namespace-folders: true -``` - -### Python Multi API Generation - -Generate all API versions currently shipped for this package. These settings apply only when `--multiapi` is specified on the command line. - -```yaml $(python) && $(multiapi) +package-version: 1.0.0b1 clear-output-folder: true -batch: - - tag: package-2021-09-01-preview - - multiapiscript: true ``` -```yaml $(multiapiscript) -output-folder: $(python-sdks-folder)/dashboard/azure-mgmt-dashboard/ -clear-output-folder: false -perform-load: false +``` yaml $(python-mode) == 'update' && $(track2) +no-namespace-folders: true +output-folder: $(python-sdks-folder)/dashboard/azure-mgmt-dashboard/azure/mgmt/dashboard ``` -### Tag: package-2021-09-01-preview and python - -These settings apply only when `--tag=package-2021-09-01-preview --python` is specified on the command line. Please also specify `--python-sdks-folder=`. - -``` yaml $(tag) == 'package-2021-09-01-preview' && $(python) -namespace: azure.mgmt.dashboard.v2021_09_01_preview -output-folder: $(python-sdks-folder)/dashboard/azure-mgmt-dashboard/v2021_09_01_preview +``` yaml $(python-mode) == 'create' && $(track2) +basic-setup-py: true +output-folder: $(python-sdks-folder)/dashboard/azure-mgmt-dashboard ``` - From 05f921b4719ba46368453398dc53dd740226abcc Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Thu, 17 Feb 2022 15:52:48 +0800 Subject: [PATCH 17/18] Update readme.md --- specification/dashboard/resource-manager/readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/dashboard/resource-manager/readme.md b/specification/dashboard/resource-manager/readme.md index 512e55d624e5..89d375ae98eb 100644 --- a/specification/dashboard/resource-manager/readme.md +++ b/specification/dashboard/resource-manager/readme.md @@ -45,7 +45,6 @@ This is not used by Autorest itself. ``` yaml $(swagger-to-sdk) swagger-to-sdk: - repo: azure-sdk-for-net - - repo: azure-sdk-for-python - repo: azure-sdk-for-python-track2 - repo: azure-sdk-for-go-track2 - repo: azure-resource-manager-schemas From 7a6f63393a3d70a61ee2253e62ec2b4e3866a52f Mon Sep 17 00:00:00 2001 From: Wei Dong <40835867+dw511214992@users.noreply.github.com> Date: Thu, 17 Feb 2022 15:58:29 +0800 Subject: [PATCH 18/18] Update specification/dashboard/resource-manager/readme.csharp.md --- specification/dashboard/resource-manager/readme.csharp.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/dashboard/resource-manager/readme.csharp.md b/specification/dashboard/resource-manager/readme.csharp.md index 03cd0509fc02..79d82b928253 100644 --- a/specification/dashboard/resource-manager/readme.csharp.md +++ b/specification/dashboard/resource-manager/readme.csharp.md @@ -10,6 +10,6 @@ csharp: payload-flattening-threshold: 1 clear-output-folder: true client-side-validation: false - namespace: Microsoft.Dashboard - output-folder: $(csharp-sdks-folder)/dashboard/management/Microsoft.Dashboard/src/Generated + namespace: Microsoft.Azure.Management.Dashboard + output-folder: $(csharp-sdks-folder)/dashboard/Microsoft.Azure.Management.Dashboard/src/Generated ```