CoreService

<back to all web services

GetCollection

Collection - CRUD

Returns a single collection by its id

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/api/collections/{Id}Returns a collection
GET/collections/{Id}Returns a collection
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 ValueDataType =
        | String = 0
        | Number = 1
        | Boolean = 2
        | List = 3

    type Environments =
        | Lab = 0
        | Poc = 1
        | Dev = 2
        | Test = 3
        | Int = 4
        | Uat = 5
        | Prod = 6

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

    [<AllowNullLiteral>]
    type TenantDto() = 
        inherit ConfigItemDto()
        ///<summary>
        ///Variables defined on tenant level
        ///</summary>
        member val Variables:IList<VariableDto> = null with get,set

        ///<summary>
        ///Allowed email domains used for authentication
        ///</summary>
        member val AllowedMailDomains:IList<String> = null with get,set

        ///<summary>
        ///List of licensed modules for this tenant
        ///</summary>
        member val LicensedModules:IList<String> = null with get,set

        ///<summary>
        ///Amount of days until a Deployment expires
        ///</summary>
        member val DefaultDeploymentLifetimeDays:Int16 = new Int16() with get,set

        ///<summary>
        ///Max amount of days until a Deployment expires
        ///</summary>
        member val MaxDeploymentLifetimeDays:Int16 = new Int16() with get,set

        ///<summary>
        ///Amount of days without patching until a unpatched warning is shown
        ///</summary>
        member val SystemUnpatchedWarningDays:Int16 = new Int16() with get,set

        ///<summary>
        ///Amount of hours without backup until a backup missing warning is shown
        ///</summary>
        member val SystemBackupMissingWarningHours:Int16 = new Int16() with get,set

        ///<summary>
        ///Amount of days until a vulnerable resource is getting stopped
        ///</summary>
        member val StopVulnerableResourceAfterDays:Int16 = new Int16() with get,set

        ///<summary>
        ///Amount of days before deployment expiration, which triggers the expiration warning
        ///</summary>
        member val DeploymentExpirationWarningDays:Int16 = new Int16() with get,set

        ///<summary>
        ///Amount of days the patch notification is sent out prior to the patch date
        ///</summary>
        member val PatchNotificationDays:Int16 = new Int16() with get,set

        ///<summary>
        ///Use a pool with your own hostnames (true) or let the hostname be auto generated (false)
        ///</summary>
        member val UseCustomHostnames:Boolean = new Boolean() with get,set

        ///<summary>
        ///After how many days inactive vulnerabilities will be purged from database
        ///</summary>
        member val RemoveInactiveVulnerabilitiesAfterDays:Int16 = new Int16() with get,set

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

    [<AllowNullLiteral>]
    type DeploymentCollectionDto() = 
        inherit ConfigItemDto()
        member val TenantId:Guid = new Guid() with get,set
        member val Tenant:TenantDto = null with get,set
        ///<summary>
        ///A collection scoped list of variables
        ///</summary>
        member val Variables:IList<VariableDto> = null with get,set

        ///<summary>
        ///Defines the collection where scanned but not deployed resources will be stored
        ///</summary>
        member val IsLostAndFound:Boolean = new Boolean() with get,set

        ///<summary>
        ///The monthly cost budget for the whole collection
        ///</summary>
        member val MonthlyBudget:Nullable<Decimal> = new Nullable<Decimal>() with get,set

        ///<summary>
        ///Whether to send budget information mails to the collection owners
        ///</summary>
        member val SendBudgetNotificationMails:Nullable<Boolean> = new Nullable<Boolean>() with get,set

        ///<summary>
        ///A threshold, when to send the first budget warning mail
        ///</summary>
        member val BudgetWarningThresholdPercent:Nullable<Int32> = new Nullable<Int32>() with get,set

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

    ///<summary>
    ///Returns a single collection by its id
    ///</summary>
    [<Api(Description="Returns a single collection by its id")>]
    [<ApiResponse(Description="The request ended successful", IsDefaultResponse=true, ResponseType=typeof<DeploymentCollectionDto>, StatusCode=200)>]
    [<AllowNullLiteral>]
    type GetCollection() = 
        interface IGet
        ///<summary>
        ///The unique id of the collection
        ///</summary>
        [<ApiMember(DataType="string", Description="The unique id of the collection", 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

        ///<summary>
        ///Returns all referenced object
        ///</summary>
        [<ApiMember(Description="Returns all referenced object", ParameterType="query")>]
        member val IncludeReferencedObjects:Nullable<Boolean> = new Nullable<Boolean>() with get,set

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

{"tenantId":"00000000-0000-0000-0000-000000000000","tenant":{"variables":null,"allowedMailDomains":null,"licensedModules":null,"defaultDeploymentLifetimeDays":0,"maxDeploymentLifetimeDays":0,"systemUnpatchedWarningDays":0,"systemBackupMissingWarningHours":0,"stopVulnerableResourceAfterDays":0,"deploymentExpirationWarningDays":0,"patchNotificationDays":0,"useCustomHostnames":false,"removeInactiveVulnerabilitiesAfterDays":0,"links":[{"caption":"Collections","rel":"down","hRef":"/collections/","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"},"variables":null,"isLostAndFound":false,"monthlyBudget":0,"sendBudgetNotificationMails":false,"budgetWarningThresholdPercent":0,"links":[{"caption":"Index","rel":"up","hRef":"/collections/","method":"GET"},{"caption":"Deployments","rel":"down","hRef":"/deployments?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"}