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 - 24.04

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Teradata Data Lab
Teradata Viewpoint
Release Number
24.04
Published
April 2024
Language
English (United States)
Last Update
2024-04-29
dita:mapPath
qko1711972084905.ditamap
dita:ditavalPath
ft:empty
dita:id
prd1525780132746
Product Category
Analytical Ecosystem
List reports for users/roles/groups for the data provided for a system
[
  {
    "name": "viewpoint",
    "group_name": "demo",
    "lab_name": "(all)",
    "access": "Full",
    "permissions": "User"
  }
]
Create lab group return status
{
  "success": true,
  "groupid": 100,
  "cancel": false
}
Lab Group
{ 
"system_id": 1, // The id of the system 
"group_id": 1, // The is of the lab group 
"group_name": "Group1", // Specifies the group name 
"parent_database": "dbc", // Specifies parent database for the lab group 
"lab_group_size": 0, // Allocated space for the lab group in bytes (min: 1, max: 9999 
"description": "", // Description of the lab group 
"is_data_privacy_enabled": true, //Boolean value to enable/disable data privacy: default is false 
"space_notification_threshold": 0, // When allocated space is within this percentage of the lab group size a notification is sent. Default: 10 
"enable_users_list": true, // Enable display of users and roles for the lab group and labs 
"default_lab_size": 0, // Default size for all labs under this lab group 
"enable_default_lab_expiration": true, // Enable default lab expiration. Default: true 
"default_lab_expiration": 0, // The number of days after which lab will expire. Default: 90 (min: 1,max: 9999) 
"enable_limit_expiration_duration": true, // Enable a limit for expiration duration. Default: false 
"limit_request_expiration_duration": 0, // Limit the number of days upto which a lab expiration can be set. Default:365 (min: 1, max: 9999) 
"enable_days_before_expired_lab_deletion": true, // Enable the setting of deleting lab post expiration. Default: false 
"days_before_expired_lab_deletion": 0, // Set the number of days post expiration that a lab gets deleted. Default: 14 (min: 1, max: 9999) 
"lab_prefix": "string", // id used to associate labs with one another (max length: 12 characters) 
"default_lab_instructions": "", // Default Lab instructions for all labs in labgroup provide guidance and best practices to help lab users. 
"enable_max_lab_size": true, // Enable limiting max lab size 
"max_lab_size": 0, // The max lab size 
"enable_max_lab_age": true, // Enable limiting cumulative lab life 
" max_lab_age": 0, // Maximum cumulative lab life 
" default_lab_notification_expiration": 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 
" default_lab_notification_space": 0, // Default allocated space when within this percentage of the lab size a notification is sent. Default: 10 (min: 1, max: 100) 
" enable_create_table": true, //To enable create object set to true 
" enable_statistics": true, //To enable statistics set to true 
" enable_execute_proc": true, //To enable execute procedure set to true 
" enable_execute_function": true, //To enable execute function set to true 
" enable_show": true, //To enable show set to true set to true 
" enable_alter_proc": true, //To enable alter procedure set to true 
" enable_alter_function": true, //To enable alter function set to true 
" enable_alter_external_proc": true, // To enable alter external procedure set to true 
" enable_create_external_proc": 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 }
], 
" group_type": "public", // Type of group – public or private
" access_limit": "string", // Access controls determine who can access the labs in a labgroup. Values – all or include or exclude
" private_users": [ // List of users who can view the labs in a lab group
{ "name": "All", 
"userid": 0, 
" read_only": true, 
" is_role": false } ], 
" exclude_roles": false, //Disable configuration of user access using roles 
" include_default_users": true, //Enable settings for Teradata users and roles to have access to all labs in this lab group. 
" default_users": [ // Select the list of Teradata users and roles which have default access to all labs in the lab group
{ "name": "akram", 
"userid": 0, 
" read_only": true, 
" is_role": false } ], 
" approval_policy_rules": 
[ { " approval_request_type": "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 
" threshold_name": "SIZE_MAX", // Values - SIZE_MAX, BOOLEAN_NO_THRESHOLD, DURATION_MAX
" auto_approval_enabled": true, 
" lab_owner_approval_enabled": true, 
" group_owner_approval_enabled": true, 
" auto_approval_threshold": 0, // Threshold for automatic approvals 
" lab_owner_approval_threshold": 0, // Threshold for lab owner approvals 
" group_owner_approval_threshold": 0 // Threshold for lab group owner approvals 
  } ], 
