CoreService

<back to all web services

GetAction

Action - CRUD

Returns an action by its id

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
All Verbs/api/actions/{Id}
All Verbs/actions/{Id}
namespace CoreService.ServiceModel.Dtos.Actions.Crud

open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    type ObjectTypes =
        | None = 0
        | ConfigItem = 1
        | Tenant = 2
        | Collection = 3
        | Resource = 4
        | ComputeNode = 5
        | VirtualMachine = 6
        | PhysicalMachine = 7
        | Disk = 8
        | Subnet = 9
        | IPAddress = 10
        | Job = 11
        | JobEvent = 12
        | FreezePeriod = 13
        | ResourceGroup = 14
        | Deployment = 15
        | ResourceGroupTemplate = 16
        | DeploymentTemplate = 17
        | ResourceProvider = 18
        | GenericResource = 19
        | Role = 20
        | Permission = 21
        | User = 22
        | PatchingWindow = 23
        | Update = 24
        | ReportDefinition = 25
        | TimeSeries = 26
        | DataPoint = 27
        | Action = 28
        | ActionAssignment = 29
        | UserNote = 30

    [<AllowNullLiteral>]
    type TagDto() = 
        member val Name:String = null with get,set
        member val Value:String = null with get,set
        member val IsProtected:Boolean = new Boolean() with get,set

    [<AllowNullLiteral>]
    type PathItemDto() = 
        member val Label:String = null with get,set
        member val Link:String = null with get,set
        member val ObjectType:ObjectTypes = new ObjectTypes() with get,set
        member val ObjectId:Guid = new Guid() with get,set

    [<AllowNullLiteral>]
    type LinkDto() = 
        member val Caption:String = null with get,set
        member val Rel:String = null with get,set
        member val HRef:String = null with get,set
        member val Method:String = null with get,set

    [<AllowNullLiteral>]
    type ConfigItemDto() = 
        member val Id:Guid = new Guid() with get,set
        member val Name:String = null with get,set
        member val DisplayName:String = null with get,set
        member val Description:String = null with get,set
        member val ObjectType:ObjectTypes = new ObjectTypes() with get,set
        member val SelfLink:String = null with get,set
        member val Tags:IList<TagDto> = null with get,set
        member val Path:IList<PathItemDto> = null with get,set
        member val Created:DateTime = new DateTime() with get,set
        member val CreateUser:String = null with get,set
        member val CreateUserId:String = null with get,set
        member val Modified:DateTime = new DateTime() with get,set
        member val ModifyUser:String = null with get,set
        member val ModifyUserId:String = null with get,set
        member val IsDeleted:Boolean = new Boolean() with get,set
        member val Deleted:Nullable<DateTime> = new Nullable<DateTime>() with get,set
        member val DeleteUser:String = null with get,set
        member val DeleteUserId:String = null with get,set
        member val Links:IList<LinkDto> = null with get,set

    type ParameterValueType =
        | String = 0
        | Number = 1
        | Boolean = 2
        | SecureString = 3

    [<AllowNullLiteral>]
    type ParameterDto() = 
        member val Name:String = null with get,set
        member val Description:String = null with get,set
        ///<summary>
        ///Value in form of a json string (e.g. Number = 1234, String = "foo", Boolean = false). Note: string values need extra quotes
        ///</summary>
        member val Value:String = null with get,set

        ///<summary>
        ///Optional default value for the frontend. Needs to be in the same format as the value
        ///</summary>
        member val Default:String = null with get,set

        ///<summary>
        ///Optional parameters do not need to have a value. Default -> Optional=false
        ///</summary>
        member val Optional:Boolean = new Boolean() with get,set

        ///<summary>
        ///The data type of the value and default property
        ///</summary>
        member val Type:ParameterValueType = new ParameterValueType() with get,set

        member val Validation:String = null with get,set

    type ActionScopes =
        | Deployment = 0
        | ResourceGroup = 1
        | Resource = 2

    [<AllowNullLiteral>]
    type ActionStepDto() = 
        member val Name:String = null with get,set
        member val DisplayName:String = null with get,set
        ///<summary>
        ///The variables which are used in the ansible job
        ///</summary>
        member val Variables:Dictionary<String, Object> = null with get,set

        ///<summary>
        ///Optional credential to be used in awx (credential stored in awx)
        ///</summary>
        member val Credential:String = null with get,set

        ///<summary>
        ///Ansible limit (optional if Scope is Resource)
        ///</summary>
        member val Limit:String = null with get,set

        ///<summary>
        ///Optional type of the awx action to run (job, workflow, etc.)
        ///</summary>
        member val Type:String = null with get,set

        ///<summary>
        ///Optional ansible module to be used
        ///</summary>
        member val Module:String = null with get,set

        ///<summary>
        ///Optional image for the execution environment which runs the action
        ///</summary>
        member val ExecutionEnvironment:String = null with get,set

        ///<summary>
        ///Optional inventory
        ///</summary>
        member val Inventory:String = null with get,set

    [<AllowNullLiteral>]
    type ActionDto() = 
        inherit ConfigItemDto()
        member val TenantId:Guid = new Guid() with get,set
        ///<summary>
        ///The schema version of the attached definition (json/yaml structure)
        ///</summary>
        member val SchemaVersion:Int32 = new Int32() with get,set

        ///<summary>
        ///The action definition as json/yaml
        ///</summary>
        member val Definition:String = null with get,set

        ///<summary>
        ///Action parameters
        ///</summary>
        member val Parameters:IList<ParameterDto> = null with get,set

        ///<summary>
        ///Disabled actions cannot be assigned to a configitem
        ///</summary>
        member val IsDisabled:Boolean = new Boolean() with get,set

        ///<summary>
        ///This action can anly be assigned to configitems of this type
        ///</summary>
        member val Scope:ActionScopes = new ActionScopes() with get,set

        ///<summary>
        ///The individual steps of the action
        ///</summary>
        member val Steps:ResizeArray<ActionStepDto> = null with get,set

    ///<summary>
    ///Returns an action by its id
    ///</summary>
    [<Api(Description="Returns an action by its id")>]
    [<ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof<ActionDto>, StatusCode=200)>]
    [<AllowNullLiteral>]
    type GetAction() = 
        interface IGet
        [<ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")>]
        member val Id:Guid = new Guid() with get,set

        [<ApiMember(DataType="string", IsRequired=true, ParameterType="header")>]
        [<Validate(Validator="NotEmpty")>]
        member val TenantName:String = null with get,set

        [<ApiMember(ParameterType="query", Verb="GET")>]
        member val IncludeReferencedObjects:Nullable<Boolean> = new Nullable<Boolean>() with get,set

        ///<summary>
        ///If true, also soft deleted items will be returned
        ///</summary>
        [<ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")>]
        member val IncludeDeleted:Nullable<Boolean> = new Nullable<Boolean>() with get,set

F# GetAction 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/actions/{Id} HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"id":"00000000-0000-0000-0000-000000000000","tenantName":"String","includeReferencedObjects":false,"includeDeleted":false,"txId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

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