| 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 java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
/**
* Creates a user note on a deployment or resource
*/
@Api(Description="Creates a user note on a deployment or resource")
@ApiResponse(Description="Created", ResponseType=UserNoteDto::class, StatusCode=201)
open class CreateUserNote : IBaseRequest, IHasTenantName, IPost
{
@ApiMember(DataType="string", IsRequired=true, ParameterType="header")
@Validate(Validator="NotEmpty")
override var tenantName:String? = null
/**
* 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")
open var configItemId:UUID? = null
/**
* 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")
open var configItemType:ObjectTypes? = null
/**
* 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)")
open var message:String? = null
}
enum class 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,
}
open class UserNoteDto
{
open var id:UUID? = null
open var message:String? = null
open var configItemId:UUID? = null
open var configItemType:ObjectTypes? = null
open var configItemName:String? = null
open var tenantId:UUID? = null
open var created:Date? = null
open var createUser:String? = null
open var createUserId:String? = null
open var modified:Date? = null
open var modifyUser:String? = null
open var modifyUserId:String? = null
open var selfLink:String? = null
open var objectType:ObjectTypes? = null
}
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"}