CoreService

<back to all web services

GetDeployment

Deployment - CRUD

Returns a deployment by its ID

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/api/deployments/{Id}Returns a deployment
GET/deployments/{Id}Returns 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 CoreService.ServiceModel.Dtos.Deployments.Responses;
using CoreService.ServiceModel.Dtos.Base.Responses;
using YCO.Dune.Models.Enums;
using CoreService.ServiceModel.Enums;

namespace CoreService.ServiceModel.Dtos.Base.Responses
{
    public partial class ConfigItemDto
        : IConfigItem
    {
        public virtual Guid Id { get; set; }
        public virtual string Name { get; set; }
        public virtual string DisplayName { get; set; }
        public virtual string? Description { get; set; }
        public virtual ObjectTypes ObjectType { get; set; }
        public virtual string SelfLink { get; set; }
        public virtual IList<TagDto> Tags { get; set; }
        public virtual IList<PathItemDto> Path { get; set; }
        public virtual DateTime Created { get; set; }
        public virtual string CreateUser { get; set; }
        public virtual string CreateUserId { get; set; }
        public virtual DateTime Modified { get; set; }
        public virtual string ModifyUser { get; set; }
        public virtual string ModifyUserId { get; set; }
        public virtual bool IsDeleted { get; set; }
        public virtual DateTime? Deleted { get; set; }
        public virtual string? DeleteUser { get; set; }
        public virtual string? DeleteUserId { get; set; }
        public virtual IList<LinkDto> Links { get; set; }
    }

    public partial class LinkDto
    {
        public virtual string Caption { get; set; }
        public virtual string Rel { get; set; }
        public virtual string HRef { get; set; }
        public virtual string Method { get; set; }
    }

    public partial class ParameterDto
    {
        public virtual string Name { get; set; }
        public virtual string? Description { 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>
        public virtual string? Value { get; set; }
        ///<summary>
        ///Optional default value for the frontend. Needs to be in the same format as the value
        ///</summary>
        public virtual string? Default { get; set; }
        ///<summary>
        ///Optional parameters do not need to have a value. Default -> Optional=false
        ///</summary>
        public virtual bool Optional { get; set; }
        ///<summary>
        ///The data type of the value and default property
        ///</summary>
        public virtual ParameterValueType Type { get; set; }
        public virtual string? Validation { get; set; }
    }

    public partial class PathItemDto
    {
        public virtual string Label { get; set; }
        public virtual string Link { get; set; }
        public virtual ObjectTypes ObjectType { get; set; }
        public virtual Guid ObjectId { get; set; }
    }

    public partial class TagDto
    {
        public virtual string Name { get; set; }
        public virtual string? Value { get; set; }
        public virtual bool IsProtected { get; set; }
    }

    public partial class VariableDto
    {
        public virtual string Name { 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>
        public virtual string Value { get; set; }
        ///<summary>
        ///The data type of the value property
        ///</summary>
        public virtual ValueDataType Type { get; set; }
        public virtual string? Description { get; set; }
        public virtual bool IsInherited { get; set; }
        public virtual Environments? Environment { get; set; }
    }

}

namespace CoreService.ServiceModel.Dtos.Deployments.Crud
{
    ///<summary>
    ///Returns a deployment by its ID
    ///</summary>
    [Api(Description="Returns a deployment by its ID")]
    [ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(CoreService.ServiceModel.Dtos.Deployments.Responses.DeploymentDto), StatusCode=200)]
    public partial class GetDeployment
        : IGetSingleRequest, 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; }

        [ApiMember(ParameterType="query", Verb="GET")]
        public virtual bool? IncludeReferencedObjects { 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")]
        public virtual bool? IncludeDeleted { get; set; }
    }

}

