hammer_cli_foreman_webhooks 0.0.1 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/hammer_cli_foreman_webhooks/version.rb +1 -1
- data/lib/hammer_cli_foreman_webhooks/webhook.rb +6 -5
- data/lib/hammer_cli_foreman_webhooks/webhook_template.rb +15 -0
- data/test/data/3.3/foreman_api.json +1 -0
- data/test/functional/test_helper.rb +11 -0
- data/test/functional/webhook_template_test.rb +63 -0
- data/test/functional/webhook_test.rb +126 -0
- data/test/test_helper.rb +18 -0
- metadata +16 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3349e5ec869114bfd9b702fa6f1e43204ec39b63d47dd0a2557fdc071fab3e1
|
4
|
+
data.tar.gz: 00424fc9386abcd61e9aee533b73b2dbce63dfafaf46cc5f59303e826b75455a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81d6d4db570f2e88a9706cf79a579488b86d690848dacc52101ec3c45fd487b2643879bc2bb9e558f63764ecf7b31f9810111912668ec14f37b1bf6267c5bdda
|
7
|
+
data.tar.gz: cdc9dcf879643d4d4aefbd7673393f8e9bda5d0e2035be834604bb6e408715f34772b90f2fea5b914b4d5a94a0f48e2e9b5edb6da2621e14bc67f5861a12c672
|
data/README.md
CHANGED
@@ -8,9 +8,9 @@ This Hammer CLI plugin contains set of commands for [foreman_webhooks](
|
|
8
8
|
|
9
9
|
This is the list of which version of Foreman Webhooks is needed to which version of this plugin.
|
10
10
|
|
11
|
-
| hammer_cli_foreman_webhooks | v0.0.1 |
|
12
|
-
|
13
|
-
| foreman_webhooks | v0.0.1 |
|
11
|
+
| hammer_cli_foreman_webhooks | v0.0.1 | v0.0.3 |
|
12
|
+
|-----------------------------|--------|--------|
|
13
|
+
| foreman_webhooks | v0.0.1 | v3.0.2 |
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
@@ -21,10 +21,11 @@ module HammerCLIForemanWebhooks
|
|
21
21
|
field :http_method, _('HTTP Method')
|
22
22
|
field :http_content_type, _('HTTP Content Type')
|
23
23
|
custom_field Fields::Reference, label: _('Webhook Template'), path: [:webhook_template]
|
24
|
-
field :user, _('User'), Fields::Field
|
25
|
-
field :
|
24
|
+
field :user, _('User'), Fields::Field
|
25
|
+
field :verify_ssl, _('Verify SSL'), Fields::Boolean
|
26
|
+
field :proxy_authorization, _('Proxy Authorization'), Fields::Boolean
|
26
27
|
field :ssl_ca_certs, _('X509 Certification Authorities'), Fields::Text, sets: %w[ADDITIONAL ALL]
|
27
|
-
collection :http_headers, _('HTTP Headers')
|
28
|
+
collection :http_headers, _('HTTP Headers') do
|
28
29
|
custom_field Fields::KeyValue
|
29
30
|
end
|
30
31
|
HammerCLIForeman::References.timestamps(self)
|
@@ -41,7 +42,7 @@ module HammerCLIForemanWebhooks
|
|
41
42
|
|
42
43
|
build_options without: %i[ssl_ca_certs http_headers]
|
43
44
|
|
44
|
-
extend_with(HammerCLIForemanWebhooks::CommandExtensions::Webhook.new(only:
|
45
|
+
extend_with(HammerCLIForemanWebhooks::CommandExtensions::Webhook.new(only: %i[option request_params]))
|
45
46
|
end
|
46
47
|
|
47
48
|
class UpdateCommand < HammerCLIForeman::UpdateCommand
|
@@ -50,7 +51,7 @@ module HammerCLIForemanWebhooks
|
|
50
51
|
|
51
52
|
build_options without: %i[ssl_ca_certs http_headers]
|
52
53
|
|
53
|
-
extend_with(HammerCLIForemanWebhooks::CommandExtensions::Webhook.new(only:
|
54
|
+
extend_with(HammerCLIForemanWebhooks::CommandExtensions::Webhook.new(only: %i[option request_params]))
|
54
55
|
end
|
55
56
|
|
56
57
|
class DeleteCommand < HammerCLIForeman::DeleteCommand
|
@@ -95,6 +95,21 @@ module HammerCLIForemanWebhooks
|
|
95
95
|
build_options
|
96
96
|
end
|
97
97
|
|
98
|
+
class ExportCommand < HammerCLIForeman::DownloadCommand
|
99
|
+
command_name "export"
|
100
|
+
action :export
|
101
|
+
|
102
|
+
def saved_response_message(filepath)
|
103
|
+
_("The webhook template has been saved to %{path}.") % { path: filepath }
|
104
|
+
end
|
105
|
+
|
106
|
+
def default_filename
|
107
|
+
"Webhook Template-#{Time.new.strftime("%Y-%m-%d")}.txt"
|
108
|
+
end
|
109
|
+
|
110
|
+
build_options
|
111
|
+
end
|
112
|
+
|
98
113
|
autoload_subcommands
|
99
114
|
end
|
100
115
|
end
|