Class: UU::OperationRegistry::Resource
- Inherits:
-
BaseMethods
- Object
- BaseMethods
- UU::OperationRegistry::Resource
- Defined in:
- lib/uu/operation_registry/resource.rb
Overview
Resource.
Class Method Summary collapse
-
.create(resource_group_uri, attributes) ⇒ UU::OS::UESURI
Creates a new resource.
-
.delete(resource_uri, parameters = {}) ⇒ void
Deletes the specified resource from the registry.
-
.get_attributes(resource_uri) ⇒ Hash
Gets the attributes of the resource specified by resource URI and returns its detail.
-
.get_resource_list(resource_uri, criteria = {}) ⇒ UU::OS::Persistence::PagedResult<Hash>
Returns list of resources.
-
.set_attributes(resource_uri, attributes) ⇒ UU::OS::UESURI
Sets attributes of an resource.
Instance Method Summary collapse
-
#create(resource_group_uri, attributes) ⇒ Object
Creates a new resource.
-
#delete(resource_uri, parameters = {}) ⇒ void
Deletes the specified resource from the registry.
-
#get_attributes(resource_uri) ⇒ Hash
Gets the attributes of the resource specified by resource URI and returns its detail.
-
#get_resource_list(resource_group_uri, criteria = {}) ⇒ UU::OS::Persistence::PagedResult<Hash>
Returns a list of resources at the given resourceGroup.
-
#initialize(session = nil) ⇒ Resource
constructor
Creates a new instance of
Resource
. -
#set_attributes(resource_uri, attributes) ⇒ UU::OS::UESURI
Sets attributes of an resource.
Constructor Details
#initialize(session = nil) ⇒ Resource
Creates a new instance of Resource
.
18 19 20 |
# File 'lib/uu/operation_registry/resource.rb', line 18 def initialize(session = nil) super end |
Class Method Details
.create(resource_group_uri, attributes) ⇒ UU::OS::UESURI
Creates a new resource. This method is a convenience shortcut for the #create instance method.
|
# File 'lib/uu/operation_registry/resource.rb', line 33
|
.delete(resource_uri, parameters = {}) ⇒ void
This method returns an undefined value.
Deletes the specified resource from the registry. This method is a convenience shortcut for the #delete instance method.
100 101 102 |
# File 'lib/uu/operation_registry/resource.rb', line 100 def self.delete(resource_uri, parameters = {}) self.new(UU::OS::Security::Session.current_session).delete(resource_uri, parameters) end |
.get_attributes(resource_uri) ⇒ Hash
Gets the attributes of the resource specified by resource URI and returns its detail. This method is a convenience shortcut for the #get_attributes instance method.
|
# File 'lib/uu/operation_registry/resource.rb', line 46
|
.get_resource_list(resource_uri, criteria = {}) ⇒ UU::OS::Persistence::PagedResult<Hash>
Returns list of resources. This method is a convenience shortcut for the #get_resource_list instance method.
126 127 128 |
# File 'lib/uu/operation_registry/resource.rb', line 126 def self.get_resource_list(resource_uri, criteria = {}) self.new(UU::OS::Security::Session.current_session).get_resource_list(resource_uri, criteria) end |
.set_attributes(resource_uri, attributes) ⇒ UU::OS::UESURI
Sets attributes of an resource. This method is a convenience shortcut for the #set_attributes instance method.
|
# File 'lib/uu/operation_registry/resource.rb', line 66
|
Instance Method Details
#create(resource_group_uri, attributes) ⇒ Object
Creates a new resource.
|
# File 'lib/uu/operation_registry/resource.rb', line 22
|
#delete(resource_uri, parameters = {}) ⇒ void
This method returns an undefined value.
Deletes the specified resource from the registry.
Resource can be successfully deleted if all these conditions are met:
-
no GatewayDomainLink exists referencing this resource (via
gatewayUri
)
92 93 94 |
# File 'lib/uu/operation_registry/resource.rb', line 92 def delete(resource_uri, parameters = {}) client.invoke(:delete, resource_uri, parameters: parameters) end |
#get_attributes(resource_uri) ⇒ Hash
Gets the attributes of the resource specified by resource URI and returns its detail.
|
# File 'lib/uu/operation_registry/resource.rb', line 40
|
#get_resource_list(resource_group_uri, criteria = {}) ⇒ UU::OS::Persistence::PagedResult<Hash>
Returns a list of resources at the given resourceGroup. Command does not return all resources, only a sublist. The list of returned resources could be filtered using Mongo Query.
117 118 119 |
# File 'lib/uu/operation_registry/resource.rb', line 117 def get_resource_list(resource_group_uri, criteria = {}) @client.invoke(:getResourceList, resource_group_uri, parameters: criteria) end |
#set_attributes(resource_uri, attributes) ⇒ UU::OS::UESURI
Sets attributes of an resource.
|
# File 'lib/uu/operation_registry/resource.rb', line 53
|