unimatrix-cli 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +4 -0
  5. data/README.md +12 -0
  6. data/Rakefile +6 -0
  7. data/VERSION +1 -0
  8. data/bin/console +14 -0
  9. data/bin/setup +8 -0
  10. data/exe/unimatrix +11 -0
  11. data/lib/unimatrix_cli.rb +74 -0
  12. data/lib/unimatrix_cli/alchemist/rendition/list_command.rb +72 -0
  13. data/lib/unimatrix_cli/alchemist/rendition_profile/assign_command.rb +59 -0
  14. data/lib/unimatrix_cli/alchemist/rendition_profile/list_command.rb +36 -0
  15. data/lib/unimatrix_cli/alchemist/video/create_command.rb +40 -0
  16. data/lib/unimatrix_cli/alchemist/video/describe_command.rb +40 -0
  17. data/lib/unimatrix_cli/alchemist/video_encoder/create_command.rb +37 -0
  18. data/lib/unimatrix_cli/alchemist/video_encoder/describe_command.rb +39 -0
  19. data/lib/unimatrix_cli/alchemist/video_encoder/encode_command.rb +102 -0
  20. data/lib/unimatrix_cli/alchemist/video_encoder/list_command.rb +35 -0
  21. data/lib/unimatrix_cli/archivist/blueprint/create_command.rb +94 -0
  22. data/lib/unimatrix_cli/citadel/app/build_command.rb +28 -0
  23. data/lib/unimatrix_cli/citadel/app/console_command.rb +17 -0
  24. data/lib/unimatrix_cli/citadel/app/db_setup_command.rb +17 -0
  25. data/lib/unimatrix_cli/citadel/app/environment_command.rb +30 -0
  26. data/lib/unimatrix_cli/citadel/app/logs_command.rb +17 -0
  27. data/lib/unimatrix_cli/citadel/app/migrate_command.rb +17 -0
  28. data/lib/unimatrix_cli/citadel/app/migrate_status_command.rb +17 -0
  29. data/lib/unimatrix_cli/citadel/app/rake_command.rb +18 -0
  30. data/lib/unimatrix_cli/citadel/app/routes_command.rb +17 -0
  31. data/lib/unimatrix_cli/citadel/citadel_command.rb +285 -0
  32. data/lib/unimatrix_cli/citadel/instance/details_command.rb +18 -0
  33. data/lib/unimatrix_cli/citadel/instance/scp_command.rb +48 -0
  34. data/lib/unimatrix_cli/citadel/instance/ssh_command.rb +29 -0
  35. data/lib/unimatrix_cli/citadel/instance/status_command.rb +17 -0
  36. data/lib/unimatrix_cli/citadel/instance/user_data_command.rb +17 -0
  37. data/lib/unimatrix_cli/citadel/instance/user_data_logs_command.rb +17 -0
  38. data/lib/unimatrix_cli/cli.rb +30 -0
  39. data/lib/unimatrix_cli/command.rb +138 -0
  40. data/lib/unimatrix_cli/config/acceptance.yml +23 -0
  41. data/lib/unimatrix_cli/config/configuration.rb +66 -0
  42. data/lib/unimatrix_cli/config/production.yml +15 -0
  43. data/lib/unimatrix_cli/config/staging.yml +15 -0
  44. data/lib/unimatrix_cli/config/unimatrix.rb +4 -0
  45. data/lib/unimatrix_cli/iris/stream/create_command.rb +43 -0
  46. data/lib/unimatrix_cli/iris/stream/describe_command.rb +35 -0
  47. data/lib/unimatrix_cli/iris/stream_encoder/create_command.rb +43 -0
  48. data/lib/unimatrix_cli/iris/stream_encoder/describe_command.rb +37 -0
  49. data/lib/unimatrix_cli/iris/stream_input/create_command.rb +43 -0
  50. data/lib/unimatrix_cli/iris/stream_input/describe_command.rb +37 -0
  51. data/lib/unimatrix_cli/iris/stream_output/create_command.rb +55 -0
  52. data/lib/unimatrix_cli/iris/stream_output/describe_command.rb +37 -0
  53. data/lib/unimatrix_cli/iris/stream_recorder/create_command.rb +49 -0
  54. data/lib/unimatrix_cli/iris/stream_recorder/describe_command.rb +37 -0
  55. data/lib/unimatrix_cli/iris/stream_transcriber/create_command.rb +54 -0
  56. data/lib/unimatrix_cli/iris/stream_transcriber/describe_command.rb +37 -0
  57. data/lib/unimatrix_cli/iris/stream_transmutator/create_command.rb +65 -0
  58. data/lib/unimatrix_cli/iris/stream_transmutator/describe_command.rb +38 -0
  59. data/lib/unimatrix_cli/login_command.rb +91 -0
  60. data/lib/unimatrix_cli/logout_command.rb +21 -0
  61. data/lib/unimatrix_cli/version.rb +3 -0
  62. data/lib/unimatrix_cli/zephyrus/input/create_command.rb +40 -0
  63. data/lib/unimatrix_cli/zephyrus/input/describe_command.rb +35 -0
  64. data/lib/unimatrix_cli/zephyrus/input/list_command.rb +38 -0
  65. data/lib/unimatrix_cli/zephyrus/output/list_command.rb +44 -0
  66. data/lib/unimatrix_cli/zephyrus/recording/configuration_command.rb +43 -0
  67. data/lib/unimatrix_cli/zephyrus/rendition/list_command.rb +40 -0
  68. data/lib/unimatrix_cli/zephyrus/routing/configuration_command.rb +43 -0
  69. data/lib/unimatrix_cli/zephyrus/transcoding/configuration_command.rb +55 -0
  70. data/lib/unimatrix_cli/zephyrus/transcribing/configuration_command.rb +55 -0
  71. data/lib/unimatrix_cli/zephyrus/transmutation/configuration_command.rb +55 -0
  72. data/lib/unimatrix_parser.rb +796 -0
  73. data/unimatrix-cli.gemspec +30 -0
  74. metadata +247 -0
@@ -0,0 +1,43 @@
1
+ module UnimatrixCLI
2
+ module Iris
3
+ module StreamInput
4
+ class CreateCommand < Command
5
+
6
+ option :realm, "The realm uuid", type: :string, required: true
7
+ option :stream, "The stream the stream_input belongs to", type: :string, required: true
8
+ option :region, "The region of the stream", type: :string, default: "us-east-1"
9
+
10
+ synopsis "Create a new stream_input"
11
+
12
+ def execute
13
+ stream_input = create_stream_input
14
+
15
+ if validate( stream_input, 'Iris::StreamInput' )
16
+ write( message: "StreamInput uuid: #{ stream_input.uuid }" )
17
+ else
18
+ write(
19
+ message: "Error creating stream_input: #{ stream_input.inspect }",
20
+ error: true
21
+ )
22
+ end
23
+ end
24
+
25
+ #----------------------------------------------------------------------------
26
+
27
+ private; def create_stream_input
28
+ endpoint = "/streams/#{ @options[ :stream ] }/stream_inputs"
29
+
30
+ stream_input = Unimatrix::Iris::StreamInput.new(
31
+ region: @options[ :region ],
32
+ state: 'disconnected'
33
+ )
34
+
35
+ operation(
36
+ endpoint,
37
+ realm_uuid: @options[ :realm ]
38
+ ).write( 'stream_inputs', stream_input ).first rescue nil
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,37 @@
1
+ module UnimatrixCLI
2
+ module Iris
3
+ module StreamInput
4
+ class DescribeCommand < Command
5
+
6
+ option :stream_input, "The stream_input uuid", type: :string, required: true, short: :i
7
+ option :stream, "The uuid of its stream", type: :string, required: true
8
+
9
+ synopsis "Describe a stream_input"
10
+
11
+ def execute
12
+ stream_input = find_stream_input
13
+
14
+ if validate( stream_input, 'Iris::StreamInput' )
15
+ parse_object( stream_input ).each do | response |
16
+ write( message: response )
17
+ end
18
+ else
19
+ write(
20
+ message: "StreamInput could not be found: #{ stream_input.inspect }",
21
+ error: true
22
+ )
23
+ end
24
+ end
25
+
26
+ #----------------------------------------------------------------------------
27
+
28
+ private; def find_stream_input
29
+ endpoint = "/streams/#{ @options[ :stream ] }/stream_inputs/" +
30
+ "#{ @options[ :stream_input ] }"
31
+
32
+ operation( endpoint ).read.first
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,55 @@
1
+ module UnimatrixCLI
2
+ module Iris
3
+ module StreamOutput
4
+ class CreateCommand < Command
5
+
6
+ option :realm, "The realm uuid", type: :string, required: true
7
+ option :stream, "The stream_output's stream", type: :string, required: true
8
+ option :key, "The key of the stream_output", type: :string, required: true
9
+ option :region, "The region of the stream", type: :string, default: "us-east-1"
10
+ option :url, "The url of the stream_output", type: :string
11
+ option :username, "Authentication username", type: :string
12
+ option :password, "Authentication password", type: :string
13
+
14
+ synopsis "Create a new stream_output"
15
+
16
+ def execute
17
+ stream_output = create_stream_output
18
+
19
+ if validate( stream_output, 'Iris::StreamOutput' )
20
+ write( message: "StreamOutput uuid: #{ stream_output.uuid }" )
21
+ else
22
+ write(
23
+ message: "Error creating stream_output: #{ stream_output.inspect }",
24
+ error: true
25
+ )
26
+ end
27
+ end
28
+
29
+ #----------------------------------------------------------------------------
30
+
31
+ private; def create_stream_output
32
+ endpoint = "/streams/#{ @options[ :stream ] }/stream_outputs"
33
+
34
+ stream_output = Unimatrix::Iris::StreamOutput.new(
35
+ key: @options[ :key ],
36
+ state: 'disconnected'
37
+ )
38
+
39
+ if @options[ :username ] && @options[ :password ]
40
+ output.authentication_username = @options[ :username ]
41
+ output.authentication_password = @options[ :password ]
42
+ end
43
+
44
+ stream_output.url = @options[ :url ] if @options[ :url ]
45
+
46
+ operation(
47
+ endpoint,
48
+ realm_uuid: @options[ :realm ],
49
+ region: @options[ :region ]
50
+ ).write( 'stream_outputs', stream_output ).first rescue nil
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,37 @@
1
+ module UnimatrixCLI
2
+ module Iris
3
+ module StreamOutput
4
+ class DescribeCommand < Command
5
+
6
+ option :stream_output, "The stream_output uuid", type: :string, required: true, short: :o
7
+ option :stream, "The uuid of its stream", type: :string, required: true
8
+
9
+ synopsis "Describe a stream_output"
10
+
11
+ def execute
12
+ stream_output = find_stream_output
13
+
14
+ if validate( stream_output, 'Iris::StreamOutput' )
15
+ parse_object( stream_output ).each do | response |
16
+ write( message: response )
17
+ end
18
+ else
19
+ write(
20
+ message: "StreamOutput could not be found: #{ stream_output.inspect }",
21
+ error: true
22
+ )
23
+ end
24
+ end
25
+
26
+ #----------------------------------------------------------------------------
27
+
28
+ private; def find_stream_output
29
+ endpoint = "/streams/#{ @options[ :stream ] }/stream_outputs/" +
30
+ "#{ @options[ :stream_output ] }"
31
+
32
+ operation( endpoint ).read.first
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,49 @@
1
+ module UnimatrixCLI
2
+ module Iris
3
+ module StreamRecorder
4
+ class CreateCommand < Command
5
+
6
+ option :realm, "The realm uuid", type: :string, required: true
7
+ option :stream, "The stream_recorder's stream", type: :string, required: true
8
+ option :duration_limit, "Duration limit", type: :integer
9
+
10
+ synopsis "Create a new stream_recorder"
11
+
12
+ def execute
13
+ stream_recorder = create_stream_recorder
14
+
15
+ if validate( stream_recorder, 'Iris::StreamRecorder' )
16
+ write(
17
+ message: "StreamRecorder uuid: #{ stream_recorder.uuid }"
18
+ )
19
+ else
20
+ write(
21
+ message: "Error creating stream_recorder: #{ stream_recorder.inspect }",
22
+ error: true
23
+ )
24
+ end
25
+ end
26
+
27
+ #----------------------------------------------------------------------------
28
+
29
+ private; def create_stream_recorder
30
+ endpoint = "/streams/#{ @options[ :stream ] }/stream_recorders"
31
+
32
+ stream_recorder = Unimatrix::Iris::StreamRecorder.new(
33
+ state: 'default',
34
+ recording_state: 'off'
35
+ )
36
+
37
+ if @options[ :duration_limit ]
38
+ stream_recorder.duration_limit = @options[ :duration_limit ]
39
+ end
40
+
41
+ operation(
42
+ endpoint,
43
+ realm_uuid: @options[ :realm ]
44
+ ).write( 'stream_recorders', stream_recorder ).first rescue nil
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,37 @@
1
+ module UnimatrixCLI
2
+ module Iris
3
+ module StreamRecorder
4
+ class DescribeCommand < Command
5
+
6
+ option :stream_recorder, "The stream_recorder uuid", type: :string, required: true, short: :r
7
+ option :stream, "The uuid of its stream", type: :string, required: true
8
+
9
+ synopsis "Describe a stream_recorder"
10
+
11
+ def execute
12
+ stream_recorder = find_stream_recorder
13
+
14
+ if validate( stream_recorder, 'Iris::StreamRecorder' )
15
+ parse_object( stream_recorder ).each do | response |
16
+ write( message: response )
17
+ end
18
+ else
19
+ write(
20
+ message: "StreamRecorder could not be found: #{ stream_recorder.inspect }",
21
+ error: true
22
+ )
23
+ end
24
+ end
25
+
26
+ #----------------------------------------------------------------------------
27
+
28
+ private; def find_stream_recorder
29
+ endpoint = "/streams/#{ @options[ :stream ] }/stream_recorders/" +
30
+ "#{ @options[ :stream_recorder ] }"
31
+
32
+ operation( endpoint ).read.first
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,54 @@
1
+ module UnimatrixCLI
2
+ module Iris
3
+ module StreamTranscriber
4
+ class CreateCommand < Command
5
+
6
+ option :realm, "The realm uuid", type: :string, required: true
7
+ option :stream, "The stream_transcriber's stream", type: :string, required: true
8
+ option :min_duration, "The minimum segment duration", type: :integer, short: :n
9
+ option :max_duration, "The maximum segment duration", type: :integer, short: :x
10
+
11
+ synopsis "Create a new stream_transcriber"
12
+
13
+ def execute
14
+ stream_transcriber = create_stream_transcriber
15
+
16
+ if validate( stream_transcriber, 'Iris::StreamTranscriber' )
17
+ write(
18
+ message: "StreamTranscriber uuid: #{ stream_transcriber.uuid }"
19
+ )
20
+ else
21
+ write(
22
+ message: "Error creating stream_transcriber: " +
23
+ "#{ stream_transcriber.inspect }",
24
+ error: true
25
+ )
26
+ end
27
+ end
28
+
29
+ #----------------------------------------------------------------------------
30
+
31
+ private; def create_stream_transcriber
32
+ endpoint = "/streams/#{ @options[ :stream ] }/stream_transcribers"
33
+
34
+ stream_transcriber = Unimatrix::Iris::StreamTranscriber.new(
35
+ state: 'default'
36
+ )
37
+
38
+ if @options[ :min_duration ]
39
+ stream_transcriber.minimum_segment_duration = @options[ :min_duration ]
40
+ end
41
+
42
+ if @options[ :max_duration ]
43
+ stream_transcriber.maximum_segment_duration = @options[ :max_duration ]
44
+ end
45
+
46
+ operation(
47
+ endpoint,
48
+ realm_uuid: @options[ :realm ]
49
+ ).write( 'stream_transcribers', stream_transcriber ).first rescue nil
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,37 @@
1
+ module UnimatrixCLI
2
+ module Iris
3
+ module StreamTranscriber
4
+ class DescribeCommand < Command
5
+
6
+ option :stream_transcriber, "The stream_transcriber uuid", type: :string, required: true, short: :t
7
+ option :stream, "The uuid of its stream", type: :string, required: true
8
+
9
+ synopsis "Describe a stream_transcriber"
10
+
11
+ def execute
12
+ stream_transcriber = find_stream_transcriber
13
+
14
+ if validate( stream_transcriber, 'Iris::StreamTranscriber' )
15
+ parse_object( stream_transcriber ).each do | response |
16
+ write( message: response )
17
+ end
18
+ else
19
+ write(
20
+ message: "StreamTranscriber could not be found: #{ stream_transcriber.inspect }",
21
+ error: true
22
+ )
23
+ end
24
+ end
25
+
26
+ #----------------------------------------------------------------------------
27
+
28
+ private; def find_stream_transcriber
29
+ endpoint = "/streams/#{ @options[ :stream ] }/stream_transcribers/" +
30
+ "#{ @options[ :stream_transcriber ] }"
31
+
32
+ operation( endpoint ).read.first
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,65 @@
1
+ module UnimatrixCLI
2
+ module Iris
3
+ module StreamTransmutator
4
+ class CreateCommand < Command
5
+
6
+ option :realm, "The realm uuid", type: :string, required: true
7
+ option :stream, "The stream_transmutator's stream", type: :string, required: true
8
+ option :url, "The destination url", type: :string, required: true
9
+ option :height, "Video height in pixels", type: :integer
10
+ option :width, "Video width in pixels", type: :integer
11
+ option :video_bitrate, "Video data rate in bps", type: :integer
12
+ option :audio_bitrate, "Audio data rate in bps", type: :integer
13
+ option :audio_sample_rate, "Audio sample rate in Hz", type: :integer
14
+
15
+ synopsis "Create a new stream_transmutator"
16
+
17
+ def execute
18
+ stream_transmutator = create_stream_transmutator
19
+
20
+ if validate( stream_transmutator, 'Iris::StreamTransmutator' )
21
+ write(
22
+ message: "StreamTransmutator uuid: #{ stream_transmutator.uuid }"
23
+ )
24
+ else
25
+ write(
26
+ message: "Error creating stream_transmutator: #{ stream_transmutator.inspect }",
27
+ error: true
28
+ )
29
+ end
30
+ end
31
+
32
+ #----------------------------------------------------------------------------
33
+
34
+ private; def create_stream_transmutator
35
+ endpoint = "/streams/#{ @options[ :stream ] }/stream_transmutators"
36
+
37
+ stream_transmutator = Unimatrix::Iris::StreamTransmutator.new(
38
+ url: @options[ :url ],
39
+ state: 'default'
40
+ )
41
+
42
+ stream_transmutator.height = @options[ :height ] if @options[ :height ]
43
+ stream_transmutator.width = @options[ :width ] if @options[ :width ]
44
+
45
+ if @options[ :video_bitrate ]
46
+ stream_transmutator.video_bitrate = @options[ :video_bitrate ]
47
+ end
48
+
49
+ if @options[ :audio_bitrate ]
50
+ stream_transmutator.audio_bitrate = @options[ :audio_bitrate ]
51
+ end
52
+
53
+ if @options[ :audio_sample_rate ]
54
+ stream_transmutator.audio_sample_rate = @options[ :audio_sample_rate ]
55
+ end
56
+
57
+ operation(
58
+ endpoint,
59
+ realm_uuid: @options[ :realm ]
60
+ ).write( 'stream_transmutators', stream_transmutator ).first rescue nil
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,38 @@
1
+ module UnimatrixCLI
2
+ module Iris
3
+ module StreamTransmutator
4
+ class DescribeCommand < Command
5
+
6
+ option :stream_transmutator, "The stream_transmutator uuid", type: :string, required: true, short: :t
7
+ option :stream, "The uuid of its stream", type: :string, required: true
8
+
9
+ synopsis "Describe a stream_transmutator"
10
+
11
+ def execute
12
+ stream_transmutator = find_stream_transmutator
13
+
14
+ if validate( stream_transmutator, 'Iris::StreamTransmutator' )
15
+ parse_object( stream_transmutator ).each do | response |
16
+ write( message: response )
17
+ end
18
+ else
19
+ write(
20
+ message: "StreamTransmutator could not be found: " +
21
+ "#{ stream_transmutator.inspect }",
22
+ error: true
23
+ )
24
+ end
25
+ end
26
+
27
+ #----------------------------------------------------------------------------
28
+
29
+ private; def find_stream_transmutator
30
+ endpoint = "/streams/#{ @options[ :stream ] }/" +
31
+ "stream_transmutators/#{ @options[ :stream_transmutator ] }"
32
+
33
+ operation( endpoint ).read.first
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end