Sha256: edbcf027e1742702ef27ac51a9632fb0d39d60872c22f711208333ce6d571111

Contents?: true

Size: 624 Bytes

Versions: 16

Compression:

Stored size: 624 Bytes

Contents

module MKIt
  class CreatePodSaga < ASaga

    def topics
      %w{create_pod_saga}
    end

    #
    # create_pod_saga:
    #
    # payload:
    #  * service_id
    #
    # triggers
    #  * nothing
    #
    def do_the(job)
      MKItLogger.info("#{self.class} <#{job.topic}> #{job.inspect}....")
      service = Service.find(job.service_id)
      # create pod

      pd = Pod.new( service: service, status: MKIt::Status::CREATED, name: SecureRandom.uuid.gsub('-','')[0..11])
      service.pod << pd
      service.save
      MkitJob.publish(topic: :start_pod, service_id: job.service_id, pod_id: pd.id)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mkit-0.9.0 lib/mkit/sagas/create_pod_saga.rb
mkit-0.8.0 lib/mkit/sagas/create_pod_saga.rb
mkit-0.7.2 lib/mkit/sagas/create_pod_saga.rb
mkit-0.7.1 lib/mkit/sagas/create_pod_saga.rb
mkit-0.7.0 lib/mkit/sagas/create_pod_saga.rb
mkit-0.6.3 lib/mkit/sagas/create_pod_saga.rb
mkit-0.6.2 lib/mkit/sagas/create_pod_saga.rb
mkit-0.6.1 lib/mkit/sagas/create_pod_saga.rb
mkit-0.6.0 lib/mkit/sagas/create_pod_saga.rb
mkit-0.5.0 lib/mkit/sagas/create_pod_saga.rb
mkit-0.4.3 lib/mkit/sagas/create_pod_saga.rb
mkit-0.4.2 lib/mkit/sagas/create_pod_saga.rb
mkit-0.4.1 lib/mkit/sagas/create_pod_saga.rb
mkit-0.4.0 lib/mkit/sagas/create_pod_saga.rb
mkit-0.3.0 lib/mkit/sagas/create_pod_saga.rb
mkit-0.2.0 lib/mkit/sagas/create_pod_saga.rb