Class: Aserto::Directory::V3::Client

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Exporter, Importer, Model, Reader, Writer
Defined in:
lib/aserto/directory/v3/client.rb

Defined Under Namespace

Classes: NullClient

Constant Summary

Constants included from Exporter

Exporter::DATA_TYPE

Instance Method Summary collapse

Methods included from Exporter

#export

Methods included from Importer

#import

Methods included from Model

#delete_manifest, #get_manifest, #set_manifest

Methods included from Writer

#delete_object, #delete_relation, #set_object, #set_relation

Methods included from Reader

#check, #check_permission, #check_relation, #get_graph, #get_object, #get_objects, #get_relation, #get_relations

Constructor Details

#initialize(config) ⇒ Aserto::Directory::V3::Client

Creates a new Directory V3 Client

Base configuration If non-nil, this configuration is used for any client that doesn’t have its own configuration. If nil, only clients that have their own configuration will be created.

Examples:

Create a new Directory V3 Client with all the services

client = Aserto::Directory::V3::Client.new(
  {
    url: "directory.eng.aserto.com:8443",
    tenant_id: "tenant-id",
    api_key: "basic api-key",
  }
)

Create a new Directory V3 Client with reader only

client = Aserto::Directory::V3::Client.new(
  {
    reader: {
      url: "directory.eng.aserto.com:8443",
      tenant_id: "tenant-id",
      api_key: "basic api-key",
    }
  }
)

Parameters:



61
62
63
64
65
66
67
68
69
# File 'lib/aserto/directory/v3/client.rb', line 61

def initialize(config)
  base_config = ::Aserto::Directory::V3::Config.new(config)

  @reader = create_client(:reader, base_config.reader)
  @writer = create_client(:writer, base_config.writer)
  @importer = create_client(:importer, base_config.importer)
  @exporter = create_client(:exporter, base_config.exporter)
  @model = create_client(:model, base_config.model)
end