Class: RubyAem::Aem
- Inherits:
-
Object
- Object
- RubyAem::Aem
- Defined in:
- lib/ruby_aem.rb
Overview
Aem class represents an AEM client instance.
Instance Method Summary collapse
-
#aem ⇒ Object
Create an AEM instance.
-
#bundle(name) ⇒ Object
Create a bundle instance.
-
#config_property(name, type, value) ⇒ Object
Create a config property instance.
-
#flush_agent(run_mode, name) ⇒ Object
Create a flush agent instance.
-
#group(path, name) ⇒ Object
Create a group instance.
-
#initialize(conf = {}) ⇒ Object
constructor
Initialise a Ruby AEM instance.
-
#node(path, name) ⇒ Object
Create a node instance.
-
#outbox_replication_agent(run_mode, name) ⇒ Object
Create an outbox replication agent instance.
-
#package(group_name, package_name, package_version) ⇒ Object
Create a package instance.
-
#path(name) ⇒ Object
Create a path instance.
-
#replication_agent(run_mode, name) ⇒ Object
Create a replication agent instance.
-
#repository ⇒ Object
Create a repository instance.
-
#reverse_replication_agent(run_mode, name) ⇒ Object
Create a reverse replication agent instance.
-
#user(path, name) ⇒ Object
Create a user instance.
Constructor Details
#initialize(conf = {}) ⇒ Object
Initialise a Ruby AEM instance.
-
username: username used to authenticate to AEM instance, default: ‘admin’
-
password: password used to authenticate to AEM instance, default: ‘admin’
-
protocol: AEM instance protocol (http or https), default: ‘http’
-
host: AEM instance host name, default: ‘localhost’
-
port: AEM instance port, default: 4502
-
timeout: connection timeout in seconds, default: 300 seconds
-
debug: if true, then additional debug messages will be included, default: false
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/ruby_aem.rb', line 49 def initialize(conf = {}) conf[:username] ||= 'admin' conf[:password] ||= 'admin' conf[:protocol] ||= 'http' conf[:host] ||= 'localhost' conf[:port] ||= 4502 conf[:timeout] ||= 300 conf[:debug] ||= false SwaggerAemClient.configure { |swagger_conf| [ swagger_conf.host = "#{conf[:protocol]}://#{conf[:host]}:#{conf[:port]}", swagger_conf.username = conf[:username], swagger_conf.password = conf[:password], swagger_conf.timeout = conf[:timeout], swagger_conf.debugging = conf[:debug], swagger_conf.params_encoding = :multi ]} apis = { :console => SwaggerAemClient::ConsoleApi.new, :custom => SwaggerAemClient::CustomApi.new, :cq => SwaggerAemClient::CqApi.new, :crx => SwaggerAemClient::CrxApi.new, :sling => SwaggerAemClient::SlingApi.new } spec = YAML.load_file(File.('../../conf/spec.yaml', __FILE__)) @client = RubyAem::Client.new(apis, spec) end |
Instance Method Details
#aem ⇒ Object
Create an AEM instance.
84 85 86 |
# File 'lib/ruby_aem.rb', line 84 def aem() RubyAem::Resources::Aem.new(@client) end |
#bundle(name) ⇒ Object
Create a bundle instance.
92 93 94 |
# File 'lib/ruby_aem.rb', line 92 def bundle(name) RubyAem::Resources::Bundle.new(@client, name) end |
#config_property(name, type, value) ⇒ Object
Create a config property instance.
102 103 104 |
# File 'lib/ruby_aem.rb', line 102 def config_property(name, type, value) RubyAem::Resources::ConfigProperty.new(@client, name, type, value) end |
#flush_agent(run_mode, name) ⇒ Object
Create a flush agent instance.
111 112 113 |
# File 'lib/ruby_aem.rb', line 111 def flush_agent(run_mode, name) RubyAem::Resources::FlushAgent.new(@client, run_mode, name) end |
#group(path, name) ⇒ Object
Create a group instance.
120 121 122 |
# File 'lib/ruby_aem.rb', line 120 def group(path, name) RubyAem::Resources::Group.new(@client, path, name) end |
#node(path, name) ⇒ Object
Create a node instance.
129 130 131 |
# File 'lib/ruby_aem.rb', line 129 def node(path, name) RubyAem::Resources::Node.new(@client, path, name) end |
#outbox_replication_agent(run_mode, name) ⇒ Object
Create an outbox replication agent instance.
165 166 167 |
# File 'lib/ruby_aem.rb', line 165 def outbox_replication_agent(run_mode, name) RubyAem::Resources::OutboxReplicationAgent.new(@client, run_mode, name) end |
#package(group_name, package_name, package_version) ⇒ Object
Create a package instance.
139 140 141 |
# File 'lib/ruby_aem.rb', line 139 def package(group_name, package_name, package_version) RubyAem::Resources::Package.new(@client, group_name, package_name, package_version) end |
#path(name) ⇒ Object
Create a path instance.
147 148 149 |
# File 'lib/ruby_aem.rb', line 147 def path(name) RubyAem::Resources::Path.new(@client, name) end |
#replication_agent(run_mode, name) ⇒ Object
Create a replication agent instance.
156 157 158 |
# File 'lib/ruby_aem.rb', line 156 def replication_agent(run_mode, name) RubyAem::Resources::ReplicationAgent.new(@client, run_mode, name) end |
#repository ⇒ Object
Create a repository instance.
181 182 183 |
# File 'lib/ruby_aem.rb', line 181 def repository RubyAem::Resources::Repository.new(@client) end |
#reverse_replication_agent(run_mode, name) ⇒ Object
Create a reverse replication agent instance.
174 175 176 |
# File 'lib/ruby_aem.rb', line 174 def reverse_replication_agent(run_mode, name) RubyAem::Resources::ReverseReplicationAgent.new(@client, run_mode, name) end |
#user(path, name) ⇒ Object
Create a user instance.
190 191 192 |
# File 'lib/ruby_aem.rb', line 190 def user(path, name) RubyAem::Resources::User.new(@client, path, name) end |