Module: Aserto::Directory::V3::Importer
- Included in:
- Client
- Defined in:
- lib/aserto/directory/v3/importer.rb
Instance Method Summary collapse
-
#import(data) ⇒ Object
Imports objects and relations.
Instance Method Details
#import(data) ⇒ Object
Imports objects and relations
op_code =
OPCODE_UNKNOWN = ;
OPCODE_SET = 1;
OPCODE_DELETE = 2;
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/aserto/directory/v3/importer.rb', line 34 def import(data) data.map! do |value| if value.dig(:object, :properties) require "google/protobuf/well_known_types" value[:object][:properties] = Google::Protobuf::Struct.from_hash( value[:object][:properties].transform_keys(&:to_s) ) end Aserto::Directory::Importer::V3::ImportRequest.new(value) end operation = importer.import(data, return_op: true) response = operation.execute response.each { |r| } # ensures that the server sends trailing data operation.wait end |