• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / tigerdata-app / bb6442c4-eb43-430c-9683-6ffb5848882a

21 Oct 2025 08:43PM UTC coverage: 87.325% (+0.4%) from 86.877%
bb6442c4-eb43-430c-9683-6ffb5848882a

Pull #2066

circleci

bess
Stop mediaflux when we stop everything else
Pull Request #2066: Stop mediaflux when we stop everything else

2625 of 3006 relevant lines covered (87.33%)

307.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.0
/app/models/mediaflux/namespace_destroy_request.rb
1
# frozen_string_literal: true
2
module Mediaflux
4✔
3
  # Destroy a MediaFlux namespace and everything in it
4
  # @example
5
  #   Mediaflux::NamespaceDestroyRequest.new(session_token: session_id, namespace: "/td-test-001/tigerdataNS/Banana1NS").destroy
6
  #   => true
7
  class NamespaceDestroyRequest < Request
4✔
8
    attr_reader :description, :namespace, :store
4✔
9

10
    # Constructor
11
    # @param session_token [String] the API token for the authenticated session
12
    # @param namespace [String] name of namespace to be destroyed
13
    # @param ignore_missing [Bool] ignore error if the namespace to delete is missing
14
    def initialize(session_token:, namespace:, ignore_missing: false)
4✔
15
      super(session_token: session_token)
5✔
16
      @namespace = namespace
5✔
17
      @ignore_missing = ignore_missing
5✔
18
    end
19

20
    def destroy
4✔
21
      resolve
1✔
22
      if error?
1✔
23
        if response_error.fetch(:message, "").include?("does not exist or is not accessible") && @ignore_missing
1✔
24
          # nothing to do
25
        else
26
          raise(StandardError, "call to service 'asset.namespace.hard.destroy' failed: The namespace #{namespace} does not exist or is not accessible")
×
27
        end
28
      end
29
    end
30

31
    # Specifies the Mediaflux service to use when destroying namespaces
32
    # @return [String]
33
    def self.service
4✔
34
      "asset.namespace.hard.destroy"
10✔
35
    end
36

37
    private
4✔
38

39
      def build_http_request_body(name:)
4✔
40
        super do |xml|
10✔
41
          xml.args do
10✔
42
            xml.namespace @namespace
10✔
43
            xml.atomic true
10✔
44
          end
45
        end
46
      end
47
  end
48
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc