CoreService

<back to all web services

CreateUserNote

UserNote - CRUD

Creates a user note on a deployment or resource

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
POST/api/usernotesCreates a user note on a deployment or resource
POST/usernotesCreates a user note on a deployment or resource
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports CoreService.ServiceModel.Dtos.Notes.Crud
Imports YCO.Dune.Models.Enums
Imports CoreService.ServiceModel.Dtos.Notes.Responses

Namespace Global

    Namespace CoreService.ServiceModel.Dtos.Notes.Crud

        '''<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:=GetType(UserNoteDto), StatusCode:=201)>
        Public Partial Class CreateUserNote
            Implements IBaseRequest
            Implements IHasTenantName
            Implements IPost
            <ApiMember(DataType:="string", IsRequired:=true, ParameterType:="header")>
            <Validate(Validator:="NotEmpty")>
            Public Overridable Property TenantName As String Implements IHasTenantName.TenantName

            '''<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")>
            Public Overridable Property ConfigItemId As Guid

            '''<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")>
            Public Overridable Property ConfigItemType As ObjectTypes

            '''<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)")>
            Public Overridable Property Message As String
        End Class
    End Namespace

    Namespace CoreService.ServiceModel.Dtos.Notes.Responses

        Public Partial Class UserNoteDto
            Public Overridable Property Id As Guid
            Public Overridable Property Message As String
            Public Overridable Property ConfigItemId As Guid
            Public Overridable Property ConfigItemType As ObjectTypes
            Public Overridable Property ConfigItemName As String
            Public Overridable Property TenantId As Guid
            Public Overridable Property Created As Date
            Public Overridable Property CreateUser As String
            Public Overridable Property CreateUserId As String
            Public Overridable Property Modified As Date
            Public Overridable Property ModifyUser As String
            Public Overridable Property ModifyUserId As String
            Public Overridable Property SelfLink As String
            Public Overridable Property ObjectType As ObjectTypes
        End Class
    End Namespace

    Namespace YCO.Dune.Models.Enums

        Public 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
        End Enum
    End Namespace
End Namespace

VB.NET CreateUserNote 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

HTTP + JSON

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"}