asperalm 0.11 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1394f7859bed75467ae576ad24b5f4d163e863ea4d0f5479f0205740f4727e88
4
- data.tar.gz: 75661a6cd9fb1e50ccbf3b8a2695e240c2224804f50fc89d3a19447f70bd2a5f
3
+ metadata.gz: 1c44a530f34eadbe92cc2b15af22b71d4370f035dae7c99f431de666434b10e0
4
+ data.tar.gz: '078f0bec9070dbdb435520caa34929ae603007fbc6fb1188f6c5a2dd5095656f'
5
5
  SHA512:
6
- metadata.gz: 9a97c2ec9571ee1bf124883abb9f949f8888166d608df1a4889d80f511b8e25fa7dc136ea35d7fb47024a7996b0a69a0ae42ce50bc6f5fcbad962b4485974b81
7
- data.tar.gz: 8952b7aae4ea142fdb777954799a831531c03248b43dc0e88bf89f4509e6cfdc62ca9354dc9e7ab7562434b9e3e50b6becacd682e54dc29ac20bd11fbc58724f
6
+ metadata.gz: 0f1b910e8837eacd94d56985f9f2776a0cca0b0db514f47b7501a64cec68a6aefd0e8227754b79d24c80cf353fe883bb9eb5050705252fab597d9bdca5f35e38
7
+ data.tar.gz: 5e7ec216f972a86a67e04c1848a85f3097aeba86fb13ba3209a0d55c1a5dd33fc1d749c092b2cdb57c75a9eabd767df88cc9d3468112bc2416f009d0ee03fccf
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Asperalm - A Ruby library for Aspera transfers and "Amelia", the _Multi Layer IBM Aspera_ Command Line Tool
2
2
 
3
- Version : 0.11
3
+ Version : 0.11.1
4
4
 
5
5
 
6
- _Laurent/2016-2018_
6
+ _Laurent/2016-2020_
7
7
 
8
8
  This gem provides a ruby API to Aspera transfers and a command line interface to Aspera Applications. Location:
