usd 0.2.4.2 → 0.2.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -6
  3. data/bin/rusdc +24 -1
  4. data/change_log.md +8 -0
  5. data/usd.gemspec +2 -2
  6. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 515503469768aad64a6610b7fc0b9e8233f0cc77aa765226503e14f9a6d22a51
4
- data.tar.gz: ef1b76360680e68fcf1c2fc701757c40632c780be4adc9243890168f19d44a76
3
+ metadata.gz: f696d29388c8753c8af789acf542239241211c06846def69b792a9cc95eee735
4
+ data.tar.gz: 53f51965deba761faa9d759d77661599631609e2e7e4cf04d76eaa30088347a7
5
5
  SHA512:
6
- metadata.gz: 271c5acb4202200f6d3cf82974307262ac99e9d8f42044c4006108001192bed71ffed0d7155ff3b60ebc4f6204f9306282a08bbafab07007cddca1227b08f2ac
7
- data.tar.gz: 655db19bfe69c81bd94b4421e54e722012d50b566192d2fac0ef7794c5a2aeef504a40ef3b58d8ea2cddd72f823f503437e8a2ee04ea31aaa09278a3e01b71be
6
+ metadata.gz: 317cd855b80a7fd240cccfb94211529c7857bcd4fa0347c72b7c29a4ec10135f713e1edc45d42de469febfa4fe405ffe137db92e0a0db9b1a54ba812eb2a9848
7
+ data.tar.gz: 02d8a72b2f6a552cd999629409e739ae7e87eeed93b10a5e9daa16c875a51f6afcaf474811931c20d75dd07840e749b62a00ae8d8b233849d21b498451451cd5
data/README.md CHANGED
@@ -21,6 +21,14 @@ yum group install "Development Tools"
21
21
  yum install ruby-devel
22
22
  ```
23
23
 
24
+ # documentation
25
+
26
+ see [https://github.com/ogaida/usd/wiki](https://github.com/ogaida/usd/wiki)
27
+
28
+ ## bash-completion
29
+
30
+ see [https://github.com/ogaida/usd/wiki/bash-completion](https://github.com/ogaida/usd/wiki/bash-completion)
31
+
24
32
  # external tools
25
33
 
26
34
  If you use the `rusdc find` command with `--format mlr` option then you need `mlr`.
@@ -38,24 +46,25 @@ rusdc create # p
38
46
  rusdc field_names <object-type> [wc] # list all fields of an object including its format
39
47
  rusdc find <object-type> [where-clause] [fields, comma separated] [options] # finds each object which meets the wc-condition
40
48
  rusdc get <object-type> <common_name|id> # shows one object by name or id
41
- rusdc get_all_attachments_of_co <co_name> # get all attachments of a changeorder and save all these to current folder
42
- rusdc get_attachment_of_ci <ci_name> <filename> # download an attachment of a CI and print it out on stdout
43
- rusdc get_attachment_of_co <co_name> <filename> # download an attachment of a changeorder and print it out on stdout
49
+ rusdc get_all_attachments_of_co <co_name> # get all attachments of a changeorder and save all th...
50
+ rusdc get_attachment_of_ci <ci_name> <filename> # download an attachment of a CI and print it out on s...
51
+ rusdc get_attachment_of_co <co_name> <filename> # download an attachment of a changeorder and print it...
44
52
  rusdc help [COMMAND] # Describe available commands or one specific command
45
53
  rusdc in_add_2_chg <changeorder> <incident> # add incident to changeorder
46
54
  rusdc in_list_child_ins <in> # list all child-incidents of one incident
47
55
  rusdc list_attachments_of_ci <ci_name> # list all attachments of a CI
48
56
  rusdc list_attachments_of_co <co_name> # list all attachments of a changeorder
49
57
  rusdc nr_add_child <nr-name> <child-name> # add one child CI to another CI
58
+ rusdc nr_add_org <nr> <org> # add an Organisation to a ConfigurationItem
50
59
  rusdc nr_changes <nr> [inactive-too] # list all open changeorders of one CI
51
60
  rusdc nr_childs <ci-name> # lists all childs CIs of a specific CI
52
61
  rusdc nr_incidents <nr> [inactive-too] # lists all incident of a specific CI
53
62
  rusdc nr_parents <ci-name> # lists all parent CIs of a specific CI
54
63
  rusdc update # pipe json-data to update object
55
- rusdc update_attr <obj> <common_name|wc> <key> <value> # updates a direct (not referenced) attribute of one or more objects.
56
- rusdc update_attr_by_id <obj> <id> <key> <value> # updates a plain attribute of one object by id, does not work
64
+ rusdc update_attr <obj> <common_name|wc> <key> <value> # updates a direct (not referenced) attribute of one o...
65
+ rusdc update_attr_by_id <obj> <id> <key> <value> # updates a plain attribute of one object by id, does ...
57
66
  rusdc update_ref_attr <obj> <common_name> <key> <value> # updates a referenced attribute of one object.
58
- rusdc update_ref_attr_by_id <obj> <id> <key> <value_id> # updates a referenced attribute of one object_id by value-id
67
+ rusdc update_ref_attr_by_id <obj> <id> <key> <value_id> # updates a referenced attribute of one object_id by v...
59
68
  ```
