# Rancher 2.0 API 

**URL:** https://forums.suse.com/t/rancher-2-0-api/10999
**Category:** Rancher 2.0 Tech Preview
**Created:** [July 3, 2018, 11:05pm UTC](https://forums.suse.com/t/rancher-2-0-api/10999 "2018-07-03T23:05:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![radha](https://avatars.discourse-cdn.com/v4/letter/r/ecb155/32.png) [@radha](https://forums.suse.com/u/radha)
#### Post date: [July 3, 2018, 11:05pm UTC](https://forums.suse.com/t/rancher-2-0-api/10999/1 "2018-07-03T23:05:37Z")

</div>

I have created a rancher server2.0 with the following items:

• Cluster- Cluster1 using the below command,  
#Creating Cluster  
CLUSTERRESPONSE=`curl -s 'https://127.0.0.1/v3/cluster' -H 'content-type: application/json' -H "Authorization: Bearer $APITOKEN" --data-binary '{"type":"cluster","nodes":[],"rancherKubernetesEngineConfig":{"ignoreDockerVersion":false, "kubernetesVersion":"v1.9.5-rancher1-1", "services":{"etcd":{"extraArgs":{"election-timeout":"5000", "heartbeat-interval":"500"}}}, "network":{"type":"networkConfig", "plugin":"flannel"}, "authentication":{"type":"authnConfig", "strategy":"x509"}, "ingress":{"type":"ingressConfig", "provider":"nginx"}, "podSecurityPolicy":false},"name":"Cluster1"}' --insecure`  
echo $CLUSTERRESPONSE

• Nodes – etcd, controlplane and workers

Now the requirement is, I have to create a new cluster Cluster2 under the same rancher server from different host, so am using rancherIP instead of referring to localhost

• Cluster- Cluster2 using the below command,  
#Creating Cluster  
CLUSTERRESPONSE=`curl -s 'https://$RANCHER2_SERVER_IP/v3/cluster' -H 'content-type: application/json' -H "Authorization: Bearer $APITOKEN" --data-binary '{"type":"cluster","nodes":[],"rancherKubernetesEngineConfig":{"ignoreDockerVersion":false, "kubernetesVersion":"v1.9.5-rancher1-1", "services":{"etcd":{"extraArgs":{"election-timeout":"5000", "heartbeat-interval":"500"}}}, "network":{"type":"networkConfig", "plugin":"flannel"}, "authentication":{"type":"authnConfig", "strategy":"x509"}, "ingress":{"type":"ingressConfig", "provider":"nginx"}, "podSecurityPolicy":false},"name":"Cluster2"}' --insecure`  
echo $CLUSTERRESPONSE

But am getting empty response, am using the same APITOKEN provided by the rancherserver for Cluster1.

Am I doing anything wrong? Please help.
