hyperkit 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/hyperkit/client/containers.rb +2 -2
- data/lib/hyperkit/client/images.rb +1 -1
- data/lib/hyperkit/client/networks.rb +1 -2
- data/lib/hyperkit/client/operations.rb +1 -2
- data/lib/hyperkit/client/profiles.rb +23 -1
- data/lib/hyperkit/connection.rb +1 -1
- data/lib/hyperkit/middleware/follow_redirects.rb +1 -1
- data/lib/hyperkit/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4d2caa2f80d739680a347aa9678a11adb20bc6cd074c3708bc3ab51b43c6ccfa
|
4
|
+
data.tar.gz: e11c4d3f981d541bb460e24e91c9da0e0afe28172eccccc4af941fb71fb5e0a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd51c31eb7831fa4b6f452c128e16d03f6ab427010820af8e68a95e7de5d6d291d1cddd5c8eb01261c1d50a4d1cd665bc00ccf2e347f10eec1adae9c8424e49b
|
7
|
+
data.tar.gz: e5cf9de68bd7ae698127453dd89a0863d94ff18a9f3058d3d2e2e557c02731819c5a7ff74f1378d78912e881bf61bb308b8c648046eeaa9f7d38b560bfab3ab3
|
@@ -8,7 +8,7 @@ module Hyperkit
|
|
8
8
|
# Methods for the containers API
|
9
9
|
#
|
10
10
|
# @see Hyperkit::Client
|
11
|
-
# @see https://github.com/lxc/lxd/blob/master/
|
11
|
+
# @see https://github.com/lxc/lxd/blob/master/doc/rest-api.md
|
12
12
|
module Containers
|
13
13
|
|
14
14
|
# @!group Retrieval
|
@@ -1031,7 +1031,7 @@ module Hyperkit
|
|
1031
1031
|
end
|
1032
1032
|
|
1033
1033
|
def extract_container_options(name, options)
|
1034
|
-
opts = options.slice(:architecture, :profiles, :ephemeral, :config).
|
1034
|
+
opts = options.slice(:architecture, :profiles, :ephemeral, :config, :devices).
|
1035
1035
|
merge({ name: name })
|
1036
1036
|
|
1037
1037
|
opts[:config] = stringify_hash(opts[:config]) if opts[:config]
|
@@ -5,7 +5,7 @@ module Hyperkit
|
|
5
5
|
# Methods for the networks API
|
6
6
|
#
|
7
7
|
# @see Hyperkit::Client
|
8
|
-
# @see https://github.com/lxc/lxd/blob/master/
|
8
|
+
# @see https://github.com/lxc/lxd/blob/master/doc/rest-api.md
|
9
9
|
module Networks
|
10
10
|
|
11
11
|
# List of networks defined on the host
|
@@ -44,4 +44,3 @@ module Hyperkit
|
|
44
44
|
end
|
45
45
|
|
46
46
|
end
|
47
|
-
|
@@ -7,7 +7,7 @@ module Hyperkit
|
|
7
7
|
# Methods for the operations API
|
8
8
|
#
|
9
9
|
# @see Hyperkit::Client
|
10
|
-
# @see https://github.com/lxc/lxd/blob/master/
|
10
|
+
# @see https://github.com/lxc/lxd/blob/master/doc/rest-api.md
|
11
11
|
module Operations
|
12
12
|
|
13
13
|
# List of operations active on the server
|
@@ -125,4 +125,3 @@ module Hyperkit
|
|
125
125
|
end
|
126
126
|
|
127
127
|
end
|
128
|
-
|
@@ -7,7 +7,7 @@ module Hyperkit
|
|
7
7
|
# Methods for the profiles API
|
8
8
|
#
|
9
9
|
# @see Hyperkit::Client
|
10
|
-
# @see https://github.com/lxc/lxd/blob/master/
|
10
|
+
# @see https://github.com/lxc/lxd/blob/master/doc/rest-api.md
|
11
11
|
module Profiles
|
12
12
|
|
13
13
|
# List of profiles on the server
|
@@ -92,6 +92,28 @@ module Hyperkit
|
|
92
92
|
put(profile_path(name), opts).metadata
|
93
93
|
end
|
94
94
|
|
95
|
+
# Patch an existing profile using patch api
|
96
|
+
#
|
97
|
+
# @param name [String] Profile name
|
98
|
+
# @param options [Hash] Additional data to be passed
|
99
|
+
# @option options [Hash] :config Profile configuration. It will be merged with existing configuration
|
100
|
+
# @option options [String] :description Profile description
|
101
|
+
# @option options [Hash] :devices Profile devices. Existing devices will be merged
|
102
|
+
# @return [Sawyer::Resource]
|
103
|
+
#
|
104
|
+
# @example Patch profile with config (config is merged)
|
105
|
+
# Hyperkit.patch_profile("test-profile", config: {
|
106
|
+
# "limits.memory" => "4GB",
|
107
|
+
# "limits.cpu" => 4,
|
108
|
+
# "raw.lxc" => "lxc.aa_profile = unconfined"
|
109
|
+
# })
|
110
|
+
#
|
111
|
+
def patch_profile(name, options={})
|
112
|
+
opts = options.except(:name)
|
113
|
+
opts[:config] = stringify_hash(opts[:config]) if opts[:config]
|
114
|
+
patch(profile_path(name), opts).metadata
|
115
|
+
end
|
116
|
+
|
95
117
|
# Rename a profile
|
96
118
|
#
|
97
119
|
# @param old_name [String] Existing profile name
|
data/lib/hyperkit/connection.rb
CHANGED
@@ -168,7 +168,7 @@ module Hyperkit
|
|
168
168
|
end
|
169
169
|
|
170
170
|
if client_key && File.exist?(client_key)
|
171
|
-
conn_opts[:ssl][:client_key] = OpenSSL::PKey
|
171
|
+
conn_opts[:ssl][:client_key] = OpenSSL::PKey.read(File.read(client_key))
|
172
172
|
end
|
173
173
|
|
174
174
|
opts[:faraday] = Faraday.new(conn_opts)
|
@@ -10,7 +10,7 @@ module Hyperkit
|
|
10
10
|
# Taken from Octokit, which was originally adapted from
|
11
11
|
# https://github.com/lostisland/faraday_middleware/blob/138766e/lib/faraday_middleware/response/follow_redirects.rb
|
12
12
|
|
13
|
-
class RedirectLimitReached < Faraday::
|
13
|
+
class RedirectLimitReached < Faraday::ClientError
|
14
14
|
attr_reader :response
|
15
15
|
|
16
16
|
def initialize(response)
|
data/lib/hyperkit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyperkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Shantz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -108,8 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
|
-
|
112
|
-
rubygems_version: 2.6.11
|
111
|
+
rubygems_version: 3.1.2
|
113
112
|
signing_key:
|
114
113
|
specification_version: 4
|
115
114
|
summary: Hyperkit is a flat API wrapper for LXD, the next-generation hypervisor
|