Sha256: 9c0f227d01a7e3b50a8d18274600b04eed345cb46b54a5c84245db18c7e19f0b

Contents?: true

Size: 1.8 KB

Versions: 37

Compression:

Stored size: 1.8 KB

Contents

module KineticSdk
  class Task

    # Test the database connection
    #
    # @param db [Hash] Database configuration seettings to send as the request body
    # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
    # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
    #
    # Example
    #
    #     {
    #       "type": "PostgreSQL",
    #       "properties": {
    #         "host": "mydbserver.company.com",
    #         "port": "5432",
    #         "database": "kinetictask",
    #         "username": "TaskUser",
    #         "password": "TaskPassword1"
    #       }
    #     }
    #
    def test_db_connection(db={}, headers=default_headers)
      @logger.info("Testing database connection")
      response = post("#{@api_url}/setup/db/test", db, headers)
      response.content
    end


    # Run the database migrations
    #
    # @param db [Hash] Database configuration seettings to send as the request body
    # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
    # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
    #
    # Example
    # 
    #     {
    #       "type": "PostgreSQL",
    #       "properties": {
    #         "host": "mydbserver.company.com",
    #         "port": "5432",
    #         "database": "kinetictask",
    #         "username": "TaskUser",
    #         "password": "TaskPassword1"
    #       }
    #     }
    #
    def migrate_db(db={}, headers=default_headers)
      @logger.info("Running database migrations")
      response = post("#{@api_url}/setup/db/migrate", db, headers)
      response.content
    end

  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
kinetic_sdk-5.0.29 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.28 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.27 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.26 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.25 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.24 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.23 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.22 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.21 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.20 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.19 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.18 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.17 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.16 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.15 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.14 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.13 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.12 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.11 lib/kinetic_sdk/task/lib/setup.rb
kinetic_sdk-5.0.10 lib/kinetic_sdk/task/lib/setup.rb