Module: UU::OS::Command
- Extended by:
- Command
- Included in:
- Command
- Defined in:
- uu_os-0.29.16/lib/uu/os/command.rb,
uu_os-0.29.16/lib/uu/os/command/command_create.rb,
uu_os-0.29.16/lib/uu/os/command/command_export.rb,
uu_os-0.29.16/lib/uu/os/command/command_attributes.rb,
uu_os-0.29.16/lib/uu/os/command/command_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/command/command_get_export_data.rb
Overview
Module Command.
Defined Under Namespace
Classes: CommandAttributes, CommandCreate, CommandExport, CommandGetExportData, CommandSetAttributes
Constant Summary
- PATH =
Service path
'uu/os/Command'
Instance Method Summary (collapse)
-
- (UU::OS::UESURI) create(location_uri, criteria = nil)
The command creates a command in a specified location.
-
- (void) delete(uri)
The command deletes the specified command from the system.
-
- (UU::OS::UESURI) export(uri)
Exports a command to the XML file, which is saved to the export storage.
-
- (CommandAttributes) get_attributes(command_uri)
This command returns attributes representing the command specified by the command_uri parameter.
-
- (UU::OS::REST::BinaryValue) get_export_data(command_uri, command = nil)
Returns a XML file generated by the export command export.
-
- (UU::OS::UESURI) set_attributes(uri, criteria = nil)
The command for setting attributes of a specified command.
Instance Method Details
- (UU::OS::UESURI) create(location_uri, criteria = nil)
The command creates a command in a specified location. At the very least meta artifact must be specified in CommandCreate Object. Competent role for the new command will be selected as the most suitable according to specified container and meta artifact (executive/authorized role with connected interface), or can be also specified in CommandCreate Object.
43 44 45 46 47 48 49 50 51 |
# File 'uu_os-0.29.16/lib/uu/os/command.rb', line 43 def create(location_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Command) payload = UU::OS::Command::CommandCreate.new(criteria).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('create', location_uri, payload) return UU::OS::UESURI.new(res) end end |
- (void) delete(uri)
This method returns an undefined value.
The command deletes the specified command from the system. The command fails when the specified command is referenced by some use case.
63 64 65 66 67 68 |
# File 'uu_os-0.29.16/lib/uu/os/command.rb', line 63 def delete(uri) svc = UU::OS::REST::RemoteClient.new(Command) UU::OS::QoS::QoSHandler.auto_retry do svc.post('delete', uri) end end |
- (UU::OS::UESURI) export(uri)
129 130 131 132 133 134 135 136 137 |
# File 'uu_os-0.29.16/lib/uu/os/command.rb', line 129 def export(uri) svc = UU::OS::REST::RemoteClient.new(Command) payload = UU::OS::Command::CommandExport.new(nil).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('export', uri, payload) return UU::OS::UESURI.new(res) end end |
- (CommandAttributes) get_attributes(command_uri)
This command returns attributes representing the command specified by the command_uri parameter.
79 80 81 82 83 84 85 |
# File 'uu_os-0.29.16/lib/uu/os/command.rb', line 79 def get_attributes(command_uri) svc = UU::OS::REST::RemoteClient.new(Command) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', command_uri) return Command::CommandAttributes.new(res) end end |
- (UU::OS::REST::BinaryValue) get_export_data(command_uri, command = nil)
Returns a XML file generated by the export command export.
156 157 158 159 160 161 162 163 164 165 |
# File 'uu_os-0.29.16/lib/uu/os/command.rb', line 156 def get_export_data(command_uri, command = nil) svc = UU::OS::REST::RemoteClient.new(Command) dto = UU::OS::Command::CommandGetExportData.new(command) if dto.requested_mime_type svc.add_parameter('requestedMimeType', dto.requested_mime_type) end UU::OS::QoS::QoSHandler.auto_retry do return svc.get_binary('getExportData', command_uri) end end |
- (UU::OS::UESURI) set_attributes(uri, criteria = nil)
The command for setting attributes of a specified command. The command can't modify references to objects like storage, competent role and so on.
106 107 108 109 110 111 112 113 114 |
# File 'uu_os-0.29.16/lib/uu/os/command.rb', line 106 def set_attributes(uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Command) payload = UU::OS::Command::CommandSetAttributes.new(criteria).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setAttributes', uri, payload) return UU::OS::UESURI.new(res) end end |