databricks 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/databricks/resources/clusters.rb +5 -1
- data/lib/databricks/resources/instance_pool.rb +27 -0
- data/lib/databricks/resources/instance_pools.rb +43 -0
- data/lib/databricks/resources/jobs.rb +3 -1
- data/lib/databricks/resources/root.rb +1 -0
- data/lib/databricks/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5180797f8cb0ab700566b70bbb20fe1e54a46241162a2efc7c128846998aaaf4
|
4
|
+
data.tar.gz: 910d6984b316a2b09b90a94ae267e157aadc7197aa5f897bd50b2a5b21e21da2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da5dcd7a5f419079a845c43fe2c4f3d073351abad9c5f8313d826124389c5d801bf528622ef06bdb81ca58d41bdd341d0487dfa0740632d1a50162548b263324
|
7
|
+
data.tar.gz: 8d850d1cabacf5c325ee094560473055c14da9278cc5d4412b3a85ae2fbd914c01ede639458db3ffab9ba3fb8001e174bbc326a7aaf2b86421141d3d3b24d065
|
@@ -9,13 +9,15 @@ module Databricks
|
|
9
9
|
# List clusters
|
10
10
|
#
|
11
11
|
# Result::
|
12
|
-
# * Array<
|
12
|
+
# * Array<Cluster>: List of clusters
|
13
13
|
def list
|
14
14
|
(get_json('clusters/list')['clusters'] || []).map { |properties| new_resource(:cluster, properties) }
|
15
15
|
end
|
16
16
|
|
17
17
|
# Get a cluster based on its cluster_id
|
18
18
|
#
|
19
|
+
# Parameters::
|
20
|
+
# * *cluster_id* (String): The cluster id to get
|
19
21
|
# Result::
|
20
22
|
# * Cluster: The cluster
|
21
23
|
def get(cluster_id)
|
@@ -26,6 +28,8 @@ module Databricks
|
|
26
28
|
#
|
27
29
|
# Parameters::
|
28
30
|
# * *properties* (Hash<Symbol,Object>): Properties to create the cluster
|
31
|
+
# Result::
|
32
|
+
# * Cluster: The new cluster created
|
29
33
|
def create(**properties)
|
30
34
|
cluster = new_resource(:cluster, post_json('clusters/create', properties))
|
31
35
|
cluster.add_properties(properties)
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Databricks
|
2
|
+
|
3
|
+
module Resources
|
4
|
+
|
5
|
+
class InstancePool < Resource
|
6
|
+
|
7
|
+
# Edit properties of this instance pool.
|
8
|
+
#
|
9
|
+
# Parameters::
|
10
|
+
# * *properties* (Hash<Symbol,Object>): Properties of this cluster
|
11
|
+
def edit(**properties)
|
12
|
+
# Make sure we don't change its ID
|
13
|
+
properties[:instance_pool_id] = instance_pool_id
|
14
|
+
post_json('instance-pools/edit', properties)
|
15
|
+
add_properties(properties)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Delete this instance pool
|
19
|
+
def delete
|
20
|
+
post_json('instance-pools/delete', { instance_pool_id: instance_pool_id })
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Databricks
|
2
|
+
|
3
|
+
module Resources
|
4
|
+
|
5
|
+
# Provide the Instance Pools API
|
6
|
+
# cf. https://docs.databricks.com/dev-tools/api/latest/instance-pools.html
|
7
|
+
class InstancePools < Resource
|
8
|
+
|
9
|
+
# List instance pools
|
10
|
+
#
|
11
|
+
# Result::
|
12
|
+
# * Array<InstancePool>: List of instance pools
|
13
|
+
def list
|
14
|
+
(get_json('instance-pools/list')['instance_pools'] || []).map { |properties| new_resource(:instance_pool, properties) }
|
15
|
+
end
|
16
|
+
|
17
|
+
# Get an instance pool based on its instance_pool_id
|
18
|
+
#
|
19
|
+
# Parameters::
|
20
|
+
# * *instance_pool_id* (String): The instance pool id to get
|
21
|
+
# Result::
|
22
|
+
# * InstancePool: The instance pool
|
23
|
+
def get(instance_pool_id)
|
24
|
+
new_resource(:instance_pool, get_json('instance-pools/get', { instance_pool_id: instance_pool_id }))
|
25
|
+
end
|
26
|
+
|
27
|
+
# Create a new instance pool.
|
28
|
+
#
|
29
|
+
# Parameters::
|
30
|
+
# * *properties* (Hash<Symbol,Object>): Properties to create the instance pool
|
31
|
+
# Result::
|
32
|
+
# * InstancePool: The new instance pool created
|
33
|
+
def create(**properties)
|
34
|
+
instance_pool = new_resource(:instance_pool, post_json('instance-pools/create', properties))
|
35
|
+
instance_pool.add_properties(properties)
|
36
|
+
instance_pool
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
@@ -9,7 +9,7 @@ module Databricks
|
|
9
9
|
# List jobs
|
10
10
|
#
|
11
11
|
# Result::
|
12
|
-
# * Array<
|
12
|
+
# * Array<Job>: List of jobs information
|
13
13
|
def list
|
14
14
|
(get_json('jobs/list')['jobs'] || []).map { |properties| new_resource(:job, properties) }
|
15
15
|
end
|
@@ -18,6 +18,8 @@ module Databricks
|
|
18
18
|
#
|
19
19
|
# Parameters::
|
20
20
|
# * *properties* (Hash<Symbol,Object>): Properties to create the job
|
21
|
+
# Result::
|
22
|
+
# * Job: The new job created
|
21
23
|
def create(**properties)
|
22
24
|
job = new_resource(:job, post_json('jobs/create', properties))
|
23
25
|
job.add_properties(properties)
|
data/lib/databricks/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: databricks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Muriel Salvan
|
@@ -80,6 +80,8 @@ files:
|
|
80
80
|
- lib/databricks/resources/clusters.rb
|
81
81
|
- lib/databricks/resources/dbfs.rb
|
82
82
|
- lib/databricks/resources/file.rb
|
83
|
+
- lib/databricks/resources/instance_pool.rb
|
84
|
+
- lib/databricks/resources/instance_pools.rb
|
83
85
|
- lib/databricks/resources/job.rb
|
84
86
|
- lib/databricks/resources/jobs.rb
|
85
87
|
- lib/databricks/resources/root.rb
|