Group Update: Domain Scope of the File Source

Overview

A configuration with Source type = File targets the devices of an imported XML file. The import keeps the list in memory. Each imported device carries its domain (the ACS cpe.location_id).

The list, the count and the save use the same domain scope. A caller never sees or saves an imported device outside this scope. The same rule applies to every owner type: GroupUpdate, Monitoring, Automation and FCC.

The import store

PUT /GroupUpdate/devices/import reads the serial numbers of the file. The service resolves the serial numbers to ACS device ids. It then reads the domain of every resolved device with one query for each batch of up to 1000 devices. A batch without a resolved device sends no query.

The store keeps these values:

  • the device id;

  • the serial number;

  • the domain id. The value is empty when the device has no location_id.

The store captures the domain of a device at import time. The list, the count and the save trust this value until the entry expires after 30 minutes. If an administrator moves a device to another domain in the meantime, the device stays bounded by its old domain until the next import.

The import refuses an XML file with a DOCTYPE or an external entity. The request fails with the existing invalid-file error 9144 (File not found), and the service stores nothing.

Property Value

Key

UG-<product class group id> in the import store of the session of the caller.

Lifetime

30 minutes (IMPORT_TTL in ImportService).

Location

The memory of one ui-backend JVM.

Old format

A stored value in an older format is treated as a missing key. See A missing store.

The store is local to one JVM. If you run several ui-backend replicas, route all requests of one user session to the same replica (session affinity). A request that reaches another replica finds no store.

The target domain scope

TargetDomainResolver computes the scope once for each request.

Situation Scope

The request has no owner (ownerId empty, null, 0 or negative).

The domain scope of the caller.

The owner is saved and belongs to the super domain.

The domain scope of the caller.

The owner is saved and belongs to another domain.

The subtree of the domain of the owner, limited to the domain scope of the caller. The scope is never wider than the scope of the caller.

The owner is an FCC test, and the caller is restricted.

As above. If the subtree has no domain in common with the caller scope, the request fails with 9213.

A super domain caller has no restriction. The scope is then "all domains".

For ownerType=FCC, the domain of the test comes from ft-fcc-service. A failure of this lookup stops the request with 9213 or 9211. See The test domain lookup.

The filter

  • A device with a domain stays in the result if the scope is "all domains", or if the scope contains the domain of the device.

  • A device without a domain stays only if the scope is "all domains". A restricted caller never sees it.

  • The search term is applied after the domain filter.

Endpoints

Endpoint Behaviour

POST /GroupUpdate/devices with sourceType=File

Filters the imported list once for the request. The items of the page and the total use the same filter, so they agree.

POST /GroupUpdate/activate/devices/countByGroupConfigs

The request has two new optional fields, ownerId and ownerType. The count of every config uses the scope above, for every source type. Without ownerId, the count uses the scope of the caller, as before.

PUT /GroupUpdate/groups/details

For each File config, the service reads the imported ids that are inside the scope. The scope is computed only when the request has a File config.

Which domain the save uses

Request Owner domain

Edit (id greater than 0)

The stored domain of the group.

Create

The locationId of the request. If it is empty, the domain of the caller.

On an edit, the device ids already stored for the config are kept. The save does not narrow them. The ids in unselectedDevices are removed from the result.

A missing store

The store is missing when the 30 minutes have passed, when another replica handles the request, or when the stored value has an old format. The endpoints behave in different ways.

Endpoint Result

POST /GroupUpdate/devices

Error 9122 (Cannot get object from the store).

PUT /GroupUpdate/groups/details

Error 9122.

POST /GroupUpdate/activate/devices/countByGroupConfigs

The count of the File config is 0. The count does not break the dialog.

A failure of the owner lookup is not a missing store. The count does not hide it. The request fails with 9213 or 9211. The list endpoint POST /GroupUpdate/devices answers the same way: 404 with 9213 if the FCC test is not found or not visible, and 502 with 9211 if ft-fcc-service cannot be read.

Limits

  • Import the file again after 30 minutes or after a change of replica.

  • The import still resolves one serial number for each query. The domain query is added to it.

  • The Monitoring and Automation saves read the devices that the client sends in selectedDevices. They do not read the import store. The domain filter of the save applies only to Group Update File configs.