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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/xapixctl/base_cli.rb +7 -5
- data/lib/xapixctl/cli.rb +9 -10
- data/lib/xapixctl/connector_cli.rb +9 -9
- data/lib/xapixctl/phoenix_client.rb +2 -1
- data/lib/xapixctl/preview_cli.rb +3 -3
- data/lib/xapixctl/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0650e8d61c4e4d43e38d195c74ad139484db57c0bd761af93ff2ea2a7a083217
|
4
|
+
data.tar.gz: 4878b54c4c48002b4e8d5131c62178a26ea2e4c0c12cb4b4e697ef3c43c25565
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 780557e28161b7a8c8fb1fe49f209ad86000d046cc244b654009c49f3c85628607d00a18a2d8879e60e9d0f883ac4333533dfc46b06f37e52d545fa6dd5c935b
|
7
|
+
data.tar.gz: 72c2a0ec1a8f4bd517d97a186b63de572b03063601d4d6290ef198724a2b254c2c35e1ec97fc56e7fd0c853500c5ac286b8289c25e47d8483415345854833946
|
data/Gemfile.lock
CHANGED
data/lib/xapixctl/base_cli.rb
CHANGED
@@ -30,11 +30,13 @@ module Xapixctl
|
|
30
30
|
|
31
31
|
def show_deployment_status(result)
|
32
32
|
return unless result && result['project_publication']
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
165
|
-
|
166
|
-
|
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
|
-
|
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
|
-
|
25
|
+
say "updated #{result.dig('resource', 'kind')} #{result.dig('resource', 'id')}"
|
26
26
|
else
|
27
|
-
|
27
|
+
say "uploading as new import: #{spec_filename}..."
|
28
28
|
result = prj_connection.add_schema_import(spec_filename)
|
29
|
-
|
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
|
-
|
36
|
-
issues.each { |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
|
-
|
43
|
-
updated_resources.each { |resource|
|
42
|
+
say "\nconnectors:"
|
43
|
+
shell.indent { updated_resources.each { |resource| say "- #{resource['kind']} #{resource['id']}" } }
|
44
44
|
else
|
45
|
-
|
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 = {
|
data/lib/xapixctl/preview_cli.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
51
|
+
say prj_connection.stream_processor_preview(stream_processor, format: options[:format].to_sym)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
data/lib/xapixctl/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2021-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|