Host

Hosts are the most basic unit of resource within Rancher and is represented as any Linux server, virtual or physical, with the following minimum requirements.

* Any modern Linux distribution with a supported version of Docker.
* Must be able to communicate with the Rancher server via http or https through the pre-configured port (Default is 8080).
* Must be routable to any other hosts belonging to the same environment to leverage Rancher’s cross-host networking for Docker containers.

Rancher also supports Docker Machine and allows you to add your host via any of its supported drivers.

Resource Fields

Writeable Fields

Field Type Create Update Default Notes
apiProxy string - Yes -  
description string Optional Yes -  
hostname string Yes - -  
localStorageMb int Optional Yes -  
memory int Optional Yes -  
milliCpu int Optional Yes -  
name string Optional Yes -  
stackId stack Optional - -  

Read Only Fields

Field Type Notes
agentId agent The unique identifier of the associated agent
agentIpAddress string  
agentState string  
amazonec2Config amazonec2Config  
authCertificateAuthority string  
authKey string  
azureConfig azureConfig  
computeTotal int  
data map[json]  
digitaloceanConfig digitaloceanConfig  
dockerVersion string  
driver string  
engineEnv map[string]  
engineInsecureRegistry array[string]  
engineInstallUrl string  
engineLabel map[string]  
engineOpt map[string]  
engineRegistryMirror array[string]  
engineStorageDriver string  
hostTemplateId hostTemplate  
id int The unique identifier for the host
info json  
instanceIds array[instance]  
labels map[string] A map of key value pairs to be used as labels for the host
packetConfig packetConfig  
physicalHostId physicalHost  
publicEndpoints array[publicEndpoint]  


Please read more about the common resource fields. These fields are read only and applicable to almost every resource. We have segregated them from the list above.

Actions

activate POST: /v2-beta/projects/${PROJECT_ID}/hosts/${ID}?action=activate

Input:This action has no inputs
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/hosts/${ID}?action=activate'

Output: An updated copy of the host resource
deactivate POST: /v2-beta/projects/${PROJECT_ID}/hosts/${ID}?action=deactivate

Input:This action has no inputs
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/hosts/${ID}?action=deactivate'

Output: An updated copy of the host resource
dockersocket POST: /v2-beta/projects/${PROJECT_ID}/hosts/${ID}?action=dockersocket

Input:This action has no inputs
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/hosts/${ID}?action=dockersocket'

Output: An updated copy of the hostAccess resource
error POST: /v2-beta/projects/${PROJECT_ID}/hosts/${ID}?action=error

Input:This action has no inputs
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/hosts/${ID}?action=error'

Output: An updated copy of the host resource
evacuate POST: /v2-beta/projects/${PROJECT_ID}/hosts/${ID}?action=evacuate

Input:This action has no inputs
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/hosts/${ID}?action=evacuate'

Output: An updated copy of the host resource
Edit this page