4. Manage Organizations - Axway-API-Management-Plus/apim-cli GitHub Wiki

Import organizations
Learn how you can import organizations from a configuration file into the API-Manager. This approach is following the Desired vs. Actual state approach.

Export and report organizations
You can export one or more organizations from a running API-Manager or just get a list/report of organizations. You can filter the organizations based on different criterias.

Import an Organization

The Axway API-Management CLI tool allows you to import or basically replicate the desired Organizations into the API-Manager to become the actual state.
To get started use the CLI with the following command: apim org import -h which provides you with a complete usage.

The mandatory required parameters are the stage (alternatively host/username/password) and the API-Configuration file. The following examples should help you to get started:

Command Comment/Description
apim org import -s qa -c SampleOrganization.json Replicates an organization into the QA-Stage

Organization configuration file

The following configuration contains the information for an example organization and should be self-explanatory. As of version 1.3.11, you can specify which APIs the organization should have access to. The API version is optional. However, if no unique API is found with the given API-Name, you should also specify the API-Version.

{
  "name": "My Sample Organization",
  "description": "Describes my sample org",
  "enabled": true,
  "development": true,
  "image": "organization-image.png",
  "apis": [
    {
      "apiName": "Booking API",
      "apiVersion": "1.0"
    },
    {
      "apiName": "Invoice API"
    }
  ]
}

Export Organizations

The Axway API-Management CLI tool allows you to export Organizations from the API-Manager for instance in order to promote them into the next stage, put them under version-control or just to update the configuration.
To get started use the CLI with the following command: apim org get -h which provides you with a complete usage.

Filter the list of Organizations

You can filter the list of Organizations. Multiple filters are combined with AND. The following provides you with a few examples. Please check the usage for all filter options:

Command Comment/Description
apim org get -s prod Lists ALL organizations with standard information on the console
apim org get -s qa -name "*Partner*" -ultra Gets organizations named Partner and prints them with all available information

Export Format

By default the get operation is using the console view and generates a table representation of the exported data. However, you can provide a --output or -o parameter to the get operation to control the export format you want.

JSON

This format gives you the JSON format as it's required to import the organization with apim org import. For each exported organization an export folder is created.

Command Comment/Description
apim org get -s prod -id 8f7bd987-0736-43b.... -o json Export the organization with the provided ID into the current folder.
apim org get -s qa -t C:/axway/organizations -o json Gets All applications from the QA-Stage exported into the given target folder. For each exported organization a folder is created automatically within the target folder.

You can provide the option: -deleteTargetif you would like to replace existing folders.