From 33145425b96f5ca97b606a75b2968a5f3314e783 Mon Sep 17 00:00:00 2001 From: Wei Dong <40835867+dw511214992@users.noreply.github.com> Date: Fri, 11 Mar 2022 16:09:20 +0800 Subject: [PATCH] deviceupdate change and add readme (#3066) --- .../2021-06-01-preview/deviceupdate.json | 61 +++-------------- .../deviceupdate/data-plane/readme.csharp.md | 14 ++++ .../deviceupdate/data-plane/readme.java.md | 23 +++++++ .../deviceupdate/data-plane/readme.md | 67 +++---------------- .../deviceupdate/data-plane/readme.python.md | 24 ++----- .../data-plane/readme.typescript.md | 14 ++-- 6 files changed, 71 insertions(+), 132 deletions(-) create mode 100644 specification/deviceupdate/data-plane/readme.csharp.md create mode 100644 specification/deviceupdate/data-plane/readme.java.md diff --git a/specification/deviceupdate/data-plane/Microsoft.DeviceUpdate/preview/2021-06-01-preview/deviceupdate.json b/specification/deviceupdate/data-plane/Microsoft.DeviceUpdate/preview/2021-06-01-preview/deviceupdate.json index ae652c3c128a..859c0e0324cb 100644 --- a/specification/deviceupdate/data-plane/Microsoft.DeviceUpdate/preview/2021-06-01-preview/deviceupdate.json +++ b/specification/deviceupdate/data-plane/Microsoft.DeviceUpdate/preview/2021-06-01-preview/deviceupdate.json @@ -28,6 +28,11 @@ "azure_auth": [ "user_impersonation" ] + }, + { + "AADToken": [ + "https://api.adu.microsoft.com/.default" + ] } ], "securityDefinitions": { @@ -39,6 +44,12 @@ "scopes": { "user_impersonation": "impersonate your user account" } + }, + "AADToken": { + "type": "oauth2", + "flow": "accessCode", + "authorizationUrl": "https://login.microsoftonline.com/common/v2.0/oauth2/authorize", + "tokenUrl": "https://login.microsoftonline.com/common/v2.0/oauth2/token" } }, "paths": { @@ -1198,56 +1209,6 @@ } } }, - "/deviceupdate/{instanceId}/management/groups/{groupId}/bestUpdates": { - "get": { - "tags": [ - "Device and deployment management" - ], - "description": "Get the best available updates for a group and a count of how many devices need each update.", - "operationId": "DeviceManagement_ListBestUpdatesForGroup", - "x-ms-examples": { - "DeviceManagement_ListBestUpdatesForGroup": { - "$ref": "./examples/DeviceManagement_ListBestUpdatesForGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/InstanceIdParameter" - }, - { - "$ref": "#/parameters/GroupIdParameter" - }, - { - "name": "$filter", - "in": "query", - "required": false, - "type": "string", - "description": "Restricts the set of bestUpdates returned. You can filter on update Provider, Name and Version property." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "The best available updates for a group and a count of how many devices need each update.", - "schema": { - "$ref": "#/definitions/UpdatableDevicesList" - } - }, - "default": { - "description": "Default response.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-odata": "#/definitions/GroupBestUpdatesFilter", - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, "/deviceupdate/{instanceId}/management/groups/{groupId}/deployments": { "get": { "tags": [ diff --git a/specification/deviceupdate/data-plane/readme.csharp.md b/specification/deviceupdate/data-plane/readme.csharp.md new file mode 100644 index 000000000000..f4bd1fa6cac6 --- /dev/null +++ b/specification/deviceupdate/data-plane/readme.csharp.md @@ -0,0 +1,14 @@ +## csharp + +These settings apply only when `--csharp` is specified on the command line. +Please also specify `--csharp-sdks-folder=`. + +```yaml $(csharp) +public-clients: true +title: DeviceUpdate +namespace: Azure.IoT.DeviceUpdate +data-plane: true +security: AADToken +security-scopes: https://api.adu.microsoft.com/.default +output-folder: $(csharp-sdks-folder)/sdk/deviceupdate/$(namespace)/src/Generated +``` \ No newline at end of file diff --git a/specification/deviceupdate/data-plane/readme.java.md b/specification/deviceupdate/data-plane/readme.java.md new file mode 100644 index 000000000000..202e169d42e1 --- /dev/null +++ b/specification/deviceupdate/data-plane/readme.java.md @@ -0,0 +1,23 @@ +## Java + +``` yaml $(java) +packages: +- name: azure-iot-deviceupdate + tag: package-2021-06-01-preview + input-file: + - Microsoft.DeviceUpdate/preview/2021-06-01-preview/deviceupdate.json +``` + +``` yaml $(java) && $(tag) == 'package-2021-06-01-preview' +namespace: com.azure.iot.deviceupdate +low-level-client: true +title: DeviceUpdateClient +artifact-id: azure-iot-deviceupdate +service-name: DeviceUpdate +generate-samples: true +service-versions: + - '2021-06-01-preview' +polling: {} + +generate-builder-per-client: false +``` \ No newline at end of file diff --git a/specification/deviceupdate/data-plane/readme.md b/specification/deviceupdate/data-plane/readme.md index 277a33d0f295..aeff7c52676a 100644 --- a/specification/deviceupdate/data-plane/readme.md +++ b/specification/deviceupdate/data-plane/readme.md @@ -26,7 +26,10 @@ These are the global settings for the deviceupdate. ```yaml openapi-type: data-plane -tag: package-2022-07-01-preview +tag: package-2021-06-01-preview +security: AADToken +security-scopes: https://api.adu.microsoft.com/.default +title: DeviceUpdateClient ``` ### Tag: package-2020-09-01 @@ -47,31 +50,6 @@ input-file: - Microsoft.DeviceUpdate/preview/2021-06-01-preview/deviceupdate.json ``` -### Tag: package-2022-07-01-preview - -These settings apply only when `--tag=package-2022-07-01-preview` is specified on the command line. - -```yaml $(tag) == 'package-2022-07-01-preview' -input-file: - - Microsoft.DeviceUpdate/preview/2022-07-01-preview/deviceupdate.json -``` - -## Suppressions - -``` yaml -directive: - - suppress: LongRunningResponseStatusCode - reason: The validation tools do not properly recognize 202 as a supported response code. - - supress: R2010 - reason: Approved by SDK team. - from: Microsoft.DeviceUpdate/preview/2022-07-01-preview/deviceupdate.json - - supress: R2010 - reason: Approved by SDK team. - from: Microsoft.DeviceUpdate/preview/2021-06-01-preview/deviceupdate.json -``` - ---- - # Code Generation ## Swagger to SDK @@ -81,41 +59,12 @@ This is not used by Autorest itself. ```yaml $(swagger-to-sdk) swagger-to-sdk: - - repo: azure-sdk-for-python-track2 - - repo: azure-sdk-for-java - - repo: azure-sdk-for-js - after_scripts: - - bundle install && rake arm:regen_all_profiles['deviceupdate'] + - repo: azure-sdk-for-js-dataplane + - repo: azure-sdk-for-python-dataplane + - repo: azure-sdk-for-java-dataplane + - repo: azure-sdk-for-net-dataplane ``` -## Python - -See configuration in [readme.python.md](./readme.python.md) - ## TypeScript See configuration in [readme.typescript.md](./readme.typescript.md) - -## Multi-API/Profile support for AutoRest v3 generators - -AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. - -This block is updated by an automatic script. Edits may be lost! - -``` yaml $(tag) == 'all-api-versions' /* autogenerated */ -# include the azure profile definitions from the standard location -require: $(this-folder)/../../../../profiles/readme.md - -# all the input files across all versions -input-file: - - $(this-folder)/Microsoft.DeviceUpdate/preview/2022-07-01-preview/deviceupdate.json - -``` - -If there are files that should not be in the `all-api-versions` set, -uncomment the `exclude-file` section below and add the file paths. - -``` yaml $(tag) == 'all-api-versions' -#exclude-file: -# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json -``` diff --git a/specification/deviceupdate/data-plane/readme.python.md b/specification/deviceupdate/data-plane/readme.python.md index 6841b9a2ad05..246980ed0886 100644 --- a/specification/deviceupdate/data-plane/readme.python.md +++ b/specification/deviceupdate/data-plane/readme.python.md @@ -1,25 +1,13 @@ ## Python -These settings apply only when `--python` is specified on the command line. -Please also specify `--python-sdks-folder=`. - -``` yaml $(track2) -python-mode: create +``` yaml license-header: MICROSOFT_MIT_NO_VERSION -namespace: azure.iot.deviceupdate +package-version: 1.0.0b1 package-name: azure-iot-deviceupdate -package-version: 1.1.0b1 -clear-output-folder: true -add-credentials: true +namespace: azure.iot.deviceupdate credential-scopes: https://api.adu.microsoft.com/.default -``` - -``` yaml $(python-mode) == 'create' && $(track2) -basic-setup-py: true -output-folder: $(python-sdks-folder)/deviceupdate/azure-iot-deviceupdate -``` - -``` yaml $(python-mode) == 'update' && $(track2) +add-credential: true +clear-output-folder: true no-namespace-folders: true output-folder: $(python-sdks-folder)/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate -``` +``` \ No newline at end of file diff --git a/specification/deviceupdate/data-plane/readme.typescript.md b/specification/deviceupdate/data-plane/readme.typescript.md index 958aab5247f1..5a04d00d5660 100644 --- a/specification/deviceupdate/data-plane/readme.typescript.md +++ b/specification/deviceupdate/data-plane/readme.typescript.md @@ -5,9 +5,13 @@ Please also specify `--typescript-sdks-folder=