| Required role: | TenantReader |
| POST | /api/resources/{Id}/restart | Restart the resource | |
|---|---|---|---|
| POST | /resources/{Id}/restart | Restart the resource |
namespace CoreService.ServiceModel.Dtos.Jobs.Responses
open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
type ObjectTypes =
| None = 0
| ConfigItem = 1
| Tenant = 2
| Collection = 3
| Resource = 4
| ComputeNode = 5
| VirtualMachine = 6
| PhysicalMachine = 7
| Disk = 8
| Subnet = 9
| IPAddress = 10
| Job = 11
| JobEvent = 12
| FreezePeriod = 13
| ResourceGroup = 14
| Deployment = 15
| ResourceGroupTemplate = 16
| DeploymentTemplate = 17
| ResourceProvider = 18
| GenericResource = 19
| Role = 20
| Permission = 21
| User = 22
| PatchingWindow = 23
| Update = 24
| ReportDefinition = 25
| TimeSeries = 26
| DataPoint = 27
| Action = 28
| ActionAssignment = 29
| UserNote = 30
type JobTypes =
| Create = 0
| Update = 1
| Delete = 2
| Start = 3
| Stop = 4
| Restart = 5
| Backup = 6
| Restore = 7
| Patch = 8
| Action = 9
type JobStates =
| Pending = 0
| Starting = 1
| Running = 2
| Suspended = 3
| Stopping = 4
| Completed = 5
| Failed = 6
[<AllowNullLiteral>]
type JobDto() =
///<summary>
///The id of the job
///</summary>
member val Id:Guid = new Guid() with get,set
///<summary>
///The id of the tenant
///</summary>
member val TenantId:Guid = new Guid() with get,set
///<summary>
///The name of the job
///</summary>
member val Name:String = null with get,set
member val ObjectType:ObjectTypes = new ObjectTypes() with get,set
///<summary>
///An additional message
///</summary>
member val Message:String = null with get,set
///<summary>
///Api link pointing to this object
///</summary>
member val SelfLink:String = null with get,set
///<summary>
///The id of the configitem the job belongs to
///</summary>
member val ConfigItemId:Nullable<Guid> = new Nullable<Guid>() with get,set
///<summary>
///The type of the configitem the job belongs to
///</summary>
member val ConfigItemType:Nullable<ObjectTypes> = new Nullable<ObjectTypes>() with get,set
///<summary>
///The job type
///</summary>
member val JobType:JobTypes = new JobTypes() with get,set
///<summary>
///The current state of the job
///</summary>
member val State:JobStates = new JobStates() with get,set
///<summary>
///The timestamp, when the job got started
///</summary>
member val StartTime:DateTime = new DateTime() with get,set
///<summary>
///The timestamp, when the job has finished
///</summary>
member val EndTime:Nullable<DateTime> = new Nullable<DateTime>() with get,set
///<summary>
///The duration (in seconds) of the job
///</summary>
member val Duration:Int32 = new Int32() with get,set
///<summary>
///The id of the related workflow
///</summary>
member val WorkflowId:String = null with get,set
///<summary>
///The id of the related scheduled task
///</summary>
member val SchedulerId:String = null with get,set
///<summary>
///The jobs progress in percent (0...100)
///</summary>
member val Progress:Double = new Double() with get,set
///<summary>
///Contains various infos about the job
///</summary>
member val Config:Dictionary<String, Object> = null with get,set
///<summary>
///The time the job was created
///</summary>
member val Created:DateTime = new DateTime() with get,set
///<summary>
///The user the job was created with
///</summary>
member val CreateUser:String = null with get,set
///<summary>
///The user id the job was created with
///</summary>
member val CreateUserId:String = null with get,set
///<summary>
///The user email the job was created with
///</summary>
member val CreateUserEmail:String = null with get,set
///<summary>
///The time the job was last modified
///</summary>
member val Modified:DateTime = new DateTime() with get,set
///<summary>
///The user the job was modified with
///</summary>
member val ModifyUser:String = null with get,set
///<summary>
///The user id the job was modified with
///</summary>
member val ModifyUserId:String = null with get,set
///<summary>
///True if the job is deleted
///</summary>
member val IsDeleted:Boolean = new Boolean() with get,set
///<summary>
///The time the job was deleted
///</summary>
member val Deleted:Nullable<DateTime> = new Nullable<DateTime>() with get,set
///<summary>
///The user the job was deleted with
///</summary>
member val DeleteUser:String = null with get,set
///<summary>
///The user id the job was deleted with
///</summary>
member val DeleteUserId:String = null with get,set
///<summary>
///Will be evaluated by event endpoints
///</summary>
member val SendNotifications:Boolean = new Boolean() with get,set
///<summary>
///True if it is in any of the 'running' states
///</summary>
member val IsRunning:Boolean = new Boolean() with get,set
///<summary>
///Jobs with failed JobEvents are marked with NeedsAttention
///</summary>
member val NeedsAttention:Boolean = new Boolean() with get,set
///<summary>
///Restart the resource
///</summary>
[<Api(Description="Restart the resource")>]
[<ApiResponse(Description="Operation started", IsDefaultResponse=true, ResponseType=typeof<JobDto>, StatusCode=202)>]
[<AllowNullLiteral>]
type RestartResource() =
interface IPost
///<summary>
///The primary key of every config item
///</summary>
[<ApiMember(DataType="string", Description="The primary key of every config item", Format="guid", IsRequired=true, ParameterType="path")>]
member val Id:Guid = new Guid() with get,set
[<ApiMember(DataType="string", IsRequired=true, ParameterType="header")>]
[<Validate(Validator="NotEmpty")>]
member val TenantName:String = null with get,set
///<summary>
///The cron expression for scheduling the operation
///</summary>
[<ApiMember(DataType="string", Description="The cron expression for scheduling the operation", Format="Cron", ParameterType="body")>]
member val CronExpression:String = null with get,set
///<summary>
///Inform users when the job has finished
///</summary>
[<ApiMember(DataType="bool", Description="Inform users when the job has finished", ParameterType="body")>]
member val SendNotifications:Nullable<Boolean> = new Nullable<Boolean>() with get,set
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/resources/{Id}/restart 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}