60
69
 
61
70
  # environment-variables
data/bin/rusdc CHANGED
@@ -107,7 +107,7 @@ class Rusdc < Thor
107
107
  elem.keys.each do |elem_key|
108
108
  if options[:nice_time]
109
109
  if elem_key =~ /(date|last_mod|warranty_start|warranty_end|time_stamp)$/
110
- elem[elem_key]=Time.at(elem[elem_key]).to_s
110
+ elem[elem_key]=Time.at(elem[elem_key]).to_s if elem[elem_key] != "" # not empty
111
111
  end
112
112
  end
113
113
  if fields_array.include?(elem_key)
@@ -250,6 +250,29 @@ class Rusdc < Thor
250
250
  puts loadcon.create({:type => "json", :data => json})
251
251
  end
252
252
 
253
+ # $ rusdc find lrel_oenv_orgref "nr.name like 'servername1'" org
254
+ # [{
255
+ # "org": "Orname1"
256
+ # }]
257
+
258
+ desc "nr_add_org <nr> <org>", "add an Organisation to a ConfigurationItem"
259
+ def nr_add_org(nr, org)
260
+ template = ERB.new <<-EOF
261
+ {
262
+ "lrel_oenv_orgref": {
263
+ "nr": {
264
+ "@id": "<%= uid_nr %>"
265
+ },
266
+ "org": {
267
+ "@id": "<%= uid_org %>"
268
+ }
269
+ }
270
+ }
271
+ EOF
272
+ json = template.result_with_hash(:uid_org => loadcon.request("/caisd-rest/org/COMMON_NAME-#{org}")["org"]["@id"], :uid_nr => loadcon.request("/caisd-rest/nr/COMMON_NAME-#{nr}")["nr"]["@id"])
273
+ puts loadcon.create({:type => "json", :data => json})
274
+ end
275
+
253
276
  desc "nr_changes <nr> [inactive-too]", "list all open changeorders of one CI"
254
277
  option :inactive_too, :type => :boolean, :default => false
255
278
  def nr_changes(nr)
@@ -1,5 +1,13 @@
1
1
  # rusdc changelog
2
2
 
3
+ ## 0.2.5.3
4
+
5
+ - neu function : `rusdc nr_add_org <nr> <org> # add an Organisation to a ConfigurationItem`
6
+
7
+ #### fixes:
8
+
9
+ - rusdc - line 110: more robust when querying date fields
10
+
3
11
  ## 0.2.4.2
4
12
 
5
13
  the same fixes as in 0.2.4.1 for:
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'usd'
3
- spec.version = '0.2.4.2'
4
- spec.date = '2020-01-28'
3
+ spec.version = '0.2.5.3'
4
+ spec.date = '2020-07-15'
5
5
  spec.summary = "SDM REST-API-Calls"
6
6
  spec.description = "a Ruby class and a commandlinetool for SDM REST-API-Calls"
7
7
  spec.authors = ["Oliver Gaida"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4.2
4
+ version: 0.2.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Gaida
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-28 00:00:00.000000000 Z
11
+ date: 2020-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor