Appends a label to the target.
Labels are used for categorization and filtering of targets. The label is automatically converted to lowercase.
The ID of the campaign containing the target.
The target ID to append label to.
The label to append to the target.
The campaign lock secret obtained from CampaignRepository.lock.
DatabaseError If the campaign does not exist.
DatabaseError If the campaign is not locked.
DatabaseError If the campaign lock secret does not match.
DatabaseError If the target does not exist.
DatabaseError If the data validation fails.
Creates a new target.
The target will be created in a disabled state (isEnabled = false).
Use enable to activate it for traffic routing.
The ID of the campaign to create the target in.
The new target ID to create.
The access level.
The flag indicating if the donor server uses HTTPS.
The donor subdomain.
The donor domain name.
The donor server port.
The flag indicating if the mirror server uses HTTPS.
The mirror subdomain.
The mirror server port.
The connection timeout in milliseconds.
The simple request timeout in milliseconds.
The streaming request timeout in milliseconds.
The maximum headers size in bytes.
The maximum body size in bytes.
The custom main page content.
The custom not-found page content.
The custom favicon.ico content.
The custom robots.txt content.
The custom sitemap.xml content.
The flag indicating if WebSocket connections allowed.
The campaign lock secret obtained from CampaignRepository.lock.
DatabaseError If the campaign does not exist.
DatabaseError If the campaign is not locked.
DatabaseError If the campaign lock secret does not match.
DatabaseError If a target with the same ID already exists.
DatabaseError If the target donor is already used.
DatabaseError If the target mirror is already used.
DatabaseError If the data validation fails.
Deletes the target by its ID.
The target must be disabled before it can be deleted.
The ID of the campaign containing the target.
The target ID to delete.
The campaign lock secret obtained from CampaignRepository.lock.
DatabaseError If the campaign does not exist.
DatabaseError If the campaign is not locked.
DatabaseError If the campaign lock secret does not match.
DatabaseError If the target does not exist.
DatabaseError If the target is still enabled.
DatabaseError If the data validation fails.
Disables the target, stopping traffic routing.
When disabled, requests to the mirror hostname will not be proxied.
The ID of the campaign containing the target.
The target ID to disable.
The campaign lock secret obtained from CampaignRepository.lock.
DatabaseError If the campaign does not exist.
DatabaseError If the campaign is not locked.
DatabaseError If the campaign lock secret does not match.
DatabaseError If the target does not exist.
DatabaseError If the data validation fails.
Enables the target, making it available for traffic routing.
When enabled, the mirror hostname becomes active and can be used for proxying requests to the donor server.
The ID of the campaign containing the target.
The target ID to enable.
The campaign lock secret obtained from CampaignRepository.lock.
DatabaseError If the campaign does not exist.
DatabaseError If the campaign is not locked.
DatabaseError If the campaign lock secret does not match.
DatabaseError If the target does not exist.
DatabaseError If the data validation fails.
Finds a target by its mirror hostname.
This is the primary lookup method for routing incoming HTTP requests.
Given a Host header from a request, it returns the corresponding target.
The mirror hostname to look up.
The target model, or null if no target matches the hostname.
DatabaseError If the data validation fails.
Finds a full target by its mirror hostname.
The mirror hostname to look up.
The full target model, or null if no target matches the hostname.
DatabaseError If the data validation fails.
Lists all targets for the campaign.
Targets are ordered by creation time (oldest first).
The ID of the campaign to list targets for.
The array of target models, or null if the campaign does not exist.
DatabaseError If the data validation fails.
Lists all full targets for the campaign.
Targets are ordered by creation time (oldest first).
The ID of the campaign to list targets for.
The array of full target models, or null if the campaign does not exist.
DatabaseError If the data validation fails.
Reads the target by its ID.
The ID of the campaign containing the target.
The target ID to read.
The target model, or null if the target is not found.
DatabaseError If the data validation fails.
Reads the full target by its ID.
The ID of the campaign containing the target.
The target ID to read.
The full target model, or null if the target is not found.
DatabaseError If the data validation fails.
Reads all target hosts across all campaigns.
This method returns a dictionary mapping mirror hostnames to target links, used for fast routing lookups.
The dictionary of target hosts and their links.
DatabaseError If the data validation fails.
Removes a label from the target.
The ID of the campaign containing the target.
The target ID to remove label from.
The label to remove from the target.
The campaign lock secret obtained from CampaignRepository.lock.
DatabaseError If the campaign does not exist.
DatabaseError If the campaign is not locked.
DatabaseError If the campaign lock secret does not match.
DatabaseError If the target does not exist.
DatabaseError If the data validation fails.
Updates the target specific fields.
All update parameters are optional. Only provided fields will be updated.
The ID of the campaign containing the target.
The target ID to update.
The connection timeout in milliseconds.
The simple request timeout in milliseconds.
The streaming request timeout in milliseconds.
The maximum headers size in bytes.
The maximum body size in bytes.
The custom main page content.
The custom not-found page content.
The custom favicon.ico content.
The custom robots.txt content.
The custom sitemap.xml content.
The flag indicating if WebSocket connections allowed.
The campaign lock secret obtained from CampaignRepository.lock.
DatabaseError If the campaign does not exist.
DatabaseError If the campaign is not locked.
DatabaseError If the campaign lock secret does not match.
DatabaseError If the target does not exist.
DatabaseError If the data validation fails.
Defines the public contract for a target repository.
A target contains the configuration that maps a mirror server to a donor server.