Device selection

The device set of a campaign starts as a selection. A selection is one of three things. It is a set of conditions over the catalog of the Auto Configuration Server (ACS), a list of serial numbers, or an uploaded file. It ends as rows in fcc_test_device, and the service never refreshes those rows.

The HTTP surface is on POST /FCC/devices/resolve and POST /FCC/devices/count. The content of the rows is on fcc_test_device.

One path, three callers

One read path serves every caller.

Caller What it asks for

POST /FCC/devices/resolve

The fleet, one page of it, and every counter.

POST /FCC/devices/count

The same, without the page.

PUT /FCC/item/details

The same again. The save adds one rule: an unresolved serial number fails the save.

One implementation is a requirement, not tidiness. The count is what the wizard shows while the operator chooses. The save is what the service stores. Two implementations would let an operator store a fleet other than the fleet on the screen, and both numbers would look consistent.

A save with an explicit device list is validated first and then resolved by the same read, with an id predicate.

The save stays inside the domain of the campaign

The save resolves all four sources inside one bound. The sources are All, Condition, Individual and File. The bound is the subtree of the domain where the campaign was created, intersected with the scope of the editor. The editor can be in another domain than the campaign. The editor never gets the whole scope of the editor.

Source Effect of the bound

All and Condition

The read resolves the fleet again inside the bound on every save.

Individual and File

The read finds each submitted id inside the bound only. An id outside the bound answers HTTP 400.

The bound fails closed. If the domain of the campaign has no subtree any more, the update answers HTTP 400 the domain of test id=<n> no longer exists. The service never falls back to the scope of the editor.

A create is bound too. The bound of a create is the body field domainId of a caller with the scope ALL. If that domain does not exist, the create answers HTTP 400 the domain id=<n> of the new test does not exist before anything is saved. See The domain of a new campaign.

A campaign in the super domain has no subtree to read. Its bound is the scope of the editor.

The two preview endpoints keep the scope of the caller. POST /FCC/devices/resolve and POST /FCC/devices/count have no campaign, so they have no bound.

The rules for a campaign saved before the bound existed are on The fleet stays inside the domain of the campaign.

The three device sources

The source type decides which half of the request the service reads. There is no default value. A guess from the filled fields turns a request for twelve serial numbers into a request for the whole installation.

Source type What the service reads

CONDITION

The condition block. The block is required, and an absent block is HTTP 400. It never means every device. The serial list is ignored, and both serial reports come back empty.

INDIVIDUAL

The serial list. The list is required and must not be empty. A condition block is reduced to the online flag and the domain list.

FILE

The serial numbers from the uploaded part. The rules of INDIVIDUAL apply after the parse.

The conditions

The condition block holds a fixed set of named fields. It is not a map, not a list of column and operator triples, and never a query fragment.

Every caller reaches this service through the UI Backend, and the service has no authentication of its own. A condition the caller spells freely is a query this service never meant to run. The set of fields below is therefore closed.

Every field is optional. An empty field means not filtered. Present fields combine with AND, and the service never combines two different fields with OR.

Field Type SQL Notes

manufacturerIds

Number list

pc.manuf_id IN (…​)

manufacturers

Text list

UPPER(m.name) IN (…​) and the group fallback

The service trims, upper-cases and de-duplicates the values before the comparison.

modelIds

Number list

pc.id IN (…​)

The form the catalog offers.

models

Text list

pc.model IN (…​)

Exact match, and not upper-cased.

productClassGroupIds

Number list

pc.group_id IN (…​)

firmwares

Text list

c.firmware IN (…​)

Exact match.

protocols

Text list

c.protocol_id IN (…​), with a second arm

The wire carries protocol names, never the number. See An empty protocol means TR-069.

serialContains

Text

c.serial LIKE :p ESCAPE '!'

The service escapes the wildcards in the value. See serialContains matches the wildcards literally.

onlyOnline

true or false

c.is_online = 1

true narrows the selection. false and absent mean the same thing.

domainIds

Number list

c.location_id IN (…​), or in memory

Narrows inside the scope of the caller only. See An empty intersection selects nothing.

Two more fields never come from a condition block. The serial list comes from the two serial sources, and the device id list comes from the save path. No caller sets both.

A condition list with more than 1000 entries is refused with HTTP 400. A condition list is sized by the catalog, so an oversized list is a malformed request.

The serial file format

The accepted shapes are wide on purpose. A file from a spreadsheet has one serial number per line. A file from a ticket system is comma separated. A list from an email is neither. A refusal would only mean an operator reformats thousands of lines by hand and loses one of them.

Rule Detail

Encoding

UTF-8 always, never the platform character set. The file comes from the machine of the operator and the service reads it in a container.

Byte order mark

The service drops a leading byte order mark. Windows tools add it, and otherwise the first serial number of every file is not found.

Line breaks

Every form: LF, CRLF, CR and the Unicode line separators.

