Skip to content

Arktos API extension with Openstack like VM request with remote test server

Yunwen Bai edited this page Mar 16, 2022 · 12 revisions

To use the shared test server with curl commands. the test server IP:port is 34.214.123.51:8080, currently without security or authentication checks.

root@ip-172-31-3-159:~/go/src/k8s.io/arktos# curl -L -k -XPOST -H "Content-Type: application/json" -H "User-Agent: kubectl/v0.9.0 (linux/amd64) kubernetes/$Format" -H "Accept: application/json" -H "openstack: true" 'http://54.185.164.229:8080/servers' -d @test/e2e/arktos/testvm.json -v | jq
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 54.185.164.229...
* TCP_NODELAY set
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 54.185.164.229 (54.185.164.229) port 8080 (#0)
> POST /servers HTTP/1.1
> Host: 54.185.164.229:8080
> Content-Type: application/json
> User-Agent: kubectl/v0.9.0 (linux/amd64) kubernetes/
> Accept: application/json
> openstack: true
> Content-Length: 775
> 
} [775 bytes data]
* upload completely sent off: 775 out of 775 bytes
< HTTP/1.1 307 Temporary Redirect
< Cache-Control: no-cache, private
< Location: /api/v1/tenants/system/namespaces/kube-system/pods
< Date: Sun, 13 Mar 2022 19:17:32 GMT
< Content-Length: 0
< 
100   775    0     0  100   775      0   2299 --:--:-- --:--:-- --:--:--  2299
* Connection #0 to host 54.185.164.229 left intact
* Issue another request to this URL: 'http://54.185.164.229:8080/api/v1/tenants/system/namespaces/kube-system/pods'
* Found bundle for host 54.185.164.229: 0x564d291da8d0 [can pipeline]
* Re-using existing connection! (#0) with host 54.185.164.229
* Connected to 54.185.164.229 (54.185.164.229) port 8080 (#0)
> POST /api/v1/tenants/system/namespaces/kube-system/pods HTTP/1.1
> Host: 54.185.164.229:8080
> Content-Type: application/json
> User-Agent: kubectl/v0.9.0 (linux/amd64) kubernetes/
> Accept: application/json
> openstack: true
> Content-Length: 775
> 
} [775 bytes data]
* upload completely sent off: 775 out of 775 bytes
< HTTP/1.1 201 Created
< Cache-Control: no-cache, private
< Content-Type: application/json
< Date: Sun, 13 Mar 2022 19:17:32 GMT
< Content-Length: 255
< 
{ [255 bytes data]
100  1030  100   255  100   775    499   1516 --:--:-- --:--:-- --:--:--  2015
* Connection #0 to host 54.185.164.229 left intact
{
  "id": "testvm",
  "links": [
    {
      "Link": "/servers/testvm",
      "Rel": ""
    }
  ],
  "flavor": {
    "memoryMb": 512,
    "vcpus": 1
  },
  "image": {
    "name": "download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img"
  },
  "status": "statusUnknown",
  "tenant": "system",
  "os_ext_sts_power_state": "nosate"
}
root@ip-172-31-3-159:~/go/src/k8s.io/arktos#