usd 0.1.4 → 0.1.5

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -15
  3. data/bin/rusdc +14 -14
  4. data/usd.gemspec +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1dc348116c2ad35950bcea88ca80863c751b7b50c8d30e9f7e1b61555f6d08dd
4
- data.tar.gz: 4fb82b76d1aa8ba9277ac3512e6d4fd0bc40e29fdff4054192de6f94709ee27a
3
+ metadata.gz: eeb6a5b08aafdc142ff2fa07c8dcf1859ca4993a2e2749c44aec12bc4bd2488a
4
+ data.tar.gz: 4d9a1b2f4dd5364b344f2e80f2e0e886698105734121a466e378a7710631f96e
5
5
  SHA512:
6
- metadata.gz: 2b99881822e2e345d1dc7c227806f7df202af50d51fef1d3bc4dd16563dd58e3e01b95249aab6cb910ba7209e78fc0bad04ad39613895c9bc7ad1d1e070d749a
7
- data.tar.gz: ddb9e9db898df0849150849d75fae4d848bc0d5305f6605ca881a3e5ae2c1c6498af3ac4c8f7d3370f81a278b7d41b6990853a94cf4e3dcf4e275df5cddc46c1
6
+ metadata.gz: a9f89726f11a5c925b63e21ed7a6ce9c7acbd3d7af152a1d80aae41afb1ceaa0cde4cee27ee0ccc50ebc7b787152a515b06157fbbe73f4536218759d5d47fb90
7
+ data.tar.gz: 6cd80c617bb13cdf72e7720811f83632eaa4865c33181e43ea764a68a7a84b3ad3dc158d04de870b75a97d397010846248eb8bc962ef006acf8c11fc1dd4b83a
data/README.md CHANGED
@@ -29,27 +29,27 @@ If you use the `rusdc find` command with `--format mlr` option then you need `ml
29
29
 
30
30
  Place the `mlr`-binary in a path, which is in your PATH-Environment.
31
31
 
32
- # funktions from the commandline-tool `rusdc`
32
+ # functions from the commandline-tool `rusdc`
33
33
 
34
34
  ```
35
35
  rusdc
36
36
  Commands:
37
- rusdc chg_add_nr # <CO> <CI> - fügt einer CO ein CI hinzu
38
- rusdc chg_list_nr # <CO> - listet alle CIs einer CO
37
+ rusdc chg_add_nr # <CO> <CI> - add a CI to a changeorder
38
+ rusdc chg_list_nr # <CO> - list all CIs of one changeorder
39
39
  rusdc create # pipe json-data to create object
40
- rusdc field_names # field_names <object> , listet die Attribute und Beziehungen eines Objektes auf.
41
- rusdc find # find <object> <where-clause> [fields - Komma getrennt (id,name)] - findet alle Objecte die die wc erfüllen.
42
- rusdc get # get <object> <cn>
43
- rusdc get_attachment_of_ci # <ci_name> <filename>
44
- rusdc get_attachment_of_co # <co_name> <filename>
40
+ rusdc field_names # <object-type> list all fields of an object including its format
41
+ rusdc find # <object-type> <where-clause> [fields - Komma getrennt (id,name)] - finds each object which meets the wc-condition
42
+ rusdc get # <object-type> <common_name> shows one object
43
+ rusdc get_attachment_of_ci # <ci_name> <filename>, download an attachment of a CI and print it out on stdout
44
+ rusdc get_attachment_of_co # <co_name> <filename>, download an attachment of a changeorder and print it out on stdout
45
45
  rusdc help [COMMAND] # Describe available commands or one specific command
46
- rusdc list_attachments_of_ci # <ci_name>
47
- rusdc list_attachments_of_co # <co_name>
48
- rusdc nr_add_child # <nr-name> <child-name>
49
- rusdc nr_changes # <nr> [inactive-too] - listet alle offenen Change eines nr, bei Bedarf auch inaktive
50
- rusdc nr_childs # nr_childs <ci-name> , listet alle Childs eines CI
51
- rusdc nr_incidents # <nr> [inactive-too] - listet alle offenen Incidents eines nr, bei Bedarf auch inaktive
52
- rusdc nr_parents # nr_parents <ci-name> , listet alle Parents eines CI
46
+ rusdc list_attachments_of_ci # <ci_name>, list all attachments of a CI
47
+ rusdc list_attachments_of_co # <co_name>, list all attachments of a changeorder
48
+ rusdc nr_add_child # <nr-name> <child-name>, add one child CI to another CI
49
+ rusdc nr_changes # <nr> [inactive-too] - list all open changeorders of one CI
50
+ rusdc nr_childs # <ci-name> , lists all childs CIs of a specific CI
51
+ rusdc nr_incidents # <nr> [inactive-too] - lists all incident of a specific CI
52
+ rusdc nr_parents # nr_parents <ci-name> , lists all parent CIs of a specific CI
53
53
  rusdc update # pipe json-data to update object
