| Required role: | TenantReader |
| POST | /api/resourcegroups/{Id}/stopresources | Stop resourcegroup resources as defined in sequence | |
|---|---|---|---|
| POST | /resourcegroups/{Id}/stopresources | Stop resourcegroup resources as defined in sequence |
import 'package:servicestack/servicestack.dart';
enum ObjectTypes
{
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,
}
enum JobTypes
{
Create,
Update,
Delete,
Start,
Stop,
Restart,
Backup,
Restore,
Patch,
Action,
}
enum JobStates
{
Pending,
Starting,
Running,
Suspended,
Stopping,
Completed,
Failed,
}
class JobDto implements IHasIdName, IHasTenantId, IAuditable, IHasObjectType, IConvertible
{
/**
* The id of the job
*/
String id = "";
/**
* The id of the tenant
*/
String tenantId = "";
/**
* The name of the job
*/
String name = "";
ObjectTypes objectType;
/**
* An additional message
*/
String? message;
/**
* Api link pointing to this object
*/
String selfLink = "";
/**
* The id of the configitem the job belongs to
*/
String? configItemId;
/**
* The type of the configitem the job belongs to
*/
ObjectTypes? configItemType;
/**
* The job type
*/
JobTypes jobType;
/**
* The current state of the job
*/
JobStates state;
/**
* The timestamp, when the job got started
*/
DateTime startTime = DateTime(0);
/**
* The timestamp, when the job has finished
*/
DateTime? endTime;
/**
* The duration (in seconds) of the job
*/
int duration = 0;
/**
* The id of the related workflow
*/
String? workflowId;
/**
* The id of the related scheduled task
*/
String? schedulerId;
/**
* The jobs progress in percent (0...100)
*/
double progress = 0;
/**
* Contains various infos about the job
*/
Map<String,dynamic?> config = {};
/**
* The time the job was created
*/
DateTime created = DateTime(0);
/**
* The user the job was created with
*/
String createUser = "";
/**
* The user id the job was created with
*/
String createUserId = "";
/**
* The user email the job was created with
*/
String createUserEmail = "";
/**
* The time the job was last modified
*/
DateTime modified = DateTime(0);
/**
* The user the job was modified with
*/
String modifyUser = "";
/**
* The user id the job was modified with
*/
String modifyUserId = "";
/**
* True if the job is deleted
*/
bool isDeleted;
/**
* The time the job was deleted
*/
DateTime? deleted;
/**
* The user the job was deleted with
*/
String? deleteUser;
/**
* The user id the job was deleted with
*/
String? deleteUserId;
/**
* Will be evaluated by event endpoints
*/
bool sendNotifications;
/**
* True if it is in any of the 'running' states
*/
bool isRunning;
/**
* Jobs with failed JobEvents are marked with NeedsAttention
*/
bool needsAttention;
JobDto({this.id,this.tenantId,this.name,this.objectType,this.message,this.selfLink,this.configItemId,this.configItemType,this.jobType,this.state,this.startTime,this.endTime,this.duration,this.workflowId,this.schedulerId,this.progress,this.config,this.created,this.createUser,this.createUserId,this.createUserEmail,this.modified,this.modifyUser,this.modifyUserId,this.isDeleted,this.deleted,this.deleteUser,this.deleteUserId,this.sendNotifications,this.isRunning,this.needsAttention});
JobDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
tenantId = json['tenantId'];
name = json['name'];
objectType = JsonConverters.fromJson(json['objectType'],'ObjectTypes',context!);
message = json['message'];
selfLink = json['selfLink'];
configItemId = json['configItemId'];
configItemType = JsonConverters.fromJson(json['configItemType'],'ObjectTypes',context!);
jobType = JsonConverters.fromJson(json['jobType'],'JobTypes',context!);
state = JsonConverters.fromJson(json['state'],'JobStates',context!);
startTime = JsonConverters.fromJson(json['startTime'],'DateTime',context!);
endTime = JsonConverters.fromJson(json['endTime'],'DateTime',context!);
duration = json['duration'];
workflowId = json['workflowId'];
schedulerId = json['schedulerId'];
progress = JsonConverters.toDouble(json['progress']);
config = JsonConverters.fromJson(json['config'],'Map<String,dynamic?>',context!);
created = JsonConverters.fromJson(json['created'],'DateTime',context!);
createUser = json['createUser'];
createUserId = json['createUserId'];
createUserEmail = json['createUserEmail'];
modified = JsonConverters.fromJson(json['modified'],'DateTime',context!);
modifyUser = json['modifyUser'];
modifyUserId = json['modifyUserId'];
isDeleted = json['isDeleted'];
deleted = JsonConverters.fromJson(json['deleted'],'DateTime',context!);
deleteUser = json['deleteUser'];
deleteUserId = json['deleteUserId'];
sendNotifications = json['sendNotifications'];
isRunning = json['isRunning'];
needsAttention = json['needsAttention'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'tenantId': tenantId,
'name': name,
'objectType': JsonConverters.toJson(objectType,'ObjectTypes',context!),
'message': message,
'selfLink': selfLink,
'configItemId': configItemId,
'configItemType': JsonConverters.toJson(configItemType,'ObjectTypes',context!),
'jobType': JsonConverters.toJson(jobType,'JobTypes',context!),
'state': JsonConverters.toJson(state,'JobStates',context!),
'startTime': JsonConverters.toJson(startTime,'DateTime',context!),
'endTime': JsonConverters.toJson(endTime,'DateTime',context!),
'duration': duration,
'workflowId': workflowId,
'schedulerId': schedulerId,
'progress': progress,
'config': JsonConverters.toJson(config,'Map<String,dynamic?>',context!),
'created': JsonConverters.toJson(created,'DateTime',context!),
'createUser': createUser,
'createUserId': createUserId,
'createUserEmail': createUserEmail,
'modified': JsonConverters.toJson(modified,'DateTime',context!),
'modifyUser': modifyUser,
'modifyUserId': modifyUserId,
'isDeleted': isDeleted,
'deleted': JsonConverters.toJson(deleted,'DateTime',context!),
'deleteUser': deleteUser,
'deleteUserId': deleteUserId,
'sendNotifications': sendNotifications,
'isRunning': isRunning,
'needsAttention': needsAttention
};
getTypeName() => "JobDto";
TypeContext? context = _ctx;
}
/**
* ResourceGroup service
*/
// @Api(Description="ResourceGroup service")
// @ApiResponse(Description="Operation started", IsDefaultResponse=true, ResponseType=typeof(JobDto), StatusCode=202)
class StopResourceGroupResources implements ISchedulableRequest, IHasId, IPost, IConvertible
{
// @ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")
String id = "";
// @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
// @Validate(Validator="NotEmpty")
String tenantName = "";
/**
* The cron expression for scheduling the operation
*/
// @ApiMember(DataType="string", Description="The cron expression for scheduling the operation", Format="Cron", ParameterType="body")
String? cronExpression;
/**
* Inform users when the job has finished
*/
// @ApiMember(DataType="bool", Description="Inform users when the job has finished", ParameterType="body")
bool? sendNotifications;
StopResourceGroupResources({this.id,this.tenantName,this.cronExpression,this.sendNotifications});
StopResourceGroupResources.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
tenantName = json['tenantName'];
cronExpression = json['cronExpression'];
sendNotifications = json['sendNotifications'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'tenantName': tenantName,
'cronExpression': cronExpression,
'sendNotifications': sendNotifications
};
getTypeName() => "StopResourceGroupResources";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'duneframework.com', types: <String, TypeInfo> {
'ObjectTypes': TypeInfo(TypeOf.Enum, enumValues:ObjectTypes.values),
'JobTypes': TypeInfo(TypeOf.Enum, enumValues:JobTypes.values),
'JobStates': TypeInfo(TypeOf.Enum, enumValues:JobStates.values),
'JobDto': TypeInfo(TypeOf.Class, create:() => JobDto()),
'Map<String,dynamic?>': TypeInfo(TypeOf.Class, create:() => Map<String,dynamic?>()),
'StopResourceGroupResources': TypeInfo(TypeOf.Class, create:() => StopResourceGroupResources()),
});
Dart StopResourceGroupResources 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/{Id}/stopresources HTTP/1.1
Host: core.starburst.svc
Accept: application/json
Content-Type: application/json
Content-Length: length
{"id":"00000000-0000-0000-0000-000000000000","tenantName":"String","cronExpression":"String","sendNotifications":false,"txId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"id":"00000000-0000-0000-0000-000000000000","tenantId":"00000000-0000-0000-0000-000000000000","name":"String","objectType":"Job","message":"String","selfLink":"String","configItemId":"00000000-0000-0000-0000-000000000000","configItemType":"None","jobType":"Create","state":"Pending","startTime":"0001-01-01T00:00:00.0000000Z","endTime":"0001-01-01T00:00:00.0000000Z","duration":0,"workflowId":"String","schedulerId":"String","progress":0,"config":{"String":{}},"created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","createUserEmail":"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","sendNotifications":false,"isRunning":false,"needsAttention":false}