Versions Compared

Key

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

Introduction

 Logical Folders are containers for storing and organizing inventory objects, in this case virtual machines. As the network resource, a Folder has a Managed Object Reference (moref) which is required for either virtual machine deployment (where a virtual machine will be placed upon creation) or updating virtual machine containing folder (moved).

The /v2/folder resource lists folders you are allowed to access in our environment. If by any chance you cannot see a folder and you add it to a new virtual machine creation request or a virtual machine change request, they will not be successfully processed. If you believe you need access to a specific folder, please let us know.

Panel

On this page:

Table of Contents
maxLevel2
outlinetrue

The following table shows a brief description and HTTP methods allowed to interact with logical folders.

ResourceURIDescriptionGETPOSTPUTPATCHOPTIONS
Folder/folderLogical Folder Management resource. List permitted folders and their attributes(tick) (tick)   (tick)
Note
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/folder.

Code Block
languagebash
http OPTIONS "https://vss-api.eis.utoronto.ca:8001/v2/network"
curl -X OPTIONS "https://vss-api.eis.utoronto.ca:8001/v2/network" 

 

List

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

NameTypeDescription
namestringFolder name.
parentstringParent folder name.
morefstringvCenter Managed Object Reference (moref)
_linksarrayList of URIs related to the resource.
full_pathstringvCenter full path to the folder

The following examples implements HTTPie and CURL to list all folders a user have access to:

Code Block
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/folder"
curl -u $TK -X GET "https://vss-api.eis.utoronto.ca:8001/v2/folder"
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/folder"
    },
    "data": [
        {
            "_links": {
                "self": "https://vss-api.eis.utoronto.ca:8001/v2/folder/group-v6736"
            },
            "full_path": "VSS > Sandbox > jm > APIDemo",
            "moref": "group-v6736",
            "name": "APIDemo",
            "parent": "jm"
        },
        {
            "_links": {
                "self": "https://vss-api.eis.utoronto.ca:8001/v2/folder/group-v6749"
            },
            "full_path": "VSS > Sandbox > jm > DockerDatacenter",
            "moref": "group-v6749",
            "name": "DockerDatacenter",
            "parent": "jm"
        }
    ],
    "meta": {
        "count": 2,
        "time": "0.46083s",
        "user": "jm"
    }
}

Filters

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

NameDescription
NameFolder name
morefvCenter Managed Object Reference (moref)

The following examples show how to make a GET request, which in both cases, the result would be the same because APIDemo moref contains number 6379.

Code Block
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/folder?name=API"
http -a $TK GET "https://vss-api.eis.utoronto.ca:8001/v2/folder?moref=6736"
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/folder"
    },
    "data": [
        {
            "_links": {
                "self": "https://vss-api.eis.utoronto.ca:8001/v2/folder/group-v6736"
            },
            "full_path": "VSS > Sandbox > jm > APIDemo",
            "moref": "group-v6736",
            "name": "APIDemo",
            "parent": "jm"
        }
    ],
    "meta": {
        "count": 1,
        "time": "0.46083s",
        "user": "jm"
    }
}

List specific folder info

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

NameTypeDescription
vmsarrayArray of Virtual Machines in folder.
vmCountintegerNumber of virtual machines in folder

The following example, requests information about a particular Folder using the base resource /v2/folder and appending the moref to get the URI /v2/folder/group-v6736:

Code Block
http -a $TK GET https://vss-api.eis.utoronto.ca:8001/v2/folder/group-v6736
curl -u $TK -X GET https://vss-api.eis.utoronto.ca:8001/v2/folder/dvportgroup-92

HTTP response body would look something like: