Sha256: aeb00baf0844ed73a643aecc10ccdb31da655a4479ea672b0795c125a5e78969

Contents?: true

Size: 1.22 KB

Versions: 18

Compression:

Stored size: 1.22 KB

Contents

# frozen_string_literal: true

module Evostream
  # Concern all command sending to evoStream
  module Commands
    # Abstract class for create element
    class Destroy < Command
      def initialize(commands = { group_name: 'null', remove_hls_hds_files: 1 })
        super(commands)
      end

      def cmd
        "removeConfig?params=#{Base64.urlsafe_encode64(command.join)}"
      end

      private

      attr_reader :command

      # The configId of the configuration that needs to be removed. ConfigIds
      # can be obtained from the listConfig interface. Removing an inbound
      # stream will also automatically remove all associated outbound streams.
      def id(param = 'null')
        "id=#{param} "
      end

      # The name of the group that needs to be removed (applicable to HLS, HDS
      # and external processes). *Mandatory only if the id parameter is not
      # specified.
      def group_name(param = 'null')
        "groupName=#{param} "
      end

      # If 1 (true) and the stream is HLS or HDS, the folder associated with it
      # will be removed
      def remove_hls_hds_files(param = 0)
        "removeHlsHdsFiles=#{param} "
      end
    end

    # Alias to Destroy class
    RemoveConfig = Destroy
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
evostream-event-0.3.0 lib/evostream/event/commands/destroy.rb
evostream-event-0.3.0.pre.48 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.7 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.7.pre.44 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.6 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.6.pre.41 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.6.pre.39 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.5 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.5.pre.35 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.5.pre.34 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.4 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.4.pre.31 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.3 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.3.pre.27 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.2 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.2.pre.25 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.1 lib/evostream/event/commands/destroy.rb
evostream-event-0.2.1.pre.23 lib/evostream/event/commands/destroy.rb