From 23d896b00311e101dbbd6fea04c9ae9f0006be92 Mon Sep 17 00:00:00 2001 From: komakkar <71260242+komakkar@users.noreply.github.com> Date: Wed, 22 Dec 2021 16:57:29 +0530 Subject: [PATCH] Dev oep microsoft.open energy platform 2021 06 01 preview (#17105) * New Swagger Spec File * New Swagger Example Spec File * New Readme Config File * New Azure AZ Readme Config File * New Azure CLI Readme Config File * New Go Language Readme Config File * New Python Language Readme Config File * New Typescript Language Readme Config File * New C# Language Readme Config File * Updated swagger * adding examples * correcting version of api * Go readme changed * Changing operation id Names from oepresource to energyservices * added id for data partition name for linter to pass * Removing stray operationsgroupget file * lint fix * prettier fix * added multiapi * testing the SDK pipeline run * Correcting go readme and adding SDK link * Correcting go readme and adding SDK link * Removing ARM schema * Using common type for availability response and request * removing definition * renaming definition from OEPResources to EneryServices * correcting energy services * Changing properties name * Adding v3 error response * Adding description to Data partion Names list. * correcting energyservices to energyservice * adding operation list reponse * correcting ref for operationlist * Adding examples and prettier-fix --- .../Locations_CheckNameAvailability.json | 19 + .../examples/OepResource_Create.json | 73 +++ .../examples/OepResource_Delete.json | 13 + .../examples/OepResource_Get.json | 34 ++ .../OepResource_ListByResourceGroup.json | 38 ++ .../OepResource_ListBySubscriptionId.json | 37 ++ .../examples/OepResource_Update.json | 39 ++ .../examples/Operations_List.json | 133 +++++ .../preview/2021-06-01-preview/oep.json | 484 ++++++++++++++++++ .../oep/resource-manager/readme.az.md | 28 + .../oep/resource-manager/readme.cli.md | 1 + .../oep/resource-manager/readme.csharp.md | 15 + .../oep/resource-manager/readme.go.md | 11 + specification/oep/resource-manager/readme.md | 77 +++ .../oep/resource-manager/readme.python.md | 23 + .../oep/resource-manager/readme.typescript.md | 14 + 16 files changed, 1039 insertions(+) create mode 100644 specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/Locations_CheckNameAvailability.json create mode 100644 specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Create.json create mode 100644 specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Delete.json create mode 100644 specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Get.json create mode 100644 specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_ListByResourceGroup.json create mode 100644 specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_ListBySubscriptionId.json create mode 100644 specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Update.json create mode 100644 specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/Operations_List.json create mode 100644 specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/oep.json create mode 100644 specification/oep/resource-manager/readme.az.md create mode 100644 specification/oep/resource-manager/readme.cli.md create mode 100644 specification/oep/resource-manager/readme.csharp.md create mode 100644 specification/oep/resource-manager/readme.go.md create mode 100644 specification/oep/resource-manager/readme.md create mode 100644 specification/oep/resource-manager/readme.python.md create mode 100644 specification/oep/resource-manager/readme.typescript.md diff --git a/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/Locations_CheckNameAvailability.json b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/Locations_CheckNameAvailability.json new file mode 100644 index 000000000000..83e9b46cd74d --- /dev/null +++ b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/Locations_CheckNameAvailability.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "api-version": "2021-06-01-preview", + "body": { + "name": "sample-name", + "type": "Microsoft.OEP/oepResource" + } + }, + "responses": { + "200": { + "body": { + "nameAvailable": true, + "reason": null, + "message": null + } + } + } +} diff --git a/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Create.json b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Create.json new file mode 100644 index 000000000000..601ec8f053d5 --- /dev/null +++ b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Create.json @@ -0,0 +1,73 @@ +{ + "parameters": { + "api-version": "2021-06-01-preview", + "subscriptionId": "0000000-0000-0000-0000-000000000001", + "resourceGroupName": "DummyResourceGroupName", + "resourceName": "DummyResourceName", + "oepResource": { + "location": "West US", + "tags": { + "additionalProps1": "additional properties" + }, + "properties": { + "authAppId": "sample-id", + "dataPartitionNames": [ + { + "name": "dataPartition1" + }, + { + "name": "dataPartition2" + } + ] + } + } + }, + "responses": { + "200": { + "body": { + "properties": { + "provisioningState": "Succeeded", + "authAppId": "sample-id", + "dataPartitionNames": [ + { + "name": "dataPartition1" + }, + { + "name": "dataPartition2" + } + ] + }, + "name": "DummyResourceName", + "id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/DummyResourceGroupName/providers/Microsoft.OEP/oepResource/DummyResourceName", + "type": "Microsoft.OEP/oepResource", + "location": "WestUS", + "tags": { + "additionalProps1": "additional properties" + } + } + }, + "201": { + "body": { + "properties": { + "provisioningState": "Accepted", + "authAppId": "sample-id", + "dataPartitionNames": [ + { + "name": "dataPartition1" + }, + { + "name": "dataPartition2" + } + ] + }, + "name": "DummyResourceName", + "id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/DummyResourceGroupName/providers/Microsoft.OEP/oepResource/DummyResourceName", + "type": "Microsoft.OEP/oepResource", + "location": "WestUS", + "tags": { + "additionalProps1": "additional properties" + } + } + } + } +} diff --git a/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Delete.json b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Delete.json new file mode 100644 index 000000000000..485ede36145a --- /dev/null +++ b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Delete.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "subscriptionId": "0000000-0000-0000-0000-000000000001", + "resourceGroupName": "DummyResourceGroupName", + "api-version": "2021-06-01-preview", + "resourceName": "DummyResourceName" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Get.json b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Get.json new file mode 100644 index 000000000000..d02213ad7702 --- /dev/null +++ b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Get.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "api-version": "2021-06-01-preview", + "subscriptionId": "0000000-0000-0000-0000-000000000001", + "resourceGroupName": "DummyResourceGroupName", + "resourceName": "DummyResourceName" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "provisioningState": "Accepted", + "authAppId": "sample-id", + "dataPartitionNames": [ + { + "name": "dataPartition1" + }, + { + "name": "dataPartition2" + } + ] + }, + "name": "DummyResourceName", + "id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/DummyResourceGroupName/providers/Microsoft.OEP/oepResource/DummyResourceName", + "type": "Microsoft.OEP/oepResource", + "location": "WestUS", + "tags": { + "additionalProps1": "additional properties" + } + } + } + } +} diff --git a/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_ListByResourceGroup.json b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_ListByResourceGroup.json new file mode 100644 index 000000000000..ca019028a4f1 --- /dev/null +++ b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_ListByResourceGroup.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "api-version": "2021-06-01-preview", + "subscriptionId": "0000000-0000-0000-0000-000000000001", + "resourceGroupName": "DummyResourceGroupName" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "properties": { + "provisioningState": "Accepted", + "authAppId": "sample-id", + "dataPartitionNames": [ + { + "name": "dataPartition1" + }, + { + "name": "dataPartition2" + } + ] + }, + "name": "DummyResourceName", + "id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/DummyResourceGroupName/providers/Microsoft.OEP/oepResource/DummyResourceName", + "type": "Microsoft.OEP/oepResource", + "location": "WestUS", + "tags": { + "additionalProps1": "additional properties" + } + } + ], + "nextLink": "" + } + } + } +} diff --git a/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_ListBySubscriptionId.json b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_ListBySubscriptionId.json new file mode 100644 index 000000000000..c485e1534c11 --- /dev/null +++ b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_ListBySubscriptionId.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "api-version": "2021-06-01-preview", + "subscriptionId": "0000000-0000-0000-0000-000000000001" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "properties": { + "provisioningState": "Accepted", + "authAppId": "sample-id", + "dataPartitionNames": [ + { + "name": "dataPartition1" + }, + { + "name": "dataPartition2" + } + ] + }, + "name": "DummyResourceName", + "id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/DummyResourceGroupName/providers/Microsoft.OEP/oepResource/DummyResourceName", + "type": "Microsoft.OEP/oepResource", + "location": "WestUS", + "tags": { + "additionalProps1": "additional properties" + } + } + ], + "nextLink": "" + } + } + } +} diff --git a/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Update.json b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Update.json new file mode 100644 index 000000000000..2f91438e8581 --- /dev/null +++ b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/OepResource_Update.json @@ -0,0 +1,39 @@ +{ + "parameters": { + "subscriptionId": "0000000-0000-0000-0000-000000000001", + "resourceGroupName": "DummyResourceGroupName", + "resourceName": "DummyResourceName", + "api-version": "2021-06-01-preview", + "oepPatchResource": { + "tags": { + "additionalProps1": "additional properties" + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "properties": { + "provisioningState": "Success", + "authAppId": "sample-id", + "dataPartitionNames": [ + { + "name": "dataPartition1" + }, + { + "name": "dataPartition2" + } + ] + }, + "name": "DummyResourceName", + "id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/DummyResourceGroupName/providers/Microsoft.OEP/oepResource/DummyResourceName", + "type": "Microsoft.OEP/oepResource", + "location": "WestUS", + "tags": { + "additionalProps1": "additional properties" + } + } + } + } +} diff --git a/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/Operations_List.json b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/Operations_List.json new file mode 100644 index 000000000000..91d106836f76 --- /dev/null +++ b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/examples/Operations_List.json @@ -0,0 +1,133 @@ +{ + "parameters": { + "api-version": "2021-06-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.OpenEnergyPlatform/register/action", + "isDataAction": false, + "display": { + "provider": "Microsoft.OpenEnergyPlatform", + "resource": "Microsoft.OpenEnergyPlatform", + "operation": "Register the Microsoft.OpenEnergyPlatform", + "description": "Register the subscription for Microsoft.OpenEnergyPlatform" + } + }, + { + "name": "Microsoft.OpenEnergyPlatform/unregister/action", + "isDataAction": false, + "display": { + "provider": "Microsoft.OpenEnergyPlatform", + "resource": "Microsoft.OpenEnergyPlatform", + "operation": "Unregister the Microsoft.OpenEnergyPlatform", + "description": "Unregister the subscription for Microsoft.OpenEnergyPlatform" + } + }, + { + "name": "Microsoft.OpenEnergyPlatform/Locations/OperationStatuses/read", + "isDataAction": false, + "display": { + "provider": "Microsoft.OpenEnergyPlatform", + "resource": "Locations/OperationStatuses", + "operation": "read_OperationStatuses", + "description": "read OperationStatuses" + } + }, + { + "name": "Microsoft.OpenEnergyPlatform/Locations/OperationStatuses/write", + "isDataAction": false, + "display": { + "provider": "Microsoft.OpenEnergyPlatform", + "resource": "Locations/OperationStatuses", + "operation": "write_OperationStatuses", + "description": "write OperationStatuses" + } + }, + { + "name": "Microsoft.OpenEnergyPlatform/energyServices/read", + "isDataAction": false, + "display": { + "provider": "Microsoft.OpenEnergyPlatform", + "resource": "energyServices", + "operation": "OepResources_ListByResourceGroup", + "description": "Returns list of oep resources.." + } + }, + { + "name": "Microsoft.OpenEnergyPlatform/energyServices/read", + "isDataAction": false, + "display": { + "provider": "Microsoft.OpenEnergyPlatform", + "resource": "energyServices", + "operation": "OepResources_ListBySubscriptionId", + "description": "Lists a collection of oep resources under the given Azure Subscription ID." + } + }, + { + "name": "Microsoft.OpenEnergyPlatform/energyServices/read", + "isDataAction": false, + "display": { + "provider": "Microsoft.OpenEnergyPlatform", + "resource": "energyServices", + "operation": "OepResources_Get", + "description": "Returns oep resource for a given name." + } + }, + { + "name": "Microsoft.OpenEnergyPlatform/energyServices/write", + "isDataAction": false, + "display": { + "provider": "Microsoft.OpenEnergyPlatform", + "resource": "energyServices", + "operation": "OepResources_Create", + "description": "Method that gets called if subscribed for ResourceCreationBegin trigger." + } + }, + { + "name": "Microsoft.OpenEnergyPlatform/energyServices/delete", + "isDataAction": false, + "display": { + "provider": "Microsoft.OpenEnergyPlatform", + "resource": "energyServices", + "operation": "OepResources_Delete", + "description": "Deletes oep resource" + } + }, + { + "name": "Microsoft.OpenEnergyPlatform/energyServices/write", + "isDataAction": false, + "display": { + "provider": "Microsoft.OpenEnergyPlatform", + "resource": "energyServices", + "operation": "OepResources_Update", + "description": "write energyServices" + } + }, + { + "name": "Microsoft.OpenEnergyPlatform/Operations/read", + "isDataAction": false, + "display": { + "provider": "Microsoft.OpenEnergyPlatform", + "resource": "Operations", + "operation": "read_Operations", + "description": "read Operations" + } + }, + { + "name": "Microsoft.OpenEnergyPlatform/checkNameAvailability/action", + "isDataAction": false, + "display": { + "provider": "Microsoft.OpenEnergyPlatform", + "resource": "checkNameAvailability", + "operation": "action_checkNameAvailability", + "description": "action checkNameAvailability" + } + } + ] + } + } + } +} diff --git a/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/oep.json b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/oep.json new file mode 100644 index 000000000000..0a81998e30ce --- /dev/null +++ b/specification/oep/resource-manager/Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/oep.json @@ -0,0 +1,484 @@ +{ + "swagger": "2.0", + "info": { + "title": "Open Energy Platform Management Service APIs", + "description": "Open Energy Platform Management Service APIs", + "version": "2021-06-01-preview" + }, + "paths": { + "/subscriptions/{subscriptionId}/providers/Microsoft.OpenEnergyPlatform/checkNameAvailability": { + "post": { + "tags": [ + "Locations" + ], + "description": "Checks the name availability of the resource with requested resource name.", + "operationId": "Locations_CheckNameAvailability", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "in": "body", + "name": "body", + "description": "NameAvailabilityRequest object.", + "required": true, + "schema": { + "description": "NameAvailabilityRequest object.", + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/CheckNameAvailabilityRequest" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/CheckNameAvailabilityResponse" + } + }, + "default": { + "description": "Error", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Locations_CheckNameAvailability": { + "$ref": "./examples/Locations_CheckNameAvailability.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OpenEnergyPlatform/energyServices": { + "get": { + "tags": [ + "UserRPOepResource" + ], + "description": "Returns list of oep resources..", + "operationId": "EnergyServices_ListByResourceGroup", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/EnergyServiceList" + } + }, + "default": { + "description": "Error response describing why the operation failed." + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "OepResource_ListByResourceGroup": { + "$ref": "./examples/OepResource_ListByResourceGroup.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.OpenEnergyPlatform/energyServices": { + "get": { + "tags": [ + "UserRPOepResource" + ], + "description": "Lists a collection of oep resources under the given Azure Subscription ID.", + "operationId": "EnergyServices_ListBySubscription", + "x-ms-examples": { + "OepResource_ListBySubscriptionId": { + "$ref": "./examples/OepResource_ListBySubscriptionId.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Returned when the operation is successful.", + "schema": { + "$ref": "#/definitions/EnergyServiceList" + } + }, + "default": { + "x-nullable": false, + "description": "Error response describing why the operation failed." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OpenEnergyPlatform/energyServices/{resourceName}": { + "get": { + "tags": [ + "UserRPOepResource" + ], + "description": "Returns oep resource for a given name.", + "operationId": "EnergyServices_Get", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "in": "path", + "name": "resourceName", + "description": "The resource name.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/EnergyService" + } + }, + "default": { + "description": "Error response describing why the operation failed." + } + }, + "x-ms-examples": { + "OepResource_Get": { + "$ref": "./examples/OepResource_Get.json" + } + } + }, + "put": { + "tags": [ + "UserRPOepResource" + ], + "description": "Method that gets called if subscribed for ResourceCreationBegin trigger.", + "operationId": "EnergyServices_Create", + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "in": "path", + "name": "resourceName", + "description": "The resource name.", + "required": true, + "type": "string" + }, + { + "in": "body", + "name": "body", + "description": "Request body.", + "schema": { + "description": "Request body.", + "$ref": "#/definitions/EnergyService" + } + } + ], + "responses": { + "200": { + "description": "The OEP resource created.", + "schema": { + "$ref": "#/definitions/EnergyService" + } + }, + "201": { + "description": "The OEP resource will be created asynchronously", + "schema": { + "$ref": "#/definitions/EnergyService" + } + }, + "default": { + "description": "Error response describing the reason for operation failure. 404 - NotFound (Confidential Ledger could not be created/updated)", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "OepResource_Create": { + "$ref": "./examples/OepResource_Create.json" + } + } + }, + "patch": { + "operationId": "EnergyServices_Update", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "in": "path", + "name": "resourceName", + "description": "The resource name.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "body", + "schema": { + "$ref": "#/definitions/EnergyResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "Updates the oep resource.", + "schema": { + "$ref": "#/definitions/EnergyService" + } + }, + "default": { + "description": "Error response describing why the operation failed." + } + }, + "x-ms-examples": { + "OepResource_Update": { + "$ref": "./examples/OepResource_Update.json" + } + } + }, + "delete": { + "description": "Deletes oep resource", + "operationId": "EnergyServices_Delete", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "in": "path", + "name": "resourceName", + "description": "The resource name.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "202": { + "description": "The OEP resource will be deleted asynchronously" + }, + "204": { + "description": "Returned when the operation returns no content." + }, + "default": { + "description": "Error response describing why the operation failed." + } + }, + "x-ms-examples": { + "OepResource_Delete": { + "$ref": "./examples/OepResource_Delete.json" + } + } + } + }, + "/providers/Microsoft.OpenEnergyPlatform/operations": { + "get": { + "tags": [ + "Operations" + ], + "description": "Lists the available operations of Microsoft.OpenEnergyPlatform resource provider.", + "operationId": "Operations_List", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Operations_List": { + "$ref": "./examples/Operations_List.json" + } + } + } + } + }, + "definitions": { + "EnergyServiceList": { + "description": "The list of oep resources.", + "type": "object", + "properties": { + "nextLink": { + "description": "The link used to get the next page of oep resources list.", + "type": "string" + }, + "value": { + "description": "The list of oep resources.", + "type": "array", + "items": { + "$ref": "#/definitions/EnergyService" + } + } + } + }, + "DataPartitionNames": { + "type": "object", + "description": "The list of Energy services resource's Data Partition Names.", + "properties": { + "name": { + "type": "string" + } + } + }, + "EnergyServiceProperties": { + "type": "object", + "properties": { + "dnsName": { + "type": "string", + "readOnly": true + }, + "provisioningState": { + "enum": [ + "Unknown", + "Succeeded", + "Failed", + "Canceled", + "Creating", + "Deleting", + "Updating" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": true + } + }, + "authAppId": { + "type": "string", + "readOnly": false + }, + "dataPartitionNames": { + "type": "array", + "items": { + "$ref": "#/definitions/DataPartitionNames" + }, + "x-ms-identifiers": [] + } + } + }, + "EnergyService": { + "required": [ + "location" + ], + "type": "object", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/Resource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/EnergyServiceProperties" + }, + "tags": { + "description": "Resource tags.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "location": { + "description": "Geo-location where the resource lives.", + "type": "string" + } + } + }, + "EnergyResourceUpdate": { + "description": "The resource model definition used for updating a tracked ARM resource.", + "type": "object", + "properties": { + "tags": { + "description": "Resource tags.", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "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" + } + }, + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "host": "management.azure.com", + "schemes": [ + "https" + ] +} diff --git a/specification/oep/resource-manager/readme.az.md b/specification/oep/resource-manager/readme.az.md new file mode 100644 index 000000000000..815f3b9b8920 --- /dev/null +++ b/specification/oep/resource-manager/readme.az.md @@ -0,0 +1,28 @@ +## AZ + +These settings apply only when `--az` is specified on the command line. + +For new Resource Provider. It is highly recommended to onboard Azure CLI extensions. There's no differences in terms of customer usage. + +``` yaml $(az) && $(target-mode) != 'core' +az: + extensions: oep + namespace: azure.mgmt.oep + package-name: azure-mgmt-oep +az-output-folder: $(azure-cli-extension-folder)/src/oep +python-sdk-output-folder: "$(az-output-folder)/azext_oep/vendored_sdks/oep" +# add additional configuration here specific for Azure CLI +# refer to the faq.md for more details +``` + + + +This is for command modules that already in azure cli main repo. +``` yaml $(az) && $(target-mode) == 'core' +az: + extensions: oep + namespace: azure.mgmt.oep + package-name: azure-mgmt-oep +az-output-folder: $(azure-cli-folder)/src/azure-cli/azure/cli/command_modules/oep +python-sdk-output-folder: "$(az-output-folder)/vendored_sdks/oep" +``` \ No newline at end of file diff --git a/specification/oep/resource-manager/readme.cli.md b/specification/oep/resource-manager/readme.cli.md new file mode 100644 index 000000000000..c6cf6ad37ea4 --- /dev/null +++ b/specification/oep/resource-manager/readme.cli.md @@ -0,0 +1 @@ +## CLI Common Settings for all the command line tools \ No newline at end of file diff --git a/specification/oep/resource-manager/readme.csharp.md b/specification/oep/resource-manager/readme.csharp.md new file mode 100644 index 000000000000..f885d5d45013 --- /dev/null +++ b/specification/oep/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.OEP + output-folder: $(csharp-sdks-folder)/oep/management/Microsoft.OEP/GeneratedProtocol +``` diff --git a/specification/oep/resource-manager/readme.go.md b/specification/oep/resource-manager/readme.go.md new file mode 100644 index 000000000000..3f016f32a487 --- /dev/null +++ b/specification/oep/resource-manager/readme.go.md @@ -0,0 +1,11 @@ +## Go + +These settings apply only when `--go` is specified on the command line. + +```yaml $(go) && $(track2) +azure-arm: true +license-header: MICROSOFT_MIT_NO_VERSION +module-name: sdk/resourcemanager/oep/armoep +module: github.com/Azure/azure-sdk-for-go/$(module-name) +output-folder: $(go-sdk-folder)/$(module-name) +``` \ No newline at end of file diff --git a/specification/oep/resource-manager/readme.md b/specification/oep/resource-manager/readme.md new file mode 100644 index 000000000000..10f1e9493f7d --- /dev/null +++ b/specification/oep/resource-manager/readme.md @@ -0,0 +1,77 @@ +# oep + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for oep. + +## Getting Started + +To build the SDKs for My API, simply install AutoRest via `npm` (`npm install -g autorest`) and then run: + +> `autorest readme.md` + +To see additional help and options, run: + +> `autorest --help` + +For other options on installation see [Installing AutoRest](https://aka.ms/autorest/install) on the AutoRest github page. + +--- + +## Configuration + +### Basic Information + +These are the global settings for the oep. + +```yaml +openapi-type: arm +openapi-subtype: rpaas +tag: package-2021-06-01-preview +``` + +### Tag: package-2021-06-01-preview + +These settings apply only when `--tag=package-2021-06-01-preview` is specified on the command line. + +```yaml $(tag) == 'package-2021-06-01-preview' +input-file: + - Microsoft.OpenEnergyPlatform/preview/2021-06-01-preview/oep.json +``` + +--- + +# Code Generation + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +```yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-python-track2 + - repo: azure-sdk-for-java + - repo: azure-sdk-for-go-track2 + - repo: azure-sdk-for-js + - repo: azure-cli-extensions +``` +## Az + +See configuration in [readme.az.md](./readme.az.md) + +## Go + +See configuration in [readme.go.md](./readme.go.md) + +## Python + +See configuration in [readme.python.md](./readme.python.md) + +## TypeScript + +See configuration in [readme.typescript.md](./readme.typescript.md) + +## CSharp + +See configuration in [readme.csharp.md](./readme.csharp.md) diff --git a/specification/oep/resource-manager/readme.python.md b/specification/oep/resource-manager/readme.python.md new file mode 100644 index 000000000000..ae3785e890ca --- /dev/null +++ b/specification/oep/resource-manager/readme.python.md @@ -0,0 +1,23 @@ +## Python + +These settings apply only when `--python` is specified on the command line. +Please also specify `--python-sdks-folder=`. + +``` yaml $(track2) +azure-arm: true +license-header: MICROSOFT_MIT_NO_VERSION +package-name: azure-mgmt-oep +no-namespace-folders: true +package-version: 1.0.0b1 +clear-output-folder: true +``` + +``` yaml $(python-mode) == 'update' && $(track2) +no-namespace-folders: true +output-folder: $(python-sdks-folder)/oep/azure-mgmt-oep/azure/mgmt/oep +``` + +``` yaml $(python-mode) == 'create' && $(track2) +basic-setup-py: true +output-folder: $(python-sdks-folder)/oep/azure-mgmt-oep +``` diff --git a/specification/oep/resource-manager/readme.typescript.md b/specification/oep/resource-manager/readme.typescript.md new file mode 100644 index 000000000000..e99cd7131081 --- /dev/null +++ b/specification/oep/resource-manager/readme.typescript.md @@ -0,0 +1,14 @@ +## TypeScript + +These settings apply only when `--typescript` is specified on the command line. +Please also specify `--typescript-sdks-folder=`. + +``` yaml $(typescript) +typescript: + azure-arm: true + package-name: "@azure/arm-oep" + output-folder: "$(typescript-sdks-folder)/sdk/oep/arm-oep" + payload-flattening-threshold: 1 + clear-output-folder: true + generate-metadata: true +```