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] - Update configuration related APIs #5477

Merged
merged 5 commits into from
Apr 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -427,6 +427,100 @@
},
"x-ms-long-running-operation": true
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/getGatewaySettings": {
"post": {
"tags": [
"Clusters"
],
"operationId": "Clusters_GetGatewaySettings",
"description": "Gets the gateway settings for the specified cluster.",
"x-ms-examples": {
"Get HTTP settings": {
"$ref": "./examples/HDI_Clusters_GetGatewaySettings.json"
}
},
"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.",
"schema": {
"$ref": "#/definitions/GatewaySettings"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateGatewaySettings": {
Copy link
Member

Choose a reason for hiding this comment

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

updateGatewaySettings [](start = 129, length = 21)

Is this something that the user would want to do with an ARM template?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a RESTful API for user to update credential.

"post": {
"tags": [
"Clusters"
],
"operationId": "Clusters_UpdateGatewaySettings",
"description": "Configures the gateway settings on the specified cluster.",
"x-ms-examples": {
"Enable HTTP connectivity": {
"$ref": "./examples/HDI_Clusters_UpdateGatewaySettings_Enable.json"
}
},
"parameters": [
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ClusterNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"name": "parameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/UpdateGatewaySettingsParameters"
},
"description": "The cluster configurations."
}
],
"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
}
}
},
"definitions": {
Expand Down Expand Up @@ -1228,6 +1322,50 @@
}
}
},
"UpdateGatewaySettingsParameters": {
"properties": {
"restAuthCredential.isEnabled": {
"type": "boolean",
"default": true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, we set "default": true here, but it seems that it does not take effect for C# generated code. Can someone give us suggestions on this issue?

Choose a reason for hiding this comment

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

@shahabhijeet any suggestions here?

Copy link
Member

Choose a reason for hiding this comment

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

Using default in swagger doesn't tell the client what to send by default, it tells the client that if they don't send the value, that it will assume the default value.

Your service has to assume true if the client doesn't send a value for that property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fearthecowboy Thanks for your reply. Is it possible to specify default value? In this case, our service always needs restAuthCredential.isEnabled to be true now. But for compatibility reason we have to keep the property.

"x-ms-client-name": "isCredentialEnabled",
"description": "Indicates whether or not the gateway settings based authorization is enabled."
},
"restAuthCredential.username": {
"type": "string",
"x-ms-client-name": "userName",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

AutoRest validation fails due to error DefinitionsPropertiesNamesCamelCase. This error is caused by name restAuthCredential.isEnabled, restAuthCredential.usernameand restAuthCredential.password. We wonder if it is possible to by pass the error check because these names have existed for a long time. In the past, we just didn't design a model for them.

"description": "The gateway settings user name."
},
"restAuthCredential.password": {
"type": "string",
"x-ms-client-name": "password",
"description": "The gateway settings user password."
}
},
"description": "The update gateway settings request parameters."
},
"GatewaySettings": {
"properties": {
"restAuthCredential.isEnabled": {
"type": "string",
"x-ms-client-name": "isCredentialEnabled",
"description": "Indicates whether or not the gateway settings based authorization is enabled.",
"readOnly": true
},
"restAuthCredential.username": {
"type": "string",
"x-ms-client-name": "userName",
"description": "The gateway settings user name.",
"readOnly": true
},
"restAuthCredential.password": {
"type": "string",
"x-ms-client-name": "password",
"description": "The gateway settings user password.",
"readOnly": true
}
},
"description": "Gateway settings."
},
"OperationResource": {
"properties": {
"status": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,56 @@
}
},
"paths": {
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations": {
"post": {
"tags": [
"Configurations"
],
"operationId": "Configurations_List",
"description": "Gets all configuration information for an HDI cluster.",
"x-ms-examples": {
"Get all configuration information": {
"$ref": "./examples/HDI_Configurations_List.json"
}
},
"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.",
"schema": {
"$ref": "#/definitions/ClusterConfigurations"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}": {
"post": {
"tags": [
"Configurations"
],
"operationId": "Configurations_UpdateHTTPSettings",
"description": "Configures the HTTP settings on the specified cluster.",
"operationId": "Configurations_Update",

Choose a reason for hiding this comment

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

This would be a breaking change from the SDK's perspective. Since the changes are still in preview we should be fine.

"description": "Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead.",
"deprecated": true,
"x-ms-examples": {
"Enable HTTP connectivity": {
"$ref": "./examples/ChangeHttpConnectivityEnable.json"
Expand Down Expand Up @@ -97,10 +140,10 @@
"Configurations"
],
"operationId": "Configurations_Get",
"description": "The configuration object for the specified cluster.",
"description": "The configuration object for the specified cluster. This API is not recommended and might be removed in the future. Please consider using List configurations API instead.",
"x-ms-examples": {
"Get HTTP settings": {
"$ref": "./examples/GetHttpConnectivity.json"
"Get Core site settings": {
"$ref": "./examples/HDI_Configurations_Get.json"
}
},
"parameters": [
Expand Down Expand Up @@ -144,6 +187,18 @@
"type": "string"
},
"description": "The configuration object for the specified configuration for the specified cluster."
},
"ClusterConfigurations": {
"properties": {
"configurations": {
"description": "The configuration object for the specified configuration for the specified cluster.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ClusterConfiguration"
}
}
},
"description": "The configuration object for the specified cluster."
}
},
"parameters": {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"clusterName": "cluster1",
"resourceGroupName": "rg1",
"api-version": "2015-03-01-preview",
"subscriptionId": "subid",
"configurationName": "gateway"
"subscriptionId": "subid"
},
"responses": {
"200": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,16 @@
"api-version": "2015-03-01-preview",
"subscriptionId": "subid",
"parameters": {
"osProfile": {
"windowsOperatingSystemProfile": {
"rdpSettings": {
"username": "hadoop",
"password": "**********",
"expiryDate": "2017-02-28"
}
}
}
"restAuthCredential.isEnabled": true,
"restAuthCredential.username": "hadoop",
"restAuthCredential.password": "**********"
}
},
"responses": {
"202": {
"headers": {
"location": "https://management.azure.com/subscriptions/subid/providers/Microsoft.HDInsight/pathToOperationResult"
}
},
"200": {}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"parameters": {
"clusterName": "cluster1",
"resourceGroupName": "rg1",
"api-version": "2015-03-01-preview",
"subscriptionId": "subid",
"configurationName": "core-site"
},
"responses": {
"200": {
"body": {
"fs.defaultFS":"wasb://test.blob.core.windows.net",
"fs.azure.account.key.test.blob.core.windows.net":"accountKey"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"parameters": {
"clusterName": "cluster1",
"resourceGroupName": "rg1",
"api-version": "2015-03-01-preview",
"subscriptionId": "subid"
},
"responses": {
"200": {
"body": {
"configurations": {
"core-site": {
"fs.defaultFS": "wasb://test.blob.core.windows.net",
"fs.azure.account.key.test.blob.core.windows.net": "accountKey"
},
"gateway": {
"restAuthCredential.isEnabled": "true",
"restAuthCredential.username": "admin",
"restAuthCredential.password": "**********"
}
}
}
}
}
}
Loading