Skip to content

Instantly share code, notes, and snippets.

@nextrevision
Last active February 24, 2018 17:53
Show Gist options
  • Save nextrevision/6dc1e4b2d574b1a98c1a to your computer and use it in GitHub Desktop.
Save nextrevision/6dc1e4b2d574b1a98c1a to your computer and use it in GitHub Desktop.
Example traversed tree of the Rancher metadata service
/containers
/containers/0
/containers/0/create_index :
/containers/0/health_state :
/containers/0/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/containers/0/hostname : dockermachine
/containers/0/ips
/containers/0/ips/0 : 10.42.176.231
/containers/0/labels
/containers/0/name : Network Agent
/containers/0/ports
/containers/0/primary_ip : 10.42.176.231
/containers/0/service_index :
/containers/0/service_name :
/containers/0/stack_name :
/containers/0/start_count : 1
/containers/0/uuid : 5fbea58b-4d74-44c5-aa98-aa1615ae854d
/containers/Agent : Not found
/containers/1
/containers/1/create_index : 1
/containers/1/health_state :
/containers/1/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/containers/1/hostname : dockermachine
/containers/1/ips
/containers/1/ips/0 : 10.42.168.101
/containers/1/labels
/containers/1/labels/io.rancher.project.name : example-stack
/containers/1/labels/io.rancher.project_service.name : example-stack/example
/containers/1/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=3b98e555-df27-42ce-93e0-055f53853c76
/containers/1/labels/io.rancher.service.deployment.unit : 3b98e555-df27-42ce-93e0-055f53853c76
/containers/1/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/containers/1/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/containers/1/labels/io.rancher.stack.name : example-stack
/containers/1/labels/io.rancher.stack_service.name : example-stack/example
/containers/1/name : example-stack_example_1
/containers/1/ports
/containers/1/primary_ip : 10.42.168.101
/containers/1/service_index : 1
/containers/1/service_name : example
/containers/1/stack_name : example-stack
/containers/1/start_count : 1
/containers/1/uuid : 1354377f-a27a-4505-8db8-7465a45b8215
/containers/2
/containers/2/create_index : 2
/containers/2/health_state :
/containers/2/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/containers/2/hostname : dockermachine
/containers/2/ips
/containers/2/ips/0 : 10.42.176.75
/containers/2/labels
/containers/2/labels/io.rancher.project.name : example-stack
/containers/2/labels/io.rancher.project_service.name : example-stack/example
/containers/2/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=21f2a831-badd-45b8-8467-c7693659ed3a
/containers/2/labels/io.rancher.service.deployment.unit : 21f2a831-badd-45b8-8467-c7693659ed3a
/containers/2/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/containers/2/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/containers/2/labels/io.rancher.stack.name : example-stack
/containers/2/labels/io.rancher.stack_service.name : example-stack/example
/containers/2/name : example-stack_example_2
/containers/2/ports
/containers/2/primary_ip : 10.42.176.75
/containers/2/service_index : 2
/containers/2/service_name : example
/containers/2/stack_name : example-stack
/containers/2/start_count : 1
/containers/2/uuid : 1f46823b-b077-4a2c-b8f5-f441147fc39b
/containers/3
/containers/3/create_index : 3
/containers/3/health_state :
/containers/3/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/containers/3/hostname : dockermachine
/containers/3/ips
/containers/3/ips/0 : 10.42.92.62
/containers/3/labels
/containers/3/labels/io.rancher.project.name : example-stack
/containers/3/labels/io.rancher.project_service.name : example-stack/example
/containers/3/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=e0882894-1626-4fee-a866-66a6933e0594
/containers/3/labels/io.rancher.service.deployment.unit : e0882894-1626-4fee-a866-66a6933e0594
/containers/3/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/containers/3/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/containers/3/labels/io.rancher.stack.name : example-stack
/containers/3/labels/io.rancher.stack_service.name : example-stack/example
/containers/3/name : example-stack_example_3
/containers/3/ports
/containers/3/primary_ip : 10.42.92.62
/containers/3/service_index : 3
/containers/3/service_name : example
/containers/3/stack_name : example-stack
/containers/3/start_count : 1
/containers/3/uuid : 8795d170-804f-48a5-9fe7-2527af54813c
/hosts
/hosts/0
/hosts/0/agent_ip : 172.17.0.1
/hosts/0/hostId : 1
/hosts/0/labels
/hosts/0/labels/io.rancher.host.docker_version : 1.10
/hosts/0/labels/io.rancher.host.kvm : true
/hosts/0/labels/io.rancher.host.linux_kernel_version : 3.13
/hosts/0/name : dockermachine
/hosts/0/uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/self
/self/container
/self/container/create_index : 1
/self/container/health_state :
/self/container/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/self/container/hostname : dockermachine
/self/container/ips
/self/container/ips/0 : 10.42.168.101
/self/container/labels
/self/container/labels/io.rancher.project.name : example-stack
/self/container/labels/io.rancher.project_service.name : example-stack/example
/self/container/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=3b98e555-df27-42ce-93e0-055f53853c76
/self/container/labels/io.rancher.service.deployment.unit : 3b98e555-df27-42ce-93e0-055f53853c76
/self/container/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/self/container/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/self/container/labels/io.rancher.stack.name : example-stack
/self/container/labels/io.rancher.stack_service.name : example-stack/example
/self/container/name : example-stack_example_1
/self/container/ports
/self/container/primary_ip : 10.42.168.101
/self/container/service_index : 1
/self/container/service_name : example
/self/container/stack_name : example-stack
/self/container/start_count : 1
/self/container/uuid : 1354377f-a27a-4505-8db8-7465a45b8215
/self/host
/self/host/agent_ip : 172.17.0.1
/self/host/hostId : 1
/self/host/labels
/self/host/labels/io.rancher.host.docker_version : 1.10
/self/host/labels/io.rancher.host.kvm : true
/self/host/labels/io.rancher.host.linux_kernel_version : 3.13
/self/host/name : dockermachine
/self/host/uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/self/service
/self/service/containers
/self/service/containers/0
/self/service/containers/0/create_index : 1
/self/service/containers/0/health_state :
/self/service/containers/0/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/self/service/containers/0/hostname : dockermachine
/self/service/containers/0/ips
/self/service/containers/0/ips/0 : 10.42.168.101
/self/service/containers/0/labels
/self/service/containers/0/labels/io.rancher.project.name : example-stack
/self/service/containers/0/labels/io.rancher.project_service.name : example-stack/example
/self/service/containers/0/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=3b98e555-df27-42ce-93e0-055f53853c76
/self/service/containers/0/labels/io.rancher.service.deployment.unit : 3b98e555-df27-42ce-93e0-055f53853c76
/self/service/containers/0/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/self/service/containers/0/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/self/service/containers/0/labels/io.rancher.stack.name : example-stack
/self/service/containers/0/labels/io.rancher.stack_service.name : example-stack/example
/self/service/containers/0/name : example-stack_example_1
/self/service/containers/0/ports
/self/service/containers/0/primary_ip : 10.42.168.101
/self/service/containers/0/service_index : 1
/self/service/containers/0/service_name : example
/self/service/containers/0/stack_name : example-stack
/self/service/containers/0/start_count : 1
/self/service/containers/0/uuid : 1354377f-a27a-4505-8db8-7465a45b8215
/self/service/containers/1
/self/service/containers/1/create_index : 2
/self/service/containers/1/health_state :
/self/service/containers/1/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/self/service/containers/1/hostname : dockermachine
/self/service/containers/1/ips
/self/service/containers/1/ips/0 : 10.42.176.75
/self/service/containers/1/labels
/self/service/containers/1/labels/io.rancher.project.name : example-stack
/self/service/containers/1/labels/io.rancher.project_service.name : example-stack/example
/self/service/containers/1/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=21f2a831-badd-45b8-8467-c7693659ed3a
/self/service/containers/1/labels/io.rancher.service.deployment.unit : 21f2a831-badd-45b8-8467-c7693659ed3a
/self/service/containers/1/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/self/service/containers/1/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/self/service/containers/1/labels/io.rancher.stack.name : example-stack
/self/service/containers/1/labels/io.rancher.stack_service.name : example-stack/example
/self/service/containers/1/name : example-stack_example_2
/self/service/containers/1/ports
/self/service/containers/1/primary_ip : 10.42.176.75
/self/service/containers/1/service_index : 2
/self/service/containers/1/service_name : example
/self/service/containers/1/stack_name : example-stack
/self/service/containers/1/start_count : 1
/self/service/containers/1/uuid : 1f46823b-b077-4a2c-b8f5-f441147fc39b
/self/service/containers/2
/self/service/containers/2/create_index : 3
/self/service/containers/2/health_state :
/self/service/containers/2/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/self/service/containers/2/hostname : dockermachine
/self/service/containers/2/ips
/self/service/containers/2/ips/0 : 10.42.92.62
/self/service/containers/2/labels
/self/service/containers/2/labels/io.rancher.project.name : example-stack
/self/service/containers/2/labels/io.rancher.project_service.name : example-stack/example
/self/service/containers/2/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=e0882894-1626-4fee-a866-66a6933e0594
/self/service/containers/2/labels/io.rancher.service.deployment.unit : e0882894-1626-4fee-a866-66a6933e0594
/self/service/containers/2/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/self/service/containers/2/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/self/service/containers/2/labels/io.rancher.stack.name : example-stack
/self/service/containers/2/labels/io.rancher.stack_service.name : example-stack/example
/self/service/containers/2/name : example-stack_example_3
/self/service/containers/2/ports
/self/service/containers/2/primary_ip : 10.42.92.62
/self/service/containers/2/service_index : 3
/self/service/containers/2/service_name : example
/self/service/containers/2/stack_name : example-stack
/self/service/containers/2/start_count : 1
/self/service/containers/2/uuid : 8795d170-804f-48a5-9fe7-2527af54813c
/self/service/create_index : 3
/self/service/expose
/self/service/external_ips
/self/service/fqdn :
/self/service/hostname :
/self/service/kind : service
/self/service/labels
/self/service/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/self/service/links
/self/service/metadata
/self/service/metadata/io.rancher.service.hash : f71db4bcc057fe1a4a6fc3b82abc95178baded8a
/self/service/name : example
/self/service/ports
/self/service/scale : 3
/self/service/sidekicks
/self/service/stack_name : example-stack
/self/service/token : dypkPdtJ5osQAGx91NXZhK1Bwq6qA2oXJAocVjFs
/self/service/uuid : c3b793e2-28ee-4dc5-a912-fef74a1e82da
/self/service/vip : 169.254.68.89
/self/stack
/self/stack/environment_name : Default
/self/stack/name : example-stack
/self/stack/services
/self/stack/services/0
/self/stack/services/0/containers
/self/stack/services/0/containers/0
/self/stack/services/0/containers/0/create_index : 1
/self/stack/services/0/containers/0/health_state :
/self/stack/services/0/containers/0/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/self/stack/services/0/containers/0/hostname : dockermachine
/self/stack/services/0/containers/0/ips
/self/stack/services/0/containers/0/ips/0 : 10.42.168.101
/self/stack/services/0/containers/0/labels
/self/stack/services/0/containers/0/labels/io.rancher.project.name : example-stack
/self/stack/services/0/containers/0/labels/io.rancher.project_service.name : example-stack/example
/self/stack/services/0/containers/0/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=3b98e555-df27-42ce-93e0-055f53853c76
/self/stack/services/0/containers/0/labels/io.rancher.service.deployment.unit : 3b98e555-df27-42ce-93e0-055f53853c76
/self/stack/services/0/containers/0/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/self/stack/services/0/containers/0/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/self/stack/services/0/containers/0/labels/io.rancher.stack.name : example-stack
/self/stack/services/0/containers/0/labels/io.rancher.stack_service.name : example-stack/example
/self/stack/services/0/containers/0/name : example-stack_example_1
/self/stack/services/0/containers/0/ports
/self/stack/services/0/containers/0/primary_ip : 10.42.168.101
/self/stack/services/0/containers/0/service_index : 1
/self/stack/services/0/containers/0/service_name : example
/self/stack/services/0/containers/0/stack_name : example-stack
/self/stack/services/0/containers/0/start_count : 1
/self/stack/services/0/containers/0/uuid : 1354377f-a27a-4505-8db8-7465a45b8215
/self/stack/services/0/containers/1
/self/stack/services/0/containers/1/create_index : 2
/self/stack/services/0/containers/1/health_state :
/self/stack/services/0/containers/1/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/self/stack/services/0/containers/1/hostname : dockermachine
/self/stack/services/0/containers/1/ips
/self/stack/services/0/containers/1/ips/0 : 10.42.176.75
/self/stack/services/0/containers/1/labels
/self/stack/services/0/containers/1/labels/io.rancher.project.name : example-stack
/self/stack/services/0/containers/1/labels/io.rancher.project_service.name : example-stack/example
/self/stack/services/0/containers/1/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=21f2a831-badd-45b8-8467-c7693659ed3a
/self/stack/services/0/containers/1/labels/io.rancher.service.deployment.unit : 21f2a831-badd-45b8-8467-c7693659ed3a
/self/stack/services/0/containers/1/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/self/stack/services/0/containers/1/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/self/stack/services/0/containers/1/labels/io.rancher.stack.name : example-stack
/self/stack/services/0/containers/1/labels/io.rancher.stack_service.name : example-stack/example
/self/stack/services/0/containers/1/name : example-stack_example_2
/self/stack/services/0/containers/1/ports
/self/stack/services/0/containers/1/primary_ip : 10.42.176.75
/self/stack/services/0/containers/1/service_index : 2
/self/stack/services/0/containers/1/service_name : example
/self/stack/services/0/containers/1/stack_name : example-stack
/self/stack/services/0/containers/1/start_count : 1
/self/stack/services/0/containers/1/uuid : 1f46823b-b077-4a2c-b8f5-f441147fc39b
/self/stack/services/0/containers/2
/self/stack/services/0/containers/2/create_index : 3
/self/stack/services/0/containers/2/health_state :
/self/stack/services/0/containers/2/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/self/stack/services/0/containers/2/hostname : dockermachine
/self/stack/services/0/containers/2/ips
/self/stack/services/0/containers/2/ips/0 : 10.42.92.62
/self/stack/services/0/containers/2/labels
/self/stack/services/0/containers/2/labels/io.rancher.project.name : example-stack
/self/stack/services/0/containers/2/labels/io.rancher.project_service.name : example-stack/example
/self/stack/services/0/containers/2/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=e0882894-1626-4fee-a866-66a6933e0594
/self/stack/services/0/containers/2/labels/io.rancher.service.deployment.unit : e0882894-1626-4fee-a866-66a6933e0594
/self/stack/services/0/containers/2/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/self/stack/services/0/containers/2/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/self/stack/services/0/containers/2/labels/io.rancher.stack.name : example-stack
/self/stack/services/0/containers/2/labels/io.rancher.stack_service.name : example-stack/example
/self/stack/services/0/containers/2/name : example-stack_example_3
/self/stack/services/0/containers/2/ports
/self/stack/services/0/containers/2/primary_ip : 10.42.92.62
/self/stack/services/0/containers/2/service_index : 3
/self/stack/services/0/containers/2/service_name : example
/self/stack/services/0/containers/2/stack_name : example-stack
/self/stack/services/0/containers/2/start_count : 1
/self/stack/services/0/containers/2/uuid : 8795d170-804f-48a5-9fe7-2527af54813c
/self/stack/services/0/create_index : 3
/self/stack/services/0/expose
/self/stack/services/0/external_ips
/self/stack/services/0/fqdn :
/self/stack/services/0/hostname :
/self/stack/services/0/kind : service
/self/stack/services/0/labels
/self/stack/services/0/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/self/stack/services/0/links
/self/stack/services/0/metadata
/self/stack/services/0/metadata/io.rancher.service.hash : f71db4bcc057fe1a4a6fc3b82abc95178baded8a
/self/stack/services/0/name : example
/self/stack/services/0/ports
/self/stack/services/0/scale : 3
/self/stack/services/0/sidekicks
/self/stack/services/0/stack_name : example-stack
/self/stack/services/0/token :
/self/stack/services/0/uuid : c3b793e2-28ee-4dc5-a912-fef74a1e82da
/self/stack/services/0/vip : 169.254.68.89
/self/stack/uuid : ddc9e4bb-01c6-4b14-ac90-f611e53ed5a7
/services
/services/0
/services/0/containers
/services/0/containers/0
/services/0/containers/0/create_index : 1
/services/0/containers/0/health_state :
/services/0/containers/0/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/services/0/containers/0/hostname : dockermachine
/services/0/containers/0/ips
/services/0/containers/0/ips/0 : 10.42.168.101
/services/0/containers/0/labels
/services/0/containers/0/labels/io.rancher.project.name : example-stack
/services/0/containers/0/labels/io.rancher.project_service.name : example-stack/example
/services/0/containers/0/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=3b98e555-df27-42ce-93e0-055f53853c76
/services/0/containers/0/labels/io.rancher.service.deployment.unit : 3b98e555-df27-42ce-93e0-055f53853c76
/services/0/containers/0/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/services/0/containers/0/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/services/0/containers/0/labels/io.rancher.stack.name : example-stack
/services/0/containers/0/labels/io.rancher.stack_service.name : example-stack/example
/services/0/containers/0/name : example-stack_example_1
/services/0/containers/0/ports
/services/0/containers/0/primary_ip : 10.42.168.101
/services/0/containers/0/service_index : 1
/services/0/containers/0/service_name : example
/services/0/containers/0/stack_name : example-stack
/services/0/containers/0/start_count : 1
/services/0/containers/0/uuid : 1354377f-a27a-4505-8db8-7465a45b8215
/services/0/containers/1
/services/0/containers/1/create_index : 2
/services/0/containers/1/health_state :
/services/0/containers/1/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/services/0/containers/1/hostname : dockermachine
/services/0/containers/1/ips
/services/0/containers/1/ips/0 : 10.42.176.75
/services/0/containers/1/labels
/services/0/containers/1/labels/io.rancher.project.name : example-stack
/services/0/containers/1/labels/io.rancher.project_service.name : example-stack/example
/services/0/containers/1/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=21f2a831-badd-45b8-8467-c7693659ed3a
/services/0/containers/1/labels/io.rancher.service.deployment.unit : 21f2a831-badd-45b8-8467-c7693659ed3a
/services/0/containers/1/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/services/0/containers/1/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/services/0/containers/1/labels/io.rancher.stack.name : example-stack
/services/0/containers/1/labels/io.rancher.stack_service.name : example-stack/example
/services/0/containers/1/name : example-stack_example_2
/services/0/containers/1/ports
/services/0/containers/1/primary_ip : 10.42.176.75
/services/0/containers/1/service_index : 2
/services/0/containers/1/service_name : example
/services/0/containers/1/stack_name : example-stack
/services/0/containers/1/start_count : 1
/services/0/containers/1/uuid : 1f46823b-b077-4a2c-b8f5-f441147fc39b
/services/0/containers/2
/services/0/containers/2/create_index : 3
/services/0/containers/2/health_state :
/services/0/containers/2/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/services/0/containers/2/hostname : dockermachine
/services/0/containers/2/ips
/services/0/containers/2/ips/0 : 10.42.92.62
/services/0/containers/2/labels
/services/0/containers/2/labels/io.rancher.project.name : example-stack
/services/0/containers/2/labels/io.rancher.project_service.name : example-stack/example
/services/0/containers/2/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=e0882894-1626-4fee-a866-66a6933e0594
/services/0/containers/2/labels/io.rancher.service.deployment.unit : e0882894-1626-4fee-a866-66a6933e0594
/services/0/containers/2/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/services/0/containers/2/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/services/0/containers/2/labels/io.rancher.stack.name : example-stack
/services/0/containers/2/labels/io.rancher.stack_service.name : example-stack/example
/services/0/containers/2/name : example-stack_example_3
/services/0/containers/2/ports
/services/0/containers/2/primary_ip : 10.42.92.62
/services/0/containers/2/service_index : 3
/services/0/containers/2/service_name : example
/services/0/containers/2/stack_name : example-stack
/services/0/containers/2/start_count : 1
/services/0/containers/2/uuid : 8795d170-804f-48a5-9fe7-2527af54813c
/services/0/create_index : 3
/services/0/expose
/services/0/external_ips
/services/0/fqdn :
/services/0/hostname :
/services/0/kind : service
/services/0/labels
/services/0/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/services/0/links
/services/0/metadata
/services/0/metadata/io.rancher.service.hash : f71db4bcc057fe1a4a6fc3b82abc95178baded8a
/services/0/name : example
/services/0/ports
/services/0/scale : 3
/services/0/sidekicks
/services/0/stack_name : example-stack
/services/0/token :
/services/0/uuid : c3b793e2-28ee-4dc5-a912-fef74a1e82da
/services/0/vip : 169.254.68.89
/stacks
/stacks/0
/stacks/0/environment_name : Default
/stacks/0/name : example-stack
/stacks/0/services
/stacks/0/services/0
/stacks/0/services/0/containers
/stacks/0/services/0/containers/0
/stacks/0/services/0/containers/0/create_index : 1
/stacks/0/services/0/containers/0/health_state :
/stacks/0/services/0/containers/0/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/stacks/0/services/0/containers/0/hostname : dockermachine
/stacks/0/services/0/containers/0/ips
/stacks/0/services/0/containers/0/ips/0 : 10.42.168.101
/stacks/0/services/0/containers/0/labels
/stacks/0/services/0/containers/0/labels/io.rancher.project.name : example-stack
/stacks/0/services/0/containers/0/labels/io.rancher.project_service.name : example-stack/example
/stacks/0/services/0/containers/0/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=3b98e555-df27-42ce-93e0-055f53853c76
/stacks/0/services/0/containers/0/labels/io.rancher.service.deployment.unit : 3b98e555-df27-42ce-93e0-055f53853c76
/stacks/0/services/0/containers/0/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/stacks/0/services/0/containers/0/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/stacks/0/services/0/containers/0/labels/io.rancher.stack.name : example-stack
/stacks/0/services/0/containers/0/labels/io.rancher.stack_service.name : example-stack/example
/stacks/0/services/0/containers/0/name : example-stack_example_1
/stacks/0/services/0/containers/0/ports
/stacks/0/services/0/containers/0/primary_ip : 10.42.168.101
/stacks/0/services/0/containers/0/service_index : 1
/stacks/0/services/0/containers/0/service_name : example
/stacks/0/services/0/containers/0/stack_name : example-stack
/stacks/0/services/0/containers/0/start_count : 1
/stacks/0/services/0/containers/0/uuid : 1354377f-a27a-4505-8db8-7465a45b8215
/stacks/0/services/0/containers/1
/stacks/0/services/0/containers/1/create_index : 2
/stacks/0/services/0/containers/1/health_state :
/stacks/0/services/0/containers/1/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/stacks/0/services/0/containers/1/hostname : dockermachine
/stacks/0/services/0/containers/1/ips
/stacks/0/services/0/containers/1/ips/0 : 10.42.176.75
/stacks/0/services/0/containers/1/labels
/stacks/0/services/0/containers/1/labels/io.rancher.project.name : example-stack
/stacks/0/services/0/containers/1/labels/io.rancher.project_service.name : example-stack/example
/stacks/0/services/0/containers/1/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=21f2a831-badd-45b8-8467-c7693659ed3a
/stacks/0/services/0/containers/1/labels/io.rancher.service.deployment.unit : 21f2a831-badd-45b8-8467-c7693659ed3a
/stacks/0/services/0/containers/1/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/stacks/0/services/0/containers/1/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/stacks/0/services/0/containers/1/labels/io.rancher.stack.name : example-stack
/stacks/0/services/0/containers/1/labels/io.rancher.stack_service.name : example-stack/example
/stacks/0/services/0/containers/1/name : example-stack_example_2
/stacks/0/services/0/containers/1/ports
/stacks/0/services/0/containers/1/primary_ip : 10.42.176.75
/stacks/0/services/0/containers/1/service_index : 2
/stacks/0/services/0/containers/1/service_name : example
/stacks/0/services/0/containers/1/stack_name : example-stack
/stacks/0/services/0/containers/1/start_count : 1
/stacks/0/services/0/containers/1/uuid : 1f46823b-b077-4a2c-b8f5-f441147fc39b
/stacks/0/services/0/containers/2
/stacks/0/services/0/containers/2/create_index : 3
/stacks/0/services/0/containers/2/health_state :
/stacks/0/services/0/containers/2/host_uuid : da4aa4b0-ee2f-4ad3-8ded-b09917821cfa
/stacks/0/services/0/containers/2/hostname : dockermachine
/stacks/0/services/0/containers/2/ips
/stacks/0/services/0/containers/2/ips/0 : 10.42.92.62
/stacks/0/services/0/containers/2/labels
/stacks/0/services/0/containers/2/labels/io.rancher.project.name : example-stack
/stacks/0/services/0/containers/2/labels/io.rancher.project_service.name : example-stack/example
/stacks/0/services/0/containers/2/labels/io.rancher.scheduler.affinity:container_label_soft : io.rancher.service.deployment.unit=e0882894-1626-4fee-a866-66a6933e0594
/stacks/0/services/0/containers/2/labels/io.rancher.service.deployment.unit : e0882894-1626-4fee-a866-66a6933e0594
/stacks/0/services/0/containers/2/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/stacks/0/services/0/containers/2/labels/io.rancher.service.launch.config : io.rancher.service.primary.launch.config
/stacks/0/services/0/containers/2/labels/io.rancher.stack.name : example-stack
/stacks/0/services/0/containers/2/labels/io.rancher.stack_service.name : example-stack/example
/stacks/0/services/0/containers/2/name : example-stack_example_3
/stacks/0/services/0/containers/2/ports
/stacks/0/services/0/containers/2/primary_ip : 10.42.92.62
/stacks/0/services/0/containers/2/service_index : 3
/stacks/0/services/0/containers/2/service_name : example
/stacks/0/services/0/containers/2/stack_name : example-stack
/stacks/0/services/0/containers/2/start_count : 1
/stacks/0/services/0/containers/2/uuid : 8795d170-804f-48a5-9fe7-2527af54813c
/stacks/0/services/0/create_index : 3
/stacks/0/services/0/expose
/stacks/0/services/0/external_ips
/stacks/0/services/0/fqdn :
/stacks/0/services/0/hostname :
/stacks/0/services/0/kind : service
/stacks/0/services/0/labels
/stacks/0/services/0/labels/io.rancher.service.hash : d06c76ba65f8295d4a71cd599876dfcd82b7f103
/stacks/0/services/0/links
/stacks/0/services/0/metadata
/stacks/0/services/0/metadata/io.rancher.service.hash : f71db4bcc057fe1a4a6fc3b82abc95178baded8a
/stacks/0/services/0/name : example
/stacks/0/services/0/ports
/stacks/0/services/0/scale : 3
/stacks/0/services/0/sidekicks
/stacks/0/services/0/stack_name : example-stack
/stacks/0/services/0/token :
/stacks/0/services/0/uuid : c3b793e2-28ee-4dc5-a912-fef74a1e82da
/stacks/0/services/0/vip : 169.254.68.89
/stacks/0/uuid : ddc9e4bb-01c6-4b14-ac90-f611e53ed5a7
/version : 26-bbb0b2d5d712df316689b880638ad03f8edfcb56917218dc71722a2e9399273a
_tree_walk() {
echo "${1}"
for d in `curl -s rancher-metadata/latest${1}`; do
if echo $d | egrep -q "/$"; then
_tree_walk "${1}/$(echo $d | sed 's/\///g')"
elif echo $d | egrep -q '^[0-9]+='; then
_tree_walk "${1}/$(echo $d | cut -d'=' -f1)"
else
_tree_get ${1}/${d}
fi
done
}
_tree_get() {
echo "${1} : $(curl -s rancher-metadata/latest${1})"
}
_tree_walk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment