Sha256: 1c8eb6824027d4c5a154c8fecfad2bd95905ac13a3b33d874b9bf41309afb9e7

Contents?: true

Size: 908 Bytes

Versions: 4

Compression:

Stored size: 908 Bytes

Contents

require 'fog/huaweicloud/models/model'

module Fog
  module Compute
    class HuaweiCloud
      class Service < Fog::HuaweiCloud::Model
        identity :id

        attribute :binary
        attribute :host
        attribute :state
        attribute :status
        attribute :updated_at
        attribute :zone

        # detailed
        attribute :disabled_reason

        def enable
          requires :binary, :host
          service.enable_service(host, binary)
        end

        def disable
          requires :binary, :host
          service.disable_service(host, binary)
        end

        def disable_and_log_reason
          requires :binary, :host, :disabled_reason
          service.disable_service_log_reason(host, binary, disabled_reason)
        end

        def destroy
          requires :id
          service.delete_service(id)
          true
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-huaweicloud-0.0.3 lib/fog/compute/huaweicloud/models/service.rb
fog-huaweicloud-0.0.2 lib/fog/compute/huaweicloud/models/service.rb
fog-huaweicloud-0.1.3 lib/fog/compute/huaweicloud/models/service.rb
fog-huaweicloud-0.1.2 lib/fog/compute/huaweicloud/models/service.rb