1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

add support for AWS Data Pipeline's GetPipelineDefinition endpoint

http://docs.aws.amazon.com/datapipeline/latest/APIReference/API_GetPipelineDefinition.html
This commit is contained in:
Matt Gillooly 2013-09-10 13:05:33 -04:00
parent c1cf68d4ce
commit 4aa42db453
4 changed files with 59 additions and 1 deletions

View file

@ -15,6 +15,7 @@ module Fog
request :describe_pipelines
request :list_pipelines
request :put_pipeline_definition
request :get_pipeline_definition
model_path 'fog/aws/models/data_pipeline'
model :pipeline

View file

@ -0,0 +1,37 @@
module Fog
module AWS
class DataPipeline
class Real
# Get pipeline definition JSON
# http://docs.aws.amazon.com/datapipeline/latest/APIReference/API_GetPipelineDefinition.html
# ==== Parameters
# * PipelineId <~String> - The ID of the pipeline
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
def get_pipeline_definition(id)
params = {
'pipelineId' => id,
}
response = request({
:body => Fog::JSON.encode(params),
:headers => { 'X-Amz-Target' => 'DataPipeline.GetPipelineDefinition' },
})
Fog::JSON.decode(response.body)
end
end
class Mock
def get_pipeline_definition(id, objects)
Fog::Mock.not_implemented
end
end
end
end
end

View file

@ -38,7 +38,23 @@ class AWS
"errored" => Fog::Boolean,
"validationErrors" => Fog::Nullable::Array,
}
GET_PIPELINE_DEFINITION = {
"pipelineObjects" => [
{
"id" => String,
"name" => String,
"fields" => [
{
"key" => String,
"refValue" => Fog::Nullable::String,
"stringValue" => Fog::Nullable::String,
}
]
}
]
}
end
end
end

View file

@ -46,6 +46,10 @@ Shindo.tests('AWS::DataPipeline | pipeline_tests', ['aws', 'data_pipeline']) do
Fog::AWS[:data_pipeline].activate_pipeline(@pipeline_id)
end
tests("#get_pipeline_definition").formats(AWS::DataPipeline::Formats::GET_PIPELINE_DEFINITION) do
Fog::AWS[:data_pipeline].get_pipeline_definition(@pipeline_id)
end
tests("#delete_pipeline").returns(true) do
Fog::AWS[:data_pipeline].delete_pipeline(@pipeline_id)
end