Pool de instâncias CLI (legado)
Essa documentação foi descontinuada e pode não estar atualizada.
Esta informação se aplica ao legado Databricks CLI versões 0.18 e abaixo. Databricks recomenda que o senhor use a versão mais recente do Databricks CLI 0.205 ou o acima. Consulte O que é a CLI do Databricks? Para encontrar sua versão do site Databricks CLI, execute databricks -v
.
Para migrar de Databricks CLI versão 0.18 ou abaixo para Databricks CLI versão 0.205 ou acima, consulte Databricks CLI migration.
O pool CLI requer Databricks CLI 0.9.0 ou acima.
O senhor executa os subcomandos anexando-os a databricks instance-pools
. Esses subcomandos chamam o pool de instâncias API.
databricks instance-pools -h
Usage: databricks instance-pools [OPTIONS] COMMAND [ARGS]...
Utility to interact with Databricks instance pools.
Options:
-v, --version [VERSION]
-h, --help Show this message and exit.
Commands:
create Creates a Databricks instance pool.
Options:
--json-file PATH File containing JSON request to POST to /api/2.0/cluster-pools/create.
--json JSON JSON string to POST to /api/2.0/cluster-pools/create.
delete Deletes a Databricks instance pool.
Options:
get Retrieves metadata about an instance pool.
Options:
--instance-pool-id INSTANCE_POOL_ID Can be found in the URL at https://<databricks-instance>/?o=<16-digit-number>#/setting/clusters/instance-pools/view/$INSTANCE_POOL_ID.
list Lists active instance pools with the stats of the pools.
Options:
--output FORMAT JSON or TABLE. Set to TABLE by default.
edit Edits a Databricks instance pool
Options:
--json-file PATH File containing JSON request to POST to /api/2.0/cluster-pools/create.
--json JSON JSON string to POST to /api/2.0/cluster-pools/create.
Criar um pool de instâncias
Para exibir a documentação de uso, execute databricks instance-pools create --help
.
databricks instance-pools create --json-file create-instance-pool.json
create-instance-pool.json
:
{
"instance_pool_name": "my-pool",
"node_type_id": "i3.xlarge",
"min_idle_instances": 10,
"aws_attributes": {
"availability": "SPOT"
}
}
{
"instance_pool_id": "1234-567890-binds123-pool-abcDe4fG"
}
Excluir um pool de instâncias
Para exibir a documentação de uso, execute databricks instance-pools delete --help
.
databricks instance-pools delete --instance-pool-id 1234-567890-binds123-pool-abcDe4fG
Se for bem-sucedido, nenhuma saída será exibida.
Obter informações sobre uma instância pool
Para exibir a documentação de uso, execute databricks instance-pools get --help
.
databricks instance-pools get --instance-pool-id 1234-567890-binds123-pool-abcDe4fG
{
"instance_pool_name": "My Pool",
"min_idle_instances": 0,
"max_capacity": 10,
"aws_attributes": {
"availability": "SPOT",
"zone_id": "us-west-2c",
"spot_bid_price_percent": 100
},
"node_type_id": "i3.xlarge",
"idle_instance_autotermination_minutes": 0,
"enable_elastic_disk": false,
"instance_pool_id": "1234-567890-binds123-pool-abcDe4fG",
"default_tags": {
"Vendor": "Databricks",
"DatabricksInstancePoolCreatorId": "123456789012345",
"DatabricksInstancePoolId": "1234-567890-binds123-pool-abcDe4fG",
"DatabricksInstanceGroupId": "-2345678901234567890"
},
"state": "ACTIVE",
"stats": {
"used_count": 0,
"idle_count": 0,
"pending_used_count": 0,
"pending_idle_count": 0
},
"status": {}
}
Listar informações sobre o pool de instâncias disponíveis
Para exibir a documentação de uso, execute databricks instance-pools list --help
.
databricks instance-pools list --output JSON
{
"instance_pools": [
{
"instance_pool_name": "My Pool",
"min_idle_instances": 0,
"max_capacity": 10,
"aws_attributes": {
"availability": "SPOT",
"zone_id": "us-west-2c",
"spot_bid_price_percent": 100
},
"node_type_id": "i3.xlarge",
"idle_instance_autotermination_minutes": 0,
"enable_elastic_disk": false,
"instance_pool_id": "1234-567890-binds123-pool-abcDe4fG",
"default_tags": {
"Vendor": "Databricks",
"DatabricksInstancePoolCreatorId": "123456789012345",
"DatabricksInstancePoolId": "1234-567890-binds123-pool-abcDe4fG",
"DatabricksInstanceGroupId": "-2345678901234567890"
},
"state": "ACTIVE",
"stats": {
"used_count": 0,
"idle_count": 0,
"pending_used_count": 0,
"pending_idle_count": 0
},
"status": {}
},
...
]
}
Alterar as configurações de um pool de instâncias
Para exibir a documentação de uso, execute databricks instance-pools edit --help
.
databricks instance-pools edit --json-file edit-instance-pool.json
edit-instance-pool.json
:
{
"instance_pool_name": "My Pool",
"instance_pool_id": "1234-567890-binds123-pool-abcDe4fG",
"min_idle_instances": 15
}
Se for bem-sucedido, nenhuma saída será exibida.