opsmgr 0.29.3 → 0.30.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opsmgr/api/client.rb +5 -0
- data/lib/opsmgr/api/http_client.rb +17 -0
- data/lib/opsmgr/cmd/ops_manager.rb +10 -0
- data/lib/opsmgr/tasks/opsmgr.rake +7 -5
- data/lib/opsmgr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b55c2ce7ed9ff454183870c230b6c835a21ba30
|
4
|
+
data.tar.gz: e8c6c0da0f0e9486d27de1b032ff578a7b911b39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a005c9d7a43ed25a62926e9df79eb9d6a5b2db002384d860d00d37a4bc49c2ae8bba594c9f9a805c0d8dcdddb4d19f02ee96299d8ef3476ef068d250a3dcc5ee
|
7
|
+
data.tar.gz: faa6476ebc0c61279c10cbc6675d88d7c0521831f19ce8c8ab07dae12bd970fabf35a1f03dec33dd581c7ebe30b92182da03c782cf0b5dc89a6d471c9f03ba36
|
data/lib/opsmgr/api/client.rb
CHANGED
@@ -162,6 +162,23 @@ module Opsmgr
|
|
162
162
|
endpoints.version
|
163
163
|
end
|
164
164
|
|
165
|
+
def import_installation(installation_file, password)
|
166
|
+
req = Net::HTTP::Post::Multipart.new(
|
167
|
+
endpoints.import_installation_path,
|
168
|
+
'installation[file]' =>
|
169
|
+
UploadIO.new(
|
170
|
+
installation_file,
|
171
|
+
'application/octet-stream',
|
172
|
+
File.basename(installation_file)
|
173
|
+
),
|
174
|
+
'password' => password
|
175
|
+
)
|
176
|
+
|
177
|
+
req.basic_auth(web_auth_user, web_auth_password)
|
178
|
+
|
179
|
+
http.request(req)
|
180
|
+
end
|
181
|
+
|
165
182
|
private
|
166
183
|
|
167
184
|
def web_auth_user
|
@@ -84,6 +84,16 @@ module Opsmgr
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
+
|
88
|
+
def import_installation(client, path)
|
89
|
+
result = client.import_installation(path, environment.settings.ops_manager.password)
|
90
|
+
if result.success?
|
91
|
+
log.info 'Successfully imported installation'
|
92
|
+
else
|
93
|
+
fail result.message
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
87
97
|
private
|
88
98
|
|
89
99
|
attr_reader :environment
|
@@ -31,12 +31,14 @@ namespace :opsmgr do
|
|
31
31
|
|
32
32
|
desc 'Import installation'
|
33
33
|
task :import_installation, [:environment, :om_version, :import_file] do |_, args|
|
34
|
-
require 'opsmgr/
|
34
|
+
require 'opsmgr/environments'
|
35
|
+
require 'opsmgr/cmd/ops_manager'
|
36
|
+
require 'opsmgr/api/client'
|
35
37
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
38
|
+
environment_object = Opsmgr::Environments.for(args.environment)
|
39
|
+
client = Opsmgr::Api::Client.new(environment_object)
|
40
|
+
opsmgr_cmd = Opsmgr::Cmd::OpsManager.new(environment_object)
|
41
|
+
opsmgr_cmd.import_installation(client, args.import_file)
|
40
42
|
end
|
41
43
|
|
42
44
|
desc 'Delete installation'
|
data/lib/opsmgr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opsmgr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.30.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Release Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|