From d502911c3da631e2f65b9fe332ce32a7333be0a1 Mon Sep 17 00:00:00 2001 From: Fernanda Date: Thu, 24 Jul 2025 15:29:59 -0300 Subject: [PATCH 1/2] Create api-project.adoc --- modules/ROOT/pages/_partials/api-project.adoc | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 modules/ROOT/pages/_partials/api-project.adoc diff --git a/modules/ROOT/pages/_partials/api-project.adoc b/modules/ROOT/pages/_partials/api-project.adoc new file mode 100644 index 00000000..98efde84 --- /dev/null +++ b/modules/ROOT/pages/_partials/api-project.adoc @@ -0,0 +1,168 @@ += API Project CLI + +// tag::summary[] + +[%header,cols="35a,65a"] +|=== +|Command |Description +|xref:anypoint-cli::api-project.adoc#generate-command[api-project generate] | Generates a new API Project and descriptor file +|xref:anypoint-cli::api-project.adoc#validate-command[api-project validate] | Validates an API Project against rulesets and governance policies +|xref:anypoint-cli::api-project.adoc#publish-command[api-project publish] | Publishes an API Project to Exchange +|xref:anypoint-cli::api-project.adoc#metadata-command[api-project metadata] | Retrieves local or remote metadata for an API Project +|xref:anypoint-cli::api-project.adoc#centralized-rulesets-command[api-project centralized-rulesets] | Validates an API Project using centralized governance profiles +|xref:anypoint-cli::api-project.adoc#publish-instance-command[api-project publish-instance] | Publishes API Instances to API Manager from project definition +|=== + +// end::summary[] + +// tag::generate-command[] + +[[generate-command]] +== api-project generate + +---- +> anypoint-cli-v4 api-project generate [flags] +---- + +Generates a new API Project descriptor file (`exchange.json`). + +[%header,cols="20a,80a"] +|=== +| Flag | Description +| `--api-spec-location=` | Path to the API specification file +| `--location=` or `-l` | Directory where the project will be generated +| `--api-version=` | Overrides the default API version (default: `v1`) +| `--classifier=` | Type of API project (raml, oas) +| `--format=` | Format of the API spec (yaml, json) +| `--format-version=` | Version of the spec format (e.g. raml 1.0, oas 3.0) +| `--fragment-type=` | Fragment type (used with raml-fragment classifier) +| `--json` | Outputs the result in JSON format +| `--main=` | Main file name (default: `api`) +| `--name=` | Name of the project *(Required)* +| `--group-id=` | Group ID of the asset +| `--asset-id=` | Asset ID of the asset +| `--asset-version=` | Version of the asset +| `--is-topic` | Adds agent topic annotations to the API spec +|=== + +// end::generate-command[] + +// tag::validate-command[] + +[[validate-command]] +== api-project validate + +---- +> anypoint-cli-v4 api-project validate [flags] +---- + +Validates the API Project structure, rulesets, and governance policies. + +[%header,cols="20a,80a"] +|=== +| Flag | Description +| `--location=` | Path to the project directory (default: current directory) +| `--local-ruleset=` | Path to local ruleset file *(multi-value)* +| `--ruleset=` | Remote ruleset in `group/asset/version` format *(multi-value)* +| `--skip-validation` | Skip governance and GCL validations +| `--json` | Outputs the result in JSON format +| `--centralized-rulesets` | Enables validation against centralized governance profiles +| `--filter-by=` | Apply filters to the result report *(multi-value)* +| `--page-size=` | Set the number of lines in the report output +| `--junit` | Generates a JUnit-style report +| `--junit-loc=` | Output path for JUnit report +| `--group-id=` | Group ID of the asset +| `--asset-id=` | Asset ID of the asset +| `--asset-version=` | Version of the asset +|=== + +// end::validate-command[] + +// tag::publish-command[] + +[[publish-command]] +== api-project publish + +---- +> anypoint-cli-v4 api-project publish [flags] +---- + +Validates and publishes the API Project to Exchange. + +[%header,cols="20a,80a"] +|=== +| Flag | Description +| `--location=` | Directory of the API project (default: current directory) +| `--skip-validation` | Skip governance and GCL validations +| `--tag=` | Tag(s) to associate with the project *(multi-value)* +| `--json` | Outputs the result in JSON format +|=== + +// end::publish-command[] + +// tag::metadata-command[] + +[[metadata-command]] +== api-project metadata + +---- +> anypoint-cli-v4 api-project metadata [flags] +---- + +Retrieves metadata for the API Project from local or remote sources. + +[%header,cols="20a,80a"] +|=== +| Flag | Description +| `--location=` | Directory of the API Project (default: current directory) +| `--group-id=` | Group ID of the asset +| `--asset-id=` | Asset ID of the asset +| `--asset-version=` | Asset version +|=== + +// end::metadata-command[] + +// tag::centralized-rulesets-command[] + +[[centralized-rulesets-command]] +== api-project centralized-rulesets + +---- +> anypoint-cli-v4 api-project centralized-rulesets [flags] +---- + +Validates the project against centralized governance rulesets based on metadata. + +[%header,cols="20a,80a"] +|=== +| Flag | Description +| `--location=` | Directory of the API Project (default: current directory) +| `--group-id=` | Group ID of the asset +| `--asset-id=` | Asset ID of the asset +| `--asset-version=` | Asset version +|=== + +// end::centralized-rulesets-command[] + +// tag::publish-instance-command[] + +[[publish-instance-command]] +== api-project publish-instance + +---- +> anypoint-cli-v4 api-project publish-instance [flags] +---- + +Creates API instances in API Manager based on GCL definitions in the project. + +[%header,cols="20a,80a"] +|=== +| Flag | Description +| `--location=` | Directory of the API Project (default: current directory) +| `--is-flex` | Specifies that the instance targets Flex Gateway +| `--flex-environment-id=` | Flex Gateway environment ID *(Required for Flex)* +| `--flex-target-id=` | Flex Gateway target ID *(Required for Flex)* +| `--json` | Outputs the result in JSON format +|=== + +// end::publish-instance-command[] From 2918631fe3cbfb15253bcde01ee02eed10602db7 Mon Sep 17 00:00:00 2001 From: Fernanda Date: Thu, 24 Jul 2025 15:40:47 -0300 Subject: [PATCH 2/2] W-19022580-API-project-CLI-fa --- modules/ROOT/nav.adoc | 1 + modules/ROOT/pages/_partials/api-project.adoc | 18 ++---------------- modules/ROOT/pages/api-project.adoc | 7 +++++++ 3 files changed, 10 insertions(+), 16 deletions(-) create mode 100644 modules/ROOT/pages/api-project.adoc diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index 5fec1f1f..a0e78e9d 100644 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -11,6 +11,7 @@ ** xref:api-catalog.adoc[API Catalog] ** xref:api-governance.adoc[API Governance] ** xref:api-mgr.adoc[API Manager] +** xref:api-project.adoc[API Project] ** xref:cloudhub2-apps.adoc[Cloudhub 2.0] ** xref:cloudhub.adoc[CloudHub] *** xref:cloudhub-apps.adoc[CloudHub Applications] diff --git a/modules/ROOT/pages/_partials/api-project.adoc b/modules/ROOT/pages/_partials/api-project.adoc index 98efde84..a7e301cf 100644 --- a/modules/ROOT/pages/_partials/api-project.adoc +++ b/modules/ROOT/pages/_partials/api-project.adoc @@ -15,7 +15,7 @@ // end::summary[] -// tag::generate-command[] +// tag::commands[] [[generate-command]] == api-project generate @@ -45,9 +45,7 @@ Generates a new API Project descriptor file (`exchange.json`). | `--is-topic` | Adds agent topic annotations to the API spec |=== -// end::generate-command[] -// tag::validate-command[] [[validate-command]] == api-project validate @@ -76,9 +74,6 @@ Validates the API Project structure, rulesets, and governance policies. | `--asset-version=` | Version of the asset |=== -// end::validate-command[] - -// tag::publish-command[] [[publish-command]] == api-project publish @@ -98,9 +93,6 @@ Validates and publishes the API Project to Exchange. | `--json` | Outputs the result in JSON format |=== -// end::publish-command[] - -// tag::metadata-command[] [[metadata-command]] == api-project metadata @@ -120,9 +112,6 @@ Retrieves metadata for the API Project from local or remote sources. | `--asset-version=` | Asset version |=== -// end::metadata-command[] - -// tag::centralized-rulesets-command[] [[centralized-rulesets-command]] == api-project centralized-rulesets @@ -142,9 +131,6 @@ Validates the project against centralized governance rulesets based on metadata. | `--asset-version=` | Asset version |=== -// end::centralized-rulesets-command[] - -// tag::publish-instance-command[] [[publish-instance-command]] == api-project publish-instance @@ -165,4 +151,4 @@ Creates API instances in API Manager based on GCL definitions in the project. | `--json` | Outputs the result in JSON format |=== -// end::publish-instance-command[] +// end::commands[] diff --git a/modules/ROOT/pages/api-project.adoc b/modules/ROOT/pages/api-project.adoc new file mode 100644 index 00000000..9efc212f --- /dev/null +++ b/modules/ROOT/pages/api-project.adoc @@ -0,0 +1,7 @@ +== API Project + +Use the `api-project` commands to automate the creation, validation, and publication of API Projects and instances. + +include::anypoint-cli::partial$api-project.adoc[tag=summary] + +include::anypoint-cli::partial$api-project.adoc[tag=commands]