xapixctl 1.2.3 → 1.2.4

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: afb1bf2d6f83193e0b5d1341fbfc1177c7c76802a2aa0cdef748f3d9eb0e7d11
4
- data.tar.gz: 742c9ce8f28477d6bf922196c1d0d192ec1648db7fbe1cc73a1aba673c307f2d
3
+ metadata.gz: 0650e8d61c4e4d43e38d195c74ad139484db57c0bd761af93ff2ea2a7a083217
4
+ data.tar.gz: 4878b54c4c48002b4e8d5131c62178a26ea2e4c0c12cb4b4e697ef3c43c25565
5
5
  SHA512:
6
- metadata.gz: 87ecb583e67e5210f5cc9c2333d519e6bc160b7e0d8eb5236c407825acca54fc0dd1bfac178d2f0abef4becd29e5cc4b46bdc1d6e0c4ffcda79ab969a2d5846f
7
- data.tar.gz: 5ee3f1ef369eb548117d7e277884348ea9cc4885f650bae9c3bb4191a72e7f4d3261ceb05b97f53ca2ee04c2a917fbd2937e96d024b4e4a690d3a0fe37926d80
6
+ metadata.gz: 780557e28161b7a8c8fb1fe49f209ad86000d046cc244b654009c49f3c85628607d00a18a2d8879e60e9d0f883ac4333533dfc46b06f37e52d545fa6dd5c935b
7
+ data.tar.gz: 72c2a0ec1a8f4bd517d97a186b63de572b03063601d4d6290ef198724a2b254c2c35e1ec97fc56e7fd0c853500c5ac286b8289c25e47d8483415345854833946
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xapixctl (1.2.3)
4
+ xapixctl (1.2.4)
5
5
  activesupport (>= 5.2.3, < 6.0.0)
6
6
  hashdiff (>= 1.0.1, < 1.2.0)
7
7
  rest-client (>= 2.1.0, < 3.0.0)
@@ -30,11 +30,13 @@ module Xapixctl
30
30
 
31
31
  def show_deployment_status(result)
32
32
  return unless result && result['project_publication']
33
- puts "deployment: #{result.dig('project_publication', 'deployment')}"
34
- puts " data api: #{result.dig('project_publication', 'data_api')} (version: #{result.dig('project_publication', 'data_api_version').presence || 'n/a'})"
35
- puts " user management: #{result.dig('project_publication', 'user_management')}"
36
- if result.dig('project_publication', 'deployment') == 'success'
37
- puts " base URL: #{result.dig('project_publication', 'base_url')}"
33
+ say "deployment: #{result.dig('project_publication', 'deployment')}"
34
+ shell.indent do
35
+ say "data api: #{result.dig('project_publication', 'data_api')} (version: #{result.dig('project_publication', 'data_api_version').presence || 'n/a'})"
36
+ say "user management: #{result.dig('project_publication', 'user_management')}"
37
+ if result.dig('project_publication', 'deployment') == 'success'
38
+ say "base URL: #{result.dig('project_publication', 'base_url')}"
39
+ end
38
40
  end
39
41
  end
40
42
 
data/lib/xapixctl/cli.rb CHANGED
@@ -44,7 +44,7 @@ module Xapixctl
44
44
  conn = org_or_prj_connection
45
45
  resource_ids = resource_id ? [resource_id] : conn.resource_ids(resource_type)
46
46
  resource_ids.each do |res_id|
47
- puts conn.resource(resource_type, res_id, format: options[:format].to_sym)
47
+ say conn.resource(resource_type, res_id, format: options[:format].to_sym)
48
48
  end
49
49
  end
50
50
 
@@ -89,7 +89,7 @@ module Xapixctl
89
89
  LONGDESC
90
90
  def apply
91
91
  Util.resources_from_file(options[:file]) do |desc|
92
- puts "applying #{desc['kind']} #{desc.dig('metadata', 'id')}"
92
+ say "applying #{desc['kind']} #{desc.dig('metadata', 'id')}"
93
93
  org_or_prj_connection.apply(desc)
94
94
  end
95
95
  end
@@ -114,7 +114,7 @@ module Xapixctl
114
114
  def delete(resource_type = nil, resource_id = nil)
115
115
  if resource_type && resource_id
116
116
  org_or_prj_connection.delete(resource_type, resource_id)
117
- puts "DELETED #{resource_type} #{resource_id}"
117
+ say "DELETED #{resource_type} #{resource_id}"
118
118
  elsif options[:file]
119
119
  Util.resources_from_file(options[:file]) do |desc|
120
120
  res_type = desc['kind']
@@ -153,20 +153,19 @@ module Xapixctl
153
153
  LONGDESC
154
154
  def logs(correlation_id)
155
155
  result = prj_connection.logs(correlation_id)
156
- puts result['logs'].to_yaml
156
+ say result['logs'].to_yaml
157
157
  end
158
158
 
159
159
  SUPPORTED_CONTEXTS = ['Project', 'Organization'].freeze
160
160
 
161
161
  desc "api-resources", "retrieves a list of all available resource types"
162
162
  def api_resources