" automatic_rejection_lab_age": false, // Automatically reject requests exceeding the maxLabAge 
" automatic_rejection_lab_size": false // Automatically reject requests exceeding the maxLabSize 
}
List lab groups (IncludePrivacyInfo=true)
[
  {
    "group_id": 20,
    "name": "AnnualSales",
    "parent_db": "DBC",
    "is_private": 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",
    “is_data_privacy_enabled”: true,
    "privacy_info": {
      "access_limit": "INCLUDE",
      "users": [
        "akram",
        "hussain",
        "akramhussain"
      ],
      "roles": [
        "evenrole",
        "oddrole"
      ]
    }
  },
  {
    " group_id ": 41,
    "name": "Finance",
    "parentDB": "DBC",
    " is_private ": true,
    "size": 3600000000,
    "allocated": 220000000,
    "used": 1400000,
    "description": "This is a lab group for Finance",
    "location": "labs_Finance",
   “is_data_privacy_enabled”: true,
    "created": "2018-04-25T16:40:42Z",
    "privacy_info": {
      "access_limit": "EXCLUDE",
      "users": [
        "All",
        "akram",
        "hussain",
        "akramhussain"
      ],
      "roles": [
        "PDCR_Access",
        "PDCR_Admin",
        "PDCR_Canary"
      ]
    }
  }
]
List lab group owners
[
  {
    "name": "akram",
    "is_role": false
  },
  {
    "name": "dlgown004",
    "is_role": true
  }
]
List lab users and roles
{
  "users_and_roles": [
    {
      "name": "DBC",
      "userid": null,
      "read_only": false,
      "is_role": false
    },
    {
      "name": "Administrator",
      "userid": null,
      "read_only": false,
      "is_role": true
    }
  ],
  "default_users_and_roles": [
    {
      "name": "akram",
      "userid": null,
      "read_only": false,
      "is_role": false
    },
    {
      "name": "viewpoint",
      "userid": null,
      "read_only": false,
      "is_role": false
    }
  ]
}

Lab
{
 "lab_name": "Lab1", // name of lab 
"lab_instructions": "", // 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. 
"lab_size": 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 
"lab_notification_expiration": 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) 
"lab_notification_space": 0, // When allocated space is within this percentage of the lab size a notification is sent. Default: 10 
"lab_expiration": 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
[
  {
    "lab_id": 225,
    "lab_name": "Lab1",
    "creation_date": "2021-06-28T14:26:00.021Z",
    "expiration_date": "2021-09-26T14:25:59.708Z",
    "group_id": 123,
    "notification_expiration": 14,
    "notification_space": 10
  },
{ 
"lab_id": 226, 
"lab_name": "Lab2",


]
List lab owners
[
  {
    "name": "admin",
    "is_role": false
  },
  {
    "name": "dlgown004",
    "is_role": true
  }
]

List request log (log=true)
 [
  {
    "log_id": 247,
    "request_id": 139,
    "action": "REQUEST",
    "system_name": "Almond",
    "request_type": "ADD_LAB",
    "log_date": "2018-07-27 09:02:45.096",
    "group_name": "Guild",
    "lab_name": "Edric",
    "location": "Edric",
    "is_automatic_approval": false,
    "approver": "akram",
    "requestor": "ah250068",
    "additional_info": {
      "expires": "2018-10-25 09:02:45.091",
      "size": 1048576
    }
  },
  {
    "log_id": 190,
    "request_id": 108,
    "action": "EXECUTION",
    "system_name": "Almond",
    "request_type": "NEW_LAB_GROUP",
    "log_date": "2018-07-26 16:39:55.572",
    "status": "FAILED",
    "group_name": "Bachelor",
    "location": "labs_Bachelor",
    "is_automatic_approval": true,
    "requestor": "akram",
"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",
  "lab_size": 0 // new size in bytes
}
Extend Lab
{
  "comments": "string",
  "require_expiration": true, // if require_expiration is false then lab won’t expire
  "expiration_days": 30 // expiration_days is required if “requireExpiration” is true
}
Lab Users and Roles
{
 "users_and_roles": [
 {
 "name": "All", // Name of the user/role
 "read_only": true, // Read only access to the lab
 "is_role": true //If true: the name refers to a role
 },
 {
 "name": "viewpoint", // Name of the user/role
 "read_only": true, // Read only access to the lab
 "is_role": false //If false: the name refers to a user
} 
]
 }
Drop Object
{
 "table_name": "string", //name of the object to be dropped
 "comments": "string"
}
Lab Owner
{
 "comments": "",
 "owners": [
 {
 "name": "Administrator", // Name of the owner
 "is_rRole": true // True: if the name refers to role
 },
 {
 "name": "akram",
 "is_role": false // False: if the name refers to a user
}
]
}
Reinstate Lab
{
 "comments": "string",
 "require_expiration": true, // if require_expiration is false then lab
won’t expire
 "lab_expiration": 0 // lab_expiration is required if “require_expiration” is true
}
Permissions of a lab group: (To grant additional full access lab permissions for default users and lab users)
{
 "enable_create_table": true, //To enable create object set to true
 "enable_statistics": false, //To enable statistics set to true
 "enable_execute_proc": false, //To enable execute procedure set to true
 "enable_execute_function": false, //To enable execute function set to true
 "enable_show": false,  to true
 "enable_alter_proc": false, //To enable alter procedure set to true
 "enable_alter_function": false, //To enable alter function set to true
 "enable_alter_external_proc": false, // To enable alter external procedure set to true
 "enable_create_external_proc": 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 group_owner_approval_enabled,
auto_approval_enabled, and lab_owner_approval_enabledcan be true
 "approval_request_type": "ADD_LAB_OWNER",
 "threshold_name": "BOOLEAN_NO_THRESHOLD",
 "auto_approval_enabled": false,
 "lab_owner_approval_enabled": false,
 "group_owner_approval_enabled": true,
 "auto_approval_threshold": 0,
 "lab_owner_approval_threshold": 0,
 "group_owner_approval_threshold": 0
 },
 { // for DELETE_LAB type -> only one among group_owner_approval_enabled,
auto_approval_enabled, and lab_owner_approval_enabled can be true
 "approval_request_type": "DELETE_LAB",
 "threshold_name": "BOOLEAN_NO_THRESHOLD",
 "auto_approval_enabled": false,
 "lab_owner_approval_enabled": false,
 "group_owner_approval_enabled": true,
 "auto_approval_threshold": 0,
 "lab_owner_approval_threshold": 0,
 "group_owner_approval_threshold": 0
 },
 { // for REMOVE_LAB_SPACE type -> only one among group_owner_approval_enabled,
auto_approval_enabled, and lab_owner_approval_enabled can be true
 "approval_request_type": "REMOVE_LAB_SPACE",
 "threshold_name": "BOOLEAN_NO_THRESHOLD",
 "auto_approval_enabled": false,
 "lab_owner_approval_enabled": false,
 "group_owner_approval_enabled": true,
 "auto_approval_threshold": 0,
 "lab_owner_approval_threshold": 0,
 "group_owner_approval_threshold": 0
 },
 { // for REMOVE_TABLE type -> only one among group_owner_approval_enabled,
auto_approval_enabled, and lab_owner_approval_enabled can be true
 "approval_request_type": "REMOVE_TABLE",
 "threshold_name": "BOOLEAN_NO_THRESHOLD",
 "auto_approval_enabled": false,
 "lab_owner_approval_enabled": false,
 "group_owner_approval_enabled": true,
 "auto_approval_threshold": 0,
 "lab_owner_approval_threshold": 0,
 "group_owner_approval_threshold": 0
 },
 {
 "approval_request_type": "ADD_LAB_SPACE",
 "threshold_name": "SIZE_MAX", // max size in bytes for lab as threshold for
automatic approval.
 "auto_approval_enabled": false, // auto_approval_enabled will be true if
auto_approval_threshold is provided
 "lab_owner_approval_enabled": false, // lab_owner_approval_enabled will be true if
lab_owner_approval_threshold is provided
 "group_owner_approval_enabled": true, // group_owner_approval_enabled will be true
for ADD_LAB_SPACE
 "auto_approval_threshold": 0,
 "lab_owner_approval_threshold": 0,
 "group_owner_approval_threshold": 0
 },
 {
 "approval_request_type": "CHANGE_LAB_EXPIRATION",
 "threshold_name": "DURATION_MAX", // max no of days for lab expiration as
threshold for automatic approval
 "auto_approval_enabled": false, // auto_approval_enabledwill be true if
auto_approval_threshold is provided
 "lab_owner_approval_enabled": false, // lab_owner_approval_enabledwill be true if
lab_owner_approval_threshold is provided
 "group_owner_approval_enabled": true, // group_owner_approval_enabledwill be true
for CHANGE_LAB_EXPIRATION
 "auto_approval_threshold": 0,
 "lab_owner_approval_threshold": 0,
 "group_owner_approval_threshold": 0
 },
 {
 "approval_request_type": "ADD_LAB",
 "threshold_name": "SIZE_MAX", // max size in bytes for lab as threshold for
automatic approval.
 "auto_approval_enabled": false, // auto_approval_enabledwill be true if
auto_approval_threshold is provided
 "lab_owner_approval_enabled": false, // lab_owner_approval_enabledwill be true if
lab_owner_approval_enabledis provided
 "group_owner_approval_enabled": true, // group_owner_approval_enabledwill be true
for ADD_LAB
 "auto_approval_threshold": 0,
 "lab_owner_approval_threshold": 0,
 "group_owner_approval_threshold": 0
 },
 { // for REMOVE_LAB_USER_OR_ROLE type -> only one among
group_owner_approval_enabled, auto_approval_enabled, and lab_owner_approval_enabled can
be true
 "approval_request_type": "REMOVE_LAB_USER_OR_ROLE",
 "threshold_name": "BOOLEAN_NO_THRESHOLD",
 "auto_approval_enabled": false,
 "lab_owner_approval_enabled": false,
 "group_owner_approval_enabled": true,
 "auto_approval_threshold": 0,
 "lab_owner_approval_threshold": 0,
 "group_owner_approval_threshold": 0
 },
 { // for ADD_LAB_USER_OR_ROLE type -> only one among
group_owner_approval_enabled, auto_approval_enabled, and lab_owner_approval_enabled can
be true
 "approval_request_type": "ADD_LAB_USER_OR_ROLE",
 "threshold_name": "BOOLEAN_NO_THRESHOLD",
 "auto_approval_enabled": false,
 "lab_owner_approval_enabled": false,
 "group_owner_approval_enabled": true,
 "auto_approval_threshold": 0,
 "lab_owner_approval_threshold": 0,
 "group_owner_approval_threshold": 0
 },
 { // for REMOVE_LAB_OWNER type -> only one among group_owner_approval_enabled,
auto_approval_enabled, and lab_owner_approval_enabled can be true
 "approval_request_type": "REMOVE_LAB_OWNER",
 "threshold_name": "BOOLEAN_NO_THRESHOLD",
 "auto_approval_enabled": false,
 "lab_owner_approval_enabled": false,
 "group_owner_approval_enabled": true,
 "auto_approval_threshold": 0,
 "lab_owner_approval_threshold": 0,
 "group_owner_approval_threshold": 0
 }
]