Data Lab REST APIs | Data Objects | Teradata Viewpoint - Data Objects for Data Lab RESTful API - Teradata Data Lab - Teradata Viewpoint

Teradata® Viewpoint and Teradata® Data Lab API Reference Guide - 22.10

Product
Teradata Data Lab
Teradata Viewpoint
Release Number
22.10
Published
October 2022
Language
English (United States)
Last Update
2022-10-20
dita:mapPath
ejp1661857287902.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2215
lifecycle
previous
Product Category
Analytical Ecosystem
List reports for users/roles/groups for the data provided for a system
[
  {
    "name": "viewpoint",
    "groupName": "demo",
    "labName": "(all)",
    "access": "Full",
    "permissions": "User"
  }
] 
Create lab group return status
{
     "success":true
     "groupid":100
     "cancel":false
} 
Lab Group
{
  "systemId": 1, // The id of the system
  "groupId": 1, // The is of the lab group
  "groupName": "Group1", // Specifies the group name
  "parentDatabase": "dbc", // Specifies parent database for the lab group
  "labGroupSize": 0, // Allocated space for the lab group in bytes (min: 1, max: 9999
  "description": "", // Description of the lab group
  "spaceNotificationThreshold": 0, // When allocated space is within this percentage of the lab group size a notification is sent. Default: 10
  "enableUsersList": true, // Enable display of users and roles for the lab group and labs
  "defaultLabSize": 0, // Default size for all labs under this lab group
  "enableDefaultLabExpiration": true, // Enable default lab expiration. Default: true
  "defaultLabExpiration": 0, // The number of days after which lab will expire. Default: 90 (min: 1,max: 9999)
  "enableLimitExpirationDuration": true, // Enable a limit for expiration duration. Default: false
  "limitRequestExpirationDuration": 0, // Limit the number of days upto which a lab expiration can be set. Default:365 (min: 1, max: 9999)
  "enableDaysBeforeExpiredLabDeletion": true, // Enable the setting of deleting lab post expiration. Default: false
  "daysBeforeExpiredLabDeletion": 0, // Set the number of days post expiration that a lab gets deleted. Default: 14 (min: 1, max: 9999)
  "labPrefix": "string", // id used to associate labs with one another (max length: 12 characters)
  "defaultLabInstructions": "", // Default Lab instructions for all labs in labgroup provide guidance and best practices to help lab users. 
  "enableMaxLabSize": true, // Enable limiting max lab size
  "maxLabSize": 0, // The max lab size
  "enableMaxLabAge": true, // Enable limiting cumulative lab life
  "maxLabAge": 0, // Maximum cumulative lab life
  "defaultLabNotificationExpiration": 0,  // Default number of days (7, 14, or 30) prior to lab expiring that an email notification is sent to the lab owners. Default: 14 
  "defaultLabNotificationSpace": 0, // Default allocated space when within this percentage of the lab size a notification is sent. Default: 10 (min: 1, max: 100)
  "enableCreateTable": true, //To enable create object set to true
  "enableStatistics": true, //To enable statistics set to true
  "enableExecuteProc": true, //To enable execute procedure set to true
  "enableExecuteFunction": true, //To enable execute function set to true
  "enableShow": true, //To enable show set to true set to true
  "enableAlterProc": true, //To enable alter procedure set to true
  "enableAlterFunction": true, //To enable alter function set to true
  "enableAlterExternalProc": true, // To enable alter external procedure set to true
  "enableCreateExternalProc": true, // To enable create external procedure set to true
  "owners": [ // List of owners who have access to this lab group (specified by their Viewpoint username)
    {
      "name": "admin",
      "isRole": false
    }
  ], 
  "groupType": "public", // Type of group – public or private
  "accessLimit": "string", // Access controls determine who can access the labs  in a labgroup. Values – all or include or exclude
  "privateUsers": [ // List of users who can view the labs in a lab group
    {
      "name": "All",
      "userid": 0,
      "readOnly": true,
      "isRole": false
    }
  ],
  "excludeRoles": false, //Disable configuration of user access using roles
  "includeDefaultUsers": true, //Enable settings for Teradata users and roles to have access to all labs in this lab group.
  "defaultUsers": [ // Select the list of Teradata users and roles which have default access to all labs in the lab group
    {
      "name": "user1",
      "userid": 0,
      "readOnly": true,
      "isRole": false
    }
  ],
  "approvalPolicyRules": [
    {
      "approvalRequestType": "ADD_LAB", // Values - ADD_LAB, REMOVE_LAB_USER_OR_ROLE, ADD_LAB_USER_OR_ROLE, REMOVE_LAB_OWNER, ADD_LAB_OWNER, DELETE_LAB, REMOVE_LAB_SPACE, REMOVE_TABLE, ADD_LAB_SPACE, CHANGE_LAB_EXPIRATION
      "thresholdName": "SIZE_MAX", // Values - SIZE_MAX, BOOLEAN_NO_THRESHOLD, DURATION_MAX
      "autoApprovalEnabled": true,
      "labOwnerApprovalEnabled": true,
      "groupOwnerApprovalEnabled": true,
      "autoApprovalThreshold": 0, // Threshold for automatic approvals
      "labOwnerApprovalThreshold": 0, // Threshold for lab owner approvals
      "groupOwnerApprovalThreshold": 0 // Threshold for lab group owner approvals
    }
  ],
  "automaticRejectionLabAge": false, // Automatically reject requests exceeding the maxLabAge
	
  "automaticRejectionLabSize": false // Automatically reject requests exceeding the maxLabSize
} 
List lab groups (IncludePrivacyInfo=true)
[
        {
            "groupId":20,
            "name":"AnnualSales",
            "parentDB":"DBC",
            "isPrivate":false,
            "size":200000000,
            "allocated":10000000,
            "used":500000,
            "description":"This is a lab group for Annual Sales",
            "location":"labs_AnnualSales",
            "created":"2018-06-20T11:10:26Z",
            "privacyInfo": {
                "accessLimit": "INCLUDE",
                "users": [
                    "abc",
                    "adw",
                    "wlauser"
                ],
                "roles": [
                    "evenrole",
                    "oddrole"
                ]
            } 
        }, 
        {
            "groupId":41,
            "name":"Finance",
            "parentDB":"DBC",
            "isPrivate":true,
            "size":3600000000,
            "allocated":220000000,
            "used":1400000,
            "description":"This is a lab group for Finance",
            "location":"labs_Finance",
            "created":"2018-04-25T16:40:42Z",
            "privacyInfo": {
                "accessLimit": "EXCLUDE",
                "users": [
                    "All",
                    "abc",
                    "abortuser",
                    "adw"
                ],
                "roles": [
                    "PDCR_Access",
                    "PDCR_Admin",
                    "PDCR_Canary"
                ]
            }
        }
]
List lab group owners
[
        {
            "name":"admin",
            "isRole":false
        },
        {
            "name":"dlgown004"
            "isRole":true
        }
]
List lab users and roles
{
  "usersAndRoles": [
    {
      "name": "DBC",
      "userid": null,
      "readOnly": false,
      "isRole": false
    },
	{
      "name": "Administrator",
      "userid": null,
      "readOnly": false,
      "isRole": true
    }
  ],
  "defaultUsersAndRoles": [
    {
      "name": "srota",
      "userid": null,
      "readOnly": false,
      "isRole": false
    },
    {
      "name": "viewpoint",
      "userid": null,
      "readOnly": false,
      "isRole": false
    }
  ]
}
Lab
{
  "labName": "Lab1", // name of lab
  "labInstructions": "", // Lab instructions provide guidance and best practices to help lab users. For example, provide information for loading data into objects using Teradata Data Mover or load utilities such as FastLoad or MultiLoad.
  "labSize": 0, // Size of lab (if not set, the size is set to defaultLabSize, which is set during lab group creation)
  "description": "string", // Description of the lab
  "labNotificationExpiration": 0, // Select the number of days prior to this lab expiring that an email notification is sent to the lab owners. Default: 14(min: 1, max: 9999)
  "labNotificationSpace": 0, // When allocated space is within this percentage of the lab size a notification is sent. Default: 10
  "labExpiration": 0 // Select the number of days from 1 to 9999 to shorten the lab expiration date. The new lab expiration date must predate the current lab expiration date.
}
List labs
[
    {
      "labId": 225,
      "labName": "Lab1",
      "creationDate": "2021-06-28T14:26:00.021Z",
      "expirationDate": "2021-09-26T14:25:59.708Z",
      "groupId": 123,
      "notificationExpiration": 14,
      "notificationSpace": 10
    },
    {
      "labId": 226,
      "labName": "Lab2",

]
List lab owners
[
        {
            "name":"admin",
            "isRole":false
        },
        {
            "name":"dlgown004"
            "isRole":true
        }
]
List request log (log=true)
[
    {
      "logId": 247,
      "requestId": 139,
      "action": "REQUEST",
      "systemName": "Almond",
      "requestType": "ADD_LAB",
      "logDate": "2018-07-27 09:02:45.096",
      "groupName": "Guild",
      "labName": "Edric",
      "location": "Edric",
      "isAutomaticApproval": false,
      "approver": "admin",
      "requestor": "ss185026",
      "additionalInfo": {
        "expires": "2018-10-25 09:02:45.091",
        "size": 1048576
    },
    {
      "logId": 190,
      "requestId": 108,
      "action": "EXECUTION",
      "systemName": "Almond",
      "requestType": "NEW_LAB_GROUP",
      "logDate": "2018-07-26 16:39:55.572",
      "status": "FAILED",
      "groupName": "Bachelor",
      "location": "labs_Bachelor",
      "isAutomaticApproval": true,
      "requestor": "admin",
      "error": "Step failed: Create lab group user Bachelor.  [Teradata Database] [TeraJDBC 16.20.00.01] [Error 5612] [SQLState HY000] A user, database, role, or zone with the specified name already exists."
    }
] 
Lab Size
{
  "comments": "string",
  "labSize": 0 // new size in bytes
}
Extend Lab
{
  "comments": "string",
  "requireExpiration": true, // if requireExpiration is false then lab won’t expire
  "expirationDays": 30 // expirationDays is required if “requireExpiration” is true
}
Lab Users and Roles
{
  "usersAndRoles": [
    {
      "name": "All", // Name of the user/role
      "readOnly": true, // Read only access to the lab
      "isRole": true //If true: the name refers to a role
    },
   {
      "name": "viewpoint", // Name of the user/role
      "readOnly": true, // Read only access to the lab
      "isRole": false //If false: the name refers to a user
    }
  ]
}
Drop Object
{
  "tableName": "string",     //name of the object to be dropped
  "comments": "string"
}
Lab Owner
{
  "comments": "",
  "owners": [
    {
      "name": "Administrator", // Name of the owner
      "isRole": true // True: if the name refers to role
    },
   {
      "name": "user1",
      "isRole": false // False: if the name refers to a user
}
]
}
Reinstate Lab
{
  "comments": "string",
  "requireExpiration": true, // if requireExpiration is false then lab won’t expire
  "labExpiration": 0 // labExpiration is required if “requireExpiration” is true

}
Permissions of a lab group: (To grant additional full access lab permissions for default users and lab users)
{
  "enableCreateTable": true,             //To enable create object set to true
  "enableStatistics": false,                  //To enable statistics set to true
  "enableExecuteProc": false,            //To enable execute procedure set to true
  "enableExecuteFunction": false,    //To enable execute function set to true
  "enableShow": false,                        //To enable show set to true set to true
  "enableAlterProc": false,                 //To enable alter procedure set to true
  "enableAlterFunction": false,         //To enable alter function set to true
  "enableAlterExternalProc": false,  // To enable alter external procedure set to true
  "enableCreateExternalProc": false// To enable create external procedure set to true
}
List of approval policy rules of a lab group:
// BOOLEAN_NO_THRESHOLD means that there will no Threshold
[
  { // for ADD_LAB_OWNER type ->  only one among groupOwnerApprovalEnabled, autoApprovalEnabled, and labOwnerApprovalEnabled can be true
    "approvalRequestType": "ADD_LAB_OWNER",
    "thresholdName": "BOOLEAN_NO_THRESHOLD",
    "autoApprovalEnabled": false,
    "labOwnerApprovalEnabled": false,
    "groupOwnerApprovalEnabled": true,
    "autoApprovalThreshold": 0,
    "labOwnerApprovalThreshold": 0,
    "groupOwnerApprovalThreshold": 0
  },
  { // for DELETE_LAB type -> only one among groupOwnerApprovalEnabled, autoApprovalEnabled, and labOwnerApprovalEnabled can be true
    "approvalRequestType": "DELETE_LAB",
    "thresholdName": "BOOLEAN_NO_THRESHOLD",
    "autoApprovalEnabled": false,
    "labOwnerApprovalEnabled": false,
    "groupOwnerApprovalEnabled": true,
    "autoApprovalThreshold": 0,
    "labOwnerApprovalThreshold": 0,
    "groupOwnerApprovalThreshold": 0
  },
  { // for REMOVE_LAB_SPACE type -> only one among groupOwnerApprovalEnabled, autoApprovalEnabled, and labOwnerApprovalEnabled can be true
    "approvalRequestType": "REMOVE_LAB_SPACE",
    "thresholdName": "BOOLEAN_NO_THRESHOLD",
    "autoApprovalEnabled": false,
    "labOwnerApprovalEnabled": false,
    "groupOwnerApprovalEnabled": true,
    "autoApprovalThreshold": 0,
    "labOwnerApprovalThreshold": 0,
    "groupOwnerApprovalThreshold": 0
  },
  { // for REMOVE_TABLE type ->  only one among groupOwnerApprovalEnabled, autoApprovalEnabled, and labOwnerApprovalEnabled can be true
    "approvalRequestType": "REMOVE_TABLE",
    "thresholdName": "BOOLEAN_NO_THRESHOLD", 
    "autoApprovalEnabled": false,
    "labOwnerApprovalEnabled": false,
    "groupOwnerApprovalEnabled": true,
    "autoApprovalThreshold": 0,
    "labOwnerApprovalThreshold": 0,
    "groupOwnerApprovalThreshold": 0
  },
  {
    "approvalRequestType": "ADD_LAB_SPACE",
    "thresholdName": "SIZE_MAX", // max size in bytes for lab as threshold for automatic approval.
    "autoApprovalEnabled": false, // autoApprovalEnabled will be true if autoApprovalThreshold is provided
    "labOwnerApprovalEnabled": false, // labOwnerApprovalEnabled will be true if labOwnerApprovalThreshold is provided
    "groupOwnerApprovalEnabled": true, // groupOwnerApprovalEnabled will be true for ADD_LAB_SPACE
    "autoApprovalThreshold": 0,
    "labOwnerApprovalThreshold": 0,
    "groupOwnerApprovalThreshold": 0
  },
  {
    "approvalRequestType": "CHANGE_LAB_EXPIRATION",
    "thresholdName": "DURATION_MAX", // max no of days for lab expiration as threshold for automatic approval
    "autoApprovalEnabled": false, // autoApprovalEnabled will be true if autoApprovalThreshold is provided
    "labOwnerApprovalEnabled": false, // labOwnerApprovalEnabled will be true if labOwnerApprovalEnabled is provided
    "groupOwnerApprovalEnabled": true, // groupOwnerApprovalEnabled will be true for CHANGE_LAB_EXPIRATION
    "autoApprovalThreshold": 0,
    "labOwnerApprovalThreshold": 0,
    "groupOwnerApprovalThreshold": 0
  },
  {
    "approvalRequestType": "ADD_LAB",
    "thresholdName": "SIZE_MAX", // max size in bytes for lab as threshold for automatic approval.
    "autoApprovalEnabled": false, // autoApprovalEnabled will be true if autoApprovalThreshold is provided
    "labOwnerApprovalEnabled": false, // labOwnerApprovalEnabled will be true if labOwnerApprovalEnabled is provided
    "groupOwnerApprovalEnabled": true, // groupOwnerApprovalEnabled will be true for ADD_LAB
    "autoApprovalThreshold": 0,
    "labOwnerApprovalThreshold": 0,
    "groupOwnerApprovalThreshold": 0
  },
  { // for REMOVE_LAB_USER_OR_ROLE type -> only one among groupOwnerApprovalEnabled, autoApprovalEnabled, and labOwnerApprovalEnabled can be true
    "approvalRequestType": "REMOVE_LAB_USER_OR_ROLE",
    "thresholdName": "BOOLEAN_NO_THRESHOLD",
    "autoApprovalEnabled": false,
    "labOwnerApprovalEnabled": false,
    "groupOwnerApprovalEnabled": true,
    "autoApprovalThreshold": 0,
    "labOwnerApprovalThreshold": 0,
    "groupOwnerApprovalThreshold": 0
  },
  { // for ADD_LAB_USER_OR_ROLE type -> only one among groupOwnerApprovalEnabled, autoApprovalEnabled, and labOwnerApprovalEnabled can be true
    "approvalRequestType": "ADD_LAB_USER_OR_ROLE",
    "thresholdName": "BOOLEAN_NO_THRESHOLD",
    "autoApprovalEnabled": false,
    "labOwnerApprovalEnabled": false,
    "groupOwnerApprovalEnabled": true,
    "autoApprovalThreshold": 0,
    "labOwnerApprovalThreshold": 0,
    "groupOwnerApprovalThreshold": 0
  },
  { // for REMOVE_LAB_OWNER type ->  only one among groupOwnerApprovalEnabled, autoApprovalEnabled, and labOwnerApprovalEnabled can be true
    "approvalRequestType": "REMOVE_LAB_OWNER",
    "thresholdName": "BOOLEAN_NO_THRESHOLD",
    "autoApprovalEnabled": false,
    "labOwnerApprovalEnabled": false,
    "groupOwnerApprovalEnabled": true,
    "autoApprovalThreshold": 0,
    "labOwnerApprovalThreshold": 0,
    "groupOwnerApprovalThreshold": 0
  }
]