Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for definition of custom tags.
Change-Id: I4811d45216753a526acf68f687b23692da6caa6a Depends-On: I18cfd4b0117cde62f855e48f475c2bc70ab57cac Partial-Bug: #1772594
- Loading branch information
1 parent
84f4434
commit 63f7c89
Showing
14 changed files
with
120 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
o11nplugin-contrail-workflows/src/main/js/actions/listTagTypes.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if (!item) return ["application", "deployment", "label", "site", "tier"]; | ||
var connection = item.getConnection(); | ||
return connection.listTagTypes(); |
5 changes: 2 additions & 3 deletions
5
o11nplugin-contrail-workflows/src/main/js/workflows/createGlobalTag.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
var type = typeName.toLowerCase(); | ||
item = new ContrailTag(); | ||
item.setName(type+"="+value); | ||
item.setName(typeName+"="+value); | ||
item.setParentConfigRoot(new ContrailConfigRoot()); | ||
item.setParentConnection(parent); | ||
item.setValue(value); | ||
item.setTypeName(type); | ||
item.setTypeName(typeName); | ||
item.create(); |
5 changes: 2 additions & 3 deletions
5
o11nplugin-contrail-workflows/src/main/js/workflows/createTagInProject.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
var type = typeName.toLowerCase(); | ||
item = new ContrailTag(); | ||
item.setName(type+"="+value); | ||
item.setName(typeName+"="+value); | ||
item.setParentProject(parent); | ||
item.setValue(value); | ||
item.setTypeName(type); | ||
item.setTypeName(typeName); | ||
item.create(); |
4 changes: 4 additions & 0 deletions
4
o11nplugin-contrail-workflows/src/main/js/workflows/createTagType.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
item = new ContrailTagType(); | ||
item.setName(name); | ||
item.setParentConnection(parent); | ||
item.create(); |
1 change: 1 addition & 0 deletions
1
o11nplugin-contrail-workflows/src/main/js/workflows/deleteTagType.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
item.delete(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...n-contrail-workflows/src/main/kotlin/net/juniper/contrail/vro/workflows/custom/TagType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | ||
} | ||
} | ||
} |