| Required role: | TenantReader |
| GET | /api/deployments/{Id}/structure | Returns the structure of a deployment | |
|---|---|---|---|
| GET | /deployments/{Id}/structure | Returns the structure of a deployment |
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using CoreService.ServiceModel.Dtos.Deployments.Crud;
using YCO.Dune.Models.Dtos.Core;
using YCO.Dune.Models.Enums;
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=typeof(YCO.Dune.Models.Dtos.Core.NestedHierarchyItemDto), StatusCode=200)]
public partial class GetDeploymentStructure
: IBaseRequest, IHasTenantName, IGet
{
[ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")]
public virtual Guid Id { get; set; }
[ApiMember(DataType="string", IsRequired=true, ParameterType="header")]
[Validate("NotEmpty")]
public virtual string TenantName { get; set; }
}
}
namespace YCO.Dune.Models.Dtos.Core
{
public partial class HierarchyItemDto
{
public virtual Guid Id { get; set; }
public virtual ObjectTypes ConfigItemType { get; set; }
public virtual string? Name { get; set; }
public virtual string? DisplayName { get; set; }
public virtual string? Description { get; set; }
}
public partial class NestedHierarchyItemDto
: HierarchyItemDto
{
public virtual List<NestedHierarchyItemDto> Children { get; set; } = [];
}
}
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,
}
}
C# 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
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"}