0

In order to avoid imperfect human manual definition I would like to know how to generate a json datasets manifest file from active GoodData project for Ruby automation?

I thought there might be some command line to achieve this like by inputting project.blueprint.~ or GoodData::Model::ProjectBlueprint on console like windows command prompt, or, find MAQL from CloudConnect LDM modeler's MAQL tab, or, from project web console such as next location;

https://secure.gooddata.com/gdc/md/{project_id}/ldm/singleloadinterface/dataset.{dataset_name}

Yuya Kobayashi
  • 465
  • 1
  • 4
  • 15
  • Especially, when the business customer project becomes enlarged, this manual way of project dataset json manifest creation without convertibility between CloudConnect's LDM modeler is not appropriate nor suitable, since such customer projects inevitably be handled by CloudConnect otherwise such project can't be grown so large for its business level unsufficient productivity or maintenancability. This functionality I think can't be said as a business level offering but a technically experimental level offering. – Yuya Kobayashi Mar 26 '15 at 01:38
  • Isn't there any technique in logging the exact text based content of the project datasets manifest included in the so-called variable, blueprint, on console, by calling certain GoodData API method through Ruby automation SDK on Console combined with less command or something? – Yuya Kobayashi Mar 26 '15 at 02:46
  • I am strongly concerning consistency between server datasets schema and that defined by local model.rb manifest file. – Yuya Kobayashi Mar 26 '15 at 02:58
  • Must the project datasets json manifest file always be described also about already defined datasets inside the target project, or, only be described about the very direct target datasets to be uploaded data by the Ruby script, and which is not yet defined at the target project? How can we keep consistency in project datasets manifest definition and the actual schema inside the target project? – Yuya Kobayashi Mar 27 '15 at 00:24
  • Is there only one-sided manner of external dataset schema declaration in manipulating (specifying) the target dataset to be uploaded data by the external Ruby script, and none of the way in referring how already defined project dataset schema should be referred from outside of the project by external Ruby script in compatible manner among active GoodData project dataset schema, CloudConnect's LDM modeler and dataset manifest file of Ruby automation SDK, – Yuya Kobayashi Mar 27 '15 at 00:25
  • therefore isn't there any mean in keeping consistency of dataset schema declaration methods among those but only successful consideration to avoid conflict among them? – Yuya Kobayashi Mar 27 '15 at 00:25
  • Is there any method supported at GoodData::Model::ProjectBlueprint declared at next URL to generate itself into JSON file to some directory? I meant some method to provide effect in contrary to from_json() but something like to_json. It extremely contributes to data model authoring combined with CloudConnect in massive production manner. https://github.com/gooddata/gooddata-ruby/blob/b8097c47a9e8fd96c829261087513b64a7a10c53/lib/gooddata/models/project_blueprint.rb – Yuya Kobayashi Apr 03 '15 at 08:36

1 Answers1

0

There's currently a bug when trying to get the manifest in the way it is defined in http://www.rubydoc.info/gems/gooddata/GoodData/Model/ToManifest But I can give you a workaround to get it till they fix it and update our gem:

require 'gooddata'
require 'pp'

module GoodData
    module Model
        module ToManifest
        def self.dataset_to_manifest(project, dataset, mode = 'FULL')
            dataset = dataset.is_a?(String) ?  Model::ProjectBlueprint.find_dataset(project, dataset) : dataset
            dataset = dataset.to_hash
            all_datasets = Model::ProjectBlueprint.datasets(project)
            tm = to_manifest(project, mode)
            datasets = all_datasets.zip(tm)
            res = datasets.find do |ds|
            ds.first[:title] == dataset['dataSet']['meta']['title']
        end
        res[1]
        end
    end
end
end


GoodData.logging_on
client = GoodData.connect 'your_user@gooddata.com', 'password'

project = client.projects('project_id')
dataset =project.datasets('/gdc/md/projectid/obj/dataset_id')

res = GoodData::Model::ToManifest.dataset_to_manifest(project.blueprint, dataset)

pp res

This will allow you to get your manifest with no errors.