Separators in a line

Comma, semicolon or any whitespace. This covers tab and space separated exports.

Comments

The service skips a line with # as its first visible character.

Blank lines

Skipped.

Duplicates

Removed without regard to case. The first spelling wins. The default MySQL collation ignores case and the Oracle one does not, so the same file must behave the same way.

Reported spelling

Your own. The report of missing serial numbers echoes the file, so you can search for that exact text.

Size

More than ft.fcc.max-devices-per-test distinct serial numbers is HTTP 400, before the first query.

The same normalisation applies to a serial list in a JSON body. A pasted list and an uploaded file therefore agree about a repeated serial number.

The upload limit

Property Default Meaning

spring.servlet.multipart.max-file-size

10MB

The largest accepted file part.

spring.servlet.multipart.max-request-size

10MB

The largest whole request. One environment variable feeds both properties, so a change stays coherent.

The limit exists because the service reads the upload whole into memory. It has no authentication of its own, so an unbounded upload is a denial of service for anyone on the network. 10 MB is far above the need of a 20000-line list, because 20 characters per line are about 400 KB.

An oversized upload answers HTTP 413 with FT code 9413 and names the maximum. A missing file part answers HTTP 400 with FT code 9400. A part with an unsupported content type answers HTTP 415 with FT code 9415. See the multipart status codes.

An XML device file

An XML device file is imported through PUT /GroupUpdate/devices/import and listed through POST /GroupUpdate/devices with sourceType=File, as Automation and Monitoring do. The chosen cpe ids are saved as selectedDevices on PUT /FCC/item/details.

The UI must send every cpe id of the file in selectedDevices. The service has no copy of the imported file. It resolves the ids that the request carries, and an id the UI leaves out is not in the fleet. The ids stay inside the domain bound of the campaign. See The save stays inside the domain of the campaign.

The frozen fleet

The save replaces the fleet inside one transaction. It deletes the rows of the campaign and inserts the new rows.

The fleet is replaced as a whole and never compared row by row. A comparison would need an identity beyond the campaign and the device, and there is none.

Every stored value comes from the ACS row, never from the request. That covers the serial number, the model, the domain and the protocol. A caller may send a serial number or a model id, and the service discards both.

One save is the exception: the save of an activated campaign. It writes the stored rows back as they are stored, and it does not read the ACS row again.

The domain comes from the device row and not from the campaign. A device may sit in a sub-domain of the campaign domain.

A device without a model is still a device

A device selected by id or by serial number can come back without a model. Three places handle that:

  • The model column of the fleet table is nullable, so the snapshot stores what it found.

  • The connection ceiling check filters those devices out before it asks for capabilities. A missing model has no capability row by definition.

  • The per-model count gives them a bucket of their own, under an empty key.

The last point carries the weight. A dropped bucket would make the per-model breakdown add up to less than the campaign. The sum of the buckets stays equal to the total, and an operator reading the wizard may assume that.

The model set is frozen with the devices

The model of a device is a column of the fleet row. A frozen fleet is therefore already a frozen model set. The per-model figures of a report are counted over the frozen fleet, so they describe the devices of the run.

The freeze itself happens on the first activation. See fcc_test_device. The service compares the resulting set of device ids, so a reworded selection with the same devices is a legal edit.

What the snapshot gives you

The snapshot gives you one thing. A report shows the fleet of the run and not the fleet of today. The ACS schema is read-only and may live on another database server, so a join at read time is not available anyway. The frozen protocol also answers how many devices could never produce a measurement weeks after a run.

The snapshot has three readers: the save path, the per-device status screen and the four report endpoints. A report filtered by model, manufacturer, device id or serial number resolves through the frozen fleet, never through the ACS table. A device re-provisioned into another model must not rewrite the history of a finished run. See Model and manufacturer come from the frozen fleet.

The snapshot goes stale on purpose, and two rules live with that.

  • A device without a serial number does not block an unrelated edit. The save checks only the devices you add.

  • The service never fills the protocol in later. A snapshot with today’s facts is the one thing this table must not hold.

The ACS tables this service reads

The service reads four tables through a read-only account and writes nothing. It does not own or migrate that schema. See Schema ownership. The columns below are a contract, and the service checks them at startup. See The ftacs schema check.

fcc-ftacs-device-resolution

cpe

Column What the service depends on

id

The id the ACS addresses a device by. The fleet row stores it.

serial

The id the ACS identifies a measurement by. It is mandatory on the wire. See A device without a serial number is refused.

product_class_id

The model id. See product_class.

location_id

This column is the domain. Every domain field of this service means this column.

is_online

A number, not a boolean. MySQL returns an integer here and Oracle returns a decimal, so the service reads it as a number and compares it to 1.

protocol_id

Nullable. A null means Technical Report 069 (TR-069), not unknown. The column came long after the table, so a legacy device still carries a null. See An empty protocol means TR-069.

