mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
add support for AWS Data Pipeline's DescribeObjects endpoint
http://docs.aws.amazon.com/datapipeline/latest/APIReference/API_DescribeObjects.html
This commit is contained in:
parent
f9f71d54eb
commit
012930a089
4 changed files with 70 additions and 14 deletions
|
@ -17,6 +17,7 @@ module Fog
|
|||
request :put_pipeline_definition
|
||||
request :get_pipeline_definition
|
||||
request :query_objects
|
||||
request :describe_objects
|
||||
|
||||
model_path 'fog/aws/models/data_pipeline'
|
||||
model :pipeline
|
||||
|
|
41
lib/fog/aws/requests/data_pipeline/describe_objects.rb
Normal file
41
lib/fog/aws/requests/data_pipeline/describe_objects.rb
Normal file
|
@ -0,0 +1,41 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class DataPipeline
|
||||
|
||||
class Real
|
||||
|
||||
# Queries a pipeline for the names of objects that match a specified set of conditions.
|
||||
# http://docs.aws.amazon.com/datapipeline/latest/APIReference/API_DescribeObjects.html
|
||||
# ==== Parameters
|
||||
# * PipelineId <~String> - The ID of the pipeline
|
||||
# * ObjectIds <~Array> - Identifiers of the pipeline objects that contain the definitions
|
||||
# to be described. You can pass as many as 25 identifiers in a
|
||||
# single call to DescribeObjects.
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
# * body<~Hash>:
|
||||
def describe_objects(id, objectIds)
|
||||
params = {
|
||||
'pipelineId' => id,
|
||||
'objectIds' => objectIds,
|
||||
}
|
||||
|
||||
response = request({
|
||||
:body => Fog::JSON.encode(params),
|
||||
:headers => { 'X-Amz-Target' => 'DataPipeline.DescribeObjects' },
|
||||
})
|
||||
|
||||
Fog::JSON.decode(response.body)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Mock
|
||||
def describe_objects(id, objects)
|
||||
Fog::Mock.not_implemented
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
|
@ -6,6 +6,14 @@ class AWS
|
|||
'pipelineId' => String,
|
||||
}
|
||||
|
||||
FIELDS = [
|
||||
{
|
||||
"key" => String,
|
||||
"refValue" => Fog::Nullable::String,
|
||||
"stringValue" => Fog::Nullable::String,
|
||||
}
|
||||
]
|
||||
|
||||
LIST_PIPELINES = {
|
||||
"hasMoreResults" => Fog::Nullable::Boolean,
|
||||
"marker" => Fog::Nullable::String,
|
||||
|
@ -23,19 +31,25 @@ class AWS
|
|||
"ids" => Fog::Nullable::Array,
|
||||
}
|
||||
|
||||
DESCRIBE_OBJECTS = {
|
||||
"hasMoreResults" => Fog::Nullable::Boolean,
|
||||
"marker" => Fog::Nullable::String,
|
||||
"pipelineObjects" => [
|
||||
{
|
||||
'id' => String,
|
||||
'name' => String,
|
||||
'fields' => FIELDS,
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
DESCRIBE_PIPELINES = {
|
||||
"pipelineDescriptionList" => [
|
||||
{
|
||||
"description" => Fog::Nullable::String,
|
||||
"name" => String,
|
||||
"pipelineId" => String,
|
||||
"fields" => [
|
||||
{
|
||||
"key" => String,
|
||||
"refValue" => Fog::Nullable::String,
|
||||
"stringValue" => Fog::Nullable::String,
|
||||
}
|
||||
]
|
||||
"fields" => FIELDS,
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -50,13 +64,7 @@ class AWS
|
|||
{
|
||||
"id" => String,
|
||||
"name" => String,
|
||||
"fields" => [
|
||||
{
|
||||
"key" => String,
|
||||
"refValue" => Fog::Nullable::String,
|
||||
"stringValue" => Fog::Nullable::String,
|
||||
}
|
||||
]
|
||||
"fields" => FIELDS,
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -64,6 +64,12 @@ Shindo.tests('AWS::DataPipeline | pipeline_tests', ['aws', 'data_pipeline']) do
|
|||
end
|
||||
end
|
||||
|
||||
tests('#describe_objects').formats(AWS::DataPipeline::Formats::DESCRIBE_OBJECTS) do
|
||||
attempts = Fog::AWS[:data_pipeline].query_objects(@pipeline_id, 'ATTEMPT')
|
||||
object_ids = attempts['ids'][0..5]
|
||||
Fog::AWS[:data_pipeline].describe_objects(@pipeline_id, object_ids)
|
||||
end
|
||||
|
||||
tests("#delete_pipeline").returns(true) do
|
||||
Fog::AWS[:data_pipeline].delete_pipeline(@pipeline_id)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue