Class: OvirtSDK4::UserOptionsService
- Defined in:
- lib/ovirtsdk4/services.rb,
lib/ovirtsdk4/services.rb
Instance Method Summary collapse
-
#add(option, opts = {}) ⇒ UserOption
Adds a new user profile property of type JSON.
-
#list(opts = {}) ⇒ Array<UserOption>
Returns a list of user profile properties of type JSON.
-
#option_service(id) ⇒ UserOptionService
Locates the
option
service. -
#service(path) ⇒ Service
Locates the service corresponding to the given path.
Methods inherited from Service
Instance Method Details
#add(option, opts = {}) ⇒ UserOption
Adds a new user profile property of type JSON.
Example request(for user with identifier 123
):
POST /ovirt-engine/api/users/123/options
Payload:
<user_option>
<name>SomeName</name>
<content>["any", "JSON"]</content>
</user_option>
29736 29737 29738 |
# File 'lib/ovirtsdk4/services.rb', line 29736 def add(option, opts = {}) internal_add(option, UserOption, ADD, opts) end |
#list(opts = {}) ⇒ Array<UserOption>
Returns a list of user profile properties of type JSON.
Example request(for user with identifier 123
):
GET /ovirt-engine/api/users/123/options
The result will be the following XML document:
<user_options>
<user_option href="/ovirt-engine/api/users/123/options/456" id="456">
<name>SomeName</name>
<content>["any", "JSON"]</content>
<user href="/ovirt-engine/api/users/123" id="123"/>
</user_option>
</user_options>
29781 29782 29783 |
# File 'lib/ovirtsdk4/services.rb', line 29781 def list(opts = {}) internal_get(LIST, opts) end |
#option_service(id) ⇒ UserOptionService
Locates the option
service.
29792 29793 29794 |
# File 'lib/ovirtsdk4/services.rb', line 29792 def option_service(id) UserOptionService.new(self, id) end |
#service(path) ⇒ Service
Locates the service corresponding to the given path.
29803 29804 29805 29806 29807 29808 29809 29810 29811 29812 |
# File 'lib/ovirtsdk4/services.rb', line 29803 def service(path) if path.nil? || path == '' return self end index = path.index('/') if index.nil? return option_service(path) end return option_service(path[0..(index - 1)]).service(path[(index + 1)..-1]) end |