CoreService

<back to all web services

GetDeploymentStructure

Deployment - CRUD

Returns the structure of a deployment (deployment → resource groups → resources)

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/api/deployments/{Id}/structureReturns the structure of a deployment
GET/deployments/{Id}/structureReturns the structure of a deployment
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports CoreService.ServiceModel.Dtos.Deployments.Crud
Imports YCO.Dune.Models.Dtos.Core
Imports YCO.Dune.Models.Enums

Namespace Global

    Namespace CoreService.ServiceModel.Dtos.Deployments.Crud

        '''<Summary>
        '''Returns the structure of a deployment (deployment → resource groups → resources)
        '''</Summary>
        <Api(Description:="Returns the structure of a deployment (deployment → resource groups → resources)")>
        <ApiResponse(Description:="Success", IsDefaultResponse:=true, ResponseType:=GetType(NestedHierarchyItemDto), StatusCode:=200)>
        Public Partial Class GetDeploymentStructure
            Implements IBaseRequest
            Implements IHasTenantName
            Implements IGet
            <ApiMember(DataType:="string", Format:="guid", IsRequired:=true, ParameterType:="path")>
            Public Overridable Property Id As Guid

            <ApiMember(DataType:="string", IsRequired:=true, ParameterType:="header")>
            <Validate(Validator:="NotEmpty")>
            Public Overridable Property TenantName As String Implements IHasTenantName.TenantName
        End Class
    End Namespace

    Namespace YCO.Dune.Models.Dtos.Core

        Public Partial Class HierarchyItemDto
            Public Overridable Property Id As Guid
            Public Overridable Property ConfigItemType As ObjectTypes
            Public Overridable Property Name As String
            Public Overridable Property DisplayName As String
            Public Overridable Property Description As String
        End Class

        Public Partial Class NestedHierarchyItemDto
            Inherits HierarchyItemDto
            Public Overridable Property Children As List(Of NestedHierarchyItemDto) = New List(Of NestedHierarchyItemDto)
        End Class
    End Namespace

    Namespace YCO.Dune.Models.Enums

        Public 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
        End Enum
    End Namespace
End Namespace

VB.NET GetDeploymentStructure 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/deployments/{Id}/structure HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"children":[{"children":[{"children":[{"children":null,"id":"00000000-0000-0000-0000-000000000000","configItemType":"None","name":"String","displayName":"String","description":"String"}],"id":"00000000-0000-0000-0000-000000000000","configItemType":"None","name":"String","displayName":"String","description":"String"}],"id":"00000000-0000-0000-0000-000000000000","configItemType":"None","name":"String","displayName":"String","description":"String"}],"id":"00000000-0000-0000-0000-000000000000","configItemType":"None","name":"String","displayName":"String","description":"String"}