veeam 0.1.0 → 0.2.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 +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile +2 -1
- data/README.md +3 -0
- data/Rakefile +8 -0
- data/lib/veeam/authentication.rb +5 -1
- data/lib/veeam/error.rb +11 -0
- data/lib/veeam/version.rb +1 -1
- data/veeam.gemspec +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 148191d02ac28a90ed3d295fbc8ebec48f2dab60e8338d78b29b9f5207d3d93f
|
4
|
+
data.tar.gz: fc816fd6cd3f55c336f4e22953fa5ca3b7b9cd9e2ff58b9310d007b2d068db66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 441bbce8273f5481b2599a2e93916b39b890dd7bcfc6a47b5a3735737b6422fd69a9d5be460847560bdc001e1ae314d55d567dbf8f8212ae55d8ffec597c9481
|
7
|
+
data.tar.gz: e2ef14ecf16f6ec7b4c86b72405bdd0bd0d9057193a679c7b36fa5cfb36da113274ce4e792f8489d011c1b365feb02f55128543c2dce5ebf5bfd5fe3678e2bfd
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -2,9 +2,10 @@
|
|
2
2
|
|
3
3
|
source 'https://rubygems.org'
|
4
4
|
|
5
|
-
# Specify your gem's dependencies in
|
5
|
+
# Specify your gem's dependencies in veeam.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
8
|
gem 'rake', '~> 13.0'
|
9
9
|
gem 'rubocop', '~> 1.7'
|
10
|
+
gem 'simplecov', require: false, group: :test
|
10
11
|
gem 'wrapi'
|
data/README.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
# Veeam backup API
|
2
|
+
[](https://rubygems.org/gems/veaam)
|
3
|
+
[](https://codeclimate.com/github/jancotanis/veeam/maintainability)
|
4
|
+
[](https://codeclimate.com/github/jancotanis/veeam/test_coverage)
|
2
5
|
|
3
6
|
This is a wrapper for the Veeam Service Provider Console rest API. You can see the API endpoints here https://helpcenter.veeam.com/docs/vac/rest/reference/vspc-rest.html
|
4
7
|
|
data/Rakefile
CHANGED
@@ -1,12 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'bundler/gem_tasks'
|
4
|
+
require 'dotenv'
|
4
5
|
require 'rake/testtask'
|
5
6
|
|
7
|
+
Dotenv.load
|
8
|
+
|
9
|
+
system './bin/cc-test-reporter before-build'
|
10
|
+
|
6
11
|
Rake::TestTask.new(:test) do |t|
|
7
12
|
t.libs << 'test'
|
8
13
|
t.libs << 'lib'
|
9
14
|
t.test_files = FileList['test/**/*_test.rb']
|
15
|
+
at_exit do
|
16
|
+
system './bin/cc-test-reporter after-build'
|
17
|
+
end
|
10
18
|
end
|
11
19
|
|
12
20
|
require 'rubocop/rake_task'
|
data/lib/veeam/authentication.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require File.expand_path('error', __dir__)
|
1
2
|
|
2
3
|
module Veeam
|
3
4
|
# Deals with authentication flow and stores it within global configuration
|
@@ -6,10 +7,13 @@ module Veeam
|
|
6
7
|
# https://helpcenter.veeam.com/docs/vac/rest/reference/vspc-rest.html?ver=80#tag/Authentication
|
7
8
|
# Authorize to the Veeam portal and return access_token
|
8
9
|
def login(options = {})
|
9
|
-
raise
|
10
|
+
raise ConfigurationError, "Accesstoken/api-key not set" unless access_token
|
10
11
|
# only bearer token needed
|
11
12
|
# will do sanitty check if token if valid
|
12
13
|
get("/api/v3/about")
|
14
|
+
rescue Faraday::UnauthorizedError => e
|
15
|
+
|
16
|
+
raise AuthenticationError.new 'Unauthorized; response ' + e.to_s
|
13
17
|
end
|
14
18
|
|
15
19
|
end
|
data/lib/veeam/error.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
module Veeam
|
2
|
+
|
3
|
+
# Generic error to be able to rescue all Veeam errors
|
4
|
+
class VeeamError < StandardError; end
|
5
|
+
|
6
|
+
# Raised when Veeam not configured correctly
|
7
|
+
class ConfigurationError < VeeamError; end
|
8
|
+
|
9
|
+
# Error when authentication fails
|
10
|
+
class AuthenticationError < VeeamError; end
|
11
|
+
end
|
data/lib/veeam/version.rb
CHANGED
data/veeam.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: veeam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janco Tanis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
description:
|
84
98
|
email: gems@jancology.com
|
85
99
|
executables: []
|
@@ -100,6 +114,7 @@ files:
|
|
100
114
|
- lib/veeam/client/alarms.rb
|
101
115
|
- lib/veeam/client/companies.rb
|
102
116
|
- lib/veeam/client/infrastructure.rb
|
117
|
+
- lib/veeam/error.rb
|
103
118
|
- lib/veeam/pagination.rb
|
104
119
|
- lib/veeam/version.rb
|
105
120
|
- veeam.gemspec
|