Sha256: e8baf87930de148e6818aca438061238837c5ca82a72952bca80fd5e2b91fbde

Contents?: true

Size: 948 Bytes

Versions: 28

Compression:

Stored size: 948 Bytes

Contents

module Souls
  module Gcloud
    class << self
      def create_pubsub_topic(topic_name: "send-user-mail")
        system("gcloud pubsub topics create #{topic_name}")
      end

      def create_pubsub_subscription(
        topic_name: "send-user-mail",
        project_id: "souls-app",
        service_account: "souls-app",
        endpoint: "https:://test.com"
      )
        system(
          "gcloud pubsub subscriptions create #{topic_name}-sub \
          --topic #{topic_name} \
          --topic-project #{project_id} \
          --push-auth-service-account #{service_account} \
          --push-endpoint #{endpoint} \
          --expiration-period never
           "
        )
      end

      def update_pubsub_subscription(
        topic_name: "send-user-mail",
        endpoint: "https:://test.com"
      )
        system("gcloud pubsub subscriptions update #{topic_name}-sub --push-endpoint #{endpoint} ")
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
souls-0.31.1 lib/souls/cli/gcloud/pubsub.rb
souls-0.31.0 lib/souls/cli/gcloud/pubsub.rb
souls-0.30.11 lib/souls/cli/gcloud/pubsub.rb
souls-0.30.10 lib/souls/cli/gcloud/pubsub.rb
souls-0.30.9 lib/souls/gcloud/pubsub.rb
souls-0.30.8 lib/souls/gcloud/pubsub.rb
souls-0.30.7 lib/souls/gcloud/pubsub.rb
souls-0.30.6 lib/souls/gcloud/pubsub.rb
souls-0.30.5 lib/souls/gcloud/pubsub.rb
souls-0.30.4 lib/souls/gcloud/pubsub.rb
souls-0.30.3 lib/souls/gcloud/pubsub.rb
souls-0.30.2 lib/souls/gcloud/pubsub.rb
souls-0.30.1 lib/souls/gcloud/pubsub.rb
souls-0.30.0 lib/souls/gcloud/pubsub.rb
souls-0.29.10 lib/souls/gcloud/pubsub.rb
souls-0.29.9 lib/souls/gcloud/pubsub.rb
souls-0.29.8 lib/souls/gcloud/pubsub.rb
souls-0.29.7 lib/souls/gcloud/pubsub.rb
souls-0.29.6 lib/souls/gcloud/pubsub.rb
souls-0.29.5 lib/souls/gcloud/pubsub.rb