Skip to content

Commit

Permalink
[HDInsight] Add two new APIs: listhosts and restart node (Azure#8794)
Browse files Browse the repository at this point in the history
  • Loading branch information
aim-for-better authored and 00Kai0 committed Oct 12, 2020
1 parent e27ee31 commit 530bcd7
Show file tree
Hide file tree
Showing 4 changed files with 279 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"parameters": {
"api-version": "2018-06-01-preview",
"subscriptionId": "subid",
"resourceGroupName": "rg1",
"clusterName": "cluster1"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": "gateway1"
},
{
"name": "gateway3"
},
{
"name": "headnode0"
},
{
"name": "headnode3"
},
{
"name": "workernode0"
},
{
"name": "workernode1"
},
{
"name": "zookeepernode0"
},
{
"name": "zookeepernode2"
},
{
"name": "zookeepernode3"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"parameters": {
"api-version": "2018-06-01-preview",
"subscriptionId": "subid",
"resourceGroupName": "rg1",
"clusterName": "cluster1",
"hosts": [
"gateway1",
"gateway3"
]
},
"responses": {
"202": {
"headers": {
"location": "https://management.azure.com/subscriptions/subid/providers/Microsoft.HDInsight/pathToOperationResult"
}
},
"200": {
"headers": {
"location": "https://management.azure.com/subscriptions/subid/providers/Microsoft.HDInsight/pathToOperationResult"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
{
"swagger": "2.0",
"info": {
"title": "HDInsightManagementClient",
"description": "The HDInsight Management Client.",
"version": "2018-06-01-preview"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/listHosts": {
"post": {
"tags": [
"VirtualMachines"
],
"operationId": "VirtualMachines_ListHosts",
"description": "Lists the HDInsight clusters hosts",
"x-ms-examples": {
"Get All hosts in the cluster": {
"$ref": "./examples/GetClusterVirtualMachines.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": "#/definitions/ErrorResponse"
}
},
"200": {
"description": "OK response definition.",
"schema": {
"$ref": "#/definitions/HostInfoListResult"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/restartHosts": {
"post": {
"tags": [
"VirtualMachines"
],
"operationId": "VirtualMachines_RestartHosts",
"description": "Restarts the specified HDInsight cluster hosts.",
"x-ms-examples": {
"Restarts the specified HDInsight cluster hosts.": {
"$ref": "./examples/RestartVirtualMachinesOperation.json"
}
},
"parameters": [
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ClusterNameParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"name": "hosts",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/RestartHostsParameters"
},
"description": "The list of hosts to restart"
}
],
"responses": {
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"200": {
"description": "OK response definition."
},
"202": {
"description": "Accepted response definition."
}
},
"x-ms-long-running-operation": true
}
}
},
"definitions": {
"HostInfo": {
"description": "The cluster host information.",
"properties": {
"name": {
"description": "The host name",
"type": "string"
}
},
"readOnly": true
},
"HostInfoListResult": {
"description": "Result of the request to list cluster hosts",
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/HostInfo"
},
"description": "The list of cluster hosts."
}
},
"readOnly": true
},
"RestartHostsParameters": {
"type": "array",
"items": {
"type": "string"
},
"description": "The list of hosts which need to be restarted."
},
"ErrorResponse": {
"description": "Describes the format of Error response.",
"type": "object",
"properties": {
"code": {
"description": "Error code",
"type": "string"
},
"message": {
"description": "Error message indicating why the operation failed.",
"type": "string"
}
}
}
},
"parameters": {
"SubscriptionIdParameter": {
"name": "subscriptionId",
"in": "path",
"required": true,
"type": "string",
"description": "The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."
},
"ResourceGroupNameParameter": {
"name": "resourceGroupName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource group.",
"x-ms-parameter-location": "method"
},
"ClusterNameParameter": {
"name": "clusterName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the cluster.",
"x-ms-parameter-location": "method"
},
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"required": true,
"type": "string",
"description": "The HDInsight client API Version."
}
}
}
2 changes: 2 additions & 0 deletions specification/hdinsight/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ input-file:
- Microsoft.HDInsight/stable/2018-06-01-preview/extensions.json
- Microsoft.HDInsight/stable/2018-06-01-preview/scriptActions.json
- Microsoft.HDInsight/stable/2018-06-01-preview/operations.json
- Microsoft.HDInsight/stable/2018-06-01-preview/virtualMachines.json
```


Expand Down Expand Up @@ -226,6 +227,7 @@ input-file:
- $(this-folder)/Microsoft.HDInsight/stable/2018-06-01-preview/extensions.json
- $(this-folder)/Microsoft.HDInsight/stable/2018-06-01-preview/scriptActions.json
- $(this-folder)/Microsoft.HDInsight/stable/2018-06-01-preview/operations.json
- $(this-folder)/Microsoft.HDInsight/stable/2018-06-01-preview/virtualMachines.json
- $(this-folder)/Microsoft.HDInsight/preview/2015-03-01-preview/cluster.json
- $(this-folder)/Microsoft.HDInsight/preview/2015-03-01-preview/applications.json
- $(this-folder)/Microsoft.HDInsight/preview/2015-03-01-preview/locations.json
Expand Down

0 comments on commit 530bcd7

Please sign in to comment.