Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: I467af8d28f554bce6f7a13385a6e8df7d114b86f Closes-bug: #1797594
- Loading branch information
1 parent
bb311ea
commit ff77473
Showing
12 changed files
with
172 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#maven.buildNumber.plugin properties file | ||
#Tue Oct 09 16:35:36 CEST 2018 | ||
buildNumber=1855 | ||
#Fri Oct 12 16:45:51 CEST 2018 | ||
buildNumber=1891 |
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
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
9 changes: 9 additions & 0 deletions
9
o11nplugin-contrail-workflows/src/main/js/workflows/editGlobalConfig.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,9 @@ | ||
var globalSystemConfig = parentConnection.globalSystemConfig(); | ||
var globalVrouterConfig = parentConnection.globalVrouterConfig(); | ||
|
||
globalSystemConfig.setEnableSecurityPolicyDraft(enableSecurityPolicyDraft); | ||
globalVrouterConfig.setEncapsulationPriorities(new ContrailEncapsulationPrioritiesType(encapsulationPriorities)); | ||
globalVrouterConfig.setForwardingMode(forwardingMode); | ||
|
||
globalVrouterConfig.update(); | ||
globalSystemConfig.update(); |
68 changes: 68 additions & 0 deletions
68
...orkflows/src/main/kotlin/net/juniper/contrail/vro/workflows/custom/GlobalConfiguration.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,68 @@ | ||
package net.juniper.contrail.vro.workflows.custom | ||
|
||
import net.juniper.contrail.api.types.GlobalSystemConfig | ||
import net.juniper.contrail.api.types.GlobalVrouterConfig | ||
import net.juniper.contrail.vro.config.constants.Connection | ||
import net.juniper.contrail.vro.config.constants.editGlobalConfiguration | ||
import net.juniper.contrail.vro.config.defaultConnection | ||
import net.juniper.contrail.vro.config.parentConnection | ||
import net.juniper.contrail.vro.schema.Schema | ||
import net.juniper.contrail.vro.schema.propertyDescription | ||
import net.juniper.contrail.vro.schema.simpleTypeConstraints | ||
import net.juniper.contrail.vro.workflows.dsl.FromComplexPropertyValue | ||
import net.juniper.contrail.vro.workflows.dsl.WhenNonNull | ||
import net.juniper.contrail.vro.workflows.dsl.WorkflowDefinition | ||
import net.juniper.contrail.vro.workflows.dsl.fromAction | ||
import net.juniper.contrail.vro.workflows.dsl.inCategory | ||
import net.juniper.contrail.vro.workflows.dsl.workflow | ||
import net.juniper.contrail.vro.workflows.model.ParameterType | ||
import net.juniper.contrail.vro.workflows.model.array | ||
import net.juniper.contrail.vro.workflows.model.boolean | ||
import net.juniper.contrail.vro.workflows.model.reference | ||
import net.juniper.contrail.vro.workflows.model.string | ||
|
||
val securityDraftModeParameterName = "enableSecurityPolicyDraft" | ||
val encapsulationPrioritiesParameterName = "encapsulationPriorities" | ||
val forwardingModeParameterName = "forwardingMode" | ||
val encapsulationPredefinedAnswers = listOf("MPLSoGRE", "MPLSoUDP", "VXLAN") | ||
|
||
internal fun editGlobalConfig(schema: Schema): WorkflowDefinition = | ||
workflow(editGlobalConfiguration).withScriptFile("editGlobalConfig") { | ||
step("Connection") { | ||
parameter(parentConnection, Connection.reference) { | ||
description = "Contrail controller whose config will be changed" | ||
mandatory = true | ||
dataBinding = fromAction(defaultConnection, type) {} | ||
} | ||
} | ||
step("System config") { | ||
visibility = WhenNonNull(parentConnection) | ||
parameter(securityDraftModeParameterName, boolean) { | ||
description = schema.propertyDescription<GlobalSystemConfig>(securityDraftModeParameterName) | ||
mandatory = true | ||
dataBinding = globalSystemConfigParameter(parentConnection, securityDraftModeParameterName, boolean) | ||
} | ||
} | ||
step("Virtual Routers config") { | ||
visibility = WhenNonNull(parentConnection) | ||
parameter(encapsulationPrioritiesParameterName, array(string)) { | ||
description = schema.propertyDescription<GlobalVrouterConfig>(encapsulationPrioritiesParameterName) | ||
// for some reason, trying to extract these from schema returns an error | ||
predefinedAnswers = encapsulationPredefinedAnswers | ||
dataBinding = globalVrouterConfigParameter(parentConnection, "$encapsulationPrioritiesParameterName.encapsulation", array(string)) | ||
mandatory = true | ||
} | ||
parameter(forwardingModeParameterName, string) { | ||
description = schema.propertyDescription<GlobalVrouterConfig>(forwardingModeParameterName) | ||
additionalQualifiers += schema.simpleTypeConstraints<GlobalVrouterConfig>(forwardingModeParameterName) | ||
dataBinding = globalVrouterConfigParameter(parentConnection, forwardingModeParameterName, string) | ||
mandatory = true | ||
} | ||
} | ||
}.inCategory("Global Configuration") | ||
|
||
private fun <T : Any> globalSystemConfigParameter(connectionParam: String, parameterName: String, type: ParameterType<T>) = | ||
FromComplexPropertyValue(connectionParam, "globalSystemConfig().$parameterName", type) | ||
|
||
private fun <T : Any> globalVrouterConfigParameter(connectionParam: String, parameterName: String, type: ParameterType<T>) = | ||
FromComplexPropertyValue(connectionParam, "globalVrouterConfig().$parameterName", type) |