Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HDInsight] Support the latest azure monitor api #14496

Merged
merged 22 commits into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
46e7cb8
Add networkProperties and clusterId
Oct 10, 2020
afc3561
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Oct 14, 2020
75a1f51
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Nov 6, 2020
34c9683
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Nov 12, 2020
151f917
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Nov 19, 2020
f271a42
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Dec 10, 2020
92044fa
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Dec 14, 2020
11e9fac
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Dec 18, 2020
bbe65a3
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Jan 5, 2021
a858456
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Jan 13, 2021
2418dfb
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Jan 13, 2021
891652d
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Jan 18, 2021
3a250aa
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Jan 21, 2021
f22e409
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Jan 25, 2021
b59b60f
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Feb 3, 2021
7b642ef
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Mar 9, 2021
4b4ef5a
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Mar 9, 2021
c840074
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Mar 17, 2021
45ff4b5
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
Apr 27, 2021
75fffe7
Merge branch 'master' of github.com:Azure/azure-rest-api-specs
May 19, 2021
4d31fcc
Add Azure Monitor API
May 19, 2021
1c47f55
Add azure monitor examples and modify descriptions and add related ap…
May 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"parameters": {
"clusterName": "cluster1",
"resourceGroupName": "rg1",
"api-version": "2015-03-01-preview",
"subscriptionId": "subid"
},
"responses": {
"200": {},
"202": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"parameters": {
"clusterName": "cluster1",
"resourceGroupName": "rg1",
"api-version": "2015-03-01-preview",
"subscriptionId": "subid",
"parameters": {
"workspaceId": "a2090ead-8c9f-4fba-b70e-533e3e003163",
"primaryKey": "**********"
}
},
"responses": {
"200": {},
"202": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"parameters": {
"clusterName": "cluster1",
"resourceGroupName": "rg1",
"api-version": "2015-03-01-preview",
"subscriptionId": "subid"
},
"responses": {
"200": {
"body": {
"clusterMonitoringEnabled": true,
"workspaceId": "id"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,148 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor": {
"put": {
"tags": [
"Extensions"
],
"description": "Enables the Azure Monitor on the HDInsight cluster.",
"x-ms-examples": {
"Enable cluster monitoring": {
"$ref": "./examples/EnableLinuxClusterAzureMonitor.json"
}
},
"operationId": "Extensions_EnableAzureMonitor",
"parameters": [
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ClusterNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"name": "parameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AzureMonitorRequest"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PUT request body doesn't match the ARM standard pattern at all. I see properties workspaceId, primaryKey are exposed at top-level instead of having them under properties envelope. For more details, refer RPC here https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md#resource-request-properties-envelope

However, I understand the swagger already defined the extensions API and this PR is just adding an instance of extension resource. I would give the exception for this reason and sign off.

I would recommend to have a workItem/task on your side to correct the request/response formats in future new API versions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @RamyasreeChakka, Thanks for your comment and approval.

it seems that the we follow the rule: the workspaceId and primaryKey under that properties of the AzureMonitorRequest definion. Could you please help me understand better about this rule so that our service can satisfy the ARM standard pattern next time?

"AzureMonitorRequest": 
{      
  "description": "The azure monitor parameters.", 
    "properties": 
      {       
         "workspaceId":  {          
              "description": "The Log Analytics workspace ID.", 
                "type": "string"       
           },        
           "primaryKey": {
             "description": "The Log Analytics workspace key.",  
                 "type": "string"        
           },       
          "selectedConfigurations": {        
            "description": "The selected configurations.",   
             "$ref": "#/definitions/AzureMonitorSelectedConfigurations"       
            } 
      }
}

},
"description": "The Log Analytics workspace parameters."
}
],
"responses": {
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "./operations.json#/definitions/ErrorResponse"
}
},
"200": {
"description": "Ok response definition."
},
"202": {
"description": "Accepted response definition."
}
},
"x-ms-long-running-operation": true,
"x-ms-long-running-operation-options": {
"final-state-via": "location"
}
},
"get": {
"tags": [
"Extensions"
],
"description": "Gets the status of Azure Monitor on the HDInsight cluster.",
"x-ms-examples": {
"Enable cluster monitoring": {
"$ref": "./examples/GetLinuxClusterAzureMonitorStatus.json"
}
},
"operationId": "Extensions_GetAzureMonitorStatus",
"parameters": [
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ClusterNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "./operations.json#/definitions/ErrorResponse"
}
},
"200": {
"description": "OK. The request has succeeded.",
"schema": {
"$ref": "#/definitions/AzureMonitorResponse"
}
}
}
},
"delete": {
"tags": [
"Extensions"
],
"description": "Disables the Azure Monitor on the HDInsight cluster.",
"x-ms-examples": {
"Enable cluster monitoring": {
"$ref": "./examples/DisableLinuxClusterAzureMonitor.json"
}
},
"operationId": "Extensions_DisableAzureMonitor",
"parameters": [
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ClusterNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "./operations.json#/definitions/ErrorResponse"
}
},
"200": {
"description": "Ok response definition."
},
"202": {
"description": "OK response definition."
},
"204": {
"description": "No Content response definition."
}
},
"x-ms-long-running-operation": true,
"x-ms-long-running-operation-options": {
"final-state-via": "location"
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}": {
"put": {
"tags": [
Expand Down Expand Up @@ -415,6 +557,72 @@
"type": "string"
}
}
},
"AzureMonitorRequest": {
"description": "The azure monitor parameters.",
"properties": {
"workspaceId": {
"description": "The Log Analytics workspace ID.",
"type": "string"
},
"primaryKey": {
"description": "The Log Analytics workspace key.",
"type": "string"
},
"selectedConfigurations": {
"description": "The selected configurations.",
"$ref": "#/definitions/AzureMonitorSelectedConfigurations"
}
}
},
"AzureMonitorResponse": {
"description": "The azure monitor status response.",
"properties": {
"clusterMonitoringEnabled": {
"description": "The status of the monitor on the HDInsight cluster.",
"type": "boolean"
},
"workspaceId": {
"description": "The workspace ID of the monitor on the HDInsight cluster.",
"type": "string"
},
"selectedConfigurations": {
"description": "The selected configurations.",
"$ref": "#/definitions/AzureMonitorSelectedConfigurations"
}
}
},
"AzureMonitorSelectedConfigurations": {
"description": "The selected configurations for azure monitor.",
"properties": {
"configurationVersion": {
"description": "The configuration version.",
"type": "string"
},
"globalConfigurations": {
"description": "The global configurations of selected configurations.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"tableList": {
"description": "The table list.",
"type": "array",
"items": {
"$ref": "#/definitions/AzureMonitorTableConfiguration"
}
}
}
},
"AzureMonitorTableConfiguration": {
"description": "The table configuration for the Log Analytics integration.",
"properties": {
"name": {
"description": "The name.",
"type": "string"
}
}
}
},
"parameters": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"parameters": {
"clusterName": "cluster1",
"resourceGroupName": "rg1",
"api-version": "2018-06-01-preview",
"subscriptionId": "subid"
},
"responses": {
"200": {},
"202": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"parameters": {
"clusterName": "cluster1",
"resourceGroupName": "rg1",
"api-version": "2018-06-01-preview",
"subscriptionId": "subid",
"parameters": {
"workspaceId": "a2090ead-8c9f-4fba-b70e-533e3e003163",
"primaryKey": "**********"
}
},
"responses": {
"200": {},
"202": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"parameters": {
"clusterName": "cluster1",
"resourceGroupName": "rg1",
"api-version": "2018-06-01-preview",
"subscriptionId": "subid"
},
"responses": {
"200": {
"body": {
"clusterMonitoringEnabled": true,
"workspaceId": "id"
}
}
}
}
Loading