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.
-
#aem_configmgr ⇒ Object
Create an AEM ConfigMgr instance.
-
#authorizable_keystore(intermediate_path, authorizable_id) ⇒ Object
Create a Keystore instance for given authorizable id.
-
#bundle(name) ⇒ Object
Create a bundle instance.
-
#certificate(serial_number) ⇒ Object
Create a certificate instance.
-
#certificate_chain(private_key_alias, keystore_intermediate_path, keystore_authorizable_id) ⇒ Object
# Create a certificate chain 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.
-
#saml ⇒ Object
Create a Saml instance.
-
#sanitise_conf(conf) ⇒ Object
Set default configuration values and handle numeric/boolean String values.
-
#ssl ⇒ Object
Create a SSL instance.
-
#truststore ⇒ Object
Create a Truststore 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
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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/ruby_aem.rb', line 54 def initialize(conf = {}) sanitise_conf(conf) SwaggerAemClient.configure { |swagger_conf| [ swagger_conf.scheme = conf[:protocol], swagger_conf.host = "#{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.verify_ssl = conf[:verify_ssl], swagger_conf.verify_ssl_host = conf[:verify_ssl], swagger_conf.params_encoding = :multi ] } SwaggerAemOsgiClient.configure { |swagger_conf| [ swagger_conf.scheme = conf[:protocol], swagger_conf.host = "#{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.verify_ssl = conf[:verify_ssl], swagger_conf.verify_ssl_host = conf[:verify_ssl], swagger_conf.params_encoding = :multi ] } apis = { console: SwaggerAemClient::ConsoleApi.new, configmgr: SwaggerAemOsgiClient::ConfigmgrApi.new, custom: SwaggerAemClient::CustomApi.new, cq: SwaggerAemClient::CqApi.new, crx: SwaggerAemClient::CrxApi.new, sling: SwaggerAemClient::SlingApi.new, granite: SwaggerAemClient::GraniteApi.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.
119 120 121 |
# File 'lib/ruby_aem.rb', line 119 def aem RubyAem::Resources::Aem.new(@client) end |
#aem_configmgr ⇒ Object
Create an AEM ConfigMgr instance.
126 127 128 |
# File 'lib/ruby_aem.rb', line 126 def aem_configmgr RubyAem::Resources::AemConfigMgr.new(@client) end |
#authorizable_keystore(intermediate_path, authorizable_id) ⇒ Object
Create a Keystore instance for given authorizable id.
187 188 189 |
# File 'lib/ruby_aem.rb', line 187 def (intermediate_path, ) RubyAem::Resources::AuthorizableKeystore.new(@client, intermediate_path, ) end |
#bundle(name) ⇒ Object
Create a bundle instance.
134 135 136 |
# File 'lib/ruby_aem.rb', line 134 def bundle(name) RubyAem::Resources::Bundle.new(@client, name) end |
#certificate(serial_number) ⇒ Object
Create a certificate instance.
142 143 144 |
# File 'lib/ruby_aem.rb', line 142 def certificate(serial_number) RubyAem::Resources::Certificate.new(@client, serial_number) end |
#certificate_chain(private_key_alias, keystore_intermediate_path, keystore_authorizable_id) ⇒ Object
# Create a certificate chain instance. # # @return new RubyAem::Resources::CertificateChain instance
152 153 154 |
# File 'lib/ruby_aem.rb', line 152 def certificate_chain(private_key_alias, keystore_intermediate_path, ) RubyAem::Resources::CertificateChain.new(@client, private_key_alias, keystore_intermediate_path, ) end |
#config_property(name, type, value) ⇒ Object
Create a config property instance.
162 163 164 |
# File 'lib/ruby_aem.rb', line 162 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.
171 172 173 |
# File 'lib/ruby_aem.rb', line 171 def flush_agent(run_mode, name) RubyAem::Resources::FlushAgent.new(@client, run_mode, name) end |
#group(path, name) ⇒ Object
Create a group instance.
180 181 182 |
# File 'lib/ruby_aem.rb', line 180 def group(path, name) RubyAem::Resources::Group.new(@client, path, name) end |
#node(path, name) ⇒ Object
Create a node instance.
196 197 198 |
# File 'lib/ruby_aem.rb', line 196 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.
232 233 234 |
# File 'lib/ruby_aem.rb', line 232 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.
206 207 208 |
# File 'lib/ruby_aem.rb', line 206 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.
214 215 216 |
# File 'lib/ruby_aem.rb', line 214 def path(name) RubyAem::Resources::Path.new(@client, name) end |
#replication_agent(run_mode, name) ⇒ Object
Create a replication agent instance.
223 224 225 |
# File 'lib/ruby_aem.rb', line 223 def replication_agent(run_mode, name) RubyAem::Resources::ReplicationAgent.new(@client, run_mode, name) end |
#repository ⇒ Object
Create a repository instance.
248 249 250 |
# File 'lib/ruby_aem.rb', line 248 def repository RubyAem::Resources::Repository.new(@client) end |
#reverse_replication_agent(run_mode, name) ⇒ Object
Create a reverse replication agent instance.
241 242 243 |
# File 'lib/ruby_aem.rb', line 241 def reverse_replication_agent(run_mode, name) RubyAem::Resources::ReverseReplicationAgent.new(@client, run_mode, name) end |
#saml ⇒ Object
Create a Saml instance.
255 256 257 |
# File 'lib/ruby_aem.rb', line 255 def saml RubyAem::Resources::Saml.new(@client) end |
#sanitise_conf(conf) ⇒ Object
Set default configuration values and handle numeric/boolean String values
101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/ruby_aem.rb', line 101 def sanitise_conf(conf) conf[:username] ||= 'admin' conf[:password] ||= 'admin' conf[:protocol] ||= 'http' conf[:host] ||= 'localhost' conf[:port] ||= 4502 conf[:timeout] ||= 300 # handle custom configuration value being passed as a String # e.g. when the values are passed via environment variables conf[:port] = conf[:port].to_i conf[:timeout] = conf[:timeout].to_i conf[:verify_ssl] = conf[:verify_ssl] == 'true' if conf[:verify_ssl].is_a? String conf[:debug] = conf[:debug] == 'true' if conf[:debug].is_a? String end |
#ssl ⇒ Object
Create a SSL instance.
262 263 264 |
# File 'lib/ruby_aem.rb', line 262 def ssl RubyAem::Resources::Ssl.new(@client) end |
#truststore ⇒ Object
Create a Truststore instance.
269 270 271 |
# File 'lib/ruby_aem.rb', line 269 def truststore RubyAem::Resources::Truststore.new(@client) end |
#user(path, name) ⇒ Object
Create a user instance.
278 279 280 |
# File 'lib/ruby_aem.rb', line 278 def user(path, name) RubyAem::Resources::User.new(@client, path, name) end |