README.md in akamai_ccu-1.2.1 vs README.md in akamai_ccu-1.3.0
- old
+ new
@@ -15,10 +15,12 @@
* [Reuse client](#reuse-client)
* [CLI](#cli)
* [Help](#help)
* [ccu_invalidate](#ccu_invalidate)
* [ccu_delete](#ccu_delete)
+ * [Bulk operation](#bulk-operation)
+ * [Redirecting output](#redirecting-output)
* [Overwriting options](#overwriting-options)
* [Possible issues](#possible-issues)
## Scope
This gem is a minimal wrapper of the [Akamai Content Control Utility](https://developer.akamai.com/api/purge/ccu/overview.html) APIs used to purge Edge content by request.
@@ -161,11 +163,11 @@
#### ccu_invalidate
You can request for contents invalidation by calling:
```shell
ccu_invalidate --edgerc=~/.edgerc \
- --url="https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/*.css,https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/*.js" \
+ --url=https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/*.css,https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/*.js \
--production
```
#### ccu_delete
You can request for contents deletion by calling:
@@ -173,10 +175,35 @@
ccu_delete --txt=~/tokens.txt \
--cp=12345,98765 \
--headers=Accept,Content-Length
```
+#### Bulk operation
+In case you have multiple contents to work with, it could be impractical to write several entries on the CLI.
+Just specify them on a separate file and use the bulk option:
+
+`urls.txt` file with each url/CP code specified on one line:
+```txt
+https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/*.css
+https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/*.js
+https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/static/*.html
+```
+
+Specify the bulk option by using the file path:
+```shell
+ccu_invalidate --edgerc=~/.edgerc --bulk=urls.txt
+```
+
+##### Do not mix content types
+You cannot specify both CP codes and URLs on the same bulk file, mind being consistent!
+
+#### Redirecting output
+In case you're calling the CLI from another program (like your Jenkins script), just redirect the output to your log file:
+```shell
+ccu_invalidate --edgerc=~/.edgerc --cp=12345,98765 > mylog.log
+```
+
#### Overwriting options
The CLI does allow only one option to specify the secret file and the content objects.
If multiple options for the same scope are provided, the program runs by giving precedence to:
##### Secret file
@@ -187,15 +214,23 @@
--edgerc=~/.edgerc \
--cp=12345,98765
```
##### Content objects
-The `cp` option has always precedence over the `url` one:
+The `bulk` option has always precedence over the `cp` one, that has precedence over the `url`:
+
+This command will invalidate by urls:
```shell
-# will invalidate by CP code
ccu_invalidate --txt=~/tokens.txt \
- --url="https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/*.css,https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/*.js" \
--cp=12345,98765
+ --bulk=urls.txt
+```
+
+This command will delete by CP codes:
+```shell
+ccu_delete --txt=~/tokens.txt \
+ --cp=12345,98765
+ --url=https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/*.css,https://akaa-baseurl-xxx-xxx.luna.akamaiapis.net/*.js
```
### Possible Issues
It happens you can get a `bad request` response by Akamai like this:
```shell