CoreService

<back to all web services

GetActionAssignment

ActionAssignment - CRUD

Returns an action assignment by its id

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/api/action-assignments/{Id}Returns an action assignment by its id
GET/action-assignments/{Id}Returns an action assignment by its id
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;

public class dtos
{

    /**
    * Returns an action assignment by its id
    */
    @Api(Description="Returns an action assignment by its id")
    @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=ActionAssignmentDto.class, StatusCode=200)
    public static class GetActionAssignment implements IBaseRequest, IHasTenantName, IGet
    {
        @ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")
        public UUID id = null;

        @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
        @Validate(Validator="NotEmpty")
        public String tenantName = null;

        @ApiMember(ParameterType="query", Verb="GET")
        public Boolean includeReferencedObjects = null;
        
        public UUID getId() { return id; }
        public GetActionAssignment setId(UUID value) { this.id = value; return this; }
        public String getTenantName() { return tenantName; }
        public GetActionAssignment setTenantName(String value) { this.tenantName = value; return this; }
        public Boolean isIncludeReferencedObjects() { return includeReferencedObjects; }
        public GetActionAssignment setIncludeReferencedObjects(Boolean value) { this.includeReferencedObjects = value; return this; }
    }

    public static class ActionAssignmentDto
    {
        public UUID id = null;
        public String name = null;
        public UUID actionId = null;
        public ActionDto action = null;
        public UUID configItemId = null;
        public String configItemName = null;
        public ObjectTypes configItemType = null;
        public ArrayList<ParameterDto> parameters = new ArrayList<ParameterDto>();
        public String selfLink = null;
        public ActionScopes scope = null;
        public String cronExpression = null;
        public IList<LinkDto> links = null;
        public UUID scheduledTaskAssignmentId = null;
        public ScheduledTaskAssignmentDto scheduledTaskAssignment = null;
        public ObjectTypes objectType = null;
        
        public UUID getId() { return id; }
        public ActionAssignmentDto setId(UUID value) { this.id = value; return this; }
        public String getName() { return name; }
        public ActionAssignmentDto setName(String value) { this.name = value; return this; }
        public UUID getActionId() { return actionId; }
        public ActionAssignmentDto setActionId(UUID value) { this.actionId = value; return this; }
        public ActionDto getAction() { return action; }
        public ActionAssignmentDto setAction(ActionDto value) { this.action = value; return this; }
        public UUID getConfigItemId() { return configItemId; }
        public ActionAssignmentDto setConfigItemId(UUID value) { this.configItemId = value; return this; }
        public String getConfigItemName() { return configItemName; }
        public ActionAssignmentDto setConfigItemName(String value) { this.configItemName = value; return this; }
        public ObjectTypes getConfigItemType() { return configItemType; }
        public ActionAssignmentDto setConfigItemType(ObjectTypes value) { this.configItemType = value; return this; }
        public ArrayList<ParameterDto> getParameters() { return parameters; }
        public ActionAssignmentDto setParameters(ArrayList<ParameterDto> value) { this.parameters = value; return this; }
        public String getSelfLink() { return selfLink; }
        public ActionAssignmentDto setSelfLink(String value) { this.selfLink = value; return this; }
        public ActionScopes getScope() { return scope; }
        public ActionAssignmentDto setScope(ActionScopes value) { this.scope = value; return this; }
        public String getCronExpression() { return cronExpression; }
        public ActionAssignmentDto setCronExpression(String value) { this.cronExpression = value; return this; }
        public IList<LinkDto> getLinks() { return links; }
        public ActionAssignmentDto setLinks(IList<LinkDto> value) { this.links = value; return this; }
        public UUID getScheduledTaskAssignmentId() { return scheduledTaskAssignmentId; }
        public ActionAssignmentDto setScheduledTaskAssignmentId(UUID value) { this.scheduledTaskAssignmentId = value; return this; }
        public ScheduledTaskAssignmentDto getScheduledTaskAssignment() { return scheduledTaskAssignment; }
        public ActionAssignmentDto setScheduledTaskAssignment(ScheduledTaskAssignmentDto value) { this.scheduledTaskAssignment = value; return this; }
        public ObjectTypes getObjectType() { return objectType; }
        public ActionAssignmentDto setObjectType(ObjectTypes value) { this.objectType = value; return this; }
    }

    public static class ActionDto extends ConfigItemDto implements IHasTenantId
    {
        public UUID tenantId = null;
        /**
        * The schema version of the attached definition (json/yaml structure)
        */
        public Integer schemaVersion = null;
        /**
        * The action definition as json/yaml
        */
        public String definition = null;
        /**
        * Action parameters
        */
        public IList<ParameterDto> parameters = null;
        /**
        * Disabled actions cannot be assigned to a configitem
        */
        public Boolean isDisabled = null;
        /**
        * This action can anly be assigned to configitems of this type
        */
        public ActionScopes scope = null;
        /**
        * The individual steps of the action
        */
        public ArrayList<ActionStepDto> steps = new ArrayList<ActionStepDto>();
        
        public UUID getTenantId() { return tenantId; }
        public ActionDto setTenantId(UUID value) { this.tenantId = value; return this; }
        public Integer getSchemaVersion() { return schemaVersion; }
        public ActionDto setSchemaVersion(Integer value) { this.schemaVersion = value; return this; }
        public String getDefinition() { return definition; }
        public ActionDto setDefinition(String value) { this.definition = value; return this; }
        public IList<ParameterDto> getParameters() { return parameters; }
        public ActionDto setParameters(IList<ParameterDto> value) { this.parameters = value; return this; }
        public Boolean getIsDisabled() { return isDisabled; }
        public ActionDto setIsDisabled(Boolean value) { this.isDisabled = value; return this; }
        public ActionScopes getScope() { return scope; }
        public ActionDto setScope(ActionScopes value) { this.scope = value; return this; }
        public ArrayList<ActionStepDto> getSteps() { return steps; }
        public ActionDto setSteps(ArrayList<ActionStepDto> value) { this.steps = value; return this; }
    }

    public static class ConfigItemDto implements IConfigItem
    {
        public UUID id = null;
        public String name = null;
        public String displayName = null;
        public String description = null;
        public ObjectTypes objectType = null;
        public String selfLink = null;
        public IList<TagDto> tags = null;
        public IList<PathItemDto> path = 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 Boolean isDeleted = null;
        public Date deleted = null;
        public String deleteUser = null;
        public String deleteUserId = null;
        public IList<LinkDto> links = null;
        
        public UUID getId() { return id; }
        public ConfigItemDto setId(UUID value) { this.id = value; return this; }
        public String getName() { return name; }
        public ConfigItemDto setName(String value) { this.name = value; return this; }
        public String getDisplayName() { return displayName; }
        public ConfigItemDto setDisplayName(String value) { this.displayName = value; return this; }
        public String getDescription() { return description; }
        public ConfigItemDto setDescription(String value) { this.description = value; return this; }
        public ObjectTypes getObjectType() { return objectType; }
        public ConfigItemDto setObjectType(ObjectTypes value) { this.objectType = value; return this; }
        public String getSelfLink() { return selfLink; }
        public ConfigItemDto setSelfLink(String value) { this.selfLink = value; return this; }
        public IList<TagDto> getTags() { return tags; }
        public ConfigItemDto setTags(IList<TagDto> value) { this.tags = value; return this; }
        public IList<PathItemDto> getPath() { return path; }
        public ConfigItemDto setPath(IList<PathItemDto> value) { this.path = value; return this; }
        public Date getCreated() { return created; }
        public ConfigItemDto setCreated(Date value) { this.created = value; return this; }
        public String getCreateUser() { return createUser; }
        public ConfigItemDto setCreateUser(String value) { this.createUser = value; return this; }
        public String getCreateUserId() { return createUserId; }
        public ConfigItemDto setCreateUserId(String value) { this.createUserId = value; return this; }
        public Date getModified() { return modified; }
        public ConfigItemDto setModified(Date value) { this.modified = value; return this; }
        public String getModifyUser() { return modifyUser; }
        public ConfigItemDto setModifyUser(String value) { this.modifyUser = value; return this; }
        public String getModifyUserId() { return modifyUserId; }
        public ConfigItemDto setModifyUserId(String value) { this.modifyUserId = value; return this; }
        public Boolean getIsDeleted() { return isDeleted; }
        public ConfigItemDto setIsDeleted(Boolean value) { this.isDeleted = value; return this; }
        public Date getDeleted() { return deleted; }
        public ConfigItemDto setDeleted(Date value) { this.deleted = value; return this; }
        public String getDeleteUser() { return deleteUser; }
        public ConfigItemDto setDeleteUser(String value) { this.deleteUser = value; return this; }
        public String getDeleteUserId() { return deleteUserId; }
        public ConfigItemDto setDeleteUserId(String value) { this.deleteUserId = value; return this; }
        public IList<LinkDto> getLinks() { return links; }
        public ConfigItemDto setLinks(IList<LinkDto> value) { this.links = 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 TagDto
    {
        public String name = null;
        public String value = null;
        public Boolean isProtected = null;
        
        public String getName() { return name; }
        public TagDto setName(String value) { this.name = value; return this; }
        public String getValue() { return value; }
        public TagDto setValue(String value) { this.value = value; return this; }
        public Boolean getIsProtected() { return isProtected; }
        public TagDto setIsProtected(Boolean value) { this.isProtected = value; return this; }
    }

    public static class PathItemDto
    {
        public String label = null;
        public String link = null;
        public ObjectTypes objectType = null;
        public UUID objectId = null;
        
        public String getLabel() { return label; }
        public PathItemDto setLabel(String value) { this.label = value; return this; }
        public String getLink() { return link; }
        public PathItemDto setLink(String value) { this.link = value; return this; }
        public ObjectTypes getObjectType() { return objectType; }
        public PathItemDto setObjectType(ObjectTypes value) { this.objectType = value; return this; }
        public UUID getObjectId() { return objectId; }
        public PathItemDto setObjectId(UUID value) { this.objectId = value; return this; }
    }

    public static class LinkDto
    {
        public String caption = null;
        public String rel = null;
        public String hRef = null;
        public String method = null;
        
        public String getCaption() { return caption; }
        public LinkDto setCaption(String value) { this.caption = value; return this; }
        public String getRel() { return rel; }
        public LinkDto setRel(String value) { this.rel = value; return this; }
        public String getHRef() { return hRef; }
        public LinkDto setHRef(String value) { this.hRef = value; return this; }
        public String getMethod() { return method; }
        public LinkDto setMethod(String value) { this.method = value; return this; }
    }

    public static class ParameterDto
    {
        public String name = null;
        public String description = null;
        /**
        * Value in form of a json string (e.g. Number = 1234, String = "foo", Boolean = false). Note: string values need extra quotes
        */
        public String value = null;
        /**
        * Optional default value for the frontend. Needs to be in the same format as the value
        */
        @SerializedName("default") public String Default = null;
        /**
        * Optional parameters do not need to have a value. Default -> Optional=false
        */
        public Boolean optional = null;
        /**
        * The data type of the value and default property
        */
        public ParameterValueType type = null;
        public String validation = null;
        
        public String getName() { return name; }
        public ParameterDto setName(String value) { this.name = value; return this; }
        public String getDescription() { return description; }
        public ParameterDto setDescription(String value) { this.description = value; return this; }
        public String getValue() { return value; }
        public ParameterDto setValue(String value) { this.value = value; return this; }
        public String getDefault() { return Default; }
        public ParameterDto setDefault(String value) { this.Default = value; return this; }
        public Boolean isOptional() { return optional; }
        public ParameterDto setOptional(Boolean value) { this.optional = value; return this; }
        public ParameterValueType getType() { return type; }
        public ParameterDto setType(ParameterValueType value) { this.type = value; return this; }
        public String getValidation() { return validation; }
        public ParameterDto setValidation(String value) { this.validation = value; return this; }
    }

    public static enum ParameterValueType
    {
        String,
        Number,
        Boolean,
        SecureString;
    }

    public static enum ActionScopes
    {
        Deployment,
        ResourceGroup,
        Resource;
    }

    public static class ActionStepDto
    {
        public String name = null;
        public String displayName = null;
        /**
        * The variables which are used in the ansible job
        */
        public HashMap<String,Object> variables = new HashMap<String,Object>();
        /**
        * Optional credential to be used in awx (credential stored in awx)
        */
        public String credential = null;
        /**
        * Ansible limit (optional if Scope is Resource)
        */
        public String limit = null;
        /**
        * Optional type of the awx action to run (job, workflow, etc.)
        */
        public String type = null;
        /**
        * Optional ansible module to be used
        */
        public String module = null;
        /**
        * Optional image for the execution environment which runs the action
        */
        public String executionEnvironment = null;
        /**
        * Optional inventory
        */
        public String inventory = null;
        
        public String getName() { return name; }
        public ActionStepDto setName(String value) { this.name = value; return this; }
        public String getDisplayName() { return displayName; }
        public ActionStepDto setDisplayName(String value) { this.displayName = value; return this; }
        public HashMap<String,Object> getVariables() { return variables; }
        public ActionStepDto setVariables(HashMap<String,Object> value) { this.variables = value; return this; }
        public String getCredential() { return credential; }
        public ActionStepDto setCredential(String value) { this.credential = value; return this; }
        public String getLimit() { return limit; }
        public ActionStepDto setLimit(String value) { this.limit = value; return this; }
        public String getType() { return type; }
        public ActionStepDto setType(String value) { this.type = value; return this; }
        public String getModule() { return module; }
        public ActionStepDto setModule(String value) { this.module = value; return this; }
        public String getExecutionEnvironment() { return executionEnvironment; }
        public ActionStepDto setExecutionEnvironment(String value) { this.executionEnvironment = value; return this; }
        public String getInventory() { return inventory; }
        public ActionStepDto setInventory(String value) { this.inventory = value; return this; }
    }

    public static class ScheduledTaskAssignmentDto
    {
        public UUID id = null;
        public UUID configItemId = null;
        public ObjectTypes objectType = null;
        public String displayName = null;
        public Long taskId = null;
        public String taskName = null;
        public String cronExpression = null;
        
        public UUID getId() { return id; }
        public ScheduledTaskAssignmentDto setId(UUID value) { this.id = value; return this; }
        public UUID getConfigItemId() { return configItemId; }
        public ScheduledTaskAssignmentDto setConfigItemId(UUID value) { this.configItemId = value; return this; }
        public ObjectTypes getObjectType() { return objectType; }
        public ScheduledTaskAssignmentDto setObjectType(ObjectTypes value) { this.objectType = value; return this; }
        public String getDisplayName() { return displayName; }
        public ScheduledTaskAssignmentDto setDisplayName(String value) { this.displayName = value; return this; }
        public Long getTaskId() { return taskId; }
        public ScheduledTaskAssignmentDto setTaskId(Long value) { this.taskId = value; return this; }
        public String getTaskName() { return taskName; }
        public ScheduledTaskAssignmentDto setTaskName(String value) { this.taskName = value; return this; }
        public String getCronExpression() { return cronExpression; }
        public ScheduledTaskAssignmentDto setCronExpression(String value) { this.cronExpression = value; return this; }
    }

}

Java GetActionAssignment 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.

GET /api/action-assignments/{Id} HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id":"00000000-0000-0000-0000-000000000000","name":"String","actionId":"00000000-0000-0000-0000-000000000000","action":{"tenantId":"00000000-0000-0000-0000-000000000000","schemaVersion":0,"definition":"String","parameters":null,"isDisabled":false,"scope":"Deployment","steps":[{"name":"String","displayName":"String","variables":{"String":{}},"credential":"String","limit":"String","type":"String","module":"String","executionEnvironment":"String","inventory":"String"}],"id":"00000000-0000-0000-0000-000000000000","name":"String","displayName":"String","description":"String","objectType":"None","selfLink":"String","tags":null,"path":null,"created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","modified":"0001-01-01T00:00:00.0000000Z","modifyUser":"String","modifyUserId":"String","isDeleted":false,"deleted":"0001-01-01T00:00:00.0000000Z","deleteUser":"String","deleteUserId":"String","links":null},"configItemId":"00000000-0000-0000-0000-000000000000","configItemName":"String","configItemType":"None","parameters":[{"name":"String","description":"String","value":"String","default":"String","optional":false,"type":"String","validation":"String"}],"selfLink":"String","scope":"Deployment","cronExpression":"String","links":[{"caption":"Start","rel":"start","hRef":"/action-assignments/00000000-0000-0000-0000-000000000000/start","method":"POST"},{"caption":"Completed","rel":"completed","hRef":"/action-assignments/00000000-0000-0000-0000-000000000000/completed","method":"PATCH"}],"scheduledTaskAssignmentId":"00000000-0000-0000-0000-000000000000","scheduledTaskAssignment":{"id":"00000000-0000-0000-0000-000000000000","configItemId":"00000000-0000-0000-0000-000000000000","objectType":"None","displayName":"String","taskId":0,"taskName":"String","cronExpression":"String"},"objectType":"ActionAssignment"}