Module: Aserto::Directory::V3::Exporter

Included in:
Client
Defined in:
lib/aserto/directory/v3/exporter.rb

Constant Summary collapse

DATA_TYPE =
{
  unknown: ::Aserto::Directory::Exporter::V3::Option::OPTION_UNKNOWN,
  objects: ::Aserto::Directory::Exporter::V3::Option::OPTION_DATA_OBJECTS,
  relations: ::Aserto::Directory::Exporter::V3::Option::OPTION_DATA_RELATIONS,
  all: ::Aserto::Directory::Exporter::V3::Option::OPTION_DATA
}.freeze

Instance Method Summary collapse

Instance Method Details

#export(data_type: :unknown) ⇒ Object

Exports directory data

Parameters:

  • data_type (String) (defaults to: :unknown)

    one of [:unknown, :objects, :relations, :all]



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/aserto/directory/v3/exporter.rb', line 19

def export(data_type: :unknown)
  operation = exporter.export(
    Aserto::Directory::Exporter::V3::ExportRequest.new(options: DATA_TYPE[data_type]),
    return_op: true
  )

  response = operation.execute
  data = response.map { |r| r }
  operation.wait

  data
end