Examples
Real-world examples for common xcsh use cases.
Contents
Section titled “Contents”| Example | Description |
|---|---|
| AI Assistant Guide | Using the AI assistant for natural language queries |
| Load Balancers | HTTP and TCP load balancer configuration |
| Cloud Sites | AWS and Azure site deployment |
Quick Examples
Section titled “Quick Examples”List All Namespaces
Section titled “List All Namespaces”xcsh tenant_and_identity list namespaceOutput:
NAME DESCRIPTIONdefault Default namespaceshared Shared namespacesystem System namespaceCreate Resource from File
Section titled “Create Resource from File”xcsh virtual create http_loadbalancer -f lb.yamlGet Resource as YAML
Section titled “Get Resource as YAML”xcsh virtual get http_loadbalancer example-lb -o yamlOutput:
metadata: name: example-lb namespace: defaultspec: domains: - example.comDelete Resource
Section titled “Delete Resource”xcsh virtual delete http_loadbalancer example-lb -ns example-namespaceCommon Workflows
Section titled “Common Workflows”Deploy HTTP Load Balancer
Section titled “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-namespaceUpdate Configuration
Section titled “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.yamlCleanup Resources
Section titled “Cleanup Resources”# Delete load balancerxcsh virtual delete http_loadbalancer example-lb -ns example-namespace
# Delete origin poolxcsh virtual delete origin_pool example-pool -ns example-namespace
# Delete health checkxcsh virtual delete healthcheck example-hc -ns example-namespace