Operating Systems
Introduction
VMware supports most of Windows, Linux, Unix, Macintosh, and other operating systems (full list here), however we have carefully selected the latest, most used in our user community and those we know are stable enough in our environment.
The following table shows a brief description and HTTP methods allowed to interact with the Supported Operating System resource.
Resource | URI | Description | GET | POST | PUT | PATCH |
---|---|---|---|---|---|---|
Supported Operating Systems | /os | List supported operating systems and their attributes | Â |
On this page:
TK stores the Cloud API Token generated as a result of the following POST request to the /auth/request-token resource:
curl -X POST https://vss-api.eis.utoronto.ca/auth/request-token -u <username>
For example, extracting the token with the jq command:
TK=$(curl -X POST https://vss-api.eis.utoronto.ca/auth/request-token -u <username> | jq -r '.token')
List
There are more than 60 operating systems to use in our environment and to list them all, a GET request should be made to /v2/os as show below:
http GET "https://vss-api.eis.utoronto.ca/v2/os" "Authorization: Bearer $TK" curl -H "Authorization: Bearer $TK" -X GET "https://vss-api.eis.utoronto.ca/v2/os"
As a result, there will be a list of JSON objects with two attributes each: id and name described in the following table:
Name | Type | Description |
---|---|---|
guest_id | string | Guest OS identifier. Used as value of attribute os in /v2/vm resource to crate VMs or in /v2/vm/<vm_uuid/guest/os to update given VM Guest OS Support. |
full_name | string | Guest OS full name. |
family | string | Guest Os family |
The following example is a response body with only a few elements. In practice you will get more than 60 elements.
Paging
All requests to the /os URL are paginated. The response body includes a 'meta.pages' key with everything to navigate through the results, for instance:
Key | Description |
---|---|
first_url | Contain the URLs to navigate through results. |
last_url | |
prev_url | |
next_url | |
page | Current page |
pages | Total number of pages |
per_page | Results per page. Maximum 100; Default 10. |
total | Total number of results |
Results per page can be set by including the parameter in the URL query, so we can get the desired number of elements per page, for example:
http GET "https://vss-api.eis.utoronto.ca/v2/os?per_page=5" "Authorization: Bearer $TK" curl -X GET -H "Authorization: Bearer $TK" "https://vss-api.eis.utoronto.ca/v2/os?per_page=5"
In this example, you can see the number of pages have increased from 8 to 15 and the '_link.self' key has included the parameter 'per_page' in the URL query.
Expansion
OS resource expansion is disabled by default, therefore elements found are listed as URLs. However, if you wish to display its contents add the expand=1 to URL query string and you will get the actual element in full JSON format, as follows:
http GET "https://vss-api.eis.utoronto.ca/v2/os?per_page=1&page=22&expand=1" "Authorization: Bearer $TK" curl -X GET -H "Authorization: Bearer $TK" "https://vss-api.eis.utoronto.ca/v2/os?per_page=1&page=22&expand=1"
Filtering
Supported operating systems can be filtered by adding the filter argument to the query string in the following format:
filter=<field_name>,<operator>,<value>
Operators can be:
Operator | Description |
---|---|
eq | Equals |
ne | Not equal |
lt | Lower than |
le | Lower equal |
gt | Greater than |
ge | Greater equal |
like | Matching pattern |
in | Match value in many items separated by commas |
A resource can be filtered by as many attributes the object has, for instance /os can be filtered by guest_id, full_name and family. Thus, the following example will filter CentOS operating systems:
http GET "https://vss-api.eis.utoronto.ca/v2/os?filter=full_name,like,CentOS%&expand=1" "Authorization: Bearer $TK" curl -X GET -H "Authorization: Bearer $TK" "https://vss-api.eis.utoronto.ca/v2/os?filter=full_name,like,CentOS%&expand=1"
Sorting
Operating systems can be sorted by adding the sort parameter in the URL query string in the following format:
sort=<field_name>,<asc|desc>
The following example shows how to sort by guest_id , filter by full_name and expand results :
http GET "https://vss-api.eis.utoronto.ca/v2/os?filter=full_name,like,Windows%&expand=1&sort=guest_id,asc" "Authorization: Bearer $TK" curl -X GET -H "Authorization: Bearer $TK" "https://vss-api.eis.utoronto.ca/v2/os?filter=full_name,like,Windows%&expand=1&sort=guest_id,asc"