From db00be4465b9351e4db9d27eeb79fd238e151e1b Mon Sep 17 00:00:00 2001 From: aim-for-better <1253936411@qq.com> Date: Sat, 29 Jun 2019 07:00:31 +0800 Subject: [PATCH] [HDInsight] Add ListBillingSpecs API to HDInsight's stable and preview version (#6360) * Add ListBillingSpecs API to stable and preview version * Add enum for tier, osType and filtermode * Update HDI_Locations_ListBillingSpecs.json Fix model validation errors * Update HDI_Locations_ListBillingSpecs.json Fix model validation errors --- .../HDI_Locations_ListBillingSpecs.json | 63 ++++++ .../preview/2015-03-01-preview/locations.json | 204 ++++++++++++++++- .../HDI_Locations_ListBillingSpecs.json | 63 ++++++ .../stable/2018-06-01-preview/locations.json | 206 +++++++++++++++++- 4 files changed, 533 insertions(+), 3 deletions(-) create mode 100644 specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2015-03-01-preview/examples/HDI_Locations_ListBillingSpecs.json create mode 100644 specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/HDI_Locations_ListBillingSpecs.json diff --git a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2015-03-01-preview/examples/HDI_Locations_ListBillingSpecs.json b/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2015-03-01-preview/examples/HDI_Locations_ListBillingSpecs.json new file mode 100644 index 000000000000..de9a1182d869 --- /dev/null +++ b/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2015-03-01-preview/examples/HDI_Locations_ListBillingSpecs.json @@ -0,0 +1,63 @@ +{ + "parameters": { + "location": "East US 2", + "api-version": "2015-03-01-preview", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "vmSizes": [ + "A5", + "A6", + "A7" + ], + "vmSizeFilters": [ + { + "filterMode": "Exclude", + "regions": null, + "clusterFlavors": null, + "nodeTypes": null, + "clusterVersions": null, + "osType": null, + "vmSizes": null + } + ], + "billingResources": [ + { + "region": "East US 2", + "billingMeters": [], + "diskBillingMeters": [] + }, + { + "region": "default", + "billingMeters": [ + { + "meterParameter": "default", + "meter": "11111111-1111-1111-1111-111111111111", + "unit": "CoreHours" + }, + { + "meterParameter": "Kafka", + "meter": "11111111-1111-1111-1111-111111111111", + "unit": "CoreHours" + } + ], + "diskBillingMeters": [ + { + "diskRpMeter": "11111111-1111-1111-1111-111111111111", + "sku": "All", + "tier": "Standard" + }, + { + "diskRpMeter": "11111111-1111-1111-1111-111111111111", + "sku": "All", + "tier": "Standard" + } + ] + } + ] + } + } + } +} diff --git a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2015-03-01-preview/locations.json b/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2015-03-01-preview/locations.json index cb49fa0aedd1..613792593a21 100644 --- a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2015-03-01-preview/locations.json +++ b/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2015-03-01-preview/locations.json @@ -111,6 +111,45 @@ } } } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/billingSpecs": { + "get": { + "tags": [ + "Regions" + ], + "operationId": "Locations_ListBillingSpecs", + "description": "Lists the billingSpecs for the specified subscription and location.", + "x-ms-examples": { + "Get the subscription billingSpecs for the specified location": { + "$ref": "./examples/HDI_Locations_ListBillingSpecs.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/LocationParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./operations.json#/definitions/ErrorResponse" + } + }, + "200": { + "description": "OK response definition.", + "schema": { + "$ref": "#/definitions/BillingResponseListResult" + } + } + } + } } }, "definitions": { @@ -338,6 +377,169 @@ } } } + }, + "BillingResponseListResult": { + "type": "object", + "description": "The response for the operation to get regional billingSpecs for a subscription.", + "properties": { + "vmSizes": { + "description": "The virtual machine sizes to include or exclude.", + "type": "array", + "items": { + "type": "string" + } + }, + "vmSizeFilters": { + "description": "The virtual machine filtering mode. Effectively this can enabling or disabling the virtual machine sizes in a particular set.", + "type": "array", + "items": { + "$ref": "#/definitions/VmSizeCompatibilityFilterV2" + } + }, + "billingResources": { + "description": "The billing and managed disk billing resources for a region.", + "type": "array", + "items": { + "$ref": "#/definitions/BillingResources" + } + } + } + }, + "VmSizeCompatibilityFilterV2": { + "type": "object", + "description": "This class represent a single filter object that defines a multidimensional set. The dimensions of this set are Regions, ClusterFlavors, NodeTypes and ClusterVersions. The constraint should be defined based on the following: FilterMode (Exclude vs Include), VMSizes (the vm sizes in affect of exclusion/inclusion) and the ordering of the Filters. Later filters override previous settings if conflicted.", + "properties": { + "filterMode": { + "description": "The filtering mode. Effectively this can enabling or disabling the VM sizes in a particular set.", + "type": "string", + "enum": [ + "Exclude", + "Include" + ], + "x-ms-enum": { + "name": "FilterMode", + "modelAsString": true + } + }, + "regions": { + "description": "The list of regions under the effect of the filter.", + "type": "array", + "items": { + "type": "string" + } + }, + "clusterFlavors": { + "description": "The list of cluster flavors under the effect of the filter.", + "type": "array", + "items": { + "type": "string" + } + }, + "nodeTypes": { + "description": "The list of node types affected by the filter.", + "type": "array", + "items": { + "type": "string" + } + }, + "clusterVersions": { + "description": "The list of cluster versions affected in Major.Minor format.", + "type": "array", + "items": { + "type": "string" + } + }, + "osType": { + "description": "The OSType affected, Windows or Linux.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "Windows", + "Linux" + ], + "x-ms-enum": { + "name": "OSType", + "modelAsString": false + } + } + }, + "vmSizes": { + "description": "The list of virtual machine sizes to include or exclude.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "BillingResources": { + "type": "object", + "description": "The billing resources.", + "properties": { + "region": { + "description": "The region or location.", + "type": "string" + }, + "billingMeters": { + "description": "The billing meter information.", + "type": "array", + "items": { + "$ref": "#/definitions/BillingMeters" + } + }, + "diskBillingMeters": { + "description": "The managed disk billing information.", + "type": "array", + "items": { + "$ref": "#/definitions/DiskBillingMeters" + } + } + } + }, + "BillingMeters": { + "type": "object", + "description": "The billing meters.", + "properties": { + "meterParameter": { + "description": "The virtual machine sizes.", + "type": "string" + }, + "meter": { + "description": "The HDInsight meter guid.", + "type": "string" + }, + "unit": { + "description": "The unit of meter, VMHours or CoreHours.", + "type": "string" + } + } + }, + "DiskBillingMeters": { + "type": "object", + "description": "The disk billing meters.", + "properties": { + "diskRpMeter": { + "description": "The managed disk meter guid.", + "type": "string" + }, + "sku": { + "description": "The managed disk billing sku, P30 or S30.", + "type": "string" + }, + "tier": { + "description": "The managed disk billing tier, Standard or Premium.", + "type": "string", + "enum": [ + "Standard", + "Premium" + ], + "x-ms-enum": { + "name": "Tier", + "modelAsString": false + } + } + } } }, "parameters": { @@ -353,7 +555,7 @@ "in": "path", "required": true, "type": "string", - "description": "The location.", + "description": "The Azure location (region) for which to make the request.", "x-ms-parameter-location": "method" }, "ApiVersionParameter": { diff --git a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/HDI_Locations_ListBillingSpecs.json b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/HDI_Locations_ListBillingSpecs.json new file mode 100644 index 000000000000..2ff11cb94c13 --- /dev/null +++ b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/examples/HDI_Locations_ListBillingSpecs.json @@ -0,0 +1,63 @@ +{ + "parameters": { + "location": "East US 2", + "api-version": "2018-06-01-preview", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "vmSizes": [ + "A5", + "A6", + "A7" + ], + "vmSizeFilters": [ + { + "filterMode": "Exclude", + "regions": null, + "clusterFlavors": null, + "nodeTypes": null, + "clusterVersions": null, + "osType": null, + "vmSizes": null + } + ], + "billingResources": [ + { + "region": "East US 2", + "billingMeters": [], + "diskBillingMeters": [] + }, + { + "region": "default", + "billingMeters": [ + { + "meterParameter": "default", + "meter": "11111111-1111-1111-1111-111111111111", + "unit": "CoreHours" + }, + { + "meterParameter": "Kafka", + "meter": "11111111-1111-1111-1111-111111111111", + "unit": "CoreHours" + } + ], + "diskBillingMeters": [ + { + "diskRpMeter": "11111111-1111-1111-1111-111111111111", + "sku": "All", + "tier": "Standard" + }, + { + "diskRpMeter": "11111111-1111-1111-1111-111111111111", + "sku": "All", + "tier": "Standard" + } + ] + } + ] + } + } + } +} diff --git a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/locations.json b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/locations.json index efc0d5c7d043..3c701f7b6796 100644 --- a/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/locations.json +++ b/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/locations.json @@ -72,6 +72,45 @@ } } } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/billingSpecs": { + "get": { + "tags": [ + "Regions" + ], + "operationId": "Locations_ListBillingSpecs", + "description": "Lists the billingSpecs for the specified subscription and location.", + "x-ms-examples": { + "Get the subscription billingSpecs for the specified location": { + "$ref": "./examples/HDI_Locations_ListBillingSpecs.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/LocationParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./operations.json#/definitions/ErrorResponse" + } + }, + "200": { + "description": "OK response definition.", + "schema": { + "$ref": "#/definitions/BillingResponseListResult" + } + } + } + } } }, "definitions": { @@ -123,6 +162,169 @@ } }, "readOnly": true + }, + "BillingResponseListResult": { + "type": "object", + "description": "The response for the operation to get regional billingSpecs for a subscription.", + "properties": { + "vmSizes": { + "description": "The virtual machine sizes to include or exclude.", + "type": "array", + "items": { + "type": "string" + } + }, + "vmSizeFilters": { + "description": "The virtual machine filtering mode. Effectively this can enabling or disabling the virtual machine sizes in a particular set.", + "type": "array", + "items": { + "$ref": "#/definitions/VmSizeCompatibilityFilterV2" + } + }, + "billingResources": { + "description": "The billing and managed disk billing resources for a region.", + "type": "array", + "items": { + "$ref": "#/definitions/BillingResources" + } + } + } + }, + "VmSizeCompatibilityFilterV2": { + "type": "object", + "description": "This class represent a single filter object that defines a multidimensional set. The dimensions of this set are Regions, ClusterFlavors, NodeTypes and ClusterVersions. The constraint should be defined based on the following: FilterMode (Exclude vs Include), VMSizes (the vm sizes in affect of exclusion/inclusion) and the ordering of the Filters. Later filters override previous settings if conflicted.", + "properties": { + "filterMode": { + "description": "The filtering mode. Effectively this can enabling or disabling the VM sizes in a particular set.", + "type": "string", + "enum": [ + "Exclude", + "Include" + ], + "x-ms-enum": { + "name": "FilterMode", + "modelAsString": true + } + }, + "regions": { + "description": "The list of regions under the effect of the filter.", + "type": "array", + "items": { + "type": "string" + } + }, + "clusterFlavors": { + "description": "The list of cluster flavors under the effect of the filter.", + "type": "array", + "items": { + "type": "string" + } + }, + "nodeTypes": { + "description": "The list of node types affected by the filter.", + "type": "array", + "items": { + "type": "string" + } + }, + "clusterVersions": { + "description": "The list of cluster versions affected in Major.Minor format.", + "type": "array", + "items": { + "type": "string" + } + }, + "osType": { + "description": "The OSType affected, Windows or Linux.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "Windows", + "Linux" + ], + "x-ms-enum": { + "name": "OSType", + "modelAsString": false + } + } + }, + "vmSizes": { + "description": "The list of virtual machine sizes to include or exclude.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "BillingResources": { + "type": "object", + "description": "The billing resources.", + "properties": { + "region": { + "description": "The region or location.", + "type": "string" + }, + "billingMeters": { + "description": "The billing meter information.", + "type": "array", + "items": { + "$ref": "#/definitions/BillingMeters" + } + }, + "diskBillingMeters": { + "description": "The managed disk billing information.", + "type": "array", + "items": { + "$ref": "#/definitions/DiskBillingMeters" + } + } + } + }, + "BillingMeters": { + "type": "object", + "description": "The billing meters.", + "properties": { + "meterParameter": { + "description": "The virtual machine sizes.", + "type": "string" + }, + "meter": { + "description": "The HDInsight meter guid.", + "type": "string" + }, + "unit": { + "description": "The unit of meter, VMHours or CoreHours.", + "type": "string" + } + } + }, + "DiskBillingMeters": { + "type": "object", + "description": "The disk billing meters.", + "properties": { + "diskRpMeter": { + "description": "The managed disk meter guid.", + "type": "string" + }, + "sku": { + "description": "The managed disk billing sku, P30 or S30.", + "type": "string" + }, + "tier": { + "description": "The managed disk billing tier, Standard or Premium.", + "type": "string", + "enum": [ + "Standard", + "Premium" + ], + "x-ms-enum": { + "name": "Tier", + "modelAsString": false + } + } + } } }, "parameters": { @@ -138,7 +340,7 @@ "in": "path", "required": true, "type": "string", - "description": "The location to get capabilities for.", + "description": "The Azure location (region) for which to make the request.", "x-ms-parameter-location": "method" }, "ApiVersionParameter": { @@ -149,4 +351,4 @@ "description": "The HDInsight client API Version." } } -} +} \ No newline at end of file