Skip to content

Commit

Permalink
databricks: switching parameters to be a proper struct (Azure#7872)
Browse files Browse the repository at this point in the history
* databricks: switching `parameters` to be a proper struct

* removing the unused required field

* linting

* DataBricks: matching the Swagger to the API request/response

* Refactor nexamples/WorkspaceCreateParameters.json - > examples/WorkspaceCreateWithParameters.json

* prettier

* Update 201 body

* Update resourceTags

* DataBricks: fixing the parameter types
  • Loading branch information
mbfrahry authored and AnuTalluri committed Dec 11, 2019
1 parent d55a706 commit 2d01cc4
Show file tree
Hide file tree
Showing 5 changed files with 357 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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": [
Expand Down Expand Up @@ -377,8 +383,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,
Expand Down Expand Up @@ -494,6 +500,121 @@
"modelAsString": true
}
},
"WorkspaceCustomParameterType": {
"description": "Provisioning status of the workspace.",
"readOnly": true,
"enum": [
"Bool",
"Object",
"String"
],
"type": "string",
"x-ms-enum": {
"name": "CustomParameterType",
"modelAsString": true
}
},
"WorkspaceCustomBooleanParameter": {
"properties": {
"type": {
"$ref": "#/definitions/WorkspaceCustomParameterType",
"description": "The type of variable that this is"
},
"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": {
"type": {
"$ref": "#/definitions/WorkspaceCustomParameterType",
"description": "The type of variable that this is"
},
"value": {
"type": "object",
"description": "The value which should be used for this field."
}
},
"required": [
"value"
],
"description": "The value which should be used for this field."
},
"WorkspaceCustomStringParameter": {
"properties": {
"type": {
"$ref": "#/definitions/WorkspaceCustomParameterType",
"description": "The type of variable that this is"
},
"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": {
"$ref": "#/definitions/WorkspaceCustomStringParameter",
"description": "The ID of a Virtual Network where this Databricks Cluster should be created"
},
"customPublicSubnetName": {
"$ref": "#/definitions/WorkspaceCustomStringParameter",
"description": "The name of a Public Subnet within the Virtual Network"
},
"customPrivateSubnetName": {
"$ref": "#/definitions/WorkspaceCustomStringParameter",
"description": "The name of the Private Subnet within the Virtual Network"
},
"enableNoPublicIp": {
"$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": {
"$ref": "#/definitions/WorkspaceCustomStringParameter",
"description": "The name of an Azure Relay Namespace"
},
"storageAccountName": {
"$ref": "#/definitions/WorkspaceCustomStringParameter",
"description": "The name which should be used for the Storage Account"
},
"storageAccountSkuName": {
"$ref": "#/definitions/WorkspaceCustomStringParameter",
"description": "The SKU which should be used for this Storage Account"
},
"resourceTags": {
"$ref": "#/definitions/WorkspaceCustomObjectParameter",
"description": "A map of Tags which should be applied to the resources used by this Databricks Cluster."
},
"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."
},
"WorkspaceProviderAuthorization": {
"properties": {
"principalId": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG"
},
"name": "myWorkspace",
"location": "westus"
}
},
"responses": {
"200": {
"body": {
"name": "myWorkspace",
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"location": "East US 2",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
{
"parameters": {
"subscriptionId": "subid",
"resourceGroupName": "rg",
"workspaceName": "myWorkspace",
"api-version": "2018-04-01",
"parameters": {
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG"
},
"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": {
"type": "String",
"value": "11112222-3333-4444-5555-666677778888"
},
"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": "CustomBackendAddressPool"
},
"loadBalancerId": {
"type": "String",
"value": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/loadBalancers/lb1"
},
"relayNamespaceName": {
"type": "String",
"value": "test"
},
"resourceTags": {
"type": "Object",
"value": {
"hello": "world"
}
},
"storageAccountName": {
"type": "String",
"value": "mysa999"
},
"storageAccountSkuName": {
"type": "String",
"value": "Standard_GRS"
},
"vnetAddressPrefix": {
"type": "String",
"value": "10.139"
}
},
"provisioningState": "Created",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json"
}
}
},
"201": {
"headers": {},
"body": {
"name": "myWorkspace",
"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": {
"type": "String",
"value": "11112222-3333-4444-5555-666677778888"
},
"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": "CustomBackendAddressPool"
},
"loadBalancerId": {
"type": "String",
"value": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/loadBalancers/lb1"
},
"relayNamespaceName": {
"type": "String",
"value": "test"
},
"resourceTags": {
"type": "Object",
"value": {
"hello": "world"
}
},
"storageAccountName": {
"type": "String",
"value": "mysa999"
},
"storageAccountSkuName": {
"type": "String",
"value": "Standard_GRS"
},
"vnetAddressPrefix": {
"type": "String",
"value": "10.139"
}
},
"provisioningState": "Created",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json"
}
}
}
}
}
Loading

0 comments on commit 2d01cc4

Please sign in to comment.