namespace CoreService.ServiceModel.Dtos.Deployments.Responses
{
    public partial class DeploymentDto
        : ConfigItemDto, IHasParentDto, IHasTenantId, IEnvironmentSpecific
    {
        ///<summary>
        ///The operational state of the deployment (Running, Stopped, None, Unknown)
        ///</summary>
        public virtual OperationalStates OperationalState { get; set; }
        ///<summary>
        ///How many start/stop-capable resources are currently running
        ///</summary>
        public virtual int ResourcesRunning { get; set; }
        ///<summary>
        ///Total number of start/stop-capable resources in this deployment
        ///</summary>
        public virtual int ResourcesTotal { get; set; }
        ///<summary>
        ///Shorter id than the guid which can be used for automation (tenant wide unique) prefixed with a 'd'. E.g. dr36x3
        ///</summary>
        public virtual string ShortId { get; set; }
        ///<summary>
        ///The user defined part of the name property {userDefined}_{environment}
        ///</summary>
        public virtual string NameUserDefinedPart { get; set; }
        ///<summary>
        ///The id of the tenant
        ///</summary>
        public virtual Guid TenantId { get; set; }
        ///<summary>
        ///The state of the deployment
        ///</summary>
        public virtual LifecycleStates State { get; set; }
        ///<summary>
        ///The environment the deployment is deployed in
        ///</summary>
        public virtual Environments Environment { get; set; }
        ///<summary>
        ///The id of the template which was used to create the deployment
        ///</summary>
        public virtual Guid? TemplateId { get; set; }
        ///<summary>
        ///Shows if a deployment was rolled out through a dune template or not
        ///</summary>
        public virtual bool IsTemplateBased { get; set; }
        ///<summary>
        ///The parameters which were used to create this deployment
        ///</summary>
        public virtual IList<ParameterDto> Parameters { get; set; }
        ///<summary>
        ///A deployment scoped list of variables used for deployment of resources
        ///</summary>
        public virtual IList<VariableDto> Variables { get; set; }
        ///<summary>
        ///A snapshot of the varialbs used to create the deployment
        ///</summary>
        public virtual IList<VariableDto> VariablesSnapshot { get; set; }
        ///<summary>
        ///The id of the parent (collection) of the deployment
        ///</summary>
        public virtual Guid ParentId { get; set; }
        ///<summary>
        ///The parent (collection) of the deployment
        ///</summary>
        public virtual ConfigItemDto? Parent { get; set; }
        ///<summary>
        ///The Date when the resources got deployed
        ///</summary>
        public virtual DateTime ValidFrom { get; set; }
        ///<summary>
        ///The Date when the deployment expires and has to be reevaluated
        ///</summary>
        public virtual DateTime? ValidUntil { get; set; }
        ///<summary>
        ///The deployment will never expire
        ///</summary>
        public virtual bool IsNeverExpiring { get; set; }
        ///<summary>
        ///The date, when the deployments resources will receive updates
        ///</summary>
        public virtual DateTime? NextPatchDate { get; set; }
        ///<summary>
        ///The default resource provider where the resources are deployed
        ///</summary>
        public virtual Guid DefaultResourceProviderId { get; set; }
        ///<summary>
        ///Deployments which have issues in Jobs are marked with NeedsAttention
        ///</summary>
        public virtual bool NeedsAttention { get; set; }
        ///<summary>
        ///Composition show if all resources in the deployment are dune native, dune foreign or a mix of both
        ///</summary>
        public virtual ResourceCompositions Composition { get; set; }
        ///<summary>
        ///The monthly cost budget for the whole collection
        ///</summary>
        public virtual decimal? MonthlyBudget { get; set; }
        ///<summary>
        ///Whether to send budget information mails to the collection owners
        ///</summary>
        public virtual bool? SendBudgetNotificationMails { get; set; }
        ///<summary>
        ///A threshold, when to send the first budget warning mail
        ///</summary>
        public virtual int? BudgetWarningThresholdPercent { get; set; }
        public virtual IList<LinkDto> Links { get; set; }
    }

}

namespace CoreService.ServiceModel.Enums
{
    public enum Environments
    {
        Lab,
        Poc,
        Dev,
        Test,
        Int,
        Uat,
        Prod,
    }

    public enum LifecycleStates
    {
        New,
        Deploying,
        Deployed,
        Removing,
        Removed,
        Failure,
        Imported,
    }

    public enum OperationalStates
    {
        None,
        Starting,
        Running,
        Stopping,
        Stopped,
        Restarting,
        Deleting,
        Unknown,
    }

    public enum ParameterValueType
    {
        String,
        Number,
        Boolean,
        SecureString,
    }

    public enum ResourceCompositions
    {
        Native,
        Foreign,
        Mixed,
    }

    public enum ValueDataType
    {
        String,
        Number,
        Boolean,
        List,
    }

}

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

{"operationalState":"None","resourcesRunning":0,"resourcesTotal":0,"shortId":"String","nameUserDefinedPart":"String","tenantId":"00000000-0000-0000-0000-000000000000","state":"New","environment":"Lab","templateId":"00000000-0000-0000-0000-000000000000","isTemplateBased":true,"parameters":null,"variables":null,"variablesSnapshot":null,"parentId":"00000000-0000-0000-0000-000000000000","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},"validFrom":"0001-01-01T00:00:00.0000000Z","validUntil":"0001-01-01T00:00:00.0000000Z","isNeverExpiring":false,"nextPatchDate":"0001-01-01T00:00:00.0000000Z","defaultResourceProviderId":"00000000-0000-0000-0000-000000000000","needsAttention":false,"composition":"Native","monthlyBudget":0,"sendBudgetNotificationMails":false,"budgetWarningThresholdPercent":0,"links":[{"caption":"Index","rel":"index","hRef":"/deployments/","method":"GET"},{"caption":"Collection","rel":"up","hRef":"/collections/00000000-0000-0000-0000-000000000000","method":"GET"},{"caption":"Resourcegroups","rel":"down","hRef":"/resourcegroups?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"}