| 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.*;
public class dtos
{
/**
* 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)
public static class CreateUserNote implements IBaseRequest, IHasTenantName, IPost
{
@ApiMember(DataType="string", IsRequired=true, ParameterType="header")
@Validate(Validator="NotEmpty")
public String tenantName = 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")
public UUID configItemId = 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")
public ObjectTypes configItemType = 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)")
public String message = null;
public String getTenantName() { return tenantName; }
public CreateUserNote setTenantName(String value) { this.tenantName = value; return this; }
public UUID getConfigItemId() { return configItemId; }
public CreateUserNote setConfigItemId(UUID value) { this.configItemId = value; return this; }
public ObjectTypes getConfigItemType() { return configItemType; }
public CreateUserNote setConfigItemType(ObjectTypes value) { this.configItemType = value; return this; }
public String getMessage() { return message; }
public CreateUserNote setMessage(String value) { this.message = value; return this; }
}
public static 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;
}
public static class UserNoteDto
{
public UUID id = null;
public String message = null;
public UUID configItemId = null;
public ObjectTypes configItemType = null;
public String configItemName = null;
public UUID tenantId = null;
public Date created = null;
public String createUser = null;
public String createUserId = null;
public Date modified = null;
public String modifyUser = null;
public String modifyUserId = null;
public String selfLink = null;
public ObjectTypes objectType = null;
public UUID getId() { return id; }
public UserNoteDto setId(UUID value) { this.id = value; return this; }
public String getMessage() { return message; }
public UserNoteDto setMessage(String value) { this.message = value; return this; }
public UUID getConfigItemId() { return configItemId; }
public UserNoteDto setConfigItemId(UUID value) { this.configItemId = value; return this; }
public ObjectTypes getConfigItemType() { return configItemType; }
public UserNoteDto setConfigItemType(ObjectTypes value) { this.configItemType = value; return this; }
public String getConfigItemName() { return configItemName; }
public UserNoteDto setConfigItemName(String value) { this.configItemName = value; return this; }
public UUID getTenantId() { return tenantId; }
public UserNoteDto setTenantId(UUID value) { this.tenantId = value; return this; }
public Date getCreated() { return created; }
public UserNoteDto setCreated(Date value) { this.created = value; return this; }
public String getCreateUser() { return createUser; }
public UserNoteDto setCreateUser(String value) { this.createUser = value; return this; }
public String getCreateUserId() { return createUserId; }
public UserNoteDto setCreateUserId(String value) { this.createUserId = value; return this; }
public Date getModified() { return modified; }
public UserNoteDto setModified(Date value) { this.modified = value; return this; }
public String getModifyUser() { return modifyUser; }
public UserNoteDto setModifyUser(String value) { this.modifyUser = value; return this; }
public String getModifyUserId() { return modifyUserId; }
public UserNoteDto setModifyUserId(String value) { this.modifyUserId = value; return this; }
public String getSelfLink() { return selfLink; }
public UserNoteDto setSelfLink(String value) { this.selfLink = value; return this; }
public ObjectTypes getObjectType() { return objectType; }
public UserNoteDto setObjectType(ObjectTypes value) { this.objectType = value; return this; }
}
}
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"}