This topic describes the functions of the EdgeScript CLI and how to use the EdgeScript CLI.

Functions

The EdgeScript CLI supports the following functions:
  • Publish scripts to the test environment.
  • Publish scripts in the test environment to the CDN network (production environment), or remove scripts from the test environment.
  • Query, modify, or delete scripts in the test and production environments.

Use EdgeScript CLI

You can use EdgeScript CLI to perform the following tasks:
  • Configure your AccessKey pair.
    $python ./es.py config --id=AK_ID --secret=AK_SECRET
    $cat aliyun.ini
    [Credentials]
    accesskeyid = AccessKey ID
    accesskeysecret = AccessKey Secret
  • Publish a script to the test or production environment, or modify a script in the test or production environment.
    ./es.py action=push_test_env domain=<domain> rule='{"pos":"<head|foot>","pri":"0-999","rule_path":"<the es code path>","enable":"<on|off>"}'
    ./es.py action=push_product_env domain=<domain> rule='{"pos":"<head|foot>","pri":"0-999","rule_path":"<the es code path>","enable":"<on|off>","configid":"<configid>"}'
    
    Notes:
        1. Publish a script: do not specify the configid.
        2. Modify a script: you must specify the configid. You can perform the query action to query the configid of a script.
        3. You can specify one or more scripts.
  • Query scripts in the test or production environment.
    ./es.py action=query_test_env domain=<domain>
    ./es.py action=query_product_env domain=<domain>
  • Delete a script from the test or production environment.
    ./es.py action=del_test_env domain=<domain> configid=<configid>
    ./es.py action=del_product_env domain=<domain> configid=<configid>
    
    Notes:
        1. configid: You can perform the query action to query the configid of a script.
  • Publish all scripts in the test environment to the production environment or remove all scripts from the test environment.
    ./es.py action=publish_test_env domain=<domain>
    ./es.py action=rollback_test_env domain=<domain>