54
54
  ```
55
55
 
data/bin/rusdc CHANGED
@@ -7,7 +7,7 @@ require "usd"
7
7
 
8
8
  class Rusdc < Thor
9
9
 
10
- desc "chg_add_nr", "<CO> <CI> - fügt einer CO ein CI hinzu"
10
+ desc "chg_add_nr", "<CO> <CI> - add a CI to a changeorder"
11
11
  def chg_add_nr(co, ci)
12
12
  template = ERB.new <<-EOF
13
13
  {
@@ -25,7 +25,7 @@ class Rusdc < Thor
25
25
  puts loadcon.create({:type => "json", :data => json})
26
26
  end
27
27
 
28
- desc "chg_list_nr", "<CO> - listet alle CIs einer CO"
28
+ desc "chg_list_nr", "<CO> - list all CIs of one changeorder"
29
29
  def chg_list_nr(co)
30
30
  invoke 'find', ['lrel_asset_chgnr', %(chg.chg_ref_num = '#{co}'), "nr"], {:format => "mlr", :mlr_format => "xtab"}
31
31
  end
@@ -35,7 +35,7 @@ class Rusdc < Thor
35
35
  puts loadcon.create({:type => "json", :data => STDIN.read})
36
36
  end
37
37
 
38
- desc "field_names","field_names <object> , listet die Attribute und Beziehungen eines Objektes auf."
38
+ desc "field_names","<object-type> list all fields of an object including its format"
39
39
  def field_names(object)
40
40
  e = loadcon.search(object,{'fields' => "*","start" => "1", "size" => "1"})[0]
41
41
  e.keys.sort.each do |k|
@@ -46,7 +46,7 @@ class Rusdc < Thor
46
46
  end
47
47
  end
48
48
 
49
- desc "find", "find <object> <where-clause> [fields - Komma getrennt (id,name)] - findet alle Objecte die die wc erfüllen."
49
+ desc "find", "<object-type> <where-clause> [fields - Komma getrennt (id,name)] - finds each object which meets the wc-condition"
50
50
  long_desc <<-LONGDESC
51
51
 
52
52
 
@@ -138,7 +138,7 @@ class Rusdc < Thor
138
138
  end # fields check
139
139
  end
140
140
 
141
- desc "get", "get <object> <cn>"
141
+ desc "get", "<object-type> <common_name> shows one object"
142
142
  option :yaml, :type => :boolean, :default => false
143
143
  def get(object, cn)
144
144
  e = loadcon.request("/caisd-rest/#{object}/COMMON_NAME-#{cn}")
@@ -151,7 +151,7 @@ class Rusdc < Thor
151
151
  end
152
152
  end
153
153
 
154
- desc "get_attachment_of_ci", "<ci_name> <filename>"
154
+ desc "get_attachment_of_ci", "<ci_name> <filename>, download an attachment of a CI and print it out on stdout"
155
155
  def get_attachment_of_ci(ciname, filename)
156
156
  att_nr = loadcon.search("lrel_attachments_nr",{'fields' => "attmnt","wc" => "nr.name = '#{ciname}'"})
157
157
  att_nr.each do |att|
@@ -162,7 +162,7 @@ class Rusdc < Thor
162
162
  end
163
163
  end
164
164
 
165
- desc "get_attachment_of_co", "<co_name> <filename>"
165
+ desc "get_attachment_of_co", "<co_name> <filename>, download an attachment of a changeorder and print it out on stdout"
166
166
  def get_attachment_of_co(coname, filename)
167
167
  chg_id=loadcon.request("/caisd-rest/chg/COMMON_NAME-#{coname}")["chg"]["@id"]
168
168
  att_nr = loadcon.search("lrel_attachments_changes",{'fields' => "attmnt","wc" => "chg = #{chg_id}"})
@@ -174,7 +174,7 @@ class Rusdc < Thor
174
174
  end
175
175
  end
176
176
 
177
- desc "list_attachments_of_ci", "<ci_name>"
177
+ desc "list_attachments_of_ci", "<ci_name>, list all attachments of a CI"
178
178
  def list_attachments_of_ci(ciname)
179
179
  att_nr = loadcon.search("lrel_attachments_nr",{'fields' => "attmnt","wc" => "nr.name = '#{ciname}'"})
180
180
  att_nr.each do |att|
@@ -182,7 +182,7 @@ class Rusdc < Thor
182
182
  end
183
183
  end
184
184
 
185
- desc "list_attachments_of_co", "<co_name>"
185
+ desc "list_attachments_of_co", "<co_name>, list all attachments of a changeorder"
186
186
  def list_attachments_of_co(coname)
187
187
  chg_id=loadcon.request("/caisd-rest/chg/COMMON_NAME-#{coname}")["chg"]["@id"]
188
188
  att_nr = loadcon.search("lrel_attachments_changes",{'fields' => "attmnt","wc" => "chg = #{chg_id}"})
@@ -191,7 +191,7 @@ class Rusdc < Thor
191
191
  end
192
192
  end
193
193
 
194
- desc "nr_add_child", "<nr-name> <child-name>"
194
+ desc "nr_add_child", "<nr-name> <child-name>, add one child CI to another CI"
195
195
  def nr_add_child(nr, child)
196
196
  template = ERB.new <<-EOF
197
197
  {
@@ -209,7 +209,7 @@ class Rusdc < Thor
209
209
  puts loadcon.create({:type => "json", :data => json})
210
210
  end
211
211
 
212
- desc "nr_changes", "<nr> [inactive-too] - listet alle offenen Change eines nr, bei Bedarf auch inaktive"
212
+ desc "nr_changes", "<nr> [inactive-too] - list all open changeorders of one CI"
213
213
  option :inactive_too, :type => :boolean, :default => false
214
214
  def nr_changes(nr)
215
215
  wc_add = (options[:inactive_too] ? "" : " and status.sym in ('Service pending','Work in progress','Customer Pending','Open','Hold')")
@@ -217,20 +217,20 @@ class Rusdc < Thor
217
217
  invoke 'find', ['chg', wc, 'chg_ref_num,summary,status'], {:format => "mlr"}
218
218
  end
219
219
 
220
- desc "nr_childs", "nr_childs <ci-name> , listet alle Childs eines CI"
220
+ desc "nr_childs", "<ci-name> , lists all childs CIs of a specific CI"
221
221
  def nr_childs(name)
222
222
  loadcon.search("hier",{'fields' => "*","wc" => "parent.name = '#{name}'"}).each do |c|
223
223
  puts c["child"]["@COMMON_NAME"]
224
224
  end
225
225
  end
226
226
 
227
- desc "nr_incidents", "<nr> [inactive-too] - listet alle offenen Incidents eines nr, bei Bedarf auch inaktive"
227
+ desc "nr_incidents", "<nr> [inactive-too] - lists all incident of a specific CI"
228
228
  option :inactive_too, :type => :boolean, :default => false
229
229
  def nr_incidents(nr)
230
230
  invoke 'find', ['in', %(affected_resource.name = '#{nr}'#{options[:inactive_too] ? "" : " and not status.sym in ('Cancelled','Closed')"}), "ref_num,summary,status"], {:format => "mlr"}
231
231
  end
232
232
 
233
- desc "nr_parents", "nr_parents <ci-name> , listet alle Parents eines CI"
233
+ desc "nr_parents", "nr_parents <ci-name> , lists all parent CIs of a specific CI"
234
234
  def nr_parents(name)
235
235
  loadcon.search("hier",{'fields' => "*","wc" => "child.name = '#{name}'"}).each do |c|
236
236
  puts c["parent"]["@COMMON_NAME"]
data/usd.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'usd'
3
- spec.version = '0.1.4'
3
+ spec.version = '0.1.5'
4
4
  spec.date = '2019-10-31'
5
5
  spec.summary = "SDM REST-API-Calls"
6
6
  spec.description = "a Ruby class and a commandlinetool for SDM REST-API-Calls"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Gaida