Example 1 Configuration example

This example shows a team of controllers configured with the following team member values:

Team IP Address

Member IP Addresses

 

 

192.0.2.100

192.0.2.119

 

192.0.2.125

 

192.0.2.127

 

 

Domain: sdn (the default domain name)

Username: myname

Password: mypass

NOTE: It is not mandatory that the team IP address be in the same subnet as the member IP addresses. Other IP aliases can be used if the appropriate IP routes are present for the addresses to be reachable and usable.

1.Enter the following cURL command to acquire the authentication token:

CAUTION: Credential information (user name, password, domain, and authentication tokens) used in cURL commands may be saved in the command history. For security reasons, HP recommends that you disable command history prior to executing commands containing credential information.

curl --noproxy 192.0.2.119 -X POST --fail -ksSfL --url "https:// 192.0.2.119:8443/sdn/v2.0/auth" -H "Content-Type: application/json"

--data-binary '{"login": {"domain": "sdn","user": "myname","password": "mypass"}}' {"record":{"token":"10f728e477cb4612b07069f339d0ca29","expiration": 1381119301000,"expirationDate":2013-12-06 21-15-01-0700", "userId":"51802e12d16345fe9a4389290c1a04e2","username":"sdn","domainId": "d45eca9bde1b4dc78bd7dff69ee9440d","domainName":"sdn"}}

2.Configure the controller team by using the above team values and token to enter the following curl command:

NOTE: The IP address used in this step should be the same as used in step 1.

curl --noproxy 192.0.2.119 --header X-Auth-Token: 10f728e477cb4612b07069f339d0ca29 --fail -ksS --request POST --url https://192.0.2.119:8443/sdn/v2.0/team --Data-binary '{"team":{"ip":"<team-ip>","members":

[{"ip":"<member-1-ip>"}, {"ip":"<member-2-ip>"}, {"ip":"<member-3-ip>"}]}}'

Completing the above steps creates and enables the team.

Possible responses

Since team creation is asynchronous, the response is always 202 unless the ream configuration (JSON) is not valid or there is a problem configuring the local controller. Possible codes are:

202 Accepted

400 Bad request

82 Team configuration