Manage site traffic

Organize your site's traffic to manage billing, analytics, and reports using CP codes and reporting groups.

  • CP codes function as an ID representing a particular set or subset of your traffic depending on how narrow a focus you assign to them.
  • Reporting groups work to organize your CP codes into meaningful groups that can streamline billing services or customize the information gathered about your traffic.

There are two submodules used in this workflow.

  • Property to get your contract's product IDs and create new CP codes.
  • CP Codes to manage your CP codes and reporting groups.

Get CP codes

Get a list of all of your CP codes. The response provides values for your contract, group, and product IDs along with the CP codes names and IDs.

Use a specific CP code ID to set its details to a variable you can use downstream.

Get-CPCode
cpcodeId         : 12345
cpcodeName       : My-CP-code
purgeable        : True
accountId        : A-CCT1234
defaultTimezone  : 
overrideTimezone : @{timezoneId=0; timezoneValue=GMT 0 (Greenwich Mean Time)}
type             : Regular
contracts        : {@{contractId=C-0N7RAC7; status=ongoing}}
products         : {@{productId=Site_Del::Site_Del; productName=Site Delivery}}
accessGroup      : @{groupId=12345; contractId=C-0N7RAC7}

cpcodeId         : 56789
cpcodeName       : My-CP-code-2
purgeable        : True
accountId        : A-CCT1234
defaultTimezone  : 
overrideTimezone : @{timezoneId=0; timezoneValue=GMT 0 (Greenwich Mean Time)}
type             : Regular
contracts        : {@{contractId=C-0N7RAC7; status=ongoing}}
products         : {@{productId=NetStorage::NetStorage; productName=NetStorage}}
accessGroup      : @{groupId=12345; contractId=C-0N7RAC7}
$MyCPCode = Get-CPCode -CPCodeID 12345

Update CP codes

You can make changes to your CP code's name, time zone, and purge settings.

The update CP code cmdlet uses the -Body parameter.

PropertyRequiredDescription
cpcodeName✔️Your CP code name.
overrideTimezone✔️Used for legacy reports. Overrides the time zone assigned to your CP code with the GMT offset. Contains:
  • timezoneId. Required. A GMT time zone identifier.
  • timezoneValue. Optional. The GMT time zone offset.
accessGroupA group that controls access to specific CP codes. Contains:
  • contractId. Required. Your contract ID.
  • groupId. Required. A group ID.
purgeableWhether you can purge cached content by the CP code.
typeWhether the CP code supports serving traffic from China. Value is one of:
  • China. For traffic from China.
  • Regular. For traffic elsewhere.
  1. Pass all required and any updatable parameters as a variable or JSON string as its value.

    $body = @{
    cpcodeName = "My-CP-code"
    overrideTimezone = @{timezoneId=0}
    type = "China"
    }
    
    Set-CPCode -CPCodeID 12345 -Body $body
    
    Set-CPCode -CPCodeID 12345 -Body '{@{"cpcodeName": "My-CP-code","overrideTimezone": {"timezoneId": 0},"type": "China"}'
    
  2. To apply your changes on the network, you need to version and activate your property configuration.