Class: IntegrationHelper

Inherits:
Object
  • Object
show all
Includes:
CloudmunchService, Util
Defined in:
lib/cloudmunch_Ruby_sdk_v2/IntegrationHelper.rb

Instance Method Summary collapse

Methods included from Util

getJSONArgs, log, logClose, logInit, logIt, openJSONFile

Methods included from CloudmunchService

#deleteCloudmunchData, #deleteKeys, #downloadKeys, #generateServerURL, #getCloudmunchData, getCustomDataContext, #getDataForContext, http_get, http_post, #parseResponse, putCustomDataContext, #updateCloudmunchData, #updateDataForContext

Constructor Details

#initializeIntegrationHelper

Returns a new instance of IntegrationHelper.



22
23
# File 'lib/cloudmunch_Ruby_sdk_v2/IntegrationHelper.rb', line 22

def initialize()
end

Instance Method Details

#getIntegration(jsonParams, integrationHash) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/cloudmunch_Ruby_sdk_v2/IntegrationHelper.rb', line 47

def getIntegration(jsonParams, integrationHash)
    providerName = jsonParams["providername"]
    log("DEBUG", "Provider Name: " + providerName)
    integrationDetailsHash = nil

    if !providerName.nil? && providerName.chop.length > 0 then
        regFields = integrationHash[providerName]["configuration"]

        integrationDetailsHash = {}
        regFields.each do |k,v|
            integrationDetailsHash[k] = v
        end

        return integrationDetailsHash
    else
        return nil
    end
end

#getService(jsonParams) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/cloudmunch_Ruby_sdk_v2/IntegrationHelper.rb', line 25

def getService(jsonParams)
    cloudproviders = jsonParams["cloudproviders"]
    cloudproviders = JSON.parse(cloudproviders)
    providerName = jsonParams["providername"]
    log("DEBUG", "Provider Name: " + providerName)
    integrationDetailsHash = nil

    if !providerName.nil? && providerName.chop.length > 0 then
        regFields = cloudproviders[providerName]

        integrationDetailsHash = {}
        regFields.each do |k,v|
            integrationDetailsHash[k] = v
        end

        return integrationDetailsHash
    else
        return nil
    end
end