| 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 |
namespace CoreService.ServiceModel.Dtos.Notes.Crud
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
[<AllowNullLiteral>]
type UserNoteDto() =
member val Id:Guid = new Guid() with get,set
member val Message:String = null with get,set
member val ConfigItemId:Guid = new Guid() with get,set
member val ConfigItemType:ObjectTypes = new ObjectTypes() with get,set
member val ConfigItemName:String = null with get,set
member val TenantId:Guid = new Guid() with get,set
member val Created:DateTime = new DateTime() with get,set
member val CreateUser:String = null with get,set
member val CreateUserId:String = null with get,set
member val Modified:DateTime = new DateTime() with get,set
member val ModifyUser:String = null with get,set
member val ModifyUserId:String = null with get,set
member val SelfLink:String = null with get,set
member val ObjectType:ObjectTypes = new ObjectTypes() with get,set
///<summary>
///Creates a user note on a deployment or resource
///</summary>
[<Api(Description="Creates a user note on a deployment or resource")>]
[<ApiResponse(Description="Created", ResponseType=typeof<UserNoteDto>, StatusCode=201)>]
[<AllowNullLiteral>]
type CreateUserNote() =
interface IPost
[<ApiMember(DataType="string", IsRequired=true, ParameterType="header")>]
[<Validate(Validator="NotEmpty")>]
member val TenantName:String = null with get,set
///<summary>
///The id of the deployment or resource the note is attached to
///</summary>
[<ApiMember(DataType="string", Description="The id of the deployment or resource the note is attached to", Format="guid", IsRequired=true, ParameterType="body")>]
member val ConfigItemId:Guid = new Guid() with get,set
///<summary>
///The type of the config item (Deployment or a Resource type)
///</summary>
[<ApiMember(Description="The type of the config item (Deployment or a Resource type)", IsRequired=true, ParameterType="body")>]
[<Validate(Validator="NotNull")>]
member val ConfigItemType:ObjectTypes = new ObjectTypes() with get,set
///<summary>
///The note text (max 1000 chars)
///</summary>
[<ApiMember(DataType="string", Description="The note text (max 1000 chars)", IsRequired=true, ParameterType="body")>]
[<Validate(Validator="NotEmpty")>]
[<Validate(Validator="MaximumLength(1000)")>]
member val Message:String = null 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/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"}