firmware

A condition field, and part of the resolve answer.

The unique key is the serial number together with the product class, not the serial number alone.

One serial number legitimately exists on two product classes. Examples are a re-badged unit, a model split, or an import with a second product class for the same hardware. Both rows are real devices, and the ACS can measure them separately.

That single fact explains three behaviours. The duplicate report exists. A serial list can resolve to more devices than it has lines. A duplicate does not fail a save. See Missing and duplicate serial numbers.

product_class

The id of this table is what this product calls a model id. Three things key off it:

  • the frozen model of a fleet row

  • the connection ceilings in fcc_model_capability

  • the model the wizard offers

The service reads four columns: id, model, manuf_id and group_id.

manufacturer

The service reads id and name, through a LEFT join.

A manufacturer row without a name falls back to the name of its group. The service shows that fallback name, and it also filters on it. A filter by a displayed name therefore finds the devices with a fallback name.

This table is part of the startup schema check. An upgraded installation must add SELECT on manufacturer to the read-only grant. Without the grant the service refuses to start.

product_class_group

The service reads id, manufacturer_name and protocol_id.

The protocol column of this table is the only protocol in the catalog. The product class table has no such column in the shipped ACS schema.

An empty protocol here means two different things, and the group id tells them apart.

The join is LEFT, so the column is empty for a legacy group and for a model without a group row. For a legacy group the empty value is a real fact, and the service reads it as TR-069. For a missing group row it is the absence of a row, and TR-069 would be an answer without evidence.

The catalog therefore also selects the group id, although nothing displays it. The service answers an empty protocol when there is no group row. Empty is the correct answer there. The service does not fill the gap with a guess.

The catalog protocol is a hint, not the authority.

It is a property of the group of the model. The protocol of a measurement is the per-device column, and the service reports and freezes that one.

The two may disagree, and a device of a legacy group with a new data model is an ordinary upgrade. In that case the per-device value decides whether a measurement happens.

Four selection rules

A list of empty entries is refused, not emptied

The service strips every empty entry out of a caller list. It then refuses a list with entries before the strip and none after it. The protocol list gets the same treatment one step earlier, because the service parses the names first.

Both halves matter, and they fail in opposite directions.

The strip: a term against an empty value is legal and never true. A list of one empty entry therefore narrowed the whole selection to zero devices with no error. The operator saw an empty fleet for correct conditions.

The refusal: a silently dropped condition widens the selection. The caller asked to narrow by model and would get every model. Widening is the one direction this rule must never fail in. The mistake is invisible, the fleet is frozen, and the campaign measures subscribers nobody chose.

The answer is HTTP 400, and the message names the field and the count:

condition.modelIds holds 3 entries and every one of them is empty; send the
values you mean to narrow by, or omit the field entirely. That is what
selects every value

The domain list is the one list without this rule. It comes from the scope of the caller and never from the request body. An empty domain list means the scope ALL to every read. A refusal would break the super-domain read, and an empty result would hand a caller the whole installation.

serialContains matches the wildcards literally

The service escapes % and _ in the value of serialContains. Both characters are then ordinary characters of a serial number.

The underscore is the case with real cost. Serial numbers contain underscores, and an unescaped underscore matches any single character. A search for AB_12 would match every serial number of the same length with AB and 12 in those positions. The operator would see a plausible list of the wrong devices.

An empty protocol means TR-069

The protocol column arrived long after the device table, so a legacy device still carries an empty value. The service reads that empty value as Technical Report 069 (TR-069) everywhere, including the frozen fleet.

A request for TR-069 therefore also selects every device with an empty protocol column. Without that rule a request for TR-069 would drop the oldest half of an installation. There would be no error and no warning. The device count looks plausible, and the campaign excludes the subscribers with the oldest hardware.

A request for another protocol alone never selects those devices.

A device without a model stays findable

The model column of the ACS device table is nullable. A lookup by device id or by serial number still finds such a device, and its model fields come back empty.

A selection by model never matches it. A comparison against an empty value is never true.

A selection by firmware, serial number, online state, protocol or domain does match it. Those are columns of the device, and they say nothing about a model. See A device without a model is still a device for the fleet row and the per-model count.

Why the condition set is closed

The platform already resolves a device set from the saved conditions of a view. This service reads two tables of those views and translates only the conditions it can prove it translates identically. It refuses every other condition and names the column and the operator. See the supported subset.

The reason is the cost of a wrong fleet. A group update with too many devices pushes a firmware, and that is visible, reversible and noticed within the hour. A compliance campaign with the wrong devices produces numbers, and the numbers go into a regulatory filing. Nobody notices, and there is no undo.

A free condition vocabulary cannot report the operator asked for one thing and got another as an error. A closed set can. An unknown protocol name answers HTTP 400 with the allowed values, and an oversized list answers HTTP 400 with the limit. A condition nobody implemented cannot be expressed at all.