lita-rundeck 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,26 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = "lita-rundeck"
3
+ spec.version = "0.0.1"
4
+ spec.authors = ["Harlan Barnes"]
5
+ spec.email = ["hbarnes@pobox.com"]
6
+ spec.description = %q{Lita handler for interacting with Rundeck}
7
+ spec.summary = %q{Lita handler for interacting with Rundeck}
8
+ spec.homepage = "https://github.com/harlanbarnes/lita-rundeck"
9
+ spec.license = "MIT"
10
+ spec.metadata = { "lita_plugin_type" => "handler" }
11
+
12
+ spec.files = `git ls-files`.split($/)
13
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
14
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
15
+ spec.require_paths = ["lib"]
16
+
17
+ spec.add_runtime_dependency "lita", ">= 3.3"
18
+ spec.add_runtime_dependency "xml-simple", ">= 1.1.4"
19
+ spec.add_runtime_dependency "lita-keyword-arguments"
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ spec.add_development_dependency "rspec", ">= 3.0.0"
24
+ spec.add_development_dependency "simplecov"
25
+ spec.add_development_dependency "coveralls"
26
+ end
data/locales/en.yml ADDED
@@ -0,0 +1,51 @@
1
+ en:
2
+ lita:
3
+ handlers:
4
+ rundeck:
5
+ help:
6
+ info_key: "rundeck info"
7
+ info_value: "Returns rundeck version, server name, and users authorized to execute jobs"
8
+ projects_key: "rundeck project(s)"
9
+ projects_value: "Returns list of projects"
10
+ jobs_key: "rundeck job(s)"
11
+ jobs_value: "Returns a list of jobs by project"
12
+ exec_key: "rundeck exec(utions) [NUM]"
13
+ exec_value: "Returns a number of recent executions (default: 10)"
14
+ running_key: "rundeck running [NUM]"
15
+ running_value: "Returns currently running executions (default: 10)"
16
+ run_key: "rundeck run ( ALIAS_NAME | --project PROJECT_NAME --job JOB_NAME )"
17
+ run_value: "Run a project/job either via an alias or explicit names"
18
+ alias_key: "rundeck alias(es)"
19
+ alias_value: "List the Rundeck project/job aliases"
20
+ alias_register_key: "rundeck alias ALIAS_NAME --project PROJECT_NAME --job JOB_NAME"
21
+ alias_register_value: "Create a new alias for a project / job combination"
22
+ alias_forget_key: "rundeck forget ALIAS_NAME"
23
+ alias_forget_value: "Remove an alias"
24
+ options_key: "rundeck options ( ALIAS_NAME | --project PROJECT_NAME --job JOB_NAME )"
25
+ options_value: "Describe option details for a project/job either via an alias or explicit names"
26
+ info:
27
+ users_allowed: "Users allowed to execute jobs: "
28
+ no_users: "No users are currently allowed to execute jobs. Ask an admin to 'lita add CHAT_ID rundeck_users'"
29
+ projects:
30
+ none: "No projects found"
31
+ jobs:
32
+ none: "No jobs found"
33
+ executions:
34
+ none: "No executions found"
35
+ run:
36
+ token_unauthorized: "API token is unauthorized or lacks runAs permission; check the apitoken.aclpolicy"
37
+ unauthorized: "You aren't authorized to run jobs"
38
+ failed: "Something went wrong with the job execution"
39
+ success: "Execution %{id} is running"
40
+ conflict: "Job is already running and only allows one execution at a time"
41
+ alias:
42
+ none: "No aliases have been registered yet"
43
+ list: "Alias = [Project] - Job"
44
+ registered: "Alias registered"
45
+ forgotten: "Alias removed"
46
+ exists: "Alias already exists"
47
+ notexists: "Alias not found"
48
+ format: "Format is bad, see help for more info"
49
+ misc:
50
+ definition_error: "Something went wrong finding the job definition"
51
+ job_not_found: "Can't find an alias or project and job"
@@ -0,0 +1,24 @@
1
+ <joblist>
2
+ <job>
3
+ <id>3ba7c6c8-3d79-4b02-807f-eda67e321c23</id>
4
+ <loglevel>INFO</loglevel>
5
+ <sequence keepgoing='false' strategy='node-first'>
6
+ <command>
7
+ <node-step-plugin type='localexec'>
8
+ <configuration>
9
+ <entry key='command' value='bash -c "for i in $(seq 1 ${option.SECONDS}); do d=$(date); echo $i $d; sleep 1; done"' />
10
+ </configuration>
11
+ </node-step-plugin>
12
+ </command>
13
+ </sequence>
14
+ <description></description>
15
+ <name>dateoutput</name>
16
+ <context>
17
+ <project>Litatest</project>
18
+ <options>
19
+ <option name='SECONDS' regex='\d+' required='true' />
20
+ </options>
21
+ </context>
22
+ <uuid>3ba7c6c8-3d79-4b02-807f-eda67e321c23</uuid>
23
+ </job>
24
+ </joblist>
@@ -0,0 +1,188 @@
1
+ <result success='true' apiversion='10'>
2
+ <executions count='10' total='63' offset='0' max='10'>
3
+ <execution id='285' href='https://rundeck.mycompany.org/execution/follow/285' status='succeeded' project='Litatest'>
4
+ <user>Shell User</user>
5
+ <date-started unixtime='1408028788860'>2014-08-14T15:06:28Z</date-started>
6
+ <date-ended unixtime='1408029392033'>2014-08-14T15:16:32Z</date-ended>
7
+ <job id='3ba7c6c8-3d79-4b02-807f-eda67e321c23' averageDuration='176162'>
8
+ <name>dateoutput</name>
9
+ <group></group>
10
+ <project>Litatest</project>
11
+ <description></description>
12
+ <options>
13
+ <option name='SECONDS' value='600' />
14
+ </options>
15
+ </job>
16
+ <description>Plugin[localexec, nodeStep: true]</description>
17
+ <argstring>-SECONDS 600</argstring>
18
+ <successfulNodes>
19
+ <node name='rundeck.mycompany.org' />
20
+ </successfulNodes>
21
+ </execution>
22
+ <execution id='283' href='https://rundeck.mycompany.org/execution/follow/283' status='succeeded' project='Litatest'>
23
+ <user>Shell User</user>
24
+ <date-started unixtime='1407983261310'>2014-08-14T02:27:41Z</date-started>
25
+ <date-ended unixtime='1407983266562'>2014-08-14T02:27:46Z</date-ended>
26
+ <job id='3ba7c6c8-3d79-4b02-807f-eda67e321c23' averageDuration='176162'>
27
+ <name>dateoutput</name>
28
+ <group></group>
29
+ <project>Litatest</project>
30
+ <description></description>
31
+ <options>
32
+ <option name='SECONDS' value='5' />
33
+ </options>
34
+ </job>
35
+ <description>Plugin[localexec, nodeStep: true]</description>
36
+ <argstring>-SECONDS 5</argstring>
37
+ <successfulNodes>
38
+ <node name='rundeck.mycompany.org' />
39
+ </successfulNodes>
40
+ </execution>
41
+ <execution id='282' href='https://rundeck.mycompany.org/execution/follow/282' status='succeeded' project='Litatest'>
42
+ <user>Shell User</user>
43
+ <date-started unixtime='1407978429558'>2014-08-14T01:07:09Z</date-started>
44
+ <date-ended unixtime='1407978489986'>2014-08-14T01:08:09Z</date-ended>
45
+ <job id='3ba7c6c8-3d79-4b02-807f-eda67e321c23' averageDuration='176162'>
46
+ <name>dateoutput</name>
47
+ <group></group>
48
+ <project>Litatest</project>
49
+ <description></description>
50
+ <options>
51
+ <option name='SECONDS' value='60' />
52
+ </options>
53
+ </job>
54
+ <description>Plugin[localexec, nodeStep: true]</description>
55
+ <argstring>-SECONDS 60</argstring>
56
+ <successfulNodes>
57
+ <node name='rundeck.mycompany.org' />
58
+ </successfulNodes>
59
+ </execution>
60
+ <execution id='260' href='https://rundeck.mycompany.org/execution/follow/260' status='succeeded' project='Litatest'>
61
+ <user>Shell User</user>
62
+ <date-started unixtime='1407708217960'>2014-08-10T22:03:37Z</date-started>
63
+ <date-ended unixtime='1407708220158'>2014-08-10T22:03:40Z</date-ended>
64
+ <job id='3ba7c6c8-3d79-4b02-807f-eda67e321c23' averageDuration='176162'>
65
+ <name>dateoutput</name>
66
+ <group></group>
67
+ <project>Litatest</project>
68
+ <description></description>
69
+ </job>
70
+ <description>Plugin[localexec, nodeStep: true]</description>
71
+ <argstring />
72
+ <successfulNodes>
73
+ <node name='rundeck.mycompany.org' />
74
+ </successfulNodes>
75
+ </execution>
76
+ <execution id='259' href='https://rundeck.mycompany.org/execution/follow/259' status='succeeded' project='Litatest'>
77
+ <user>Shell User</user>
78
+ <date-started unixtime='1407706456531'>2014-08-10T21:34:16Z</date-started>
79
+ <date-ended unixtime='1407707061907'>2014-08-10T21:44:21Z</date-ended>
80
+ <job id='3ba7c6c8-3d79-4b02-807f-eda67e321c23' averageDuration='176162'>
81
+ <name>dateoutput</name>
82
+ <group></group>
83
+ <project>Litatest</project>
84
+ <description></description>
85
+ <options>
86
+ <option name='SECONDS' value='600' />
87
+ </options>
88
+ </job>
89
+ <description>Plugin[localexec, nodeStep: true]</description>
90
+ <argstring>-SECONDS 600</argstring>
91
+ <successfulNodes>
92
+ <node name='rundeck.mycompany.org' />
93
+ </successfulNodes>
94
+ </execution>
95
+ <execution id='258' href='https://rundeck.mycompany.org/execution/follow/258' status='succeeded' project='Litatest'>
96
+ <user>Shell User</user>
97
+ <date-started unixtime='1407706386633'>2014-08-10T21:33:06Z</date-started>
98
+ <date-ended unixtime='1407706386756'>2014-08-10T21:33:06Z</date-ended>
99
+ <job id='3ba7c6c8-3d79-4b02-807f-eda67e321c23' averageDuration='176162'>
100
+ <name>dateoutput</name>
101
+ <group></group>
102
+ <project>Litatest</project>
103
+ <description></description>
104
+ <options>
105
+ <option name='SECOND' value='600' />
106
+ </options>
107
+ </job>
108
+ <description>Plugin[localexec, nodeStep: true]</description>
109
+ <argstring>-SECOND 600</argstring>
110
+ <successfulNodes>
111
+ <node name='rundeck.mycompany.org' />
112
+ </successfulNodes>
113
+ </execution>
114
+ <execution id='257' href='https://rundeck.mycompany.org/execution/follow/257' status='succeeded' project='Litatest'>
115
+ <user>Shell User</user>
116
+ <date-started unixtime='1407706289716'>2014-08-10T21:31:29Z</date-started>
117
+ <date-ended unixtime='1407706350069'>2014-08-10T21:32:30Z</date-ended>
118
+ <job id='3ba7c6c8-3d79-4b02-807f-eda67e321c23' averageDuration='176162'>
119
+ <name>dateoutput</name>
120
+ <group></group>
121
+ <project>Litatest</project>
122
+ <description></description>
123
+ <options>
124
+ <option name='SECONDS' value='60' />
125
+ </options>
126
+ </job>
127
+ <description>Plugin[localexec, nodeStep: true]</description>
128
+ <argstring>-SECONDS 60</argstring>
129
+ <successfulNodes>
130
+ <node name='rundeck.mycompany.org' />
131
+ </successfulNodes>
132
+ </execution>
133
+ <execution id='256' href='https://rundeck.mycompany.org/execution/follow/256' status='succeeded' project='Litatest'>
134
+ <user>Shell User</user>
135
+ <date-started unixtime='1407694901813'>2014-08-10T18:21:41Z</date-started>
136
+ <date-ended unixtime='1407694901878'>2014-08-10T18:21:41Z</date-ended>
137
+ <job id='3ba7c6c8-3d79-4b02-807f-eda67e321c23' averageDuration='176162'>
138
+ <name>dateoutput</name>
139
+ <group></group>
140
+ <project>Litatest</project>
141
+ <description></description>
142
+ </job>
143
+ <description>Plugin[localexec, nodeStep: true]</description>
144
+ <argstring />
145
+ <successfulNodes>
146
+ <node name='rundeck.mycompany.org' />
147
+ </successfulNodes>
148
+ </execution>
149
+ <execution id='255' href='https://rundeck.mycompany.org/execution/follow/255' status='succeeded' project='Litatest'>
150
+ <user>Shell User</user>
151
+ <date-started unixtime='1407651633183'>2014-08-10T06:20:33Z</date-started>
152
+ <date-ended unixtime='1407652236445'>2014-08-10T06:30:36Z</date-ended>
153
+ <job id='3ba7c6c8-3d79-4b02-807f-eda67e321c23' averageDuration='176162'>
154
+ <name>dateoutput</name>
155
+ <group></group>
156
+ <project>Litatest</project>
157
+ <description></description>
158
+ <options>
159
+ <option name='SECONDS' value='600' />
160
+ </options>
161
+ </job>
162
+ <description>Plugin[localexec, nodeStep: true]</description>
163
+ <argstring>-SECONDS 600</argstring>
164
+ <successfulNodes>
165
+ <node name='rundeck.mycompany.org' />
166
+ </successfulNodes>
167
+ </execution>
168
+ <execution id='254' href='https://rundeck.mycompany.org/execution/follow/254' status='succeeded' project='Litatest'>
169
+ <user>Shell User</user>
170
+ <date-started unixtime='1407651562717'>2014-08-10T06:19:22Z</date-started>
171
+ <date-ended unixtime='1407651623149'>2014-08-10T06:20:23Z</date-ended>
172
+ <job id='3ba7c6c8-3d79-4b02-807f-eda67e321c23' averageDuration='176162'>
173
+ <name>dateoutput</name>
174
+ <group></group>
175
+ <project>Litatest</project>
176
+ <description></description>
177
+ <options>
178
+ <option name='SECONDS' value='60' />
179
+ </options>
180
+ </job>
181
+ <description>Plugin[localexec, nodeStep: true]</description>
182
+ <argstring>-SECONDS 60</argstring>
183
+ <successfulNodes>
184
+ <node name='rundeck.mycompany.org' />
185
+ </successfulNodes>
186
+ </execution>
187
+ </executions>
188
+ </result>
@@ -0,0 +1,3 @@
1
+ <result success='true' apiversion='10'>
2
+ <executions count='0' total='0' offset='0' max='10' />
3
+ </result>
@@ -0,0 +1,52 @@
1
+ <result success='true' apiversion='10'>
2
+ <success>
3
+ <message>System Stats for Rundeck 2.0.4 on node rundeck.mycompany.org</message>
4
+ </success>
5
+ <system>
6
+ <timestamp epoch='1408027712969' unit='ms'>
7
+ <datetime>2014-08-14T14:48:32Z</datetime>
8
+ </timestamp>
9
+ <rundeck>
10
+ <version>2.0.4</version>
11
+ <build>2.0.4-1</build>
12
+ <node>rundeck.mycompany.org</node>
13
+ <base>/var/lib/rundeck</base>
14
+ <apiversion>10</apiversion>
15
+ </rundeck>
16
+ <os>
17
+ <arch>amd64</arch>
18
+ <name>Linux</name>
19
+ <version>3.2.0-60-virtual</version>
20
+ </os>
21
+ <jvm>
22
+ <name>OpenJDK 64-Bit Server VM</name>
23
+ <vendor>Oracle Corporation</vendor>
24
+ <version>1.7.0_55</version>
25
+ <implementationVersion>24.51-b03</implementationVersion>
26
+ </jvm>
27
+ <stats>
28
+ <uptime duration='727663692' unit='ms'>
29
+ <since epoch='1407300049277' unit='ms'>
30
+ <datetime>2014-08-06T04:40:49Z</datetime>
31
+ </since>
32
+ </uptime>
33
+ <cpu>
34
+ <loadAverage unit='percent'>0.0</loadAverage>
35
+ <processors>2</processors>
36
+ </cpu>
37
+ <memory unit='byte'>
38
+ <max>954728448</max>
39
+ <free>97436440</free>
40
+ <total>268959744</total>
41
+ </memory>
42
+ <scheduler>
43
+ <running>0</running>
44
+ </scheduler>
45
+ <threads>
46
+ <active>27</active>
47
+ </threads>
48
+ </stats>
49
+ <metrics href='https://rundeck.mycompany.org/metrics/metrics?pretty=true' contentType='text/json' />
50
+ <threadDump href='https://rundeck.mycompany.org/metrics/threads' contentType='text/plain' />
51
+ </system>
52
+ </result>
@@ -0,0 +1,22 @@
1
+ <result success='true' apiversion='10'>
2
+ <jobs count='3'>
3
+ <job id='984c6ce4-82be-4e8f-ab99-da4a5f050243'>
4
+ <name>Foo:Bar;baz</name>
5
+ <group />
6
+ <project>Litatest</project>
7
+ <description></description>
8
+ </job>
9
+ <job id='3ba7c6c8-3d79-4b02-807f-eda67e321c23'>
10
+ <name>dateoutput</name>
11
+ <group />
12
+ <project>Litatest</project>
13
+ <description></description>
14
+ </job>
15
+ <job id='f81c0e21-90dd-49cd-a214-6f8ef0560bd0'>
16
+ <name>test2</name>
17
+ <group />
18
+ <project>Litatest</project>
19
+ <description></description>
20
+ </job>
21
+ </jobs>
22
+ </result>
@@ -0,0 +1,3 @@
1
+ <result success='true' apiversion='10'>
2
+ <jobs count='0' />
3
+ </result>
@@ -0,0 +1,8 @@
1
+ <result success='true' apiversion='10'>
2
+ <projects count='1'>
3
+ <project href='https://rundeck.mycompany.org/api/10/project/Litatest'>
4
+ <name>Litatest</name>
5
+ <description></description>
6
+ </project>
7
+ </projects>
8
+ </result>
@@ -0,0 +1,3 @@
1
+ <result success='true' apiversion='10'>
2
+ <projects count='0' />
3
+ </result>
@@ -0,0 +1,19 @@
1
+ <result success='true' apiversion='10'>
2
+ <executions count='1'>
3
+ <execution id='285' href='https://rundeck.mycompany.org/execution/follow/285' status='running' project='Litatest'>
4
+ <user>Shell User</user>
5
+ <date-started unixtime='1408028788860'>2014-08-14T15:06:28Z</date-started>
6
+ <job id='3ba7c6c8-3d79-4b02-807f-eda67e321c23' averageDuration='128717'>
7
+ <name>dateoutput</name>
8
+ <group></group>
9
+ <project>Litatest</project>
10
+ <description></description>
11
+ <options>
12
+ <option name='SECONDS' value='600' />
13
+ </options>
14
+ </job>
15
+ <description>Plugin[localexec, nodeStep: true]</description>
16
+ <argstring>-SECONDS 600</argstring>
17
+ </execution>
18
+ </executions>
19
+ </result>
@@ -0,0 +1,5 @@
1
+ <result error='true' apiversion='10'>
2
+ <error code='api.error.execution.conflict'>
3
+ <message>Execution had a conflict: Job "dateoutput" [3ba7c6c8-3d79-4b02-807f-eda67e321c23] is currently being executed (execution [[295]])</message>
4
+ </error>
5
+ </result>
@@ -0,0 +1,6 @@
1
+ <result error='true' apiversion='10'>
2
+ <error code='api.error.job.options-invalid'>
3
+ <message>Job options were not valid: Option 'SECONDS' doesn't match regular expression \d+, value: XXX
4
+ </message>
5
+ </error>
6
+ </result>
@@ -0,0 +1,5 @@
1
+ <result error='true' apiversion='10'>
2
+ <error code='api.error.item.unauthorized'>
3
+ <message>Not authorized for action "Run as User" for Job ID 3ba7c6c8-3d79-4b02-807f-eda67e321c23</message>
4
+ </error>
5
+ </result>
@@ -0,0 +1,19 @@
1
+ <result success='true' apiversion='10'>
2
+ <executions count='1'>
3
+ <execution id='285' href='https://rundeck.mycompany.org/execution/follow/285' status='running' project='Litatest'>
4
+ <user>Shell User</user>
5
+ <date-started unixtime='1408028788860'>2014-08-14T15:06:28Z</date-started>
6
+ <job id='3ba7c6c8-3d79-4b02-807f-eda67e321c23' averageDuration='128717'>
7
+ <name>dateoutput</name>
8
+ <group></group>
9
+ <project>Litatest</project>
10
+ <description></description>
11
+ <options>
12
+ <option name='SECONDS' value='600' />
13
+ </options>
14
+ </job>
15
+ <description>Plugin[localexec, nodeStep: true]</description>
16
+ <argstring>-SECONDS 600</argstring>
17
+ </execution>
18
+ </executions>
19
+ </result>