| Required role: | TenantReader |
| POST | /api/collections/ | Creates a new collection | |
|---|---|---|---|
| POST | /collections/ | Creates a new collection |
"use strict";
/** @typedef {'None'|'ConfigItem'|'Tenant'|'Collection'|'Resource'|'ComputeNode'|'VirtualMachine'|'PhysicalMachine'|'Disk'|'Subnet'|'IPAddress'|'Job'|'JobEvent'|'FreezePeriod'|'ResourceGroup'|'Deployment'|'ResourceGroupTemplate'|'DeploymentTemplate'|'ResourceProvider'|'GenericResource'|'Role'|'Permission'|'User'|'PatchingWindow'|'Update'|'ReportDefinition'|'TimeSeries'|'DataPoint'|'Action'|'ActionAssignment'|'UserNote'} */
export var ObjectTypes;
(function (ObjectTypes) {
ObjectTypes["None"] = "None"
ObjectTypes["ConfigItem"] = "ConfigItem"
ObjectTypes["Tenant"] = "Tenant"
ObjectTypes["Collection"] = "Collection"
ObjectTypes["Resource"] = "Resource"
ObjectTypes["ComputeNode"] = "ComputeNode"
ObjectTypes["VirtualMachine"] = "VirtualMachine"
ObjectTypes["PhysicalMachine"] = "PhysicalMachine"
ObjectTypes["Disk"] = "Disk"
ObjectTypes["Subnet"] = "Subnet"
ObjectTypes["IPAddress"] = "IPAddress"
ObjectTypes["Job"] = "Job"
ObjectTypes["JobEvent"] = "JobEvent"
ObjectTypes["FreezePeriod"] = "FreezePeriod"
ObjectTypes["ResourceGroup"] = "ResourceGroup"
ObjectTypes["Deployment"] = "Deployment"
ObjectTypes["ResourceGroupTemplate"] = "ResourceGroupTemplate"
ObjectTypes["DeploymentTemplate"] = "DeploymentTemplate"
ObjectTypes["ResourceProvider"] = "ResourceProvider"
ObjectTypes["GenericResource"] = "GenericResource"
ObjectTypes["Role"] = "Role"
ObjectTypes["Permission"] = "Permission"
ObjectTypes["User"] = "User"
ObjectTypes["PatchingWindow"] = "PatchingWindow"
ObjectTypes["Update"] = "Update"
ObjectTypes["ReportDefinition"] = "ReportDefinition"
ObjectTypes["TimeSeries"] = "TimeSeries"
ObjectTypes["DataPoint"] = "DataPoint"
ObjectTypes["Action"] = "Action"
ObjectTypes["ActionAssignment"] = "ActionAssignment"
ObjectTypes["UserNote"] = "UserNote"
})(ObjectTypes || (ObjectTypes = {}));
export class TagDto {
/** @param {{name?:string,value?:string,isProtected?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
name;
/** @type {?string} */
value;
/** @type {boolean} */
isProtected;
}
export class PathItemDto {
/** @param {{label?:string,link?:string,objectType?:ObjectTypes,objectId?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
label;
/** @type {string} */
link;
/** @type {ObjectTypes} */
objectType;
/** @type {string} */
objectId;
}
export class LinkDto {
/** @param {{caption?:string,rel?:string,hRef?:string,method?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
caption;
/** @type {string} */
rel;
/** @type {string} */
hRef;
/** @type {string} */
method;
}
export class ConfigItemDto {
/** @param {{id?:string,name?:string,displayName?:string,description?:string,objectType?:ObjectTypes,selfLink?:string,tags?:IList<TagDto>,path?:IList<PathItemDto>,created?:string,createUser?:string,createUserId?:string,modified?:string,modifyUser?:string,modifyUserId?:string,isDeleted?:boolean,deleted?:string,deleteUser?:string,deleteUserId?:string,links?:IList<LinkDto>}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
id;
/** @type {string} */
name;
/** @type {string} */
displayName;
/** @type {?string} */
description;
/** @type {ObjectTypes} */
objectType;
/** @type {string} */
selfLink;
/** @type {IList<TagDto>} */
tags;
/** @type {IList<PathItemDto>} */
path;
/** @type {string} */
created;
/** @type {string} */
createUser;
/** @type {string} */
createUserId;
/** @type {string} */
modified;
/** @type {string} */
modifyUser;
/** @type {string} */
modifyUserId;
/** @type {boolean} */
isDeleted;
/** @type {?string} */
deleted;
/** @type {?string} */
deleteUser;
/** @type {?string} */
deleteUserId;
/** @type {IList<LinkDto>} */
links;
}
/** @typedef {'String'|'Number'|'Boolean'|'List'} */
export var ValueDataType;
(function (ValueDataType) {
ValueDataType["String"] = "String"
ValueDataType["Number"] = "Number"
ValueDataType["Boolean"] = "Boolean"
ValueDataType["List"] = "List"
})(ValueDataType || (ValueDataType = {}));
/** @typedef {'Lab'|'Poc'|'Dev'|'Test'|'Int'|'Uat'|'Prod'} */
export var Environments;
(function (Environments) {
Environments["Lab"] = "Lab"
Environments["Poc"] = "Poc"
Environments["Dev"] = "Dev"
Environments["Test"] = "Test"
Environments["Int"] = "Int"
Environments["Uat"] = "Uat"
Environments["Prod"] = "Prod"
})(Environments || (Environments = {}));
export class VariableDto {
/** @param {{name?:string,value?:string,type?:ValueDataType,description?:string,isInherited?:boolean,environment?:Environments}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
name;
/**
* @type {string}
* @description Value in form of a json string (e.g. Number = 1234, String = "foo", Boolean = false, List = [1,2,3,4]). Note: string values need extra quotes */
value;
/**
* @type {ValueDataType}
* @description The data type of the value property */
type;
/** @type {?string} */
description;
/** @type {boolean} */
isInherited;
/** @type {?Environments} */
environment;
}
export class TenantDto extends ConfigItemDto {
/** @param {{variables?:IList<VariableDto>,allowedMailDomains?:IList<string>,licensedModules?:IList<string>,defaultDeploymentLifetimeDays?:number,maxDeploymentLifetimeDays?:number,systemUnpatchedWarningDays?:number,systemBackupMissingWarningHours?:number,stopVulnerableResourceAfterDays?:number,deploymentExpirationWarningDays?:number,patchNotificationDays?:number,useCustomHostnames?:boolean,removeInactiveVulnerabilitiesAfterDays?:number,links?:IList<LinkDto>,id?:string,name?:string,displayName?:string,description?:string,objectType?:ObjectTypes,selfLink?:string,tags?:IList<TagDto>,path?:IList<PathItemDto>,created?:string,createUser?:string,createUserId?:string,modified?:string,modifyUser?:string,modifyUserId?:string,isDeleted?:boolean,deleted?:string,deleteUser?:string,deleteUserId?:string,links?:IList<LinkDto>}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/**
* @type {IList<VariableDto>}
* @description Variables defined on tenant level */
variables;
/**
* @type {IList<string>}
* @description Allowed email domains used for authentication */
allowedMailDomains;
/**
* @type {IList<string>}
* @description List of licensed modules for this tenant */
licensedModules;
/**
* @type {number}
* @description Amount of days until a Deployment expires */
defaultDeploymentLifetimeDays;
/**
* @type {number}
* @description Max amount of days until a Deployment expires */
maxDeploymentLifetimeDays;
/**
* @type {number}
* @description Amount of days without patching until a unpatched warning is shown */
systemUnpatchedWarningDays;
/**
* @type {number}
* @description Amount of hours without backup until a backup missing warning is shown */
systemBackupMissingWarningHours;
/**
* @type {number}
* @description Amount of days until a vulnerable resource is getting stopped */
stopVulnerableResourceAfterDays;
/**
* @type {number}
* @description Amount of days before deployment expiration, which triggers the expiration warning */
deploymentExpirationWarningDays;
/**
* @type {number}
* @description Amount of days the patch notification is sent out prior to the patch date */
patchNotificationDays;
/**
* @type {boolean}
* @description Use a pool with your own hostnames (true) or let the hostname be auto generated (false) */
useCustomHostnames;
/**
* @type {number}
* @description After how many days inactive vulnerabilities will be purged from database */
removeInactiveVulnerabilitiesAfterDays;
/** @type {IList<LinkDto>} */
links;
}
export class DeploymentCollectionDto extends ConfigItemDto {
/** @param {{tenantId?:string,tenant?:TenantDto,variables?:IList<VariableDto>,isLostAndFound?:boolean,monthlyBudget?:number,sendBudgetNotificationMails?:boolean,budgetWarningThresholdPercent?:number,links?:IList<LinkDto>,id?:string,name?:string,displayName?:string,description?:string,objectType?:ObjectTypes,selfLink?:string,tags?:IList<TagDto>,path?:IList<PathItemDto>,created?:string,createUser?:string,createUserId?:string,modified?:string,modifyUser?:string,modifyUserId?:string,isDeleted?:boolean,deleted?:string,deleteUser?:string,deleteUserId?:string,links?:IList<LinkDto>}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {string} */
tenantId;
/** @type {?TenantDto} */
tenant;
/**
* @type {IList<VariableDto>}
* @description A collection scoped list of variables */
variables;
/**
* @type {boolean}
* @description Defines the collection where scanned but not deployed resources will be stored */
isLostAndFound;
/**
* @type {?number}
* @description The monthly cost budget for the whole collection */
monthlyBudget;
/**
* @type {?boolean}
* @description Whether to send budget information mails to the collection owners */
sendBudgetNotificationMails;
/**
* @type {?number}
* @description A threshold, when to send the first budget warning mail */
budgetWarningThresholdPercent;
/** @type {IList<LinkDto>} */
links;
}
export class CreateCollection {
/** @param {{tenantName?:string,name?:string,displayName?:string,description?:string,isLostAndFound?:boolean,variables?:IList<VariableDto>,tags?:IList<TagDto>}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
tenantName;
/**
* @type {string}
* @description The collections name */
name;
/**
* @type {?string}
* @description The collections display name */
displayName;
/**
* @type {?string}
* @description A more detailed description for the collection */
description;
/**
* @type {?boolean}
* @description Defines the collections where scanned but not deployed resources will be stored */
isLostAndFound;
/** @type {?IList<VariableDto>} */
variables;
/** @type {?IList<TagDto>} */
tags;
}
JavaScript CreateCollection DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/collections/ HTTP/1.1
Host: core.starburst.svc
Accept: application/json
Content-Type: application/json
Content-Length: length
{"tenantName":"String","name":"String","displayName":"String","description":"String","isLostAndFound":false,"variables":null,"tags":null,"txId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"tenantId":"00000000-0000-0000-0000-000000000000","tenant":{"variables":null,"allowedMailDomains":null,"licensedModules":null,"defaultDeploymentLifetimeDays":0,"maxDeploymentLifetimeDays":0,"systemUnpatchedWarningDays":0,"systemBackupMissingWarningHours":0,"stopVulnerableResourceAfterDays":0,"deploymentExpirationWarningDays":0,"patchNotificationDays":0,"useCustomHostnames":false,"removeInactiveVulnerabilitiesAfterDays":0,"links":[{"caption":"Collections","rel":"down","hRef":"/collections/","method":"GET"}],"id":"00000000-0000-0000-0000-000000000000","name":"String","displayName":"String","description":"String","objectType":"None","selfLink":"String","tags":null,"path":null,"created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","modified":"0001-01-01T00:00:00.0000000Z","modifyUser":"String","modifyUserId":"String","isDeleted":false,"deleted":"0001-01-01T00:00:00.0000000Z","deleteUser":"String","deleteUserId":"String"},"variables":null,"isLostAndFound":false,"monthlyBudget":0,"sendBudgetNotificationMails":false,"budgetWarningThresholdPercent":0,"links":[{"caption":"Index","rel":"up","hRef":"/collections/","method":"GET"},{"caption":"Deployments","rel":"down","hRef":"/deployments?parentId=00000000-0000-0000-0000-000000000000","method":"GET"}],"id":"00000000-0000-0000-0000-000000000000","name":"String","displayName":"String","description":"String","objectType":"None","selfLink":"String","tags":null,"path":null,"created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","modified":"0001-01-01T00:00:00.0000000Z","modifyUser":"String","modifyUserId":"String","isDeleted":false,"deleted":"0001-01-01T00:00:00.0000000Z","deleteUser":"String","deleteUserId":"String"}