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
import 'package:servicestack/servicestack.dart';

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,
}

class HierarchyItemDto implements IConvertible
{
    String id = "";
    ObjectTypes configItemType;
    String? name;
    String? displayName;
    String? description;

    HierarchyItemDto({this.id,this.configItemType,this.name,this.displayName,this.description});
    HierarchyItemDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        configItemType = JsonConverters.fromJson(json['configItemType'],'ObjectTypes',context!);
        name = json['name'];
        displayName = json['displayName'];
        description = json['description'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'configItemType': JsonConverters.toJson(configItemType,'ObjectTypes',context!),
        'name': name,
        'displayName': displayName,
        'description': description
    };

    getTypeName() => "HierarchyItemDto";
    TypeContext? context = _ctx;
}

class NestedHierarchyItemDto extends HierarchyItemDto implements IConvertible
{
    List<NestedHierarchyItemDto> children = [];

    NestedHierarchyItemDto({this.children});
    NestedHierarchyItemDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        children = JsonConverters.fromJson(json['children'],'List<NestedHierarchyItemDto>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'children': JsonConverters.toJson(children,'List<NestedHierarchyItemDto>',context!)
    });

    getTypeName() => "NestedHierarchyItemDto";
    TypeContext? context = _ctx;
}

/**
* Returns the structure of a deployment (deployment → resource groups → resources)
*/
// @Api(Description="Returns the structure of a deployment (deployment → resource groups → resources)")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(NestedHierarchyItemDto), StatusCode=200)
class GetDeploymentStructure implements IBaseRequest, IHasTenantName, IGet, IConvertible
{
    // @ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")
    String id = "";

    // @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
    // @Validate(Validator="NotEmpty")
    String tenantName = "";

    GetDeploymentStructure({this.id,this.tenantName});
    GetDeploymentStructure.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        tenantName = json['tenantName'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'tenantName': tenantName
    };

    getTypeName() => "GetDeploymentStructure";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'duneframework.com', types: <String, TypeInfo> {
    'ObjectTypes': TypeInfo(TypeOf.Enum, enumValues:ObjectTypes.values),
    'HierarchyItemDto': TypeInfo(TypeOf.Class, create:() => HierarchyItemDto()),
    'NestedHierarchyItemDto': TypeInfo(TypeOf.Class, create:() => NestedHierarchyItemDto()),
    'List<NestedHierarchyItemDto>': TypeInfo(TypeOf.Class, create:() => <NestedHierarchyItemDto>[]),
    'GetDeploymentStructure': TypeInfo(TypeOf.Class, create:() => GetDeploymentStructure()),
});

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