CoreService

<back to all web services

CreateActionAssignment

Action - CRUD

Adds an action to a config item

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
POST/api/action-assignmentsAssigns an action to a config item
POST/action-assignmentsAssigns an action to a config item
CreateActionAssignment Parameters:
NameParameterData TypeRequiredDescription
TenantNameheaderstringYes
ConfigItemIdpathstringYesThe unique id of the config item
ConfigItemTypebodyObjectTypesYesThe type of the config item (either Deployment, ResourceGroup or Resource)

Allowable Values

  • 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
ActionIdpathstringYes
NamebodystringYesA unique name for the action
ParametersbodyarrayYes
CronExpressionbodystringNoThe cron expression for scheduling the operation
SendNotificationsbodyboolNoInform users when the job has finished
ObjectTypes Enum:
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
ParameterDto Parameters:
NameParameterData TypeRequiredDescription
NameformstringYes
DescriptionformstringNo
ValueformstringNoValue in form of a json string (e.g. Number = 1234, String = "foo", Boolean = false). Note: string values need extra quotes
DefaultformstringNoOptional default value for the frontend. Needs to be in the same format as the value
OptionalformboolNoOptional parameters do not need to have a value. Default -> Optional=false
TypeformParameterValueTypeNoThe data type of the value and default property
ValidationformstringNo
ParameterValueType Enum:
String
Number
Boolean
SecureString
ActionAssignmentDto Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNo
NameformstringYes
ActionIdformGuidNo
ActionformActionDtoNo
ConfigItemIdformGuidNo
ConfigItemNameformstringYes
ConfigItemTypeformObjectTypesNo
ParametersformList<ParameterDto>Yes
SelfLinkformstringYes
ScopeformActionScopesNo
CronExpressionformstringNo
LinksformIList<LinkDto>Yes
ScheduledTaskAssignmentIdformGuid?No
ScheduledTaskAssignmentformScheduledTaskAssignmentDtoNo
ObjectTypeformObjectTypesNo
ActionDto Parameters:
NameParameterData TypeRequiredDescription
TenantIdformGuidNo
SchemaVersionformintNoThe schema version of the attached definition (json/yaml structure)
DefinitionformstringNoThe action definition as json/yaml
ParametersformIList<ParameterDto>YesAction parameters
IsDisabledformboolNoDisabled actions cannot be assigned to a configitem
ScopeformActionScopesNoThis action can anly be assigned to configitems of this type
StepsformList<ActionStepDto>YesThe individual steps of the action
ConfigItemDto Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNo
NameformstringYes
DisplayNameformstringYes
DescriptionformstringNo
ObjectTypeformObjectTypesNo
SelfLinkformstringYes
TagsformIList<TagDto>Yes
PathformIList<PathItemDto>Yes
CreatedformDateTimeNo
CreateUserformstringYes
CreateUserIdformstringYes
ModifiedformDateTimeNo
ModifyUserformstringYes
ModifyUserIdformstringYes
IsDeletedformboolNo
DeletedformDateTime?No
DeleteUserformstringNo
DeleteUserIdformstringNo
LinksformIList<LinkDto>Yes
TagDto Parameters:
NameParameterData TypeRequiredDescription
NameformstringYes
ValueformstringNo
IsProtectedformboolNo
PathItemDto Parameters:
NameParameterData TypeRequiredDescription
LabelformstringYes
LinkformstringYes
ObjectTypeformObjectTypesNo
ObjectIdformGuidNo
LinkDto Parameters:
NameParameterData TypeRequiredDescription
CaptionformstringYes
RelformstringYes
HRefformstringYes
MethodformstringYes
ActionScopes Enum:
Deployment
ResourceGroup
Resource
ActionStepDto Parameters:
NameParameterData TypeRequiredDescription
NameformstringYes
DisplayNameformstringNo
VariablesformDictionary<string, Object>YesThe variables which are used in the ansible job
CredentialformstringNoOptional credential to be used in awx (credential stored in awx)
LimitformstringNoAnsible limit (optional if Scope is Resource)
TypeformstringNoOptional type of the awx action to run (job, workflow, etc.)
ModuleformstringNoOptional ansible module to be used
ExecutionEnvironmentformstringNoOptional image for the execution environment which runs the action
InventoryformstringNoOptional inventory
ScheduledTaskAssignmentDto Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNo
ConfigItemIdformGuidNo
ObjectTypeformObjectTypesNo
DisplayNameformstringYes
TaskIdformlongNo
TaskNameformstringYes
CronExpressionformstringYes

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/action-assignments 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","actionId":"00000000-0000-0000-0000-000000000000","name":"String","parameters":[{"name":"String","description":"String","value":"String","default":"String","optional":false,"type":"String","validation":"String"}],"cronExpression":"String","sendNotifications":false,"txId":"00000000-0000-0000-0000-000000000000"}
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"}