Examples
Real-world examples for common xcsh use cases.
Contents
Quick Examples
List All Namespaces
xcsh tenant_and_identity list namespace
Output:
NAME DESCRIPTION
default Default namespace
shared Shared namespace
system System namespace
Create Resource from File
xcsh virtual create http_loadbalancer -f lb.yaml
Get Resource as YAML
xcsh virtual get http_loadbalancer example-lb -o yaml
Output:
metadata:
name: example-lb
namespace: default
spec:
domains:
- example.com
Delete Resource
xcsh virtual delete http_loadbalancer example-lb -ns example-namespace
Common Workflows
Deploy HTTP Load Balancer
- Create an origin pool:
xcsh virtual create origin_pool -f origin-pool.yaml
- Create a health check:
xcsh virtual create healthcheck -f healthcheck.yaml
- Create the load balancer:
xcsh virtual create http_loadbalancer -f lb.yaml
- Verify deployment:
xcsh virtual get http_loadbalancer example-lb -ns example-namespace
Update Configuration
- Export current configuration:
xcsh virtual get http_loadbalancer example-lb -ns example-namespace -o yaml > lb.yaml
-
Edit the file as needed
-
Apply changes:
xcsh virtual replace http_loadbalancer example-lb -ns example-namespace -f lb.yaml
Cleanup Resources
# Delete load balancer
xcsh virtual delete http_loadbalancer example-lb -ns example-namespace
# Delete origin pool
xcsh virtual delete origin_pool example-pool -ns example-namespace
# Delete health check
xcsh virtual delete healthcheck example-hc -ns example-namespace