-
Notifications
You must be signed in to change notification settings - Fork 4
/
TagType.kt
45 lines (37 loc) · 1.42 KB
/
TagType.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
*/
package net.juniper.contrail.vro.workflows.custom
import net.juniper.contrail.api.types.TagType
import net.juniper.contrail.vro.config.constants.Connection
import net.juniper.contrail.vro.config.constants.name
import net.juniper.contrail.vro.config.constants.item
import net.juniper.contrail.vro.config.constants.parent
import net.juniper.contrail.vro.workflows.dsl.WorkflowDefinition
import net.juniper.contrail.vro.workflows.model.reference
import net.juniper.contrail.vro.workflows.model.string
internal fun createTagType(): WorkflowDefinition {
val workflowName = "Create tag type"
return customWorkflow<TagType>(workflowName).withScriptFile("createTagType") {
parameter(name, string) {
description = "Name of the tag type"
mandatory = true
}
parameter(parent, Connection.reference) {
description = "Parent connection"
mandatory = true
}
output(item, reference<TagType>()) {
description = "Tag Type created in this workflow"
}
}
}
internal fun deleteTagType(): WorkflowDefinition {
val workflowName = "Delete tag type"
return customWorkflow<TagType>(workflowName).withScriptFile("deleteTagType") {
parameter(item, reference<TagType>()) {
description = "Tag Type to delete"
mandatory = true
}
}
}