cloudmunch_Ruby_sdk_v2 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1e4ab37540bf9af7c7c73d84d95a50bbf6702e9d
         | 
| 4 | 
            +
              data.tar.gz: 6523d334311f287621bff1eedb45cc9b13ece18b
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: ec6c82baa10efc08aec3a0e5490a597d3184d3a1a4397351bb913568208fadd1262a23f6a5064f9c228faabd76298ead0824b0f21a37cb206edfa43b65d1e3c1
         | 
| 7 | 
            +
              data.tar.gz: 5e729fbee83b8a3a78e7d141813a1ec5cbeb1b97276f58c0d74ef5d974e8593ec7c95e4743cd4abffbde1be83bf2bfc32c1542273c3a7fc4b62d35f4d12bfad5
         | 
| @@ -38,7 +38,7 @@ class AppAbstract | |
| 38 38 | 
             
                def getJSONArgs()
         | 
| 39 39 | 
             
                  jsonin = nil
         | 
| 40 40 | 
             
                  varin=nil
         | 
| 41 | 
            -
                   | 
| 41 | 
            +
                  integrations=nil
         | 
| 42 42 | 
             
                  loop { case ARGV[0]
         | 
| 43 43 | 
             
                      when '-jsoninput' then  ARGV.shift; jsonin = ARGV.shift
         | 
| 44 44 | 
             
                      when '-variables' then  ARGV.shift; varin = ARGV.shift
         | 
| @@ -50,15 +50,20 @@ class AppAbstract | |
| 50 50 | 
             
                    @json_input = JSON.load(jsonin)
         | 
| 51 51 | 
             
                    @var_input =JSON.load(varin)
         | 
| 52 52 | 
             
                    @integration_input=JSON.load(integrations)
         | 
| 53 | 
            -
                    createAppContext( | 
| 53 | 
            +
                    createAppContext();
         | 
| 54 | 
            +
                    return @json_input
         | 
| 54 55 | 
             
                end
         | 
| 55 56 |  | 
| 56 57 | 
             
                def createAppContext()
         | 
| 57 | 
            -
                    @appContext = getAppContext(var_input)
         | 
| 58 | 
            -
                end
         | 
| 59 58 |  | 
| 60 | 
            -
             | 
| 59 | 
            +
                    @appContext = AppContext.new(@var_input)
         | 
| 60 | 
            +
                    
         | 
| 61 | 
            +
                end
         | 
| 61 62 |  | 
| 63 | 
            +
                def getCloudmunchService()
         | 
| 64 | 
            +
                     @cloudmunchservice = @cloudmunchservice ? @cloudmunchservice : CloudmunchService.new(@var_input)
         | 
| 65 | 
            +
                    return @cloudmunchservice
         | 
| 66 | 
            +
                end 
         | 
| 62 67 | 
             
                def openJSONFile(fileNameWithPath)
         | 
| 63 68 | 
             
                    Util.openJSONFile(fileNameWithPath)
         | 
| 64 69 | 
             
                end
         | 
| @@ -70,14 +75,13 @@ class AppAbstract | |
| 70 75 | 
             
                def getIntegrationDetails(param = nil)
         | 
| 71 76 | 
             
                    #@json_input = @json_input ? @json_input : getJSONArgs()
         | 
| 72 77 | 
             
                    serviceProvider = ServiceProvider.new(@json_input["providername"])
         | 
| 73 | 
            -
                    serviceProvider.load_data(integration_input)
         | 
| 78 | 
            +
                    serviceProvider.load_data(@integration_input)
         | 
| 74 79 | 
             
                    return serviceProvider
         | 
| 75 80 | 
             
                end
         | 
| 76 81 |  | 
| 77 | 
            -
                def getAppContext( | 
| 78 | 
            -
                     | 
| 79 | 
            -
                     | 
| 80 | 
            -
                    return appContext
         | 
| 82 | 
            +
                def getAppContext(var_input)
         | 
| 83 | 
            +
                    
         | 
| 84 | 
            +
                    return @appContext
         | 
| 81 85 | 
             
                end
         | 
| 82 86 |  | 
| 83 87 | 
             
                def getDataContextFromCMDB(param)
         | 
| @@ -14,10 +14,11 @@ module CloudmunchService | |
| 14 14 |  | 
| 15 15 | 
             
               def updateCloudmunchData(context,contextid,data)
         | 
| 16 16 |  | 
| 17 | 
            -
                serverurl | 
| 17 | 
            +
                serverurl=@applicationContext.get_data("{master_url}")+"/applications/"+@applicationContext.get_data("{application}")+"/"+context+"/"+contextid;
         | 
| 18 | 
            +
                serverurl=serverurl+"?apikey=".@applicationContext.get_data("{api_key}")
         | 
| 18 19 | 
             
                 uri = URI.parse(serverurl)
         | 
| 19 20 |  | 
| 20 | 
            -
                 response= Net::HTTP.post_form(uri,"data" =>  | 
| 21 | 
            +
                 response= Net::HTTP.post_form(uri,"data" => data.to_json)
         | 
| 21 22 |  | 
| 22 23 | 
             
                 return response.body
         | 
| 23 24 | 
             
               end
         | 
| @@ -26,16 +27,16 @@ module CloudmunchService | |
| 26 27 |  | 
| 27 28 | 
             
               def getCloudmunchData(context,contextid,filterdata)
         | 
| 28 29 | 
             
                if contextid.nil? || contextid.empty?
         | 
| 29 | 
            -
                 serverurl | 
| 30 | 
            +
                 serverurl=@applicationContext.get_data("{master_url}")+"/applications/"+@applicationContext.get_data("{application}")+"/"+context
         | 
| 30 31 | 
             
                 else
         | 
| 31 | 
            -
                 serverurl | 
| 32 | 
            +
                 serverurl=@applicationContext.get_data("{master_url}")+"/applications/"+@applicationContext.get_data("{application}")+"/"+context+"/"+contextid;
         | 
| 32 33 | 
             
                end
         | 
| 33 34 | 
             
                querystring=""
         | 
| 34 35 | 
             
                if filterdata.nil? || filterdata.empty?
         | 
| 35 | 
            -
                  serverurl=serverurl+"?apikey=" | 
| 36 | 
            +
                  serverurl=serverurl+"?apikey=".@applicationContext.get_data("{api_key}")
         | 
| 36 37 | 
             
                else
         | 
| 37 38 | 
             
                  querystring="filter="+to_json($filerdata);
         | 
| 38 | 
            -
                  serverurl=serverurl+"?"+querystring+"&apikey=" | 
| 39 | 
            +
                  serverurl=serverurl+"?"+querystring+"&apikey=".@applicationContext.get_data("{api_key}")
         | 
| 39 40 |  | 
| 40 41 | 
             
                end
         | 
| 41 42 | 
             
               uri = URI.parse(serverurl)
         | 
| @@ -45,7 +46,8 @@ module CloudmunchService | |
| 45 46 |  | 
| 46 47 |  | 
| 47 48 | 
             
               def deleteCloudmunchData(context,contextid)
         | 
| 48 | 
            -
                serverurl | 
| 49 | 
            +
                serverurl=@applicationContext.get_data("{master_url}")+"/applications/"+@applicationContext.get_data("{application}")+"/"+context+"/"+contextid;
         | 
| 50 | 
            +
               serverurl=serverurl+"?apikey=".@applicationContext.get_data("{api_key}")
         | 
| 49 51 | 
             
                uri = URI.parse(serverurl)
         | 
| 50 52 | 
             
                Net::HTTP::Delete(uri)
         | 
| 51 53 | 
             
               end 
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: cloudmunch_Ruby_sdk_v2
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - syamk
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: exe
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2015-11- | 
| 12 | 
            +
            date: 2015-11-27 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: json
         |