Let’s say we want to deploy a VCLGroup to a set of agents in the US and a set of agents in Asia. We want to use the same VCL files for all servers. This would require the following:
US
Asia
.Let’s assume we have two agents running, the one with ID 1 runs in the US. The other with ID 2 runs in Asia. The CLI commands to achieve the above would be (for further CLI examples, see the CLI chapter).
# Create tags
vcli tags add US Asia
# We assume US tag got ID 1 and Asia got ID 2. We tag agent 1 with US and agent 2 with Asia.
vcli agents tag 1 --tag 1
vcli agents tag 2 --tag 2
# Upload a VCL from the file my.vcl (assumed to get ID 1 and a new file version 1)
vcli file add main.vcl my.vcl
# Create a domain (assumed to get ID 1)
vcli domains add example.com
# Now create a VCLGroup to use on both regions (both agents)
# Deployments 1 and 2, domain 1 and VCL 1
vcli vg add myVG --tags name=US --tags name=Asia --domains 1
# Now deploy it
vcli vg deploy 1 --vcl 1