Skip to content

Commit af7f34d

Browse files
author
Chris Wiechmann
committed
Merge branch 'develop' into test-with-7.7-20200130
2 parents d329210 + 1b87966 commit af7f34d

193 files changed

Lines changed: 7019 additions & 1603 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,25 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
88
### Added
9+
- Search for APIs based on configured Inbound- and Outbound-Security (See issue [#86](https://github.com/Axway-API-Management-Plus/apim-cli/issues/86))
10+
- Added support for API-Manager Config/Alerts/Remote-Hosts (See issue [#68](https://github.com/Axway-API-Management-Plus/apim-cli/issues/68))
11+
- APIs now updated without Re-Creating them if possible (See issue [#95](https://github.com/Axway-API-Management-Plus/apim-cli/issues/95))
12+
13+
### Fixed
14+
- Avoid NPE during API-Export if custom-properties config is inconsistent (See issue [#90](https://github.com/Axway-API-Management-Plus/apim-cli/issues/90))
15+
- Disabled applications not created as disabled (See issue [#89](https://github.com/Axway-API-Management-Plus/apim-cli/issues/89))
16+
- Support for special characters like an accent (See issue [#88](https://github.com/Axway-API-Management-Plus/apim-cli/issues/88))
17+
- Organizations now validated based on given stage (See issue [#58](https://github.com/Axway-API-Management-Plus/apim-cli/issues/58))
18+
- API-Import is now stopped if host and backendBasepath is missing (See issue [#53](https://github.com/Axway-API-Management-Plus/apim-cli/issues/53))
19+
20+
## [1.2.3] 2020-09-24
21+
### Added
922
- Search for APIs based on configured tags (See issue [#82](https://github.com/Axway-API-Management-Plus/apim-cli/issues/82))
1023
- Error handling improved if custom properties configuration is invalid (Switch or Select without configured options)
1124
- Added support to import application scopes (See PR [#77](https://github.com/Axway-API-Management-Plus/apim-cli/pull/77))
1225
- Leverage "com.axway.apimanager.api.model.disable.confidential.fields" option (See PR [#71](https://github.com/Axway-API-Management-Plus/apim-cli/pull/71))
26+
- Support for Stage-Config & Variable substitution for Orgs, Client-Apps and Users
27+
- Support to export & import API-Manager configuration
1328

1429
### Fixed
1530
- Changing an APIs fails due to a ClassCastException (See issue [#85](https://github.com/Axway-API-Management-Plus/apim-cli/issues/85))

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ The CLI is flexible and is extended with new functions via modules. These can be
2020
To get an overview about the groups just call `apim`:
2121
```
2222
Available commands and options:
23-
apim app - Manage your applications
24-
apim api - Manage your APIs
23+
apim app Manage your applications
24+
apim org Manage your organizations
25+
apim api Manage your APIs
26+
apim user Manage your users
2527
```
2628
To get for instance a `wide` list of APIs on the stage: `prod` execute the following command:
2729
```
@@ -51,12 +53,13 @@ The automated End-2-End test suite contains of __116__ different scenarios, whic
5153

5254
| Version | Branch | Status | Comment |
5355
| :--- | :--- | :---: | :--- |
54-
| 7.6.2 SP5 | develop | [![Build Status](https://img.shields.io/travis/Axway-API-Management-Plus/apim-cli/develop)](https://travis-ci.org/Axway-API-Management-Plus/apim-cli/branches)||
55-
| 7.7.0 SP2 | test-with-7.7-SP2 | [![Build Status](https://img.shields.io/travis/Axway-API-Management-Plus/apim-cli/test-with-7.7-SP2)](https://travis-ci.org/Axway-API-Management-Plus/apim-cli/branches)||
56-
| 7.7-20200130 | test-with-7.7-20200130 | [![Build Status](https://img.shields.io/travis/Axway-API-Management-Plus/apim-cli/test-with-7.7-20200130)](https://travis-ci.org/Axway-API-Management-Plus/apim-cli/branches)||
57-
| 7.7-20200331 | test-with-7.7-20200331 | [![Build Status](https://img.shields.io/travis/Axway-API-Management-Plus/apim-cli/test-with-7.7-20200331)](https://travis-ci.org/Axway-API-Management-Plus/apim-cli/branches)||
58-
| 7.7-20200530 | test-with-7.7-20200530 | [![Build Status](https://img.shields.io/travis/Axway-API-Management-Plus/apim-cli/test-with-7.7-20200530)](https://travis-ci.org/Axway-API-Management-Plus/apim-cli/branches)||
59-
| 7.7-20200730 | test-with-7.7-20200730 | [![Build Status](https://img.shields.io/travis/Axway-API-Management-Plus/apim-cli/test-with-7.7-20200730)](https://travis-ci.org/Axway-API-Management-Plus/apim-cli/branches)||
56+
| 7.6.2 SP5 | develop | [![Build Status](https://img.shields.io/travis/Axway-API-Management-Plus/apim-cli/develop)](https://travis-ci.com/Axway-API-Management-Plus/apim-cli/branches)||
57+
| 7.7.0 SP2 | test-with-7.7-SP2 | [![Build Status](https://img.shields.io/travis/Axway-API-Management-Plus/apim-cli/test-with-7.7-SP2)](https://travis-ci.comAxway-API-Management-Plus/apim-cli/branches)||
58+
| 7.7-20200130 | test-with-7.7-20200130 | [![Build Status](https://img.shields.io/travis/Axway-API-Management-Plus/apim-cli/test-with-7.7-20200130)](https://travis-ci.com/Axway-API-Management-Plus/apim-cli/branches)||
59+
| 7.7-20200331 | test-with-7.7-20200331 | [![Build Status](https://img.shields.io/travis/Axway-API-Management-Plus/apim-cli/test-with-7.7-20200331)](https://travis-ci.com/Axway-API-Management-Plus/apim-cli/branches)||
60+
| 7.7-20200530 | test-with-7.7-20200530 | [![Build Status](https://img.shields.io/travis/Axway-API-Management-Plus/apim-cli/test-with-7.7-20200530)](https://travis-ci.com/Axway-API-Management-Plus/apim-cli/branches)||
61+
| 7.7-20200730 | test-with-7.7-20200730 | [![Build Status](https://img.shields.io/travis/Axway-API-Management-Plus/apim-cli/test-with-7.7-20200730)](https://travis-ci.com/Axway-API-Management-Plus/apim-cli/branches)||
62+
| 7.7-20200930 | test-with-7.7-20200930 | [![Build Status](https://img.shields.io/travis/Axway-API-Management-Plus/apim-cli/test-with-7.7-20200930)](https://travis-ci.com/Axway-API-Management-Plus/apim-cli/branches)|Multi-Org is not yet supported|
6063

6164
Version 7.5.3 is NOT supported. Version 7.6.2 SP3 is required.
6265

distribution/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# How to build a Swagger-Promote release package
1+
# How to build a APIM-CLI release package
22

33
With that, Release-Package is created and Swagger-Promote-Core is deployed to Maven-Central.
44

55
### To create a new release use the following instructions:
66
1. When the develop branch is stable and a new release should be created, merge everything from develop into master branch (e.g. using Pull-Request)
77
2. Checkout the master branch
88
3. Open the main project directory
9-
`cd C:\workspaces\api-management\apimanager-swagger-promote`
9+
`cd C:\workspaces\apim-cli`
1010
4. Validate a clean state on master (no uncommited changes)
1111
`git branch -avv`
1212
6. Prepare the release
@@ -21,7 +21,7 @@ No need to run the tests, as they have been automatically executed already on Tr
2121
- Accept or change the proposed version numbers.
2222
- The SCM-Release-Tag label should be the version number. E.g. `1.6.2`
2323
Use the built Pre-Release from folder:
24-
`apimanager-swagger-promote\modules\distribution\target`
24+
`apim-cli\modules\distribution\target`
2525
to perform some final tests.
2626
If you are not happy with the actual build for any reason, you need to rollback the actual release prepare:
2727
`mvn release:rollback`
@@ -42,8 +42,8 @@ Copy the generated checksum and insert it into the file: `tools\chocolateyinstal
4242
`choco pack`
4343
Test the installation of this package:
4444
`choco install axway-swagger-promote -s .`
45-
Execute the Swagger-Promote as shown:
46-
`api-import` or `api-export`
45+
Execute the CLI as shown:
46+
`apim api import` or `apim api get`
4747
Finally push the package to Chocolatey:
4848
`choco push --api-key <api-key-goes-here> axway-swagger-promote.1.6.2.nupkg`
4949
Lastly make sure to merge all changes from master branch back into develop

distribution/assembly/dist-release.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<include>com.github.axway-api-management-plus.apim-cli:apimcli-apps</include>
1818
<include>com.github.axway-api-management-plus.apim-cli:apimcli-organizations</include>
1919
<include>com.github.axway-api-management-plus.apim-cli:apimcli-users</include>
20+
<include>com.github.axway-api-management-plus.apim-cli:apimcli-setup</include>
2021
<include>com.github.axway-api-management-plus.apim-cli:apimcli-tool</include>
2122
</includes>
2223
<binaries>

distribution/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
<groupId>com.github.axway-api-management-plus.apim-cli</groupId>
3737
<artifactId>apimcli-users</artifactId>
3838
</dependency>
39+
<dependency>
40+
<groupId>com.github.axway-api-management-plus.apim-cli</groupId>
41+
<artifactId>apimcli-setup</artifactId>
42+
</dependency>
3943
</dependencies>
4044

4145
<build>

modules/apim-adapter/assembly/conf/env.properties.sample

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ admin_password=changeme
5757
# API-Manager stays in a clean state. With that parameter you can turn off rollback if needed.
5858
# rollback=false
5959

60+
# If an API is given with key remotehost by default the CLI validates this remote hosts exists.
61+
# Use this toggle to turn off this validation.
62+
# validateRemoteHost=false
63+
6064
# With this parameter you can map return-codes creates by Swagger-Promote into any return-code you
6165
# want.
6266
# The following example maps the return code 10 (NO_CHANGE) and 56 (UNKNOWN_API) into a SUCCESS.

modules/apim-adapter/src/main/java/com/axway/apim/adapter/APIManagerAdapter.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@
3636
import com.axway.apim.adapter.apis.APIManagerAPIAccessAdapter;
3737
import com.axway.apim.adapter.apis.APIManagerAPIAdapter;
3838
import com.axway.apim.adapter.apis.APIManagerAPIMethodAdapter;
39+
import com.axway.apim.adapter.apis.APIManagerAlertsAdapter;
3940
import com.axway.apim.adapter.apis.APIManagerConfigAdapter;
4041
import com.axway.apim.adapter.apis.APIManagerOAuthClientProfilesAdapter;
4142
import com.axway.apim.adapter.apis.APIManagerOrganizationAdapter;
4243
import com.axway.apim.adapter.apis.APIManagerPoliciesAdapter;
4344
import com.axway.apim.adapter.apis.APIManagerQuotaAdapter;
45+
import com.axway.apim.adapter.apis.APIManagerRemoteHostsAdapter;
4446
import com.axway.apim.adapter.clientApps.APIMgrAppsAdapter;
4547
import com.axway.apim.adapter.user.APIManagerUserAdapter;
4648
import com.axway.apim.api.model.CaCert;
@@ -74,6 +76,7 @@ public class APIManagerAdapter {
7476
private static APIManagerAdapter instance;
7577

7678
public static String apiManagerVersion = null;
79+
public static String apiManagerName = null;
7780

7881
public static boolean initialized = false;
7982

@@ -108,6 +111,8 @@ public static enum CUSTOM_PROP_TYPE {
108111
private static CacheManager cacheManager;
109112

110113
public APIManagerConfigAdapter configAdapter;
114+
public APIManagerAlertsAdapter alertsAdapter;
115+
public APIManagerRemoteHostsAdapter remoteHostsAdapter;
111116
public APIManagerAPIAdapter apiAdapter;
112117
public APIManagerAPIMethodAdapter methodAdapter;
113118
public APIManagerPoliciesAdapter policiesAdapter;
@@ -163,6 +168,8 @@ private APIManagerAdapter() throws AppException {
163168
super();
164169
this.cmd = CoreParameters.getInstance();
165170
this.configAdapter = new APIManagerConfigAdapter();
171+
this.alertsAdapter = new APIManagerAlertsAdapter();
172+
this.remoteHostsAdapter = new APIManagerRemoteHostsAdapter();
166173
this.apiAdapter = new APIManagerAPIAdapter();
167174
this.methodAdapter = new APIManagerAPIMethodAdapter();
168175
this.policiesAdapter = new APIManagerPoliciesAdapter();
@@ -182,7 +189,7 @@ private APIManagerAdapter() throws AppException {
182189
}
183190

184191
public void loginToAPIManager(boolean useAdminClient) throws AppException {
185-
URI uri;
192+
URI uri = null;
186193
if(cmd.isIgnoreAdminAccount() && useAdminClient) return;
187194
if(hasAdminAccount && useAdminClient) return; // Already logged in with an Admin-Account.
188195
HttpResponse httpResponse = null;
@@ -236,7 +243,7 @@ public void loginToAPIManager(boolean useAdminClient) throws AppException {
236243
throw new AppException("Not supported user-role: "+user.getRole()+"", ErrorCode.API_MANAGER_COMMUNICATION);
237244
}
238245
} catch (Exception e) {
239-
throw new AppException("Can't login to API-Manager", ErrorCode.API_MANAGER_COMMUNICATION, e);
246+
throw new AppException("Can't login to API-Manager " + uri, ErrorCode.API_MANAGER_COMMUNICATION, e);
240247
} finally {
241248
try {
242249
if(httpResponse!=null)
@@ -527,10 +534,18 @@ public static String getApiManagerVersion() throws AppException {
527534
if(APIManagerAdapter.apiManagerVersion!=null) {
528535
return apiManagerVersion;
529536
}
530-
APIManagerAdapter.apiManagerVersion = APIManagerAdapter.getInstance().configAdapter.getApiManagerConfig("productVersion");
537+
APIManagerAdapter.apiManagerVersion = APIManagerAdapter.getInstance().configAdapter.getConfig(false).getProductVersion();
531538
return APIManagerAdapter.apiManagerVersion;
532539
}
533540

541+
public static String getApiManagerName() throws AppException {
542+
if(APIManagerAdapter.apiManagerName!=null) {
543+
return apiManagerName;
544+
}
545+
APIManagerAdapter.apiManagerName = APIManagerAdapter.getInstance().configAdapter.getConfig(false).getPortalName();
546+
return APIManagerAdapter.apiManagerName;
547+
}
548+
534549
public static Map<String, String> getAllConfiguredCustomProperties(CUSTOM_PROP_TYPE type) {
535550
Map<String, String> allCustomProps = new HashMap<String, String>();
536551
try {

0 commit comments

Comments
 (0)