| Required role: | TenantReader |
| GET | /api/deploymenttemplates/ | Returns deployment templates | |
|---|---|---|---|
| GET | /api/deploymenttemplates/search | Returns deployment templates | |
| GET | /deploymenttemplates/ | Returns deployment templates | |
| GET | /deploymenttemplates/search | Returns deployment templates |
import Foundation
import ServiceStack
/**
* Returns all deployment templates
*/
// @Api(Description="Returns all deployment templates")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(0, Culture=neutral, PublicKeyToken=null]]), StatusCode=200)
public class QueryDeploymentTemplates : QueryDb<DeploymentTemplate>, IGetMultipleRequest, IHasTenantName, IGet, IGroupable
{
// @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
// @Validate(Validator="NotEmpty")
public var tenantName:String
/**
* If true, also soft deleted items will be returned
*/
// @ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")
public var includeDeleted:Bool?
/**
* The property, the data will be grouped on
*/
// @ApiMember(Description="The property, the data will be grouped on", ParameterType="query")
public var groupBy:String
/**
* The property, used for aggregation
*/
// @ApiMember(Description="The property, used for aggregation", ParameterType="query")
public var aggregateOn:String
/**
* The aggregation function to use
*/
// @ApiMember(Description="The aggregation function to use", ParameterType="query")
public var aggregation:Aggregations?
/**
* If true, also include the json definition
*/
// @ApiMember(Description="If true, also include the json definition", ParameterType="query")
public var includeDefinition:Bool?
/**
* Returns all referenced object
*/
// @ApiMember(Description="Returns all referenced object", ParameterType="query")
public var includeReferencedObjects:Bool?
/**
* The version of the template
*/
// @ApiMember(Description="The version of the template", ParameterType="query")
public var version:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case tenantName
case includeDeleted
case groupBy
case aggregateOn
case aggregation
case includeDefinition
case includeReferencedObjects
case version
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
tenantName = try container.decodeIfPresent(String.self, forKey: .tenantName)
includeDeleted = try container.decodeIfPresent(Bool.self, forKey: .includeDeleted)
groupBy = try container.decodeIfPresent(String.self, forKey: .groupBy)
aggregateOn = try container.decodeIfPresent(String.self, forKey: .aggregateOn)
aggregation = try container.decodeIfPresent(Aggregations.self, forKey: .aggregation)
includeDefinition = try container.decodeIfPresent(Bool.self, forKey: .includeDefinition)
includeReferencedObjects = try container.decodeIfPresent(Bool.self, forKey: .includeReferencedObjects)
version = try container.decodeIfPresent(String.self, forKey: .version)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if tenantName != nil { try container.encode(tenantName, forKey: .tenantName) }
if includeDeleted != nil { try container.encode(includeDeleted, forKey: .includeDeleted) }
if groupBy != nil { try container.encode(groupBy, forKey: .groupBy) }
if aggregateOn != nil { try container.encode(aggregateOn, forKey: .aggregateOn) }
if aggregation != nil { try container.encode(aggregation, forKey: .aggregation) }
if includeDefinition != nil { try container.encode(includeDefinition, forKey: .includeDefinition) }
if includeReferencedObjects != nil { try container.encode(includeReferencedObjects, forKey: .includeReferencedObjects) }
if version != nil { try container.encode(version, forKey: .version) }
}
}
public class DeploymentTemplate : ConfigItem, IHasTenantId
{
// @Required()
public var tenantId:String?
// @Required()
public var schemaVersion:Int?
// @Required()
// @StringLength(20)
public var version:String?
// @Required()
public var versionNumeric:Int?
// @Required()
// @StringLength(Int32.max)
public var definitionJson:String?
// @Required()
// @StringLength(Int32.max)
public var definitionYaml:String?
// @Required()
public var parameters:IList<Parameter>?
// @Required()
public var variables:IList<Variable>?
// @Required()
public var isDisabled:Bool?
// @Required()
public var isLatest:Bool?
public var allowedEnvironments:IList<Environments>
// @Ignore()
public var allowedResourceProviders:IList<ResourceProvider>
// @Ignore()
public var resourceGroupTemplates:IList<ResourceGroupTemplate>
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case tenantId
case name
case objectType
case selfLink
case schemaVersion
case version
case versionNumeric
case definitionJson
case definitionYaml
case parameters
case variables
case isDisabled
case isLatest
case allowedEnvironments
case allowedResourceProviders
case resourceGroupTemplates
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
tenantId = try container.decodeIfPresent(String.self, forKey: .tenantId)
name = try container.decodeIfPresent(String.self, forKey: .name)
objectType = try container.decodeIfPresent(ObjectTypes.self, forKey: .objectType)
selfLink = try container.decodeIfPresent(String.self, forKey: .selfLink)
schemaVersion = try container.decodeIfPresent(Int.self, forKey: .schemaVersion)
version = try container.decodeIfPresent(String.self, forKey: .version)
versionNumeric = try container.decodeIfPresent(Int.self, forKey: .versionNumeric)
definitionJson = try container.decodeIfPresent(String.self, forKey: .definitionJson)
definitionYaml = try container.decodeIfPresent(String.self, forKey: .definitionYaml)
parameters = try container.decodeIfPresent(IList<Parameter>.self, forKey: .parameters)
variables = try container.decodeIfPresent(IList<Variable>.self, forKey: .variables)
isDisabled = try container.decodeIfPresent(Bool.self, forKey: .isDisabled)
isLatest = try container.decodeIfPresent(Bool.self, forKey: .isLatest)
allowedEnvironments = try container.decodeIfPresent(IList<Environments>.self, forKey: .allowedEnvironments)
allowedResourceProviders = try container.decodeIfPresent(IList<ResourceProvider>.self, forKey: .allowedResourceProviders)
resourceGroupTemplates = try container.decodeIfPresent(IList<ResourceGroupTemplate>.self, forKey: .resourceGroupTemplates)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if tenantId != nil { try container.encode(tenantId, forKey: .tenantId) }
if name != nil { try container.encode(name, forKey: .name) }
if objectType != nil { try container.encode(objectType, forKey: .objectType) }
if selfLink != nil { try container.encode(selfLink, forKey: .selfLink) }
if schemaVersion != nil { try container.encode(schemaVersion, forKey: .schemaVersion) }
if version != nil { try container.encode(version, forKey: .version) }
if versionNumeric != nil { try container.encode(versionNumeric, forKey: .versionNumeric) }
if definitionJson != nil { try container.encode(definitionJson, forKey: .definitionJson) }
if definitionYaml != nil { try container.encode(definitionYaml, forKey: .definitionYaml) }
if parameters != nil { try container.encode(parameters, forKey: .parameters) }
if variables != nil { try container.encode(variables, forKey: .variables) }
if isDisabled != nil { try container.encode(isDisabled, forKey: .isDisabled) }
if isLatest != nil { try container.encode(isLatest, forKey: .isLatest) }
if allowedEnvironments != nil { try container.encode(allowedEnvironments, forKey: .allowedEnvironments) }
if allowedResourceProviders != nil { try container.encode(allowedResourceProviders, forKey: .allowedResourceProviders) }
if resourceGroupTemplates != nil { try container.encode(resourceGroupTemplates, forKey: .resourceGroupTemplates) }
}
}
public class ConfigItem : Auditable, IConfigItem
{
public var id:String
// @Required()
public var name:String?
// @Required()
// @StringLength(250)
public var displayName:String?
// @StringLength(8000)
public var Description:String
public var objectType:ObjectTypes
// @Ignore()
public var selfLink:String
// @Required()
public var tags:IList<Tag>?
// @Required()
public var path:IList<PathItem>?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case id
case name
case displayName
case Description
case objectType
case selfLink
case tags
case path
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id)
name = try container.decodeIfPresent(String.self, forKey: .name)
displayName = try container.decodeIfPresent(String.self, forKey: .displayName)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
objectType = try container.decodeIfPresent(ObjectTypes.self, forKey: .objectType)
selfLink = try container.decodeIfPresent(String.self, forKey: .selfLink)
tags = try container.decodeIfPresent(IList<Tag>.self, forKey: .tags)
path = try container.decodeIfPresent(IList<PathItem>.self, forKey: .path)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if id != nil { try container.encode(id, forKey: .id) }
if name != nil { try container.encode(name, forKey: .name) }
if displayName != nil { try container.encode(displayName, forKey: .displayName) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if objectType != nil { try container.encode(objectType, forKey: .objectType) }
if selfLink != nil { try container.encode(selfLink, forKey: .selfLink) }
if tags != nil { try container.encode(tags, forKey: .tags) }
if path != nil { try container.encode(path, forKey: .path) }
}
}
public class Auditable : IAuditable, Codable
{
// @Required()
public var created:Date?
// @Required()
public var createUser:String?
// @Required()
public var createUserId:String?
// @Required()
public var modified:Date?
// @Required()
public var modifyUser:String?
// @Required()
public var modifyUserId:String?
// @Required()
public var isDeleted:Bool?
public var deleted:Date?
public var deleteUser:String
public var deleteUserId:String
required public init(){}
}
public enum ObjectTypes : String, Codable
{
case None
case ConfigItem
case Tenant
case Collection
case Resource
case ComputeNode
case VirtualMachine
case PhysicalMachine
case Disk
case Subnet
case IPAddress
case Job
case JobEvent
case FreezePeriod
case ResourceGroup
case Deployment
case ResourceGroupTemplate
case DeploymentTemplate
case ResourceProvider
case GenericResource
case Role
case Permission
case User
case PatchingWindow
case Update
case ReportDefinition
case TimeSeries
case DataPoint
case Action
case ActionAssignment
case UserNote
}
public class Tag : Codable
{
public var name:String
public var value:String
public var isProtected:Bool
required public init(){}
}
public class PathItem : Codable
{
public var label:String
public var link:String
public var objectType:ObjectTypes
public var objectId:String
required public init(){}
}
public class Parameter : Codable
{
public var name:String
public var Description:String
public var value:String
public var `default`:String
public var optional:Bool
public var type:ParameterValueType
public var validation:String
required public init(){}
}
public enum ParameterValueType : String, Codable
{
case String
case Number
case Boolean
case SecureString
}
public class Variable : Codable
{
public var name:String
public var value:String
public var type:ValueDataType
public var Description:String
public var isInherited:Bool
public var environment:Environments?
required public init(){}
}
public enum ValueDataType : String, Codable
{
case String
case Number
case Boolean
case List
}
public enum Environments : String, Codable
{
case Lab
case Poc
case Dev
case Test
case Int
case Uat
case Prod
}
public class ResourceProvider : ConfigItem, IHasTenantId
{
// @Required()
public var tenantId:String?
// @Required()
public var defaultEnvironment:Environments?
// @Required()
public var allowedEnvironments:IList<Environments>?
// @Required()
public var type:ResourceProviderTypes?
// @Required()
public var config:IList<ProviderConfigEntry>?
// @Required()
public var isDisabled:Bool?
// @Required()
public var isReadyForDeployments:Bool?
public var costCurrentMonth:Double
public var costLastMonth:Double
public var costCurrency:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case tenantId
case name
case defaultEnvironment
case allowedEnvironments
case objectType
case type
case selfLink
case config
case isDisabled
case isReadyForDeployments
case costCurrentMonth
case costLastMonth
case costCurrency
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
tenantId = try container.decodeIfPresent(String.self, forKey: .tenantId)
name = try container.decodeIfPresent(String.self, forKey: .name)
defaultEnvironment = try container.decodeIfPresent(Environments.self, forKey: .defaultEnvironment)
allowedEnvironments = try container.decodeIfPresent(IList<Environments>.self, forKey: .allowedEnvironments)
objectType = try container.decodeIfPresent(ObjectTypes.self, forKey: .objectType)
type = try container.decodeIfPresent(ResourceProviderTypes.self, forKey: .type)
selfLink = try container.decodeIfPresent(String.self, forKey: .selfLink)
config = try container.decodeIfPresent(IList<ProviderConfigEntry>.self, forKey: .config)
isDisabled = try container.decodeIfPresent(Bool.self, forKey: .isDisabled)
isReadyForDeployments = try container.decodeIfPresent(Bool.self, forKey: .isReadyForDeployments)
costCurrentMonth = try container.decodeIfPresent(Double.self, forKey: .costCurrentMonth)
costLastMonth = try container.decodeIfPresent(Double.self, forKey: .costLastMonth)
costCurrency = try container.decodeIfPresent(String.self, forKey: .costCurrency)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if tenantId != nil { try container.encode(tenantId, forKey: .tenantId) }
if name != nil { try container.encode(name, forKey: .name) }
if defaultEnvironment != nil { try container.encode(defaultEnvironment, forKey: .defaultEnvironment) }
if allowedEnvironments != nil { try container.encode(allowedEnvironments, forKey: .allowedEnvironments) }
if objectType != nil { try container.encode(objectType, forKey: .objectType) }
if type != nil { try container.encode(type, forKey: .type) }
if selfLink != nil { try container.encode(selfLink, forKey: .selfLink) }
if config != nil { try container.encode(config, forKey: .config) }
if isDisabled != nil { try container.encode(isDisabled, forKey: .isDisabled) }
if isReadyForDeployments != nil { try container.encode(isReadyForDeployments, forKey: .isReadyForDeployments) }
if costCurrentMonth != nil { try container.encode(costCurrentMonth, forKey: .costCurrentMonth) }
if costLastMonth != nil { try container.encode(costLastMonth, forKey: .costLastMonth) }
if costCurrency != nil { try container.encode(costCurrency, forKey: .costCurrency) }
}
}
public enum ResourceProviderTypes : String, Codable
{
case Azure
case AmazonWebServices
case GoogleCloudPlatform
case ActiveDirectoryServices
case DomainNameSystem
case SwisscomESC
case AzureKeyVault
}
public class ProviderConfigEntry : Codable
{
public var name:String
public var value:String
public var isSecure:Bool
required public init(){}
}
public class ResourceGroupTemplate : ConfigItem, IHasTenantId
{
// @Required()
public var tenantId:String?
// @Required()
public var schemaVersion:Int?
// @Required()
// @StringLength(20)
public var version:String?
// @Required()
public var versionNumeric:Int?
// @Required()
// @StringLength(Int32.max)
public var definitionJson:String?
// @Required()
// @StringLength(Int32.max)
public var definitionYaml:String?
// @Required()
public var parameters:IList<Parameter>?
// @Required()
public var variables:IList<Variable>?
// @Required()
public var isLatest:Bool?
// @Required()
public var resourceTemplates:IList<ResourceTemplate>?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case tenantId
case name
case objectType
case selfLink
case schemaVersion
case version
case versionNumeric
case definitionJson
case definitionYaml
case parameters
case variables
case isLatest
case resourceTemplates
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
tenantId = try container.decodeIfPresent(String.self, forKey: .tenantId)
name = try container.decodeIfPresent(String.self, forKey: .name)
objectType = try container.decodeIfPresent(ObjectTypes.self, forKey: .objectType)
selfLink = try container.decodeIfPresent(String.self, forKey: .selfLink)
schemaVersion = try container.decodeIfPresent(Int.self, forKey: .schemaVersion)
version = try container.decodeIfPresent(String.self, forKey: .version)
versionNumeric = try container.decodeIfPresent(Int.self, forKey: .versionNumeric)
definitionJson = try container.decodeIfPresent(String.self, forKey: .definitionJson)
definitionYaml = try container.decodeIfPresent(String.self, forKey: .definitionYaml)
parameters = try container.decodeIfPresent(IList<Parameter>.self, forKey: .parameters)
variables = try container.decodeIfPresent(IList<Variable>.self, forKey: .variables)
isLatest = try container.decodeIfPresent(Bool.self, forKey: .isLatest)
resourceTemplates = try container.decodeIfPresent(IList<ResourceTemplate>.self, forKey: .resourceTemplates)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if tenantId != nil { try container.encode(tenantId, forKey: .tenantId) }
if name != nil { try container.encode(name, forKey: .name) }
if objectType != nil { try container.encode(objectType, forKey: .objectType) }
if selfLink != nil { try container.encode(selfLink, forKey: .selfLink) }
if schemaVersion != nil { try container.encode(schemaVersion, forKey: .schemaVersion) }
if version != nil { try container.encode(version, forKey: .version) }
if versionNumeric != nil { try container.encode(versionNumeric, forKey: .versionNumeric) }
if definitionJson != nil { try container.encode(definitionJson, forKey: .definitionJson) }
if definitionYaml != nil { try container.encode(definitionYaml, forKey: .definitionYaml) }
if parameters != nil { try container.encode(parameters, forKey: .parameters) }
if variables != nil { try container.encode(variables, forKey: .variables) }
if isLatest != nil { try container.encode(isLatest, forKey: .isLatest) }
if resourceTemplates != nil { try container.encode(resourceTemplates, forKey: .resourceTemplates) }
}
}
public class ResourceTemplate : Codable
{
public var name:String
public var displayName:String
public var Description:String
public var type:ObjectTypes
required public init(){}
}
public enum Aggregations : String, Codable
{
case None
case Count
case DistinctCount
case Sum
case Min
case Max
case Avg
case First
}
public class TimeSeriesDefinition : Auditable, IHasIdName, IHasTenantId, IHasObjectType
{
public var id:String
// @References(typeof(Tenant))
public var tenantId:String
public var tenant:Tenant
public var name:String
public var displayName:String
// @Ignore()
public var selfLink:String
// @Required()
public var objectType:ObjectTypes?
public var Description:String
public var sourceType:ObjectTypes
public var autoCollection:Bool
public var autoCollectionQuery:String
public var autoCollectionInterval:Int?
public var autoCollectionIntervalUnit:IntervalUnits?
@TimeSpan public var autoCollectionTime:TimeInterval?
public var lastAutoCollected:Date?
public var retentionTimeMonths:Int
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case id
case tenantId
case tenant
case name
case displayName
case selfLink
case objectType
case Description
case sourceType
case autoCollection
case autoCollectionQuery
case autoCollectionInterval
case autoCollectionIntervalUnit
case autoCollectionTime
case lastAutoCollected
case retentionTimeMonths
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id)
tenantId = try container.decodeIfPresent(String.self, forKey: .tenantId)
tenant = try container.decodeIfPresent(Tenant.self, forKey: .tenant)
name = try container.decodeIfPresent(String.self, forKey: .name)
displayName = try container.decodeIfPresent(String.self, forKey: .displayName)
selfLink = try container.decodeIfPresent(String.self, forKey: .selfLink)
objectType = try container.decodeIfPresent(ObjectTypes.self, forKey: .objectType)
Description = try container.decodeIfPresent(String.self, forKey: .Description)
sourceType = try container.decodeIfPresent(ObjectTypes.self, forKey: .sourceType)
autoCollection = try container.decodeIfPresent(Bool.self, forKey: .autoCollection)
autoCollectionQuery = try container.decodeIfPresent(String.self, forKey: .autoCollectionQuery)
autoCollectionInterval = try container.decodeIfPresent(Int.self, forKey: .autoCollectionInterval)
autoCollectionIntervalUnit = try container.decodeIfPresent(IntervalUnits.self, forKey: .autoCollectionIntervalUnit)
autoCollectionTime = try container.convertIfPresent(TimeInterval.self, forKey: .autoCollectionTime)
lastAutoCollected = try container.decodeIfPresent(Date.self, forKey: .lastAutoCollected)
retentionTimeMonths = try container.decodeIfPresent(Int.self, forKey: .retentionTimeMonths)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if id != nil { try container.encode(id, forKey: .id) }
if tenantId != nil { try container.encode(tenantId, forKey: .tenantId) }
if tenant != nil { try container.encode(tenant, forKey: .tenant) }
if name != nil { try container.encode(name, forKey: .name) }
if displayName != nil { try container.encode(displayName, forKey: .displayName) }
if selfLink != nil { try container.encode(selfLink, forKey: .selfLink) }
if objectType != nil { try container.encode(objectType, forKey: .objectType) }
if Description != nil { try container.encode(Description, forKey: .Description) }
if sourceType != nil { try container.encode(sourceType, forKey: .sourceType) }
if autoCollection != nil { try container.encode(autoCollection, forKey: .autoCollection) }
if autoCollectionQuery != nil { try container.encode(autoCollectionQuery, forKey: .autoCollectionQuery) }
if autoCollectionInterval != nil { try container.encode(autoCollectionInterval, forKey: .autoCollectionInterval) }
if autoCollectionIntervalUnit != nil { try container.encode(autoCollectionIntervalUnit, forKey: .autoCollectionIntervalUnit) }
if autoCollectionTime != nil { try container.encode(autoCollectionTime, forKey: .autoCollectionTime) }
if lastAutoCollected != nil { try container.encode(lastAutoCollected, forKey: .lastAutoCollected) }
if retentionTimeMonths != nil { try container.encode(retentionTimeMonths, forKey: .retentionTimeMonths) }
}
}
public class Tenant : ConfigItem, IHasVariables
{
// @Required()
public var variables:IList<Variable>?
// @Required()
public var allowedMailDomains:IList<String>?
// @Required()
public var licensedModules:IList<String>?
// @Required()
public var defaultDeploymentLifetimeDays:Int16?
// @Required()
public var maxDeploymentLifetimeDays:Int16?
// @Required()
public var systemUnpatchedWarningDays:Int16?
// @Required()
public var systemBackupMissingWarningHours:Int16?
// @Required()
public var stopVulnerableResourceAfterDays:Int16?
// @Required()
public var deploymentExpirationWarningDays:Int16?
// @Required()
public var patchNotificationDays:Int16?
// @Required()
public var useCustomHostnames:Bool?
// @Required()
public var removeInactiveVulnerabilitiesAfterDays:Int16?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case name
case objectType
case selfLink
case variables
case allowedMailDomains
case licensedModules
case defaultDeploymentLifetimeDays
case maxDeploymentLifetimeDays
case systemUnpatchedWarningDays
case systemBackupMissingWarningHours
case stopVulnerableResourceAfterDays
case deploymentExpirationWarningDays
case patchNotificationDays
case useCustomHostnames
case removeInactiveVulnerabilitiesAfterDays
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
name = try container.decodeIfPresent(String.self, forKey: .name)
objectType = try container.decodeIfPresent(ObjectTypes.self, forKey: .objectType)
selfLink = try container.decodeIfPresent(String.self, forKey: .selfLink)
variables = try container.decodeIfPresent(IList<Variable>.self, forKey: .variables)
allowedMailDomains = try container.decodeIfPresent(IList<String>.self, forKey: .allowedMailDomains)
licensedModules = try container.decodeIfPresent(IList<String>.self, forKey: .licensedModules)
defaultDeploymentLifetimeDays = try container.decodeIfPresent(Int16.self, forKey: .defaultDeploymentLifetimeDays)
maxDeploymentLifetimeDays = try container.decodeIfPresent(Int16.self, forKey: .maxDeploymentLifetimeDays)
systemUnpatchedWarningDays = try container.decodeIfPresent(Int16.self, forKey: .systemUnpatchedWarningDays)
systemBackupMissingWarningHours = try container.decodeIfPresent(Int16.self, forKey: .systemBackupMissingWarningHours)
stopVulnerableResourceAfterDays = try container.decodeIfPresent(Int16.self, forKey: .stopVulnerableResourceAfterDays)
deploymentExpirationWarningDays = try container.decodeIfPresent(Int16.self, forKey: .deploymentExpirationWarningDays)
patchNotificationDays = try container.decodeIfPresent(Int16.self, forKey: .patchNotificationDays)
useCustomHostnames = try container.decodeIfPresent(Bool.self, forKey: .useCustomHostnames)
removeInactiveVulnerabilitiesAfterDays = try container.decodeIfPresent(Int16.self, forKey: .removeInactiveVulnerabilitiesAfterDays)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if name != nil { try container.encode(name, forKey: .name) }
if objectType != nil { try container.encode(objectType, forKey: .objectType) }
if selfLink != nil { try container.encode(selfLink, forKey: .selfLink) }
if variables != nil { try container.encode(variables, forKey: .variables) }
if allowedMailDomains != nil { try container.encode(allowedMailDomains, forKey: .allowedMailDomains) }
if licensedModules != nil { try container.encode(licensedModules, forKey: .licensedModules) }
if defaultDeploymentLifetimeDays != nil { try container.encode(defaultDeploymentLifetimeDays, forKey: .defaultDeploymentLifetimeDays) }
if maxDeploymentLifetimeDays != nil { try container.encode(maxDeploymentLifetimeDays, forKey: .maxDeploymentLifetimeDays) }
if systemUnpatchedWarningDays != nil { try container.encode(systemUnpatchedWarningDays, forKey: .systemUnpatchedWarningDays) }
if systemBackupMissingWarningHours != nil { try container.encode(systemBackupMissingWarningHours, forKey: .systemBackupMissingWarningHours) }
if stopVulnerableResourceAfterDays != nil { try container.encode(stopVulnerableResourceAfterDays, forKey: .stopVulnerableResourceAfterDays) }
if deploymentExpirationWarningDays != nil { try container.encode(deploymentExpirationWarningDays, forKey: .deploymentExpirationWarningDays) }
if patchNotificationDays != nil { try container.encode(patchNotificationDays, forKey: .patchNotificationDays) }
if useCustomHostnames != nil { try container.encode(useCustomHostnames, forKey: .useCustomHostnames) }
if removeInactiveVulnerabilitiesAfterDays != nil { try container.encode(removeInactiveVulnerabilitiesAfterDays, forKey: .removeInactiveVulnerabilitiesAfterDays) }
}
}
public enum IntervalUnits : String, Codable
{
case Second
case Minute
case Hour
case Day
case Week
case Month
case Year
}
Swift QueryDeploymentTemplates 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/deploymenttemplates/ HTTP/1.1 Host: core.starburst.svc Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"offset":0,"total":0,"results":[{"tenantId":"00000000-0000-0000-0000-000000000000","name":"String","objectType":"DeploymentTemplate","selfLink":"/deploymenttemplates/00000000-0000-0000-0000-000000000000","schemaVersion":0,"version":"String","versionNumeric":0,"definitionJson":"String","definitionYaml":"String","parameters":null,"variables":null,"isDisabled":false,"isLatest":false,"allowedEnvironments":null,"allowedResourceProviders":null,"resourceGroupTemplates":null,"id":"00000000-0000-0000-0000-000000000000","displayName":"String","description":"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"}],"meta":{"String":"String"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}