CoreService

<back to all web services

GetResourceGroup

ResourceGroup - CRUD

Get a single resourcegroup

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/api/resourcegroups/{Id}Finds resourcegroups
GET/resourcegroups/{Id}Finds resourcegroups
namespace CoreService.ServiceModel.Dtos.Base.Responses

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 Environments =
        | Lab = 0
        | Poc = 1
        | Dev = 2
        | Test = 3
        | Int = 4
        | Uat = 5
        | Prod = 6

    type LifecycleStates =
        | New = 0
        | Deploying = 1
        | Deployed = 2
        | Removing = 3
        | Removed = 4
        | Failure = 5
        | Imported = 6

    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 ValueDataType =
        | String = 0
        | Number = 1
        | Boolean = 2
        | List = 3

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

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

        member val Description:String = null with get,set
        member val IsInherited:Boolean = new Boolean() with get,set
        member val Environment:Nullable<Environments> = new Nullable<Environments>() with get,set

    type ResourceCompositions =
        | Native = 0
        | Foreign = 1
        | Mixed = 2

    [<AllowNullLiteral>]
    type ResourceGroupDto() = 
        inherit ConfigItemDto()
        ///<summary>
        ///Shorter id than the guid which can be used for automation (tenant wide unique) prefixed with a 'g'. E.g. gk36x3
        ///</summary>
        member val ShortId:String = null with get,set

        ///<summary>
        ///The id of the tenant
        ///</summary>
        member val TenantId:Guid = new Guid() with get,set

        ///<summary>
        ///The environment the resourcegroup is deployed in
        ///</summary>
        member val Environment:Environments = new Environments() with get,set

        ///<summary>
        ///The state of the deployment
        ///</summary>
        member val State:LifecycleStates = new LifecycleStates() with get,set

        ///<summary>
        ///The id of the parent (deployment) of the resourcegroup
        ///</summary>
        member val ParentId:Guid = new Guid() with get,set

        ///<summary>
        ///The id of the template which was used to create the resourcegroup
        ///</summary>
        member val TemplateId:Nullable<Guid> = new Nullable<Guid>() with get,set

        ///<summary>
        ///Shows if a resourcegroup was rolled out through a dune template or not
        ///</summary>
        member val IsTemplateBased:Boolean = new Boolean() with get,set

        ///<summary>
        ///The parent (deployment) of the resourcegroup
        ///</summary>
        member val Parent:ConfigItemDto = null with get,set

        ///<summary>
        ///The parameters which were used to create this resourcegroup
        ///</summary>
        member val Parameters:IList<ParameterDto> = null with get,set

        ///<summary>
        ///A resourcegroup scoped list of variables used for resourcegroup of resources
        ///</summary>
        member val Variables:IList<VariableDto> = null with get,set

        ///<summary>
        ///The date, when the resourcegroups resources will receive updates
        ///</summary>
        member val NextPatchDate:Nullable<DateTime> = new Nullable<DateTime>() with get,set

        ///<summary>
        ///Composition show if all resources in the resourcegroup are dune native, dune foreign or a mix of both
        ///</summary>
        member val Composition:ResourceCompositions = new ResourceCompositions() with get,set

        member val Links:IList<LinkDto> = null with get,set

    ///<summary>
    ///Get a single resourcegroup
    ///</summary>
    [<Api(Description="Get a single resourcegroup")>]
    [<ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof<ResourceGroupDto>, StatusCode=200)>]
    [<AllowNullLiteral>]
    type GetResourceGroup() = 
        interface IGet
        ///<summary>
        ///The primary key of every config item
        ///</summary>
        [<ApiMember(DataType="string", Description="The primary key of every config item", 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

        ///<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

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

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

{"shortId":"String","tenantId":"00000000-0000-0000-0000-000000000000","environment":"Lab","state":"New","parentId":"00000000-0000-0000-0000-000000000000","templateId":"00000000-0000-0000-0000-000000000000","isTemplateBased":true,"parent":{"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},"parameters":null,"variables":null,"nextPatchDate":"0001-01-01T00:00:00.0000000Z","composition":"Native","links":[{"caption":"Index","rel":"index","hRef":"/resourcegroups/","method":"GET"},{"caption":"Deployment","rel":"up","hRef":"/deployments/00000000-0000-0000-0000-000000000000","method":"GET"},{"caption":"Resources","rel":"down","hRef":"/resources?parentId=00000000-0000-0000-0000-000000000000","method":"GET"}],"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"}