usd 1.3.4.1 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rusdc +24 -2
  3. data/change_log.md +4 -0
  4. data/usd.gemspec +2 -2
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2dc7c020bc56752e81b0ca22201b6661e17a1fcf54ffb37295ce19ad779fd7d
4
- data.tar.gz: ef77af20f3e5a2c1b6b71c2f8a78cad5f38da174908c33da9ef6a41c8fcb71be
3
+ metadata.gz: 70fbd18a6341df303be1897efab57eefae5c72db3f4e94af89cd7da4900281ad
4
+ data.tar.gz: ee6882af88f19c208d113bab4d96b2b7725d4e0c635b02c6e885153dd6c95475
5
5
  SHA512:
6
- metadata.gz: 0edea409a25f20dac2a91f5ecdacfaf9fbf5b954d7d30801a5c12cf23080789c3f616f2d08947632cf90efdd55cb1ed1fc1bf46870921789e759782739d51344
7
- data.tar.gz: 972f687caeea7d9a6b71a1704018ff67cc2da94e81849fbc0aaca93f27eb1b43c7f9b3a44a4917c095e8344f48caa277a76faf7a79bb04262539338e97c9cc66
6
+ metadata.gz: a9954d1e3f35a7d2f506e94cf5354f2e3c4ff74b27c855f56fe7e13310bd5cef8e5addc4937e1c01dfee23e803680da3e6c39a32eab22812efb8708279031d88
7
+ data.tar.gz: e9f4192677bb57d007d8eb98640e8a5e2de42d8053f906caae1ec3494c314f4ef41753b06151a842c935f8e972740319d7ae65d4bfec2fa7bb8105c4971cd550
data/bin/rusdc CHANGED
@@ -236,7 +236,7 @@ class Rusdc < Thor
236
236
  puts loadcon.request("/caisd-rest/attmnt/#{ids[0]["@id"]}/file-resource",{:unchanged => true}) if ids.class == Array
237
237
  end
238
238
 
239
- desc "in_add_attachment <in> <file>", "attach the file to incident"
239
+ desc "in_add_attachment <in> <file>", "attach a file to an incident or problem"
240
240
  def in_add_attachment(incident, file)
241
241
  response = loadcon.upload_attachment(file)
242
242
  puts response
@@ -287,7 +287,7 @@ class Rusdc < Thor
287
287
  end
288
288
  end
289
289
 
290
- desc "list_attachments_of_in <in>", "list all attachments of an Incident"
290
+ desc "list_attachments_of_in <in>", "list all attachments of an incident or problem"
291
291
  def list_attachments_of_in(incident)
292
292
  att_in = loadcon.search("lrel_attachments_requests",{'fields' => "attmnt","wc" => "cr.ref_num = '#{incident}'"})
293
293
  att_in.each do |att|
@@ -339,6 +339,28 @@ class Rusdc < Thor
339
339
  puts loadcon.create({:type => "json", :data => json})
340
340
  end
341
341
 
342
+ desc "nr_add_contact <nr> <cnt_email>", "add contact to configuration-item"
343
+ def nr_add_contact(nr, cnt_email)
344
+ template = ERB.new <<-EOF
345
+ {
346
+ "lrel_cenv_cntref": {
347
+ "nr": {
348
+ "@id": "<%= uid_nr %>"
349
+ },
350
+ "cnt": {
351
+ "@id": "<%= uid_cnt %>"
352
+ }
353
+ }
354
+ }
355
+ EOF
356
+ json = template.result_with_hash({
357
+ :uid_nr => loadcon.request("/caisd-rest/nr/COMMON_NAME-#{nr}")["nr"]["@id"],
358
+ :uid_cnt => loadcon.search("cnt",{'fields' => "@id","wc" => "email_address = '#{cnt_email}'"})[0]["@id"]
359
+ })
360
+ #puts "create relation to chg with json: #{json}"
361
+ puts loadcon.create({:type => "json", :data => json})
362
+ end
363
+
342
364
  desc "nr_add_org <nr> <org>", "add an Organisation to a ConfigurationItem"
343
365
  def nr_add_org(nr, org)
344
366
  template = ERB.new <<-EOF
@@ -1,5 +1,9 @@
1
1
  # rusdc changelog
2
2
 
3
+ ## 1.3.5
4
+
5
+ - new function `nr_add_contact <nr> <email>` to assign a contact to a configuration-item
6
+
3
7
  ## 1.3.4.1
4
8
 
5
9
  - fixed another error in Usd.search. which comes with 1.3.1 .
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'usd'
3
- spec.version = '1.3.4.1'
4
- spec.date = '2020-09-11'
3
+ spec.version = '1.3.5'
4
+ spec.date = '2020-09-25'
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: 1.3.4.1
4
+ version: 1.3.5
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-09-11 00:00:00.000000000 Z
11
+ date: 2020-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor