diff --git a/modules/ROOT/pages/custom-rulesets-validate-and-publish.adoc b/modules/ROOT/pages/custom-rulesets-validate-and-publish.adoc index 2bdd347a..1a664830 100644 --- a/modules/ROOT/pages/custom-rulesets-validate-and-publish.adoc +++ b/modules/ROOT/pages/custom-rulesets-validate-and-publish.adoc @@ -20,16 +20,59 @@ include::anypoint-cli::partial$api-governance.adoc[tag=governance-ruleset-valida [[generate-ruleset-doc]] == Generate the Ruleset Documentation -Use the following command to generate a documentation ZIP file for a ruleset YAML file. The resulting documentation ZIP file can then be used in an Exchange asset upload using the `--files.docs.zip` option. +Use the following command to generate a documentation ZIP file for a ruleset YAML file. The resulting documentation ZIP file can then be used in an Exchange asset upload using the `--files` flag with the `docs.zip` option. include::anypoint-cli::partial$api-governance.adoc[tag=governance-document,leveloffset=+1] [[publish-ruleset]] == Publish the Custom Ruleset -You can publish (upload) a ruleset and its documentation to Exchange using Anypoint CLI. You cannot use the Exchange UI to upload ruleset assets. +You can publish (upload) a ruleset and its documentation to Exchange using Anypoint CLI. You can't use the Exchange UI to upload ruleset documentation. + +You can upload the following in a single upload command: + +[%header,cols="20a,40a,40a"] +|=== +|Flag and Options|Result|Example +|The ruleset YAML using the `--files` flag with the `"ruleset.yaml"` option. +|This uploads the ruleset information included in the YAML file and ignores any other files detected in the same folder, such as the `exchange.json` file. You can use `--type=ruleset`. If you don't, the type is inferred from the `--files` flag `--ruleset.yaml` option. +|`--files='{"ruleset.yaml":"mynewruleset.yaml", "docs.zip": "ruleset.doc.zip"}'` +|The ruleset ZIP using the `--files` flag with the `"ruleset.zip"` option. +|This uploads the ruleset information included in the YAML file and evaluates other files in the zip file, such as the `exchange.json` file. You can use `--type=ruleset`. If you don't, the type is inferred from the `--files` flag `"ruleset.zip"` option. +|`--files='{"ruleset.zip":"mynewruleset.zip"}'` +|The ruleset YAML and the ruleset documentation ZIP file using the `--files` flag with the `"ruleset.yaml"` and `"docs.zip"` options in the same `--files` flag. +|This uploads the ruleset YAML information plus the documentation for the ruleset. You must upload the documentation along with the ruleset. You cannot upload documentation separately later, but can add it manually. +|`--files='{"ruleset.yaml":"mynewruleset.yaml", "docs.zip": "ruleset.doc.zip"}'` +|The ruleset ZIP and the ruleset documentation ZIP file using the `--files` flag with the `"ruleset.zip"` option with the `"docs.zip"` option in the same `--files` flag. +|This uploads the ruleset ZIP file information, evaluating any `exchange.json` file properties, plus the documentation for the ruleset. You must upload the documentation along with the ruleset. You cannot upload documentation separately later, but can add it manually. +|`--files='{"ruleset.zip":"mynewruleset.zip", "docs.zip": "ruleset.doc.zip"}'` +|=== + +=== Guidelines for Ruleset Exchange JSON Files + +You can use an `exchange.json` file to define the Exchange settings for rulesets. You can use any of the following properties: + +[%header,cols="35a,65a"] +|=== +|Property|Description +|main|The main file of your asset. Ensure that this matches the name of your ruleset when publishing a ruleset. +|name|The artifact name of your asset. You cannot change the name of an asset that's already published. +|organizationId|The Anypoint Platform organization or business group in which to publish the asset. +|groupId|The Anypoint Platform group in which to publish the asset. +|assetId|The Exchange asset ID assigned to the asset. +|version|The asset version. +|classifier|The asset type. Use the value `"ruleset"` when publishing a ruleset asset. +|dependencies| Rulesets can have fragments defined as dependencies. +|tags| Tags for a ruleset asset's details in Exchange. +|descriptorVersion|The version of the descriptor model a ruleset is based on. +|=== + +For example: +---- +{ "main":"ruleset.yaml", "name":"My Mule API Management Best Practices", "organizationId":"68ef9520-24e9-4cf2-b2f5-620025690913", "groupId":"68ef9520-24e9-4cf2-b2f5-620025690913", "assetId":"my-mule-api-management-best-practices", "version":"1.0.0", "classifier":"ruleset", "dependencies":[], "tags":["instances"], "descriptorVersion": "1.0.0" } +---- -Use the following command to upload a ruleset and its documentation to Exchange. +Use the following command documentation as a reference as you upload the ruleset and its documentation to Exchange. include::anypoint-cli::partial$exchange-assets.adoc[tag=exchange-asset-upload,leveloffset=+1]