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
-
#bundle(name) ⇒ Object
Create a bundle instance.
-
#config_property(name, type, value) ⇒ Object
Create a config property instance.
-
#flush_agent(name, run_mode) ⇒ 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.
-
#package(group_name, package_name, package_version) ⇒ Object
Create a package instance.
-
#path(name) ⇒ Object
Create a path instance.
-
#replication_agent(name, run_mode) ⇒ Object
Create a replication agent instance.
-
#repository ⇒ Object
Create a repository 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
-
password: password used to authenticate to AEM instance
-
protocol: AEM instance protocol (http or https)
-
host: AEM instance host name
-
port: AEM instance port
-
debug: if true, then additional debug messages will be included
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/ruby_aem.rb', line 45 def initialize(conf = {}) conf[:username] ||= 'admin' conf[:password] ||= 'admin' conf[:protocol] ||= 'http' conf[:host] ||= 'localhost' conf[:port] ||= 4502 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.debugging = conf[:debug], swagger_conf.params_encoding = :multi ]} apis = { :console => SwaggerAemClient::ConsoleApi.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
#bundle(name) ⇒ Object
Create a bundle instance.
78 79 80 |
# File 'lib/ruby_aem.rb', line 78 def bundle(name) RubyAem::Resources::Bundle.new(@client, name) end |
#config_property(name, type, value) ⇒ Object
Create a config property instance.
96 97 98 |
# File 'lib/ruby_aem.rb', line 96 def config_property(name, type, value) RubyAem::Resources::ConfigProperty.new(@client, name, type, value) end |
#flush_agent(name, run_mode) ⇒ Object
Create a flush agent instance.
105 106 107 |
# File 'lib/ruby_aem.rb', line 105 def flush_agent(name, run_mode) RubyAem::Resources::FlushAgent.new(@client, name, run_mode) end |
#group(path, name) ⇒ Object
Create a group instance.
114 115 116 |
# File 'lib/ruby_aem.rb', line 114 def group(path, name) RubyAem::Resources::Group.new(@client, path, name) end |
#node(path, name) ⇒ Object
Create a node instance.
123 124 125 |
# File 'lib/ruby_aem.rb', line 123 def node(path, name) RubyAem::Resources::Node.new(@client, path, name) end |
#package(group_name, package_name, package_version) ⇒ Object
Create a package instance.
133 134 135 |
# File 'lib/ruby_aem.rb', line 133 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.
86 87 88 |
# File 'lib/ruby_aem.rb', line 86 def path(name) RubyAem::Resources::Path.new(@client, name) end |
#replication_agent(name, run_mode) ⇒ Object
Create a replication agent instance.
142 143 144 |
# File 'lib/ruby_aem.rb', line 142 def replication_agent(name, run_mode) RubyAem::Resources::ReplicationAgent.new(@client, name, run_mode) end |
#repository ⇒ Object
Create a repository instance.
149 150 151 |
# File 'lib/ruby_aem.rb', line 149 def repository RubyAem::Resources::Repository.new(@client) end |
#user(path, name) ⇒ Object
Create a user instance.
158 159 160 |
# File 'lib/ruby_aem.rb', line 158 def user(path, name) RubyAem::Resources::User.new(@client, path, name) end |