163
- available_types = connection.available_resource_types
164
- format_str = "%20.20s %20.20s %26.26s"
165
- puts format_str % ['Type', 'Required Context', '']
166
- available_types.sort_by { |desc| desc['type'] }.each do |desc|
167
- next unless SUPPORTED_CONTEXTS.include?(desc['context'])
168
- puts format_str % [desc['type'], desc['context'], PhoenixClient.supported_type?(desc['type']) ? '' : '(unsupported, update CLI)']
163
+ available_types = connection.available_resource_types.sort_by { |desc| desc['type'] }.filter { |desc| SUPPORTED_CONTEXTS.include?(desc['context']) }
164
+ table = [['Type', 'Required Context', '']]
165
+ table += available_types.map do |desc|
166
+ [desc['type'], desc['context'], PhoenixClient.supported_type?(desc['type']) ? '' : '(unsupported, update CLI)']
169
167
  end
168
+ print_table table, indent: 1
170
169
  end
171
170
  end
172
171
  end
@@ -20,29 +20,29 @@ module Xapixctl
20
20
  exit 1
21
21
  end
22
22
  if options[:schema_import]
23
- puts "uploading to update schema import '#{options[:schema_import]}': #{spec_filename}..."
23
+ say "uploading to update schema import '#{options[:schema_import]}': #{spec_filename}..."
24
24
  result = prj_connection.update_schema_import(options[:schema_import], spec_filename)
25
- puts "updated #{result.dig('resource', 'kind')} #{result.dig('resource', 'id')}"
25
+ say "updated #{result.dig('resource', 'kind')} #{result.dig('resource', 'id')}"
26
26
  else
27
- puts "uploading as new import: #{spec_filename}..."
27
+ say "uploading as new import: #{spec_filename}..."
28
28
  result = prj_connection.add_schema_import(spec_filename)
29
- puts "created #{result.dig('resource', 'kind')} #{result.dig('resource', 'id')}"
29
+ say "created #{result.dig('resource', 'kind')} #{result.dig('resource', 'id')}"
30
30
  end
31
31
 
32
32
  [['issues', 'import'], ['validation_issues', 'validation']].each do |key, name|
33
33
  issues = result.dig('schema_import', 'report', key)
34
34
  if issues.any?
35
- puts "\n#{name} issues:"
36
- issues.each { |issue| puts " - #{issue}" }
35
+ say "\n#{name} issues:"
36
+ shell.indent { issues.each { |issue| say "- #{issue}" } }
37
37
  end
38
38
  end
39
39
 
40
40
  updated_resources = result.dig('schema_import', 'updated_resources')
41
41
  if updated_resources.any?
42
- puts "\nconnectors:"
43
- updated_resources.each { |resource| puts " - #{resource['kind']} #{resource['id']}" }
42
+ say "\nconnectors:"
43
+ shell.indent { updated_resources.each { |resource| say "- #{resource['kind']} #{resource['id']}" } }
44
44
  else
45
- puts "\nno connectors created/updated."
45
+ say "\nno connectors created/updated."
46
46
  end
47
47
  end
48
48
  end
@@ -20,9 +20,9 @@ module Xapixctl
20
20
  CacheConnection
21
21
  Schema
22
22
  DataSource
23
- Pipeline
24
23
  Service
25
24
  ServiceInstall
25
+ Pipeline
26
26
  EndpointGroup
27
27
  Endpoint
28
28
  StreamGroup
@@ -31,6 +31,7 @@ module Xapixctl
31
31
  Scheduler
32
32
  ApiPublishing
33
33
  ApiPublishingRole
34
+ ApiPublishingAccessRule
34
35
  ].freeze
35
36
 
36
37
  TEXT_FORMATTERS = {
@@ -18,7 +18,7 @@ module Xapixctl
18
18
  \x5> $ xapixctl preview pipeline -p xapix/some-project pipeline
19
19
  LONGDESC
20
20
  def pipeline(pipeline)
21
- puts prj_connection.pipeline_preview(pipeline, format: options[:format].to_sym)
21
+ say prj_connection.pipeline_preview(pipeline, format: options[:format].to_sym)
22
22
  end
23
23
 
24
24
  option :format, aliases: "-f", default: 'text', enum: ['text', 'yaml', 'json'], desc: "Output format"
@@ -33,7 +33,7 @@ module Xapixctl
33
33
  \x5> $ xapixctl preview endpoint -p xapix/some-project endpoint
34
34
  LONGDESC
35
35
  def endpoint(endpoint)
36
- puts prj_connection.endpoint_preview(endpoint, format: options[:format].to_sym)
36
+ say prj_connection.endpoint_preview(endpoint, format: options[:format].to_sym)
37
37
  end
38
38
 
39
39
  option :format, aliases: "-f", default: 'text', enum: ['text', 'yaml', 'json'], desc: "Output format"
@@ -48,7 +48,7 @@ module Xapixctl
48
48
  \x5> $ xapixctl preview stream-processor -p xapix/some-project processor
49
49
  LONGDESC
50
50
  def stream_processor(stream_processor)
51
- puts prj_connection.stream_processor_preview(stream_processor, format: options[:format].to_sym)
51
+ say prj_connection.stream_processor_preview(stream_processor, format: options[:format].to_sym)
52
52
  end
53
53
  end
54
54
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Xapixctl
4
- VERSION = "1.2.3"
4
+ VERSION = "1.2.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xapixctl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Reinsch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-26 00:00:00.000000000 Z
11
+ date: 2021-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport