Module: UU::OS::MetaRole
- Extended by:
- MetaRole
- Included in:
- MetaRole
- Defined in:
- uu_os_client-0.10.6/lib/uu/os/meta_role.rb,
uu_os_client-0.10.6/lib/uu/os/meta_role/meta_role_copy.rb,
uu_os_client-0.10.6/lib/uu/os/meta_role/meta_role_export.rb,
uu_os_client-0.10.6/lib/uu/os/meta_role/meta_role_create.rb,
uu_os_client-0.10.6/lib/uu/os/meta_role/meta_role_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/meta_role/meta_role_set_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/meta_role/meta_role_get_export_data.rb,
uu_os_client-0.10.6/lib/uu/os/meta_role/meta_role_add_role_interface.rb,
uu_os_client-0.10.6/lib/uu/os/meta_role/meta_role_remove_role_interface.rb,
uu_os_client-0.10.6/lib/uu/os/meta_role/meta_role_get_role_interface_list.rb,
uu_os_client-0.10.6/lib/uu/os/meta_role/meta_role_get_role_interface_list_item.rb
Overview
Module Meta Role.
Defined Under Namespace
Classes: MetaRoleAddRoleInterface, MetaRoleAttributes, MetaRoleCopy, MetaRoleCreate, MetaRoleExport, MetaRoleGetExportData, MetaRoleGetRoleInterfaceList, MetaRoleGetRoleInterfaceListItem, MetaRoleRemoveRoleInterface, MetaRoleSetAttributes
Constant Summary
- PATH =
Service path
'ues/core/role/UESMetaRole'
Instance Method Summary (collapse)
-
- (Object) add_role_interface(meta_role_uri, role_interface = nil)
This command creates new role interface connection to the specified meta role.
-
- (UU::OS::UESURI) copy(source_meta_artifact_uri, meta_role = nil)
Copy a meta role.
-
- (UU::OS::UESURI) create(location_uri, meta_role = nil)
deprecated
Deprecated.
The uuCommand MetaRole.create is used for creating meta role from the XML file temporarily. This feature will be removed in a future version and replaced by the specific uuCommands for creating template objects.
-
- (UU::OS::UESURI) export(meta_role_uri)
The uuCommand exports a meta role to the XML file, which is saved to the export storage.
-
- (UU::OS::MetaRole::MetaRoleAttributes) get_attributes(meta_role_uri)
This command returns attributes representing the meta role specified by the metaRoleUri parameter.
-
- (UU::OS::UESURI) get_export_data(meta_role_uri, meta_role = nil)
The uuCommand returns a XML file generated by the export command.
-
- (UU::OS::REST::ResultList<MetaRole::MetaRoleGetRoleInterfaceList, MetaRole::MetaRoleGetRoleInterfaceListItem>) get_role_interface_list(meta_role_uri, criteria = nil)
Returns list of the role interfaces that are added to the specified meta role.
-
- (Object) remove_role_interface(meta_role_uri, role_interface = nil)
The command removes role interface connection from the specified meta role.
-
- (UU::OS::UESURI) set_attributes(meta_role_uri, meta_role = nil)
Command for setting attributes of a meta role.
Instance Method Details
- (Object) add_role_interface(meta_role_uri, role_interface = nil)
This command creates new role interface connection to the specified meta role. The role interface has to be in an active state and must not be already added. The role interface can be added to meta role only provided that role interface is located in the same, child or parent meta model as meta role.
132 133 134 135 136 137 138 139 |
# File 'uu_os_client-0.10.6/lib/uu/os/meta_role.rb', line 132 def add_role_interface(, role_interface = nil) svc = UU::OS::REST::RemoteClient.new(MetaRole) payload = UU::OS::MetaRole::MetaRoleAddRoleInterface.new(role_interface).to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post('addRoleInterface', , payload) end end |
- (UU::OS::UESURI) copy(source_meta_artifact_uri, meta_role = nil)
Copy a meta role. The command creates a new meta role according to specified source meta role in a specified location. At the very least location meta role and name must be specified in UESMetaRoleCopy DTO. Competent role for the new meta role copy will be selected as the most suitable according to specified container and meta role (executive/authorized role with connected interface), or can be also specified in UESMetaRoleCopy DTO.
109 110 111 112 113 114 115 116 117 118 |
# File 'uu_os_client-0.10.6/lib/uu/os/meta_role.rb', line 109 def copy(, = nil) svc = UU::OS::REST::RemoteClient.new(MetaRole) svc.timeout = 120 # may take longer than default 60 seconds payload = UU::OS::MetaRole::MetaRoleCopy.new().to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('copy', , payload) return UU::OS::UESURI.new(res) end end |
- (UU::OS::UESURI) create(location_uri, meta_role = nil)
The uuCommand MetaRole.create is used for creating meta role from the XML file temporarily. This feature will be removed in a future version and replaced by the specific uuCommands for creating template objects.
The uuCommand creates a meta role from an exported XML file in the specified location. Source meta role must be derived (at least indirectly) from a meta artifact which is a part of UU.OS uuApp.
288 289 290 291 292 293 294 295 296 |
# File 'uu_os_client-0.10.6/lib/uu/os/meta_role.rb', line 288 def create(location_uri, = nil) svc = UU::OS::REST::RemoteClient.new(MetaRole) payload = UU::OS::MetaRole::MetaRoleCreate.new().to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('create', location_uri, payload) return UU::OS::UESURI.new(res) end end |
- (UU::OS::UESURI) export(meta_role_uri)
The uuCommand exports a meta role to the XML file, which is saved to the
export storage. The export is an asynchronous process.
It is possible
to wait for the end of the process. More information in
Env::Process and in REST::Future.
To get exported
data from the storage use #get_export_data.
208 209 210 211 212 213 214 215 216 |
# File 'uu_os_client-0.10.6/lib/uu/os/meta_role.rb', line 208 def export() svc = UU::OS::REST::RemoteClient.new(MetaRole) payload = UU::OS::MetaRole::MetaRoleExport.new(nil).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('export', , payload) return UU::OS::UESURI.new(res) end end |
- (UU::OS::MetaRole::MetaRoleAttributes) get_attributes(meta_role_uri)
This command returns attributes representing the meta role specified by the metaRoleUri parameter. The command does not change the state of the meta role in the system.
35 36 37 38 39 40 41 |
# File 'uu_os_client-0.10.6/lib/uu/os/meta_role.rb', line 35 def get_attributes() svc = UU::OS::REST::RemoteClient.new(MetaRole) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', ) return MetaRole::MetaRoleAttributes.new(res) end end |
- (UU::OS::UESURI) get_export_data(meta_role_uri, meta_role = nil)
The uuCommand returns a XML file generated by the export command.
235 236 237 238 239 240 241 242 243 244 245 |
# File 'uu_os_client-0.10.6/lib/uu/os/meta_role.rb', line 235 def get_export_data(, = nil) svc = UU::OS::REST::RemoteClient.new(MetaRole) dto = UU::OS::MetaRole::MetaRoleGetExportData.new() if dto.requested_mime_type svc.add_parameter('requestedMimeType', dto.requested_mime_type) end UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getExportData', ) return UU::OS::REST::BinaryValue.new(res, true) end end |
- (UU::OS::REST::ResultList<MetaRole::MetaRoleGetRoleInterfaceList, MetaRole::MetaRoleGetRoleInterfaceListItem>) get_role_interface_list(meta_role_uri, criteria = nil)
Returns list of the role interfaces that are added to the specified meta role. The list of returned interfaces could be filtered by the name or code. Returned list does not contain any objects filtered out by executed UESQuery. The list is sorted by the name (and codes in case are equal) of an interface by default.
160 161 162 163 164 165 166 167 168 169 170 |
# File 'uu_os_client-0.10.6/lib/uu/os/meta_role.rb', line 160 def get_role_interface_list(, criteria = nil) svc = UU::OS::REST::RemoteClient.new(MetaRole) dto = MetaRole::MetaRoleGetRoleInterfaceList.new(criteria) svc.add_parameter('pageIndex', dto.page_index) svc.add_parameter('pageSize', dto.page_size) svc.add_parameter('query', dto.query) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getRoleInterfaceList', ) return UU::OS::REST::ResultList.new(MetaRole::MetaRoleGetRoleInterfaceList, MetaRole::MetaRoleGetRoleInterfaceListItem, res) end end |
- (Object) remove_role_interface(meta_role_uri, role_interface = nil)
The command removes role interface connection from the specified meta role. Only added interfaces can be removed from meta role.
182 183 184 185 186 187 188 189 |
# File 'uu_os_client-0.10.6/lib/uu/os/meta_role.rb', line 182 def remove_role_interface(, role_interface = nil) svc = UU::OS::REST::RemoteClient.new(MetaRole) payload = UU::OS::MetaRole::MetaRoleRemoveRoleInterface.new(role_interface).to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post('removeRoleInterface', , payload) end end |
- (UU::OS::UESURI) set_attributes(meta_role_uri, meta_role = nil)
Command for setting attributes of a meta role. The command cannot modify references to objects like location, competent role and so on.
66 67 68 69 70 71 72 73 74 |
# File 'uu_os_client-0.10.6/lib/uu/os/meta_role.rb', line 66 def set_attributes(, = nil) svc = UU::OS::REST::RemoteClient.new(MetaRole) payload = UU::OS::MetaRole::MetaRoleSetAttributes.new().to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', , payload) return UU::OS::UESURI.new(res) end end |