aws / aws-sdk-ruby

The official AWS SDK for Ruby.
https://aws.amazon.com/sdk-for-ruby/
Apache License 2.0
3.56k stars 1.22k forks source link

Can't retrieve pipeline definition: pipelineId must not be null #324

Closed kinman-enphase closed 11 years ago

kinman-enphase commented 11 years ago

Attempting to follow the API doc for retrieving a pipeline definition results in a ValidationException.

003 > PL = AWS::DataPipeline.new AWS::DataPipeline 004 > pipeline = PL.client.create_pipeline(:name=>pipeline_name, :unique_id=>pipeline_name) {:pipeline_id=>"df-04654872H25YEAGKG08Q"} 005 > PL.client.get_pipeline_definition(pipeline) AWS::DataPipeline::Errors::ValidationException: 1 validation error detected: Value null at 'pipelineId' failed to satisfy constraint: Member must not be null from /Users/kinman/.rvm/gems/ree-1.8.7-2012.02@master/gems/aws-sdk-1.14.1/lib/aws/core/client.rb:366:in return_or_raise' from /Users/kinman/.rvm/gems/ree-1.8.7-2012.02@master/gems/aws-sdk-1.14.1/lib/aws/core/client.rb:467:inclient_request' from (eval):3:in `get_pipeline_definition' from (irb):5

geota commented 11 years ago

AWS::DataPipeline.create_pipeline returns a Core::Response object. Call the data method on the response object to access the response as a hash.

dp = AWS::DataPipeline.new
pipeline_name = "pipline_test"

pipeline = dp.client.create_pipeline({
  :name => pipeline_name,
  :unique_id => pipeline_name
  })

definition = dp.client.get_pipeline_definition(pipeline.data)
kinman-enphase commented 11 years ago

Thank you. I was misled by the return output. Documentation clearly states it's a Core::Response.