| Required role: | TenantReader |
| POST | /api/usernotes | Creates a user note on a deployment or resource | |
|---|---|---|---|
| POST | /usernotes | Creates a user note on a deployment or resource |
import Foundation
import ServiceStack
/**
* Creates a user note on a deployment or resource
*/
// @Api(Description="Creates a user note on a deployment or resource")
// @ApiResponse(Description="Created", ResponseType=typeof(UserNoteDto), StatusCode=201)
public class CreateUserNote : IBaseRequest, IHasTenantName, IPost, Codable
{
// @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
// @Validate(Validator="NotEmpty")
public var tenantName:String
/**
* The id of the deployment or resource the note is attached to
*/
// @ApiMember(DataType="string", Description="The id of the deployment or resource the note is attached to", Format="guid", IsRequired=true, ParameterType="body")
public var configItemId:String
/**
* The type of the config item (Deployment or a Resource type)
*/
// @ApiMember(Description="The type of the config item (Deployment or a Resource type)", IsRequired=true, ParameterType="body")
// @Validate(Validator="NotNull")
public var configItemType:ObjectTypes
/**
* The note text (max 1000 chars)
*/
// @ApiMember(DataType="string", Description="The note text (max 1000 chars)", IsRequired=true, ParameterType="body")
// @Validate(Validator="NotEmpty")
// @Validate(Validator="MaximumLength(1000)")
public var message:String
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 class UserNoteDto : Codable
{
public var id:String
public var message:String
public var configItemId:String
public var configItemType:ObjectTypes
public var configItemName:String
public var tenantId:String
public var created:Date
public var createUser:String
public var createUserId:String
public var modified:Date
public var modifyUser:String
public var modifyUserId:String
public var selfLink:String
public var objectType:ObjectTypes
required public init(){}
}
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/usernotes HTTP/1.1
Host: core.starburst.svc
Accept: application/json
Content-Type: application/json
Content-Length: length
{"tenantName":"String","configItemId":"00000000-0000-0000-0000-000000000000","configItemType":"None","message":"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","message":"String","configItemId":"00000000-0000-0000-0000-000000000000","configItemType":"None","configItemName":"String","tenantId":"00000000-0000-0000-0000-000000000000","created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","modified":"0001-01-01T00:00:00.0000000Z","modifyUser":"String","modifyUserId":"String","selfLink":"/usernotes/00000000-0000-0000-0000-000000000000","objectType":"UserNote"}