Module: UU::OS::QoS
- Extended by:
- QoS
- Included in:
- QoS
- Defined in:
- uu_os_framework-0.29.16/lib/uu/os/qos.rb,
uu_os_framework-0.29.16/lib/uu/os/qos/qos_handler.rb,
uu_os_framework-0.29.16/lib/uu/os/qos/territory_get_qos.rb,
uu_os_framework-0.29.16/lib/uu/os/qos/territory_set_qos.rb,
uu_os_framework-0.29.16/lib/uu/os/qos/access_role_set_qos.rb,
uu_os_framework-0.29.16/lib/uu/os/qos/access_role_get_qos.rb,
uu_os_framework-0.29.16/lib/uu/os/qos/qos_limit_exception.rb
Overview
The QoS service is used for getting and setting a QoS to the access roles or territory.
Defined Under Namespace
Modules: QoSHandler Classes: AccessRoleGetQoS, AccessRoleSetQoS, QoSLimitException, TerritoryGetQoS, TerritorySetQoS
Constant Summary
- PATH =
Service path
'/ues/core/qos/UESQoS'
Instance Method Summary (collapse)
-
- (UU::OS::QoS::AccessRoleGetQoS) get_access_role_qos(acr_uri)
Returns a DTO representing QoS for a specific access role.
-
- (UU::OS::QoS::TerritoryGetQoS) get_territory_qos(territory_uri)
Returns a DTO representing QoS for a specific territory.
-
- (void) set_access_role_qos(acr_uri, qos = nil)
Sets QoS for a specific access role.
-
- (void) set_territory_qos(territory_uri, qos = nil)
Sets QoS for a specific territory.
Instance Method Details
- (UU::OS::QoS::AccessRoleGetQoS) get_access_role_qos(acr_uri)
Returns a DTO representing QoS for a specific access role. The values represents a requests limit per particular period. Special values are 0 (no request is allowed) and -1 (unlimited).
120 121 122 123 124 125 126 127 128 129 |
# File 'uu_os_framework-0.29.16/lib/uu/os/qos.rb', line 120 def get_access_role_qos(acr_uri) svc = UU::OS::REST::RemoteClient.new(QoS) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get(:getAccessRoleQoS, acr_uri) if !(res.nil? || res.empty?) return UU::OS::QoS::AccessRoleGetQoS.new(res) end end end |
- (UU::OS::QoS::TerritoryGetQoS) get_territory_qos(territory_uri)
Returns a DTO representing QoS for a specific territory. The values represents a requests limit per particular period. Special values are 0 (no request is allowed) and -1 (unlimited).
36 37 38 39 40 41 42 43 44 45 46 |
# File 'uu_os_framework-0.29.16/lib/uu/os/qos.rb', line 36 def get_territory_qos(territory_uri) svc = UU::OS::REST::RemoteClient.new(QoS) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get(:getTerritoryQoS, territory_uri) if !(res.nil? || res.empty?) return UU::OS::QoS::TerritoryGetQoS.new(res) end end end |
- (void) set_access_role_qos(acr_uri, qos = nil)
This method returns an undefined value.
Sets QoS for a specific access role. You must specify at least one value from AccessRoleSetQoS DTO provided as parameter 'qos'. If you don't define some values in the DTO, so they stay untouched for existing QoS limits. If no QoS exists for the access role, than new one is created and undefined parameters in DTO are set to -1 (unlimited). Special values are 0 (no request is allowed) and -1 (unlimited).
172 173 174 175 176 177 178 179 180 181 |
# File 'uu_os_framework-0.29.16/lib/uu/os/qos.rb', line 172 def set_access_role_qos(acr_uri, qos = nil) svc = UU::OS::REST::RemoteClient.new(QoS) dto = UU::OS::QoS::AccessRoleSetQoS.new(qos).to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post(:setAccessRoleQoS, acr_uri, dto) end end |
- (void) set_territory_qos(territory_uri, qos = nil)
If you set at least one value to zero ( = 0, means all remote calls to territory are forbidden and ends up with QoS exception ) you will not be able to call this API for the territory anymore and set the QoS back. Setting QoS to zero isn’t what you probably want.
This method returns an undefined value.
Sets QoS for a specific territory. You must specify at least one value from TerritorySetQoS DTO provided as parameter 'qos'. If you don't define some values in the DTO so they stay untouched for existing QoS limits. If no QoS exists for the territory, than new one is created and undefined parameters in DTO are set to -1 (unlimited). Special values are 0 (no request is allowed) and -1 (unlimited).
88 89 90 91 92 93 94 95 96 |
# File 'uu_os_framework-0.29.16/lib/uu/os/qos.rb', line 88 def set_territory_qos(territory_uri, qos = nil) svc = UU::OS::REST::RemoteClient.new(QoS) dto = UU::OS::QoS::TerritorySetQoS.new(qos).to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post(:setTerritoryQoS, territory_uri, dto) end end |