| Requires the role: | TenantReader |
| POST | /api/patching/windows/{Id}/assign | Assign ComputeNodes to a PatchingWindow | |
|---|---|---|---|
| POST | /patching/windows/{Id}/assign | Assign ComputeNodes to a PatchingWindow |
import Foundation
import ServiceStack
/**
* Assign ComputeNodes to a PatchingWindow. Starts a workflow for the assignment and returns a Job to track progress
*/
// @Api(Description="Assign ComputeNodes to a PatchingWindow. Starts a workflow for the assignment and returns a Job to track progress")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(JobDto), StatusCode=202)
// @ApiResponse(Description="Too many resources (>300) in request", StatusCode=400)
public class AssignPatchingWindowComputeNodes : IBaseRequest, IHasId, IHasTenantName, IPost, Codable
{
/**
* The id of the pachting window
*/
// @ApiMember(DataType="string", Description="The id of the pachting window", Format="guid", IsRequired=true, ParameterType="path")
public var id:String
/**
* List of one or more ComputeNodes
*/
// @ApiMember(DataType="list", Description="List of one or more ComputeNodes", Format="guid", IsRequired=true, ParameterType="body")
// @Validate(Validator="NotNull")
// @Validate(Validator="NotEmpty")
public var computeNodeIds:[String] = []
// @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
// @Validate(Validator="NotEmpty")
public var tenantName:String
required public init(){}
}
public class JobDto : IHasIdName, IHasTenantId, IAuditable, IHasObjectType, Codable
{
/**
* The id of the job
*/
public var id:String
/**
* The id of the tenant
*/
public var tenantId:String
/**
* The name of the job
*/
public var name:String
public var objectType:ObjectTypes
/**
* An additional message
*/
public var message:String
/**
* Api link pointing to this object
*/
public var selfLink:String
/**
* The id of the configitem the job belongs to
*/
public var configItemId:String?
/**
* The type of the configitem the job belongs to
*/
public var configItemType:ObjectTypes?
/**
* The job type
*/
public var jobType:JobTypes
/**
* The current state of the job
*/
public var state:JobStates
/**
* The timestamp, when the job got started
*/
public var startTime:Date
/**
* The timestamp, when the job has finished
*/
public var endTime:Date?
/**
* The duration (in seconds) of the job
*/
public var duration:Int
/**
* The id of the related workflow
*/
public var workflowId:String
/**
* The id of the related scheduled task
*/
public var schedulerId:String
/**
* The jobs progress in percent (0...100)
*/
public var progress:Double
/**
* Contains various infos about the job
*/
public var config:[String:String] = [:]
/**
* The time the job was created
*/
public var created:Date
/**
* The user the job was created with
*/
public var createUser:String
/**
* The user id the job was created with
*/
public var createUserId:String
/**
* The user email the job was created with
*/
public var createUserEmail:String
/**
* The time the job was last modified
*/
public var modified:Date
/**
* The user the job was modified with
*/
public var modifyUser:String
/**
* The user id the job was modified with
*/
public var modifyUserId:String
/**
* True if the job is deleted
*/
public var isDeleted:Bool
/**
* The time the job was deleted
*/
public var deleted:Date?
/**
* The user the job was deleted with
*/
public var deleteUser:String
/**
* The user id the job was deleted with
*/
public var deleteUserId:String
/**
* Will be evaluated by event endpoints
*/
public var sendNotifications:Bool
/**
* True if it is in any of the 'running' states
*/
public var isRunning:Bool
/**
* Jobs with failed JobEvents are marked with NeedsAttention
*/
public var needsAttention:Bool
required public init(){}
}
public enum ObjectTypes : String, Codable
{
case None
case ConfigItem
case Tenant
case Collection
case Resource
case ComputeNode
case VirtualMachine
case PhysicalMachine
case Disk
case Subnet
case IPAddress
case Job
case JobEvent
case FreezePeriod
case ResourceGroup
case Deployment
case ResourceGroupTemplate
case DeploymentTemplate
case ResourceProvider
case GenericResource
case Role
case Permission
case User
case PatchingWindow
case Update
case ReportDefinition
case TimeSeries
case DataPoint
case Action
case ActionAssignment
case UserNote
}
public enum JobTypes : String, Codable
{
case Create
case Update
case Delete
case Start
case Stop
case Restart
case Backup
case Restore
case Patch
case Action
}
public enum JobStates : String, Codable
{
case Pending
case Starting
case Running
case Suspended
case Stopping
case Completed
case Failed
}
Swift AssignPatchingWindowComputeNodes 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/patching/windows/{Id}/assign HTTP/1.1
Host: core.starburst.svc
Accept: application/json
Content-Type: application/json
Content-Length: length
{"id":"00000000-0000-0000-0000-000000000000","computeNodeIds":["00000000-0000-0000-0000-000000000000"],"tenantName":"String","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}