From 2f91df533ec9fce428c0e65a3663e2474ce9094d Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Fri, 9 Aug 2019 12:39:25 +0100 Subject: [PATCH 1/4] databricks: switching `parameters` to be a proper struct --- .../stable/2018-04-01/databricks.json | 53 ++++++++++++++++++- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json index e8de8a8beaef..3a3b2d771afc 100644 --- a/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json +++ b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json @@ -377,8 +377,8 @@ "description": "The managed resource group Id." }, "parameters": { - "type": "object", - "description": "Name and value pairs that define the workspace parameters." + "$ref": "#/definitions/WorkspaceCustomParameters", + "description": "The workspace's custom parameters." }, "provisioningState": { "readOnly": true, @@ -494,6 +494,55 @@ "modelAsString": true } }, + "WorkspaceCustomParameters": { + "properties": { + "customVirtualNetworkId": { + "type": "string", + "description": "The ID of a Virtual Network where this Databricks Cluster should be created" + }, + "customPublicSubnetName": { + "type": "string", + "description": "The name of a Public Subnet within the Virtual Network" + }, + "customPrivateSubnetName": { + "type": "string", + "description": "The name of the Private Subnet within the Virtual Network" + }, + "enableNoPublicIp": { + "type": "boolean", + "description": "Should the Public IP be Disabled?" + }, + "relayNamespaceName": { + "type": "string", + "description": "The name of an Azure Relay Namespace", + }, + "storageAccountName": { + "type": "string", + "description": "The name which should be used for the Storage Account", + }, + "storageAccountSkuName": { + "type": "string", + "description": "The SKU which should be used for this Storage Account", + }, + "vnetAddressPrefix": { + "type": "string", + "description": "The first 2 octets of the virtual network /16 address range (e.g., '10.139' for the address range 10.139.0.0/16).", + }, + "resourceTags": { + "type": "object", + "description": "A map of Tags which should be applied to the resources used by this Databricks Cluster.", + "additionalProperties": { + "type": "string" + } + }, + "amlWorkspaceId": { + "type": "string", + "description": "The Workspace ID of an Azure Machine Learning Workspace" + } + }, + "required": [], + "description": "Custom Parameters used for Cluster Creation." + }, "WorkspaceProviderAuthorization": { "properties": { "principalId": { From 0e620d21221cc70c72d48e1b76d6cb8bab13153b Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Fri, 9 Aug 2019 12:49:45 +0100 Subject: [PATCH 2/4] removing the unused required field --- .../Microsoft.Databricks/stable/2018-04-01/databricks.json | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json index 3a3b2d771afc..3616c6193acb 100644 --- a/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json +++ b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json @@ -540,7 +540,6 @@ "description": "The Workspace ID of an Azure Machine Learning Workspace" } }, - "required": [], "description": "Custom Parameters used for Cluster Creation." }, "WorkspaceProviderAuthorization": { From a6735f7bfe65d311853f28a0403cf01ff2ded6fb Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Fri, 9 Aug 2019 12:55:17 +0100 Subject: [PATCH 3/4] linting --- .../stable/2018-04-01/databricks.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json index 3616c6193acb..30a8e26c4ee1 100644 --- a/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json +++ b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json @@ -514,19 +514,19 @@ }, "relayNamespaceName": { "type": "string", - "description": "The name of an Azure Relay Namespace", + "description": "The name of an Azure Relay Namespace" }, "storageAccountName": { "type": "string", - "description": "The name which should be used for the Storage Account", + "description": "The name which should be used for the Storage Account" }, "storageAccountSkuName": { "type": "string", - "description": "The SKU which should be used for this Storage Account", + "description": "The SKU which should be used for this Storage Account" }, "vnetAddressPrefix": { "type": "string", - "description": "The first 2 octets of the virtual network /16 address range (e.g., '10.139' for the address range 10.139.0.0/16).", + "description": "The first 2 octets of the virtual network /16 address range (e.g., '10.139' for the address range 10.139.0.0/16)." }, "resourceTags": { "type": "object", From 8c36be0189865ad1e6e6c7c4a130648d7c3a7db5 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Mon, 4 Nov 2019 12:16:46 +0100 Subject: [PATCH 4/4] DataBricks: matching the Swagger to the API request/response --- .../stable/2018-04-01/databricks.json | 86 +++++++++++++++---- .../2018-04-01/examples/WorkspaceCreate.json | 1 - .../examples/WorkspaceCreateParameters.json | 73 ++++++++++++++++ .../examples/WorkspaceGetParameters.json | 79 +++++++++++++++++ .../2018-04-01/examples/WorkspaceUpdate.json | 1 - 5 files changed, 220 insertions(+), 20 deletions(-) create mode 100644 specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceCreateParameters.json create mode 100644 specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceGetParameters.json diff --git a/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json index 30a8e26c4ee1..d1defed1fa8f 100644 --- a/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json +++ b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/databricks.json @@ -44,6 +44,9 @@ "x-ms-examples": { "Get a workspace": { "$ref": "./examples/WorkspaceGet.json" + }, + "Get a workspace with custom parameters": { + "$ref": "./examples/WorkspaceGetParameters.json" } }, "parameters": [ @@ -128,6 +131,9 @@ "x-ms-examples": { "Create or update workspace": { "$ref": "./examples/WorkspaceCreate.json" + }, + "Create or update workspace with custom parameters": { + "$ref": "./examples/WorkspaceCreateWithParameters.json" } }, "parameters": [ @@ -494,14 +500,57 @@ "modelAsString": true } }, + "WorkspaceCustomBooleanParameter": { + "properties": { + "value": { + "type": "boolean", + "description": "The value which should be used for this field." + } + }, + "required": [ + "value" + ], + "description": "The value which should be used for this field." + }, + "WorkspaceCustomObjectParameter": { + "properties": { + "value": { + "type": "object", + "description": "The value which should be used for this field.", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "value" + ], + "description": "The value which should be used for this field." + }, + "WorkspaceCustomStringParameter": { + "properties": { + "value": { + "type": "string", + "description": "The value which should be used for this field." + } + }, + "required": [ + "value" + ], + "description": "The Value." + }, "WorkspaceCustomParameters": { "properties": { + "amlWorkspaceId": { + "$ref": "#/definitions/WorkspaceCustomStringParameter", + "description": "The Workspace ID of an Azure Machine Learning Workspace" + }, "customVirtualNetworkId": { - "type": "string", + "$ref": "#/definitions/WorkspaceCustomStringParameter", "description": "The ID of a Virtual Network where this Databricks Cluster should be created" }, "customPublicSubnetName": { - "type": "string", + "$ref": "#/definitions/WorkspaceCustomStringParameter", "description": "The name of a Public Subnet within the Virtual Network" }, "customPrivateSubnetName": { @@ -509,35 +558,36 @@ "description": "The name of the Private Subnet within the Virtual Network" }, "enableNoPublicIp": { - "type": "boolean", + "$ref": "#/definitions/WorkspaceCustomBooleanParameter", "description": "Should the Public IP be Disabled?" }, + "loadBalancerBackendPoolName": { + "$ref": "#/definitions/WorkspaceCustomStringParameter", + "description": "The name of a Backend Address Pool within an Azure Load Balancer" + }, + "loadBalancerId": { + "$ref": "#/definitions/WorkspaceCustomStringParameter", + "description": "The Resource ID of an Azure Load Balancer" + }, "relayNamespaceName": { - "type": "string", + "$ref": "#/definitions/WorkspaceCustomStringParameter", "description": "The name of an Azure Relay Namespace" }, "storageAccountName": { - "type": "string", + "$ref": "#/definitions/WorkspaceCustomStringParameter", "description": "The name which should be used for the Storage Account" }, "storageAccountSkuName": { - "type": "string", + "$ref": "#/definitions/WorkspaceCustomStringParameter", "description": "The SKU which should be used for this Storage Account" }, - "vnetAddressPrefix": { - "type": "string", - "description": "The first 2 octets of the virtual network /16 address range (e.g., '10.139' for the address range 10.139.0.0/16)." - }, "resourceTags": { - "type": "object", - "description": "A map of Tags which should be applied to the resources used by this Databricks Cluster.", - "additionalProperties": { - "type": "string" - } + "$ref": "#/definitions/WorkspaceCustomObjectParameter", + "description": "A map of Tags which should be applied to the resources used by this Databricks Cluster." }, - "amlWorkspaceId": { - "type": "string", - "description": "The Workspace ID of an Azure Machine Learning Workspace" + "vnetAddressPrefix": { + "$ref": "#/definitions/WorkspaceCustomStringParameter", + "description": "The first 2 octets of the virtual network /16 address range (e.g., '10.139' for the address range 10.139.0.0/16)." } }, "description": "Custom Parameters used for Cluster Creation." diff --git a/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceCreate.json b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceCreate.json index 2b537b634673..d9251f7f09e6 100644 --- a/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceCreate.json +++ b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceCreate.json @@ -16,7 +16,6 @@ "200": { "headers": {}, "body": { - "name": "myWorkspace", "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace", "type": "Microsoft.Databricks/workspaces", "location": "East US 2", diff --git a/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceCreateParameters.json b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceCreateParameters.json new file mode 100644 index 000000000000..1e4ed6ab3005 --- /dev/null +++ b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceCreateParameters.json @@ -0,0 +1,73 @@ +{ + "parameters": { + "subscriptionId": "subid", + "resourceGroupName": "rg", + "workspaceName": "myWorkspace", + "api-version": "2018-04-01", + "parameters": { + "properties": { + "managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG" + }, + "name": "myWorkspace", + "location": "westus" + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace", + "type": "Microsoft.Databricks/workspaces", + "location": "East US 2", + "tags": null, + "sku": { + "name": "skuName" + }, + "properties": { + "managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG", + "parameters": { + "amlWorkspaceId": { + "value": "11112222-3333-4444-5555-666677778888" + }, + "customPrivateSubnetName": { + "value": "PrivateBob" + }, + "customPublicSubnetName": { + "value": "PublicSarah" + }, + "customVirtualNetworkId": { + "value": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myNetwork" + }, + "enableNoPublicIp": { + "value": true + }, + "loadBalancerBackendPoolName": { + "value": "CustomBackendAddressPool" + }, + "loadBalancerId": { + "value": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/loadBalancers/lb1" + }, + "relayNamespaceName": { + "value": "test" + }, + "resourceTags": { + "hello": "world" + }, + "storageAccountName": { + "value": "mysa999" + }, + "storageAccountSkuName": { + "value": "Standard_GRS" + }, + "vnetAddressPrefix": { + "value": "10.139" + } + }, + "provisioningState": "Created", + "uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json" + } + } + }, + "201": {} + } +} diff --git a/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceGetParameters.json b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceGetParameters.json new file mode 100644 index 000000000000..acbdb3a82574 --- /dev/null +++ b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceGetParameters.json @@ -0,0 +1,79 @@ +{ + "parameters": { + "subscriptionId": "subid", + "resourceGroupName": "rg", + "workspaceName": "myWorkspace", + "api-version": "2018-04-01" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "name": "myWorkspace", + "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace", + "type": "Microsoft.Databricks/workspaces", + "location": "East US 2", + "properties": { + "managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG", + "parameters": { + "customPrivateSubnetName": { + "type": "String", + "value": "PrivateBob" + }, + "customPublicSubnetName": { + "type": "String", + "value": "PublicSarah" + }, + "customVirtualNetworkId": { + "type": "String", + "value": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myNetwork" + }, + "enableNoPublicIp": { + "type": "Bool", + "value": true + }, + "loadBalancerBackendPoolName": { + "type": "String", + "value": "" + }, + "loadBalancerId": { + "type": "String", + "value": "" + }, + "relayNamespaceName": { + "type": "String", + "value": "test" + }, + "storageAccountName": { + "type": "String", + "value": "examplesa99" + }, + "storageAccountSkuName": { + "type": "String", + "value": "Standard_GRS" + }, + "vnetAddressPrefix": { + "type": "String", + "value": "10.139" + }, + "resourceTags": { + "type": "Object", + "value": { + "application": "databricks", + "databricks-environment": "true", + "Environment": "Production" + } + }, + "amlWorkspaceId": { + "type": "String", + "value": "" + } + }, + "provisioningState": "Created", + "uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json" + } + } + }, + "404": {} + } +} diff --git a/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceUpdate.json b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceUpdate.json index 6151245f9690..e386347fa0a2 100644 --- a/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceUpdate.json +++ b/specification/databricks/resource-manager/Microsoft.Databricks/stable/2018-04-01/examples/WorkspaceUpdate.json @@ -14,7 +14,6 @@ "200": { "headers": {}, "body": { - "name": "myWorkspace", "id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace", "type": "Microsoft.Databricks/workspaces", "location": "East US 2",