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 new file mode 100644 index 00000000..a7e301cf --- /dev/null +++ b/modules/ROOT/pages/_partials/api-project.adoc @@ -0,0 +1,154 @@ += 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::commands[] + +[[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 +|=== + + + +[[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 +|=== + + +[[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 +|=== + + +[[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 +|=== + + +[[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 +|=== + + +[[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::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]