9
9
  [https://rubygems.org/gems/asperalm](https://rubygems.org/gems/asperalm)
@@ -39,7 +39,7 @@ Once the gem is installed, `mlia` shall be accessible:
39
39
 
40
40
  ```bash
41
41
  $ mlia --version
42
- 0.11
42
+ 0.11.1
43
43
  ```
44
44
 
45
45
  ## First use
@@ -1230,6 +1230,9 @@ mlia aspera files find / --value='\.partial$$'
1230
1230
  mlia aspera files http_node_download --to-folder=LOCAL_FOLDER /200KB.1
1231
1231
  mlia aspera files mkdir /testfolder
1232
1232
  mlia aspera files rename /testfolder newname
1233
+ mlia aspera files short_link create --to-folder='my folder' --value=private
1234
+ mlia aspera files short_link create --to-folder='my folder' --value=public
1235
+ mlia aspera files short_link list --value=@json:'{"purpose":"shared_folder_auth_link"}'
1233
1236
  mlia aspera files transfer --workspace=eudemo --from-folder='/Demo Files/aspera-test-dir-tiny' --to-folder=unit_test 200KB.1
1234
1237
  mlia aspera files upload --to-folder=/ CF_SAMPLE_FILEPATH
1235
1238
  mlia aspera files v3 info
@@ -1373,7 +1376,7 @@ mlia sync start --parameters=@json:'{"sessions":[{"name":"test","reset":true,"re
1373
1376
  ```bash
1374
1377
  $ mlia -h
1375
1378
  NAME
1376
- mlia -- a command line tool for Aspera Applications (v0.11)
1379
+ mlia -- a command line tool for Aspera Applications (v0.11.1)
1377
1380
 
1378
1381
  SYNOPSIS
1379
1382
  mlia COMMANDS [OPTIONS] [ARGS]
@@ -3116,6 +3119,10 @@ So, it evolved into `mlia`:
3116
3119
 
3117
3120
  # Release Notes
3118
3121
 
3122
+ * 0.11.1
3123
+
3124
+ * enhanced short_link creation commands (see examples)
3125
+
3119
3126
  * 0.11
3120
3127
 
3121
3128
  * add option to provide file list directly to ascp like this (only for direct transfer agent):
@@ -1 +1 @@
1
- 0.11
1
+ 0.11.1
@@ -534,12 +534,12 @@ module Asperalm
534
534
  return {:type=>:object_list,:data=>events}
535
535
  end
536
536
  when :resource
537
- resource_type=self.options.get_next_argument('resource',[:self,:user,:group,:client,:contact,:dropbox,:node,:operation,:package,:saml_configuration, :workspace, :dropbox_membership,:short_link,:workspace_membership,'admin/apps_new'.to_sym,'admin/client_registration_token'.to_sym,'integrations/kms_profile'.to_sym])
538
- resource_class_path=resource_type.to_s+case resource_type;when :dropbox;'es';when :self,'admin/apps_new'.to_sym;'';else; 's';end
539
- singleton_object=[:self].include?(resource_type)
537
+ resource_type=self.options.get_next_argument('resource',[:self,:organization,:user,:group,:client,:contact,:dropbox,:node,:operation,:package,:saml_configuration, :workspace, :dropbox_membership,:short_link,:workspace_membership,'admin/apps_new'.to_sym,'admin/client_registration_token'.to_sym,'integrations/kms_profile'.to_sym])
538
+ resource_class_path=resource_type.to_s+case resource_type;when :dropbox;'es';when :self,:organization,'admin/apps_new'.to_sym;'';else; 's';end
539
+ singleton_object=[:self,:organization].include?(resource_type)
540
540
  global_operations=[:create,:list]
541
- supported_operations=[:show]
542
- supported_operations.push(:modify,:delete,*global_operations) unless singleton_object
541
+ supported_operations=[:show,:modify]
542
+ supported_operations.push(:delete,*global_operations) unless singleton_object
543
543
  supported_operations.push(:v4,:v3) if resource_type.eql?(:node)
544
544
  supported_operations.push(:set_pub_key) if resource_type.eql?(:client)
545
545
  supported_operations.push(:shared_folders) if [:node,:workspace].include?(resource_type)
@@ -791,9 +791,70 @@ module Asperalm
791
791
  case command_repo
792
792
  when *NODE4_COMMANDS; return execute_node_gen4_command(command_repo,@home_node_file)
793
793
  when :short_link
794
- return self.entity_action(@api_aoc,'short_links',nil,:id,'self')
795
- end
796
- throw "Error"
794
+ folder_dest=self.options.get_option(:to_folder,:optional)
795
+ value_option=self.options.get_option(:value,:optional)
796
+ case value_option
797
+ when 'public'
798
+ value_option={'purpose'=>'token_auth_redirection'}
799
+ when 'private'
800
+ value_option={'purpose'=>'shared_folder_auth_link'}
801
+ when NilClass,Hash
802
+ else raise "value must be either: public, private, Hash or nil"
803
+ end
804
+ create_params=nil
805
+ node_file=nil
806
+ if !folder_dest.nil?
807
+ node_file = @api_aoc.resolve_node_file(@home_node_file,folder_dest)
808
+ create_params={
809
+ file_id: node_file[:file_id],
810
+ node_id: node_file[:node_info]['id'],
811
+ workspace_id: @workspace_id
812
+ }
813
+ end
814
+ if !value_option.nil? and !create_params.nil?
815
+ case value_option['purpose']
816
+ when 'shared_folder_auth_link'
817
+ value_option['data']=create_params
818
+ value_option['user_selected_name']=nil
819
+ when 'token_auth_redirection'
820
+ create_params['name']=''
821
+ value_option['data']={
822
+ aoc: true,
823
+ url_token_data: {
824
+ data: create_params,
825
+ purpose: 'view_shared_file'
826
+ }
827
+ }
828
+ value_option['user_selected_name']=nil
829
+ else
830
+ raise "purpose must be one of: token_auth_redirection or shared_folder_auth_link"
831
+ end
832
+ self.options.set_option(:value,value_option)
833
+ end
834
+ result=self.entity_action(@api_aoc,'short_links',nil,:id,'self')
835
+ if result[:data].is_a?(Hash) and result[:data].has_key?('created_at') and result[:data]['resource_type'].eql?('UrlToken')
836
+ node_api=@api_aoc.get_node_api(node_file[:node_info],OnCloud::SCOPE_NODE_USER)
837
+ perm_data={
838
+ "file_id" =>node_file[:file_id],
839
+ "access_type" =>"user",
840
+ "access_id" =>result[:data]['resource_id'],
841
+ "access_levels"=>["delete","list","mkdir","preview","read","rename","write"],
842
+ "tags" =>{
843
+ "url_token" =>true,
844
+ "workspace_id" =>@workspace_id,
845
+ "workspace_name" =>@workspace_name,
846
+ "folder_name" =>"my folder",
847
+ "created_by_name" =>user_info['name'],
848
+ "created_by_email"=>user_info['email'],
849
+ "access_key" =>node_file[:node_info]['access_key'],
850
+ "node" =>node_file[:node_info]['host']
851
+ }
852
+ }
853
+ node_api.create("permissions?file_id=#{node_file[:file_id]}",perm_data)
854
+ end
855
+ return result
856
+ end # files command
857
+ throw "Error: shall not reach this line"
797
858
  when :automation
798
859
  Log.log.warn("BETA: work under progress")
799
860
  # automation api is not in the same place
@@ -317,7 +317,7 @@ module Asperalm
317
317
  return {:type=>:object_list, :data=>dropbox_list['items'], :fields=>['name','id','description','can_read','can_write']}
318
318
  end
319
319
  when :v4
320
- command=self.options.get_next_command([:dropbox, :dmembership, :workgroup,:wmembership,:user,:metadata_profile])
320
+ command=self.options.get_next_command([:package,:dropbox, :dmembership, :workgroup,:wmembership,:user,:metadata_profile])
321
321
  case command
322
322
  when :dropbox
323
323
  return self.entity_action(api_v4,'admin/dropboxes',['id','e_wg_name','e_wg_desc','created_at'],:id)
@@ -331,6 +331,10 @@ module Asperalm
331
331
  return self.entity_action(api_v4,'users',['id','name','first_name','last_name'],:id)
332
332
  when :metadata_profile
333
333
  return self.entity_action(api_v4,'metadata_profiles',nil,:id)
334
+ when :package
335
+ pkg_box_type=self.options.get_next_command([:users])
336
+ pkg_box_id=self.options.get_option(:id,:mandatory)
337
+ return self.entity_action(api_v4,"#{pkg_box_type}/#{pkg_box_id}/packages",nil,:id)
334
338
  end
335
339
  when :address_book
336
340
  result=api_v3.call({:operation=>'GET',:subpath=>'address-book',:headers=>{'Accept'=>'application/json'},:url_params=>{'format'=>'json','count'=>100000}})[:data]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asperalm
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.11'
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-23 00:00:00.000000000 Z
11
+ date: 2020-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-simple