MySQL Shell 9.2  /  ...  /  Importing and Exporting Routing Guidelines

7.8.3 Importing and Exporting Routing Guidelines

Routing Guidelines can be imported or exported using the following:

  • object.import_routing_guideline("filePath")

    This function also accepts a boolean force option, which enables you to replace an existing Routing Guideline with the same name as the one imported.

    The function validates the JSON before applying it to the target topology.

  • routingGuideline.export("filePath")

For example, to import a Routing Guideline, routingguideline1.json, to a cluster:

cluster.import_routing_guideline("~/Shell/RGs/routingguideline1.json")

For example, to export a Routing Guideline, RG1, from a cluster to the filesystem, as JSON:

var rg = cluster.get_routing_guideline("RG1")
rg.export("~/Shell/RGs/RG1.json")