Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of contents

Table of Contents

Introduction

A fault domain consists of one or more more ESXI hosts and  and Datastore Clusters grouped  grouped together according to their physical location in the datacenter. 

The following table shows a brief description and HTTP methods allowed to interact with with Fault Domains.

Resource

URI

Description

GET

POST

PUT

PATCH

OPTIONSFault

Domain

/domain

Fault Domain resource. List fault domains and their attributes

(tick) 

   (tick)

...

titleOPTIONS HTTP method

Remember, you can also show what methods are allowed and method description, parameters, etc. by making an OPTIONS HTTP request to /v2/domain.




...

languagebash

...


TK stores the Cloud API Token generated as a result of the following POST request to the /auth/request-token resource:

Code Block
curl -X POST https://vss-api
.eis.utoronto.ca:8001/v2/domain"
.eis.utoronto.ca/auth/request-token -u <username>

For example, extracting the token with the jq command:

Code Block
TK=$(curl -X 
OPTIONS
POST 
"
https://vss-api.eis.utoronto.ca
:8001
/
v2/domain"
auth/request-token -u <username> | jq -r '.token')

List

In order to list allowed Fault Domains you should make a GET request to the endpoint /v2/domain passing your access token. As a result, you will get a reference URI /v2/domain/<moref> to get detailed information about that domain, human readable name and Managed Object Reference (moref).

Name

Type

Description

Name

string

Fault Domain Human readable name

moref

string

vCenter Managed Object Reference (moref)

_links

array

List of URIs related to the resource.

The following examples implements HTTPie and CURL to list available fault domains:

Code Block
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/domain" "Authorization: Bearer $TK"
curl -H "Authorization: Bearer $TK" -u $TK -X GET "https://vss-api.eis.utoronto.ca:8001/v2/dmoain"


Response Body
Code Block
languagepy
titleResponse Body
collapsetrue
{
    "_links": {
        "api": "https://vss-api.eis.utoronto.ca:8001/v2/", 
        "self": "https://vss-api.eis.utoronto.ca:8001/v2/domain"
    }, 
    "data": [
        {
            "_links": {
                "self": "https://vss-api.eis.utoronto.ca:8001/v2/domain/domain-c4252"
            }, 
            "moref": "domain-c4252", 
            "name": "FD2"
        }, 
        {
            "_links": {
                "self": "https://vss-api.eis.utoronto.ca:8001/v2/domain/domain-c4402"
            }, 
            "moref": "domain-c4402", 
            "name": "FD1"
        }, 
        {
            "_links": {
                "self": "https://vss-api.eis.utoronto.ca:8001/v2/domain/domain-c5877"
            }, 
            "moref": "domain-c5877", 
            "name": "FD3"
        }
    ], 
    "meta": {
        "count": 3, 
        "time": "0.19787s", 
        "user": "jm"
    }
}

Filters

This resource has two main filters to narrow down the number of Fault Domains shown in the result.

Name

Description

Name

Fault Domain human readable name

moref

vCenter Managed Object Reference (moref)

The following examples show how to structure a GET request, with filters:

title
Code Block
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/domain?name=FD2"
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/domain?moref=4402"
Code Block
languagepy
=4402"


Response Body - Filtered by name=FD2
language
Code Block
collapselanguagetruepy
{
    "_links": {
        "api": "https://vss-api.eis.utoronto.ca:8001/v2/", 
        "self": "https://vss-api.eis.utoronto.ca:8001/v2/domain"
    }, 
    "data": [
        {
            "_links": {
                "self": "https://vss-api.eis.utoronto.ca:8001/v2/domain/domain-c4252"
            }, 
            "moref": "domain-c4252", 
            "name": "FD2"
        }
    ], 
    "meta": {
        "count": 1, 
        "time": "0.20156s", 
        "user": "jm"
    }
}
Code Block
pytitle


Response Body - Filtered by moref=4402
collapse
Code Block
languagetruepy
{
    "_links": {
        "api": "https://vss-api.eis.utoronto.ca:8001/v2/", 
        "self": "https://vss-api.eis.utoronto.ca:8001/v2/domain"
    }, 
    "data": [
        {
            "_links": {
                "self": "https://vss-api.eis.utoronto.ca:8001/v2/domain/domain-c4402"
            }, 
            "moref": "domain-c4402", 
            "name": "FD1"
        }
    ], 
    "meta": {
        "count": 1, 
        "time": "0.20156s", 
        "user": "jm"
    }
}

List specific Fault Domain Info

Some of the attributes will have an object value. Such is the case of items in attribute vms.

Name

Type

Description

name

string

Fault Domain name.

moref

string

vCenter Managed object reference.

status

string

Fault Domain general "health" value:

  • gray: The status is unknown.

  • green: The entity is OK.

  • red: The entity definitely has a problem.

  • yellow: The entity might have

a problem.totalCPUMHznumberFault domain cpu capacity in MHztotalMemoryGBnumberFault domain memory capacity in GB
  • a problem.

vms

array

Array of Virtual Machines hosted in given fault domain.

The following example, requests information about a particular Fault domain using the base resource /v2/domain and appending the moref to get the URI /v2/domain/domain-c5877:

Code Block
http -a $TK GET https://vss-api.eis.utoronto.ca:8001/v2/domain/domain-c5877?summary=1 "Authorization: Bearer $TK"
curl -H "Authorization: Bearer $TK" -u $TK -X GET https://vss-api.eis.utoronto.ca:8001/v2/domain/domain-c5877?summary=1

HTTP response body would look something like:

Response Body
Code Block
collapse
languagepy
titleResponse Body
true
{
    "_links": {
        "domain": "https://vss-api.eis.utoronto.ca:8001/v2/domain", 
        "self": "https://vss-api.eis.utoronto.ca:8001/v2/domain/domain-c5877"
    }, 
    "data": {
        "datastoreCount": 15, 
        "hostsCount": 4, 
        "moref": "domain-c5877", 
        "name": "FD3", 
        "status": "green", 
        "totalCPUMHz": 230304, 
        "totalMemoryGB": 2198.724608, 
        "vms": [
            {
                "_links": {
                    "self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012f4f0-443b-9cc4-1256-3d78093e7d30/"
                }, 
                "name": "Ubuntu_64b-14.04"
            }, 
            {
                "_links": {
                    "self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/50122e44-9ddd-2497-7b6c-a3bc52749c52/"
                }, 
                "name": "CentOS_64b-7"
            }, 
            {
                "_links": {
                    "self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012dae7-925b-b97a-97b8-4a40e5663147/"
                }, 
                "name": "Ubuntu_64b-14.10"
            }, 
            {
                "_links": {
                    "self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/5012826a-6a1a-815a-249d-7d6eb640f020/"
                }, 
                "name": "1604T-Ubuntu1"
            }, 
            {
                "_links": {
                    "self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/50125d11-a8d6-2af7-c01e-dc6f6be0e607/"
                }, 
                "name": "1604T-Ubuntu34"
            }, 
            {
                "_links": {
                    "self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/501210c6-7d40-b31f-b326-f66325ca27a0/"
                }, 
                "name": "1604T-Ubuntu2"
            }, 
            {
                "_links": {
                    "self": "https://vss-api.eis.utoronto.ca:8001/v2/vm/50123c4c-c810-5c0f-6203-eac67f0cb7e8/"
                }, 
                "name": "Ubuntu_64b-16.04_LTS"
            }
        ]
    }, 
    "meta": {
        "count": 8, 
        "time": "1.62886s", 
        "user": "jm"
    }
}

...