a.networks: Network configurations¶
- class databricks.sdk.service.provisioning.NetworksAPI¶
These APIs manage network configurations for customer-managed VPCs (optional). Its ID is used when creating a new workspace if you use customer-managed VPCs.
- create([, gcp_network_info: Optional[GcpNetworkInfo], network_name: Optional[str], security_group_ids: Optional[List[str]], subnet_ids: Optional[List[str]], vpc_endpoints: Optional[NetworkVpcEndpoints], vpc_id: Optional[str]]) Network¶
Usage:
import time from databricks.sdk import AccountClient a = AccountClient() netw = a.networks.create( network_name=f"sdk-{time.time_ns()}", vpc_id=hex(time.time_ns())[2:], subnet_ids=[hex(time.time_ns())[2:], hex(time.time_ns())[2:]], security_group_ids=[hex(time.time_ns())[2:]], )
Creates a Databricks network configuration that represents an VPC and its resources. The VPC will be used for new Databricks clusters. This requires a pre-existing VPC and subnets.
- Parameters:
gcp_network_info –
GcpNetworkInfo(optional)network_name – str (optional) The human-readable name of the network configuration.
security_group_ids – List[str] (optional) IDs of one to five security groups associated with this network. Security group IDs cannot be used in multiple network configurations.
subnet_ids – List[str] (optional) IDs of at least two subnets associated with this network. Subnet IDs cannot be used in multiple network configurations.
vpc_endpoints –
NetworkVpcEndpoints(optional)vpc_id – str (optional) The ID of the VPC associated with this network configuration. VPC IDs can be used in multiple networks.
- Returns:
- delete(network_id: str) Network¶
Deletes a Databricks network configuration, which represents a cloud VPC and its resources. You cannot delete a network that is associated with a workspace.
This operation is available only if your account is on the E2 version of the platform.
- Parameters:
network_id – str Databricks Account API network configuration ID.
- Returns:
- get(network_id: str) Network¶
Usage:
import time from databricks.sdk import AccountClient a = AccountClient() netw = a.networks.create( network_name=f"sdk-{time.time_ns()}", vpc_id=hex(time.time_ns())[2:], subnet_ids=[hex(time.time_ns())[2:], hex(time.time_ns())[2:]], security_group_ids=[hex(time.time_ns())[2:]], ) by_id = a.networks.get(network_id=netw.network_id)
Gets a Databricks network configuration, which represents a cloud VPC and its resources.
- Parameters:
network_id – str Databricks Account API network configuration ID.
- Returns: