| Required role: | TenantReader |
| POST | /api/resourcegroups/ | Creates a new resourcegroup | |
|---|---|---|---|
| POST | /resourcegroups/ | Creates a new resourcegroup |
"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 {'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 = {}));
/** @typedef {'New'|'Deploying'|'Deployed'|'Removing'|'Removed'|'Failure'|'Imported'} */
export var LifecycleStates;
(function (LifecycleStates) {
LifecycleStates["New"] = "New"
LifecycleStates["Deploying"] = "Deploying"
LifecycleStates["Deployed"] = "Deployed"
LifecycleStates["Removing"] = "Removing"
LifecycleStates["Removed"] = "Removed"
LifecycleStates["Failure"] = "Failure"
LifecycleStates["Imported"] = "Imported"
})(LifecycleStates || (LifecycleStates = {}));
/** @typedef {'String'|'Number'|'Boolean'|'SecureString'} */
export var ParameterValueType;
(function (ParameterValueType) {
ParameterValueType["String"] = "String"
ParameterValueType["Number"] = "Number"
ParameterValueType["Boolean"] = "Boolean"
ParameterValueType["SecureString"] = "SecureString"
})(ParameterValueType || (ParameterValueType = {}));
export class ParameterDto {
/** @param {{name?:string,description?:string,value?:string,default?:string,optional?:boolean,type?:ParameterValueType,validation?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
name;
/** @type {?string} */
description;
/**
* @type {?string}
* @description Value in form of a json string (e.g. Number = 1234, String = "foo", Boolean = false). Note: string values need extra quotes */
value;
/**
* @type {?string}
* @description Optional default value for the frontend. Needs to be in the same format as the value */
default;
/**
* @type {boolean}
* @description Optional parameters do not need to have a value. Default -> Optional=false */
optional;
/**
* @type {ParameterValueType}
* @description The data type of the value and default property */
type;
/** @type {?string} */
validation;
}
/** @typedef {'String'|'Number'|'Boolean'|'List'} */
export var ValueDataType;
(function (ValueDataType) {
ValueDataType["String"] = "String"
ValueDataType["Number"] = "Number"
ValueDataType["Boolean"] = "Boolean"
ValueDataType["List"] = "List"
})(ValueDataType || (ValueDataType = {}));
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;
}
/** @typedef {'Native'|'Foreign'|'Mixed'} */
export var ResourceCompositions;
(function (ResourceCompositions) {
ResourceCompositions["Native"] = "Native"
ResourceCompositions["Foreign"] = "Foreign"
ResourceCompositions["Mixed"] = "Mixed"
})(ResourceCompositions || (ResourceCompositions = {}));
export class ResourceGroupDto extends ConfigItemDto {
/** @param {{shortId?:string,tenantId?:string,environment?:Environments,state?:LifecycleStates,parentId?:string,templateId?:string,isTemplateBased?:boolean,parent?:ConfigItemDto,parameters?:IList<ParameterDto>,variables?:IList<VariableDto>,nextPatchDate?:string,composition?:ResourceCompositions,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}
* @description Shorter id than the guid which can be used for automation (tenant wide unique) prefixed with a 'g'. E.g. gk36x3 */
shortId;
/**
* @type {string}
* @description The id of the tenant */
tenantId;
/**
* @type {Environments}
* @description The environment the resourcegroup is deployed in */
environment;
/**
* @type {LifecycleStates}
* @description The state of the deployment */
state;
/**
* @type {string}
* @description The id of the parent (deployment) of the resourcegroup */
parentId;
/**
* @type {?string}
* @description The id of the template which was used to create the resourcegroup */
templateId;
/**
* @type {boolean}
* @description Shows if a resourcegroup was rolled out through a dune template or not */
isTemplateBased;
/**
* @type {?ConfigItemDto}
* @description The parent (deployment) of the resourcegroup */
parent;
/**
* @type {IList<ParameterDto>}
* @description The parameters which were used to create this resourcegroup */
parameters;
/**
* @type {IList<VariableDto>}
* @description A resourcegroup scoped list of variables used for resourcegroup of resources */
variables;
/**
* @type {?string}
* @description The date, when the resourcegroups resources will receive updates */
nextPatchDate;
/**
* @type {ResourceCompositions}
* @description Composition show if all resources in the resourcegroup are dune native, dune foreign or a mix of both */
composition;
/** @type {IList<LinkDto>} */
links;
}
export class CreateResourceGroup {
/** @param {{tenantName?:string,name?:string,displayName?:string,description?:string,parentId?:string,templateId?:string,parameters?:IList<ParameterDto>,variables?:IList<VariableDto>,tags?:IList<TagDto>}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
tenantName;
/**
* @type {string}
* @description The resourcegroups name */
name;
/**
* @type {?string}
* @description The resourcegroups display name */
displayName;
/**
* @type {?string}
* @description A more detailed description for the resourcegroup */
description;
/**
* @type {string}
* @description The id of the deployment, this resourcegroup belongs to */
parentId;
/**
* @type {?string}
* @description The id of the template, this resourcegroup is based on */
templateId;
/** @type {IList<ParameterDto>} */
parameters;
/** @type {?IList<VariableDto>} */
variables;
/** @type {?IList<TagDto>} */
tags;
}
JavaScript CreateResourceGroup 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/resourcegroups/ 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","parentId":"00000000-0000-0000-0000-000000000000","templateId":"00000000-0000-0000-0000-000000000000","parameters":null,"variables":null,"tags":null,"txId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"shortId":"String","tenantId":"00000000-0000-0000-0000-000000000000","environment":"Lab","state":"New","parentId":"00000000-0000-0000-0000-000000000000","templateId":"00000000-0000-0000-0000-000000000000","isTemplateBased":true,"parent":{"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","links":null},"parameters":null,"variables":null,"nextPatchDate":"0001-01-01T00:00:00.0000000Z","composition":"Native","links":[{"caption":"Index","rel":"index","hRef":"/resourcegroups/","method":"GET"},{"caption":"Deployment","rel":"up","hRef":"/deployments/00000000-0000-0000-0000-000000000000","method":"GET"},{"caption":"Resources","rel":"down","hRef":"/resources?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"}