CLI for API Manager
Command | Description |
---|---|
Creates an API instance alert |
|
Lists alerts for an API instance |
|
Lists the autodiscovery properties |
|
Changes the asset version for an API instance by choosing a new version from Exchange |
|
Classifies an API instance in a given environment |
|
Deletes an API |
|
Deploys an API to CloudHub, hybrid server, or Runtime Fabric |
|
Deprecates an API instance |
|
Shows details of an API |
|
Downloads the API proxy ZIP file to a local directory |
|
Edits an API instance |
|
Lists all APIs in API Manager 2.x |
|
Manages a new API, API version, or new API instance with an asset from Exchange |
|
Promotes an API instance from source environment |
|
Redeploys an API to CloudHub, Hybrid server, or Runtime Fabric |
|
Undeprecates an API instance |
|
Deletes a given API contract |
|
Lists all contracts to a given API instance |
|
Applies a policy to a given API instance |
|
Shows the description and available configuration properties of a given policy template |
|
Disables policy from a given API instance |
|
Edits the policy configuration of a given API instance |
|
Enables a policy on a given API instance |
|
Lists policies |
|
Removes a policy from a given API instance |
|
Creates an SLA tier |
|
Copies an SLA tier from source to a target API instance |
|
Deletes an SLA tier from an API instance |
|
Lists the SLA tiers of an API instance |
General and Authentication Flags
Following are the general and authentication flags for commands that authenticate to Anypoint Platform:
Flag | Description |
---|---|
or
|
Connected app client ID See Authentication. |
or
|
Prompt for the connected app secret for the client ID See Authentication. |
or
|
Not currently used |
or
|
The name of the Anypoint Platform environment where the APIs are cataloged |
or
|
Default: anypoint.mulesoft.com The Anypoint Platform base URL without the protocol For the US Anypoint Platform, use: anypoint.mulesoft.com For the European Anypoint Platform, use: eu1.anypoint.mulesoft.com |
or
|
The ID of the Anypoint Platform organization where the APIs are cataloged |
or
|
Anypoint user password See Authentication. |
or
|
Anypoint username See Authentication. |
api-mgr:alert:add
> api-mgr:alert:add <apiInstanceId> <name> [flags]
This command creates an API instance alert with the name passed in name
for the API instance Id passed in <apiInstanceId>
.
Besides the default --help
, general, and authentication flags, this command also accepts:
Flag | Description |
---|---|
|
Condition occurrence period duration. |
|
Condition occurrence period duration unit. |
|
Email to send alert notification to. |
|
Sets whether the alert is enabled. Include the flag to enable the alert. |
|
Condition operator that explains values in relation to threshold. |
|
Number of consecutive periods condition should occur for. |
|
ID of a policy applied to the API instance that triggers a |
|
Username to send alert notification to. |
|
Response codes to trigger |
|
Response time to trigger |
|
Alert severity. |
|
Condition occurrences threshold number. |
|
Alert type/condition. |
This command has multi-option flags. When using multi-option flags in a command, either put the parameter before the flags or use a `-- ` (two dashes followed by a space) before the parameter. |
api-mgr:alert:list
> api-mgr:alert:list [flags] <apiInstanceId>
Lists alerts for the API instance passed in <apiInstanceId>
.
Besides the default --help
, general, and authentication flags, this command also accepts:
Flag | Description |
---|---|
|
Number of results to retrieve, default is 10 results |
|
Offsets the amount of APIs passed, for example, |
|
Specifies the response format |
|
Sorts the results in the field name passed, for example, |
api-mgr:api:autodiscovery
> api-mgr:api:autodiscovery [flags] <apiInstanceId> <name>
This command lists the autodiscovery properties required for a gateway to track the API Instance Id passed in <apiInstanceId>
.
Besides the --help
, general, and authentication flags, this command also accepts:
Flag | Description |
---|---|
|
Specifies the gateway version to download |
|
Specifies the response format |
api-mgr:api:change-specification
> api-mgr:api:change-specification [flags] <apiInstanceId> <assetVersion>
Changes the asset version for the API instance passed in <apiInstanceId>
by choosing a new version from Exchange passed in <assetVersion>
.
This command accepts only the default --help
, general, and authentication flags.
api-mgr:api:classify
> api-mgr:api:classify [flags] <destEnvName> <apiInstanceId>
Classifies the API instance passed in <apiInstanceId>
in the environment passed in <destEnvName>
.
This command accepts only the default --help
, general, and authentication flags.
api-mgr:api:delete
> api-mgr:api:delete [flags] <apiInstanceId>
This command deletes the API instance passed in <apiInstanceId>
. If the API instance is deployed, this command undeploys the API instance before deleting.
This command accepts only the default --help
, general, and authentication flags.
api-mgr:api:deploy
> api-mgr:api:deploy [flags] <apiInstanceId>
This command deploys the API instance passed in '<apiInstanceId>' to the deployment target specified using the flags described below. Deploy any undeployed API using this command regardless of if it was created using the API Manager CLI or API Manger UI.
This command is only supported for endpoints with proxy. |
Besides the default --help
, general, and authentication flags, this command also accepts:
Flag | Description | Example |
---|---|---|
|
Application name |
|
|
Target environment name, only for when deploying API instances from unclassified environments |
|
|
The CloudHub Gateway version |
|
|
Update application if it exists |
|
|
Hybrid or RTF deployment target ID |
|
api-mgr:api:deprecate
> api-mgr:api:deprecate [flags] <apiInstanceId>
Deprecates the API instance passed in <apiInstanceId>
.
This command accepts only the default --help
, general, and authentication flags.
api-mgr:api:describe
> api-mgr:api:describe [flags] <apiInstanceId>
Shows details of the API instance passed in <apiInstanceId>
.
Besides the default --help
, general, and authentication flags, this command has the --output
flag. Use the --output
flag to specify the response format. Supported values are table
(default) and json
.
api-mgr:api:download-proxy
> api-mgr:api:download-proxy [flags] <apiInstanceId> <targetPath>
This command downloads the API proxy ZIP file of the API instance passed in <apiInstanceId>
to a local directory specified in <targetPath>
. You cannot download the API proxy of a Flex Gateway API instance.
Besides the default --help
, general, and authentication flags, this command also accepts a gatewayVersion
flag to specify the gateway version to download.
For example: api-mgr:api:download-proxy --gatewayVersion: 4.0.1 643404 /tmp/
api-mgr:api:edit
> api-mgr:api:edit [flag] <apiInstanceId>
This command edits the API instance passed in <apiInstanceId>
. Editing a deployed Flex Gateway API instance redeploys the instance.
Besides the default --help
, general, and authentication flags, this command also accepts:
Flag | Description |
---|---|
|
Indicates whether this is a Flex Gateway API instance. |
|
Indicates whether this is a Mule 4 API instance. |
|
Indicates whether the endpoint should use a proxy. |
|
Indicates whether a proxy should reference a user domain. |
|
API instance label, optional. |
|
Deployment type. |
|
Consumer endpoint URI. |
|
Inbound secret group ID. |
|
Outbound TLS Context ID. |
|
Outbound secret group ID. |
|
Outbound TLS Context ID. |
|
Proxy path. |
|
Proxy port. |
|
Optional Client Identity Provider Id that the API is associated with. Default is Anypoint Platform Client Provider. |
|
Maximum response timeout. |
|
Proxy scheme. |
|
WSDL service name. Flex Gateway does not support this flag. |
|
WSDL service namespace. Flex Gateway does not support this flag. |
|
WSDL service port. Flex Gateway does not support this flag. |
|
Updates the TLS context of API instances sharing the port of this API. |
|
Implementation URI. |
api-mgr:api:list
> api-mgr:api:list [flags]
Lists all APIs in API Manager 2.x.
Besides the default --help
, general, and authentication flags, this command also accepts:
Flag | Description |
---|---|
|
API version that filters results |
|
Asset ID that filters results |
|
API instance label that filters results |
|
Number of results to retrieve |
|
Offsets the amount of APIs passed |
|
Sorts the results in the field name passed |
api-mgr:api:manage
> api-mgr:api:manage [flags] <assetId> <assetVersion>
Manages a new API, API version, or new API instance with the Exchange asset passed in <assetId>
, and the version passed in <assetVersion>
.
Flex Gateway API instances created with Anypoint CLI do not support multiple upstream services. To create Flex Gateway API instances with multiple upstream services, see: |
Besides the default --help
, general, and authentication flags, this command also accepts:
Flag | Description |
---|---|
|
Indicates whether this is a Flex Gateway API instance. |
|
Indicates whether this API instance is being managed in Mule 4 or above. |
|
Indicates whether the endpoint should use a proxy. |
|
Indicates whether a proxy should reference a user domain. |
|
API instance label, optional. |
|
Deployment type. |
|
Consumer endpoint URI. |
|
Inbound secret group ID. |
|
Outbound TLS Context ID. |
|
Outbound secret group ID. |
|
Outbound TLS Context ID. |
|
Proxy path. |
|
Proxy port. |
|
Optional Client Identity Provider Id in which the API is associated with. Default is Anypoint Platform Client Provider. |
|
Response timeout. |
|
Proxy scheme. |
|
WSDL service name. Flex Gateway does not support this flag. |
|
WSDL service namespace. Flex Gateway does not support this flag. |
|
WSDL service port. Flex Gateway does not support this flag. |
|
Endpoint type. Supported options are |
|
Implementation URI. |
api-mgr:api:promote
> api-mgr:api:promote [flags] <apiInstanceId> <sourceEnvId>
Promotes the API instance passed in <apiInstanceId>
from the source environment in <sourceEnvId>
.
Besides the default --help
, general, and authentication flags, this command also accepts:
Flag | Description |
---|---|
|
Indicates whether to copy alerts. |
|
Indicates whether to copy policies. |
|
Indicates whether to copy tiers. |
|
Indicates the provider’s ID associated with the API. |
api-mgr:api:redeploy
> api-mgr:api:redeploy [flags] <apiInstanceId>
Redeploys the API instance passed in <apiInstanceId>
to the deployment target set up in the flags described below.
Besides the default --help
, general, and authentication flags, this command also accepts:
Flag | Description |
---|---|
|
Application name |
|
Target environment name |
|
CloudHub Gateway version |
|
Update application if exists |
|
Hybrid or RTF deployment target ID |
api-mgr:api:undeprecate
> api-mgr:api:undeprecate [flags] <apiInstanceId>
Undeprecates the API instance passed in <apiInstanceId>
.
This command accepts only the default --help
, general, and authentication flags.
api-mgr:contract:delete
> api-mgr:contract:delete [flags] <apiInstanceId> <clientId>
This command deletes the contract between the API instance passed in <apiInstanceId>
, and the client passed in <clientId>
.
This command accepts only the default --help
, general, and authentication flags.
api-mgr:contract:list
> api-mgr:contract:list [flags] <apiInstanceId> [searchText]
Lists all contracts of the API passed in <apiInstanceId>
.
You can specify keywords in searchText to limit results of APIs containing those specific keywords. |
Besides the default --help
, general, and authentication flags, this command also accepts:
Flag | Description | Example |
---|---|---|
|
Number of results to retrieve |
|
|
Offsets the amount of APIs passed |
|
|
Specifies the response format, supported values are |
|
|
Sorts the contracts by the criteria associated with their client applications, supported values are |
|
api-mgr:policy:apply
> api-mgr:policy:apply [flags] <apiInstanceId> <policyId>
Applies the policy passed in <policyId>
to the API instance passed in <apiInstanceId>
.
Besides the default --help
, general, and authentication flags, this command also accepts:
Flag | Description |
---|---|
|
Pass the configuration data as a JSON string. |
|
Pass the configuration data as a file. |
|
Mule 4 policy group ID. |
|
Pass pointcut data as JSON strings. |
|
Mule 4 policy version. |
The following example defines a rate limit of one request every ten seconds:
{ "rateLimits": [{ "maximumRequests": 1, "timePeriodInMilliseconds": 10000 }], "clusterizable": true, "exposeHeaders": false }
api-mgr:policy:describe
> api-mgr:policy:describe [flags] <policyId>
This command shows the description and available base configuration properties of the policy name passed in <policyId>
.
Besides the default --help
, general, and authentication flags, this command also accepts:
Flag | Description |
---|---|
|
Mule 4 policy group ID |
|
Mule 4 policy version |
|
Specifies the response format |
api-mgr:policy:disable
> api-mgr:policy:disable [flags] <apiInstanceId> <policyInstanceId>
This command disables the policy passed in <policyInstanceId>
from the API instance passed in <apiInstanceId>
.
This command accepts only the default flag --help
, general, and authentication flags.
api-mgr:policy:edit
> api-mgr:policy:edit [flags] <apiInstanceId> <policyInstanceId>
This command edits the policy configuration passed in <policyInstanceId>
for the API instance passed in <apiInstanceId>
.
Besides the default --help
, general, and authentication flags, this command also accepts:
Flag | Description |
---|---|
|
Pass the configuration data as a JSON string |
|
Pass pointcut data as JSON strings |
api-mgr:policy:enable
> api-mgr:policy:enable [flags] <apiInstanceId> <policyInstanceId>
This command enables the policy passed in <policyInstanceId>
for the API instance passed in <apiInstanceId>
.
This command accepts only the default flag --help
, general, and authentication flags.
api-mgr:policy:list
> api-mgr:policy:list [flags] [apiInstanceId]
This command lists all policies for all APIs in API Manager 2.x.
When the [apiInstanceId]
flag is specified, this command lists the policies applied to that API instance. Not specifying the [apiInstanceId]
will list all policies for all APIs.
Besides the default --help
, general, and authentication flags, this command also accepts the -m, --muleVersion4OrAbove
flag.
api-mgr:policy:remove
> api-mgr:policy:remove [flags] <apiInstanceId> <policyInstanceId>
This command removes the policy specified in <policyInstanceId>
from the API instance passed in <apiInstanceId>
.
This command accepts only the default flag --help
, general, and authentication flags.
api-mgr:tier:add
> api-mgr:tier:add [flags] <apiInstanceId>
This command creates an SLA tier for the API instance passed in <apiInstanceId>
.
Besides the default --help
, general, and authentication flags, this command also accepts:
Flag | Description | ||
---|---|---|---|
|
Indicates whether the SAL tier should be auto-approved. |
||
|
Tier name. |
||
|
Tier description. |
||
|
Single instance of an SLA tier limit in the form
For example:
|
api-mgr:tier:copy
> api-mgr:tier:copy [flags] <sourceAPIInstanceId> <targetAPIInstanceId>
This command copies the SLA tier from the API instance passed in <sourceAPIInstanceId>
to the API instance Id passed in <targetAPIInstanceId>
.
This command accepts only the default --help
, general, and authentication flags.
api-mgr:tier:delete
> api-mgr:tier:delete [flags] <apiInstanceId> <tierId>
This command deletes the SLA tier passed in <tierId>
from API instance passed in <apiInstanceId>
.
This command accepts only the default --help
, general, and authentication flags.
api-mgr:tier:list
> api-mgr:tier:list [flags] <apiInstanceId> [searchText]
This command lists the SLA tiers of the API instance passed in <apiInstanceId>
.
Besides the default --help
, general, and authentication flags, this command also accepts:
Flag | Description | Example |
---|---|---|
|
Number of results to retrieve |
|
|
Offsets the amount of APIs passed |
|
|
Specifies the response format, supported values are |
|
|
Sorts the results in the field name passed |
|