unimatrix-cli 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/unimatrix_cli.rb +11 -29
- data/lib/unimatrix_cli/command.rb +0 -1
- data/lib/unimatrix_cli/config/acceptance.yml +2 -2
- data/lib/unimatrix_cli/config/configuration.rb +1 -1
- data/lib/unimatrix_cli/config/production.yml +2 -2
- data/lib/unimatrix_cli/config/staging.yml +2 -2
- data/lib/unimatrix_cli/iris/stream_converter/create_command.rb +48 -0
- data/lib/unimatrix_cli/iris/stream_converter/describe_command.rb +37 -0
- data/lib/unimatrix_cli/keymaker/policy/destroy_command.rb +69 -0
- data/lib/unimatrix_cli/keymaker/policy/write_command.rb +156 -0
- data/lib/unimatrix_cli/keymaker/resource/list_command.rb +37 -0
- data/lib/unimatrix_cli/keymaker/resource_owner/find_command.rb +76 -0
- data/lib/unimatrix_cli/keymaker/resource_owner/invite_command.rb +60 -0
- data/lib/unimatrix_cli/keymaker/resource_owner/policies_command.rb +66 -0
- data/lib/unimatrix_cli/keymaker/resource_owner/remove_command.rb +92 -0
- data/lib/unimatrix_cli/keymaker/resource_server/list_command.rb +32 -0
- data/lib/unimatrix_cli/login_command.rb +1 -1
- data/lib/unimatrix_cli/version.rb +1 -1
- data/unimatrix-cli.gemspec +1 -1
- metadata +15 -31
- data/lib/unimatrix_cli/citadel/app/build_command.rb +0 -28
- data/lib/unimatrix_cli/citadel/app/console_command.rb +0 -17
- data/lib/unimatrix_cli/citadel/app/db_setup_command.rb +0 -17
- data/lib/unimatrix_cli/citadel/app/environment_command.rb +0 -30
- data/lib/unimatrix_cli/citadel/app/logs_command.rb +0 -17
- data/lib/unimatrix_cli/citadel/app/migrate_command.rb +0 -17
- data/lib/unimatrix_cli/citadel/app/migrate_status_command.rb +0 -17
- data/lib/unimatrix_cli/citadel/app/rake_command.rb +0 -18
- data/lib/unimatrix_cli/citadel/app/routes_command.rb +0 -17
- data/lib/unimatrix_cli/citadel/citadel_command.rb +0 -285
- data/lib/unimatrix_cli/citadel/instance/details_command.rb +0 -18
- data/lib/unimatrix_cli/citadel/instance/scp_command.rb +0 -48
- data/lib/unimatrix_cli/citadel/instance/ssh_command.rb +0 -29
- data/lib/unimatrix_cli/citadel/instance/status_command.rb +0 -17
- data/lib/unimatrix_cli/citadel/instance/user_data_command.rb +0 -17
- data/lib/unimatrix_cli/citadel/instance/user_data_logs_command.rb +0 -17
- data/lib/unimatrix_cli/zephyrus/input/create_command.rb +0 -40
- data/lib/unimatrix_cli/zephyrus/input/describe_command.rb +0 -35
- data/lib/unimatrix_cli/zephyrus/input/list_command.rb +0 -38
- data/lib/unimatrix_cli/zephyrus/output/list_command.rb +0 -44
- data/lib/unimatrix_cli/zephyrus/recording/configuration_command.rb +0 -43
- data/lib/unimatrix_cli/zephyrus/rendition/list_command.rb +0 -40
- data/lib/unimatrix_cli/zephyrus/routing/configuration_command.rb +0 -43
- data/lib/unimatrix_cli/zephyrus/transcoding/configuration_command.rb +0 -55
- data/lib/unimatrix_cli/zephyrus/transcribing/configuration_command.rb +0 -55
- data/lib/unimatrix_cli/zephyrus/transmutation/configuration_command.rb +0 -55
@@ -1,18 +0,0 @@
|
|
1
|
-
module UnimatrixCLI
|
2
|
-
module Citadel
|
3
|
-
module Instance
|
4
|
-
class DetailsCommand < CitadelCommand
|
5
|
-
|
6
|
-
option :instance, "Keyword for the name of the instance", type: :string, required: :true
|
7
|
-
|
8
|
-
synopsis "Display full details for the specified instance"
|
9
|
-
|
10
|
-
def execute
|
11
|
-
if load_environment && instance_list
|
12
|
-
write_instance_details( instance_details[ :instance_id ], full: true )
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
module UnimatrixCLI
|
2
|
-
module Citadel
|
3
|
-
module Instance
|
4
|
-
class ScpCommand < CitadelCommand
|
5
|
-
|
6
|
-
option :instance, "The instance to copy a file from or to", type: :string, required: true
|
7
|
-
option :local_file, "The local path and filename", type: :string, required: true
|
8
|
-
option :remote_file, "The remote path and filename", type: :string, required: true
|
9
|
-
option :direction, "Copy from or to an instance", type: :string, required: true
|
10
|
-
option :user, "Connect as a different user (optional)", type: :string
|
11
|
-
|
12
|
-
synopsis "Copy a file from or to a specific instance"
|
13
|
-
|
14
|
-
DIRECTIONS = %w( from to )
|
15
|
-
|
16
|
-
def execute
|
17
|
-
if @options[ :direction ] &&
|
18
|
-
DIRECTIONS.include?( @options[ :direction ] )
|
19
|
-
super
|
20
|
-
execute_scp
|
21
|
-
else
|
22
|
-
write(
|
23
|
-
message: "#{ @options[ :direction ] } is not a valid direction",
|
24
|
-
error: true
|
25
|
-
)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
#----------------------------------------------------------------------------
|
30
|
-
|
31
|
-
def execute_scp
|
32
|
-
user_to_use = @options[ :user ] || user
|
33
|
-
base = "scp -o StrictHostKeyChecking=no -i #{ key } "
|
34
|
-
|
35
|
-
if @options[ :direction ] == 'to'
|
36
|
-
command = base + "#{ @options[ :local_file ] } #{ user_to_use }@" +
|
37
|
-
"#{ instance_details[ :dns ] }:#{ @options[ :remote_file ] }"
|
38
|
-
else
|
39
|
-
command = base + "#{ user_to_use }@#{ instance_details[ :dns ] }" +
|
40
|
-
":#{ @options[ :remote_file ] } #{ @options[ :local_file ] }"
|
41
|
-
end
|
42
|
-
|
43
|
-
exec command
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module UnimatrixCLI
|
2
|
-
module Citadel
|
3
|
-
module Instance
|
4
|
-
class SshCommand < CitadelCommand
|
5
|
-
|
6
|
-
option :instance, "Keyword for the name of the instance", type: :string, required: true
|
7
|
-
option :user, "Connect as a different user (optional)", type: :string
|
8
|
-
option :commands, "Remote commands (optional)", type: :string
|
9
|
-
|
10
|
-
synopsis "Enter ssh shell on the specified instance"
|
11
|
-
|
12
|
-
def execute
|
13
|
-
super
|
14
|
-
execute_shell
|
15
|
-
end
|
16
|
-
|
17
|
-
#----------------------------------------------------------------------------
|
18
|
-
|
19
|
-
def execute_shell
|
20
|
-
command = base_command
|
21
|
-
if @options[ :commands ]
|
22
|
-
command += " #{ @options[ :commands ] }"
|
23
|
-
end
|
24
|
-
exec command
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module UnimatrixCLI
|
2
|
-
module Citadel
|
3
|
-
module Instance
|
4
|
-
class StatusCommand < CitadelCommand
|
5
|
-
|
6
|
-
option :instance, "Keyword for the name of the instance", type: :string, required: :true
|
7
|
-
|
8
|
-
synopsis "Display bluepill status for the specified instance"
|
9
|
-
|
10
|
-
def execute
|
11
|
-
super
|
12
|
-
execute_tunnel( 'bluepilld status' )
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module UnimatrixCLI
|
2
|
-
module Citadel
|
3
|
-
module Instance
|
4
|
-
class UserDataCommand < CitadelCommand
|
5
|
-
|
6
|
-
option :instance, "Keyword for the name of the instance", type: :string, required: :true
|
7
|
-
|
8
|
-
synopsis "Display user_data for the specified instance"
|
9
|
-
|
10
|
-
def execute
|
11
|
-
super
|
12
|
-
execute_tunnel( 'cat /tmp/user-data' )
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module UnimatrixCLI
|
2
|
-
module Citadel
|
3
|
-
module Instance
|
4
|
-
class UserDataLogsCommand < CitadelCommand
|
5
|
-
|
6
|
-
option :instance, "Keyword for the name of the instance", type: :string, required: :true
|
7
|
-
|
8
|
-
synopsis "Display user_data logs for the specified instance"
|
9
|
-
|
10
|
-
def execute
|
11
|
-
super
|
12
|
-
execute_tunnel( 'cat /var/log/user-data.log' )
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
module UnimatrixCLI
|
2
|
-
module Zephyrus
|
3
|
-
module Input
|
4
|
-
class CreateCommand < Command
|
5
|
-
|
6
|
-
option :key, "The input key", type: :string, required: true
|
7
|
-
option :uid, "The input uid", type: :string
|
8
|
-
|
9
|
-
synopsis "Create a new input"
|
10
|
-
|
11
|
-
def execute
|
12
|
-
input = create_input
|
13
|
-
|
14
|
-
if validate( input, 'Zephyrus::Input' )
|
15
|
-
write( message: "Input uuid: #{ input.uuid }" )
|
16
|
-
else
|
17
|
-
write(
|
18
|
-
message: "Error creating input: #{ input.inspect }",
|
19
|
-
error: true
|
20
|
-
)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
#----------------------------------------------------------------------------
|
25
|
-
|
26
|
-
private; def create_input
|
27
|
-
input = Unimatrix::Zephyrus::Input.new(
|
28
|
-
key: @options[ :key ],
|
29
|
-
state: 'disconnected'
|
30
|
-
)
|
31
|
-
input.uid = @options[ :uid ] if @options[ :uid ]
|
32
|
-
|
33
|
-
operation(
|
34
|
-
'/inputs'
|
35
|
-
).write( 'inputs', input ).first rescue nil
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module UnimatrixCLI
|
2
|
-
module Zephyrus
|
3
|
-
module Input
|
4
|
-
class DescribeCommand < Command
|
5
|
-
|
6
|
-
option :input, "The input uuid", type: :string, required: true
|
7
|
-
|
8
|
-
synopsis "Describe an input"
|
9
|
-
|
10
|
-
def execute
|
11
|
-
input = find_input
|
12
|
-
|
13
|
-
if validate( input, 'Zephyrus::Input' )
|
14
|
-
parse_object( input ).each do | response |
|
15
|
-
write( message: response )
|
16
|
-
end
|
17
|
-
else
|
18
|
-
write(
|
19
|
-
message: "Input could not be found: #{ input.inspect }",
|
20
|
-
error: true
|
21
|
-
)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
#----------------------------------------------------------------------------
|
26
|
-
|
27
|
-
private; def find_input
|
28
|
-
operation(
|
29
|
-
"/inputs/#{ @options[ :input ] }"
|
30
|
-
).read.first
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module UnimatrixCLI
|
2
|
-
module Zephyrus
|
3
|
-
module Input
|
4
|
-
class ListCommand < Command
|
5
|
-
|
6
|
-
option :key, "The key of the inputs", type: :string
|
7
|
-
option :uid, "The uid of the inputs", type: :string
|
8
|
-
|
9
|
-
synopsis "List inputs with a specific key and/or uid"
|
10
|
-
|
11
|
-
def execute
|
12
|
-
inputs = find_inputs
|
13
|
-
|
14
|
-
if validate_collection( inputs, 'Zephyrus::Input' )
|
15
|
-
inputs.each do | input |
|
16
|
-
write( message: input.uuid )
|
17
|
-
end
|
18
|
-
else
|
19
|
-
write(
|
20
|
-
message: "Inputs could not be found: #{ inputs.inspect }",
|
21
|
-
error: true
|
22
|
-
)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
#----------------------------------------------------------------------------
|
27
|
-
|
28
|
-
private; def find_inputs
|
29
|
-
endpoint = "/inputs?"
|
30
|
-
endpoint += "key=#{ @options[ :key ] }&" if @options[ :key ]
|
31
|
-
endpoint += "uid=#{ @options[ :uid ] }" if @options[ :uid ]
|
32
|
-
|
33
|
-
operation( endpoint ).read
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
module UnimatrixCLI
|
2
|
-
module Zephyrus
|
3
|
-
module Output
|
4
|
-
class ListCommand < Command
|
5
|
-
|
6
|
-
option :input, "The input uuid", type: :string, required: true
|
7
|
-
option :type_name, "The type of outputs", type: :string, required: true
|
8
|
-
option :key, "The key of the outputs", type: :string
|
9
|
-
option :url, "The url of the outputs", type: :string
|
10
|
-
option :uid, "The uid of the outputs", type: :string
|
11
|
-
|
12
|
-
synopsis "List outputs for a specific input"
|
13
|
-
|
14
|
-
def execute
|
15
|
-
outputs = find_outputs
|
16
|
-
|
17
|
-
if validate_collection( outputs, 'Zephyrus::Output' )
|
18
|
-
outputs.each do | output |
|
19
|
-
write( message: output.uuid )
|
20
|
-
end
|
21
|
-
else
|
22
|
-
write(
|
23
|
-
message: "Outputs could not be found: #{ outputs.inspect }",
|
24
|
-
error: true
|
25
|
-
)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
#----------------------------------------------------------------------------
|
30
|
-
|
31
|
-
private; def find_outputs
|
32
|
-
endpoint = "/inputs/#{ @options[ :input ] }/outputs?" +
|
33
|
-
"type_name=#{ @options[ :type_name ] }"
|
34
|
-
|
35
|
-
endpoint += "&key=#{ @options[ :key ] }" if @options[ :key ]
|
36
|
-
endpoint += "&url=#{ @options[ :url ] }" if @options[ :url ]
|
37
|
-
endpoint += "&uid=#{ @options[ :uid ] }" if @options[ :uid ]
|
38
|
-
|
39
|
-
operation( endpoint ).read
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
module UnimatrixCLI
|
2
|
-
module Zephyrus
|
3
|
-
module Recording
|
4
|
-
class ConfigurationCommand < Command
|
5
|
-
|
6
|
-
option :key, "The key for an input", type: :string, required: true
|
7
|
-
|
8
|
-
synopsis "Display recording configuration for an input"
|
9
|
-
|
10
|
-
def execute
|
11
|
-
response = recording_configuration_request
|
12
|
-
if response[ 'outputs' ].nil?
|
13
|
-
write(
|
14
|
-
message: "Configuration could not be found: #{ response.inspect }",
|
15
|
-
error: true
|
16
|
-
)
|
17
|
-
else
|
18
|
-
response[ 'outputs' ].each do | output |
|
19
|
-
write( message: parse_configuration_output( output ) )
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
#----------------------------------------------------------------------------
|
25
|
-
|
26
|
-
private; def recording_configuration_request
|
27
|
-
endpoint = "#{ Configuration.default_config[ 'zephyrus_url' ] }/" +
|
28
|
-
"recording/configuration?key=#{ @options[ :key ] }"
|
29
|
-
|
30
|
-
# Unimatrix SDK cannot handle Zephyrus configuration responses
|
31
|
-
make_request( endpoint, 'Get' )
|
32
|
-
end
|
33
|
-
|
34
|
-
private; def parse_configuration_output( output )
|
35
|
-
output = output.map do | key, value |
|
36
|
-
"#{ key }: #{ value }\n"
|
37
|
-
end
|
38
|
-
output << "\n"
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
module UnimatrixCLI
|
2
|
-
module Zephyrus
|
3
|
-
module Rendition
|
4
|
-
class ListCommand < Command
|
5
|
-
|
6
|
-
option :input, "The input uuid", type: :string, required: true
|
7
|
-
option :output, "The output uuid", type: :string, required: true
|
8
|
-
option :uid, "The uid of the renditions", type: :string, required: true
|
9
|
-
|
10
|
-
synopsis "List renditions for a specific output and uid"
|
11
|
-
|
12
|
-
def execute
|
13
|
-
renditions = find_renditions
|
14
|
-
|
15
|
-
if validate_collection( renditions, 'Zephyrus::Rendition' )
|
16
|
-
renditions.each do | rendition |
|
17
|
-
write( message: rendition.uuid )
|
18
|
-
end
|
19
|
-
else
|
20
|
-
write(
|
21
|
-
message: "Renditions could not be found: #{ renditions.inspect }",
|
22
|
-
error: true
|
23
|
-
)
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
#----------------------------------------------------------------------------
|
29
|
-
|
30
|
-
private; def find_renditions
|
31
|
-
endpoint = "/inputs/#{ @options[ :input ] }/" +
|
32
|
-
"outputs/#{ @options[ :output ] }" +
|
33
|
-
"/renditions?uid=#{ @options[ :uid ] }"
|
34
|
-
|
35
|
-
operation( endpoint ).read
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
module UnimatrixCLI
|
2
|
-
module Zephyrus
|
3
|
-
module Routing
|
4
|
-
class ConfigurationCommand < Command
|
5
|
-
|
6
|
-
option :key, "The key for an input", type: :string, required: true
|
7
|
-
|
8
|
-
synopsis "Display routing configuration for an input"
|
9
|
-
|
10
|
-
def execute
|
11
|
-
response = routing_configuration_request
|
12
|
-
if response[ 'outputs' ].nil?
|
13
|
-
write(
|
14
|
-
message: "Configuration could not be found: #{ response.inspect }",
|
15
|
-
error: true
|
16
|
-
)
|
17
|
-
else
|
18
|
-
response[ 'outputs' ].each do | output |
|
19
|
-
write( message: parse_configuration_output( output ) )
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
#----------------------------------------------------------------------------
|
25
|
-
|
26
|
-
private; def routing_configuration_request
|
27
|
-
endpoint = "#{ Configuration.default_config[ 'zephyrus_url' ] }/" +
|
28
|
-
"routing/configuration?key=#{ @options[ :key ] }"
|
29
|
-
|
30
|
-
# Unimatrix SDK cannot handle Zephyrus configuration responses
|
31
|
-
make_request( endpoint, 'Get' )
|
32
|
-
end
|
33
|
-
|
34
|
-
private; def parse_configuration_output( output )
|
35
|
-
output = output.map do | key, value |
|
36
|
-
"#{ key }: #{ value }\n"
|
37
|
-
end
|
38
|
-
output << "\n"
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|