Giter Club home page Giter Club logo

product-apim-tooling's Introduction

product-apim-tooling's People

Contributors

akshitha10110 avatar apk-github-bot avatar blasan avatar chamindu36 avatar crowleyrajapakse avatar dinusha92 avatar dushaniw avatar harsha89 avatar heshansudarshana avatar jayanie avatar kasvith avatar krishanx92 avatar malinthaprasan avatar menuka94 avatar nipunsampath avatar npamudika avatar nuwand avatar pubudu538 avatar ransikag avatar renuka-fernando avatar rmsamitha avatar sanojpunchihewa avatar suksw avatar thamindudilshan avatar tharikagithub avatar tharindu1st avatar tharsanan1 avatar thenujan-nagaratnam avatar uvindra avatar wasuradananjith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

product-apim-tooling's Issues

[APIM CLI][v3.0.0-alpha] Subscribe APIs with Available tier

Description:

As of now APIM CLI v1.0.0-alpha key generation implemantation, APIs are get subscribed to the Application with the subscription tier unlimited. But APIs may not have Unlimited tier defined as subscription policy. In the event of that, it needs to retrieve the defined policies and subscribed to the available one of the policies.

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

API name case change in used swagger and generated meta-information

Description:
When a swagger with a lowercase name is used to create a project, the generated api.yaml has the api name in pascal case, which results in the imported API to have a different case in API Manager than the title in the used swagger.

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

Issue when importing API with APIM CLI in windows

Steps to reproduce:

  • Configure APIM CLI tool [1]
  • Export an API with CLI tool in windows from environment1.
  • Import the API with APIM CLI tool in windows for environment2.

Please find the comparison between verbose logs
response via verbose logs in linux

Executed ImportExportCLI (apimcli) on Mon, 07 Oct 2019 14:09:03 +0530
[INFO]: Insecure: true[INFO]: import-api called[INFO]: Environment: 'dev'
[INFO]: Import URL: https://localhost:9444/api-import-export-2.6.0-v10/import-api?preserveProvider=true
[INFO]: Source Environment: production
ZipFilePath: /Users/lakmini/.wso2apimcli/exported/apis/production/Test_1.0.zip
Successfully imported API 'production/Test_1.0.zip'
[INFO]: Header: map[Server:[WSO2 Carbon Server] Date:[Mon, 07 Oct 2019 08:39:04 GMT] Content-Type:[application/json] Content-Length:[27]]
Succesfully imported API!

response via verbose logs in windows

Executed ImportExportCLI (apimcli) on Mon, 07 Oct 2019 14:52:07 +0530
[INFO]: Insecure: true
[INFO]: import-api called
[INFO]: Resolving for API path...
[INFO]: Looking for API in .wso2apimcli\exported\apis
[INFO]: API Location: C:\Users\wso2\Documents\apimcli-2.0.0-windows-x64\apimcli.wso2apimcli\exported\apis\production\Test_1.0.zip
[INFO]: Creating workspace
[INFO]: Extracting C:\Users\wso2\Documents\apimcli-2.0.0-windows-x64\apimcli.wso2apimcli\exported\apis\production\Test_1.0.zip to C:\Users\wso2\AppData\Local\Temp\apim490611683
[INFO]: Pre Processing API...
[INFO]: Deleting C:\Users\wso2\AppData\Local\Temp\apim490611683\Test-1.0\Meta-information\api.json
apimcli: Error importing API Reason: C:\Users\wso2\AppData\Local\Temp\apim490611683\Test-1.0\Meta-information\api.json\Meta-information\api was not found as a YAML or JSON
Exit status 1

Version: 2.6

[1] https://docs.wso2.com/display/AM260/Migrating+the+APIs+and+Applications+to+a+Different+Environment

[APIM CLI] [v3.0.0-alpha]Show proper error message for apimcli k8s mode

Description:

When APIMCLI mode is set to k8s and if kubectl related commands are being called, when an error occurs, it doesn't show the proper error message throwing from the kubectl.

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

When trying to export an application for a user in the secondary userstore it fails due to "no such file or directory"

When we login to the apimcli tool with a user in secondary userstore, and then try to export an application of that user, it falis with following error.

Executed ImportExportCLI (apimcli) on Tue, 08 Oct 2019 15:03:18 +0530
[INFO]: Insecure: true
[INFO]: export-app called
[INFO]: connecting to https://localhost:8243/token
[INFO]: ExportApp: URL: https://localhost:9443/api/am/admin/v0.14/export/applications?appName=DefaultApplication&appOwner=TEST.COM/pta88942
[INFO]: ResponseStatus: 200 OK
apimcli: Error creating zip archive Reason: open /Users/shehanirathnayake/.wso2apimcli/exported/apps/dev/TEST.COM/pta88942_DefaultApplication.zip: no such file or directory
Exit status 1

Steps to reproduce:

  1. Login to the apimcli tool with user in secondary userstore
    ./apimcli login dev -u TEST.COM/pta88942 -p 12345 --verbose

  2. try to export application under that user
    ./apimcli export-app -n DefaultApplication -o TEST.COM/pta88942 -e dev --insecure --verbose

According to the workaround the one suspicious point is, in apimcli source in [1] where the archive is created with the appOwner name and with the secondary user store domain is with the format domain/ownername, it searches for a file path with the secondary domain.When we manually created a directory with the name as the secondary domain and then successfully able to export the zip file.

[1] https://github.com/wso2/product-apim tooling/blob/b587982c5951712a3259203b0bd6411774ed24ee/import-export-cli/cmd/exportApp.go#L104

'Add environment' example endpoints are incorrect

Description:

Environment related endpoints that should be defined when adding an Environment for Import/Export CLI tool, are incorrect.

Below endpoints,
--publisher https://localhost:9292/api/am/publisher/v1.0
--registration https://localhost:9443/identity/connect/register
--token https://localhost:9443/oauth2/token

should be changed to,
--publisher https://localhost:9443/api/am/publisher/v1.0
--registration https://localhost:9443/api/identity/oauth2/dcr/v1.0/register
--token https://localhost:9443/api/auth/oauth2/v1.0/token

in, https://docs.wso2.com/display/AM300/Migrating+the+APIs+to+a+Different+Environment#MigratingtheAPIstoaDifferentEnvironment-ExportinganAPI

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:
#38
The fixes made on README here should be reflected in the docs too.

Login failure when executing the export-api command

Description:
When export-api command is executed as below, it gives an error when credentials are given to logged into the system.

c:\Program Files\WSO2\apimcli>apimcli export-api -n testapi -v v2 -r admin -e localhost
Login to localhost
Username:admin
Password:apimcli: Error getting credentials Reason: The handle is invalid.
Exit status 1

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:
windows

Steps to reproduce:

Related Issues:

Add an installation script

Description:
Most CI/CD tools use containers and need to install tools again. When doing that if we asked them to write a download script and do it by manually it will not be a smooth experience. Instead, we can provide an installation script which does all for user.

For example see kubernetes/helm, golangci-lint

Introduce go modules support

Description:
Go tools have been improved. We can use go modules for dependencies and develop outside from $GOPATH/src

go will automatically download and install dependencies.

Note: This requires Go 1.11+

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

Project fails to import when environment is added after project is created.

When using the CLI to create and import an API to API Manager, if you add an environment after the project has been initialized (using the init command), the project fails to import to the newly added environment. It complains that the relevant environment does not exist in the api_params.yaml file. The correct behaviour should be that it picks the default values for the API from the api.yaml and swagger.yaml files of the project in case the information cannot be found in the api_params.yaml.

[UX] Ability to import/export APIs through UI

Description:

Not fulfilling checklist items:
Consistency and standards - Is flow maintain the same patterns and consistency?

Related task:
Move API to a different environment

Issue and solution:
Admin users with admin permissions, API import and export should be able to import/export APIs through the UI rather executing curl command.

Suggested Labels:
UX, Improvement

Affected Product Version:
2.1.0

Make apimcli output easy to script

Description:
Current output format used in apimcli is not easy to script. For example, one use case for this is to export a list of APIs. For that we would have to iterate through the list of APIs and call export for each and every API. The list out put at the moment looks like below,

Environment: local
No. of APIs: 6
+-----------+---------+---------------+-----------+----------+--------------------------------------+
|   NAME    | VERSION |    CONTEXT    |  STATUS   | PROVIDER |                  ID                  |
+-----------+---------+---------------+-----------+----------+--------------------------------------+
| Claims    | v1      | /claims       | PUBLISHED | admin    | 2db0e25e-c162-4905-86e3-88e9e3795d1b |
| Claims    | v2      | /claims       | PUBLISHED | admin    | 6d32a1df-59eb-4327-be7b-1ba7d5cbcb2e |
| Claims    | v3      | /claims       | PUBLISHED | admin    | 86035f02-2d09-4602-980a-4c2774b8ed3f |
| Providers | v1      | /providers    | PUBLISHED | admin    | ca336dec-34be-4715-83b3-4cf65650c30c |
| Providers | v2      | /providers    | PUBLISHED | admin    | 2ee35727-3f96-4fc0-b7e2-52d82bdc02fa |
| Providers | v3      | /providers    | PUBLISHED | admin    | 6c9d865b-16fe-4393-8f3c-878feff83f54 |
+-----------+---------+---------------+-----------+----------+--------------------------------------+

First, the script should ignore the first 4-5 lines, then ignore special table delimiter lines with +---+---+. This is a bit cumbersome to do in a bash script. After that we need to take each line, and get name, version, context and pass it to export command.

Is it possible to make the output easy to script? Similar to output given by docker for example. That's very easy to chain multiple commands and script.
Affected Product Version:
APIM CLI 1.2.0, APIM 2.6.0

The context field of the api.yaml in the created project does not get created properly when using swaggers with x-wso2-basepath

Description:
The context field of the api.yaml in the created project does not get created properly when using swaggers with x-wso2-basepath

The context in the api.yaml of the project is taken as a combination of the basepath and the version of the given swagger. That context is directly assigned to x-wso2-basepath when importing the project to API Manager.

In the case of the swagger which already has x-wso2-basepath, the context of the api.yaml is taken as a combination of x-wso2-basepath and version. This combined value is assigned to x-wso2-basepath when importing to API Manager, which results in x-wso2-basepath having an additional version part appended.

This results in the following error when invoking the API through the microgateway using OAuth token
{"fault":{"code":900908, "message":"Resource forbidden ", "description":"Resource forbidden . Unclassified Authentication Failure"}}

Suggested Labels:

Suggested Assignees:

Affected Product Version:
3.0.0

OS, DB, other environment details and versions:

Steps to reproduce:
apictl init normal --oas=sampleswagger.json

Use a swagger with x-wso2-basepath as the sampleswagger.json
Related Issues:

apictl is not working on the alpine based containers

Description:
When we download the linux distribution from the site and then run it on a container which is based on alpine linux it gives syntax errors. I think we will need to have the seperate distribution for this.

Suggested Labels:

Suggested Assignees:

Affected Product Version:
3.0.0
OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

[Import/Export-CLI] Environment endpoints mentioned in README are incorrect

Description:
Environment related endpoints that should be defined when adding an Environment, are incorrect in README.

Below endpoints,
--publisher https://localhost:9292/api/am/publisher/v1.0
--registration https://localhost:9443/identity/connect/register
--token https://localhost:9443/oauth2/token

should be changed to,
--publisher https://localhost:9443/api/am/publisher/v1.0
--registration https://localhost:9443/api/identity/oauth2/dcr/v1.0/register
--token https://localhost:9443/api/auth/oauth2/v1.0/token

Affected Product Version:

2.0.0 (WSO2 APIM 3.0.0 related Tooling - Import/export CLI tool)

[3.0.0-alpha]Standardize environment parameter in commands.

Description:

As of now, APIM CLI commands use -e and -n when referring environments in different cli command. This reduce the user-friendliness of the tool. Hence to standardize, shall we use -e when referring environments?

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

[APIM CLI][v1.0.0-alpha]Moving Import export functionalities from war file to admin rest API

Description:

The current implementation of import-export functionalities in the war file will be moved to the admin rest API. The reason is having a seperate war file for this purpose is not ideal as the changes in the carbon impl (etc) layer would not automatically reflect in the api import-export war file. Hence the ideal solution is to expose this functionality in a single place.

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

APIs should be able to create from openAPI without wso2 vendor extensions

Description:
Right now we can import APIS to APIM directly from open API only. But for that to work we need at least two vender extensions.

  1. x-wso2-basePath -- specify the base path which is the sub context which categorize all the http operation defined in the open API
  2. x-wso2-production-endpoints -- specify the actual implementation url of the endpoint.

So we need to use the openAPI attributes like server (in version 3) and combination of attributes host, scheme, base path (in version 2).
Please refer the issue wso2/product-microgateway#847, which explains the solution for the micro gateway

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

Specify export path

Description:
It should be able to specify an export path when using export-api command. So people does not have to copy the archive to make changes

Suggested Labels:
feature

A short flag is used for different purposes

Description:
The -r short flag has been used it different places [1] and [2] for different uses. This is not a good standard as it can be confusing to the user.

Suggested Labels:
Improvement

Suggested Assignees:

Affected Product Version:
2.6.0

OS, DB, other environment details and versions:

Steps to reproduce:
[1] Scenario 1
When I run the following command, I see that -r is used to define whether you need to preserve the owner or not.
./apimcli import-app --help

Import an Application to an environment
Examples:
apimcli import-app -f qa/apps/sampleApp.zip -e dev
apimcli Import App -f staging/apps/sampleApp.zip -e prod -o testUser -u admin -p admin
apimcli import-app -f qa/apps/sampleApp.zip --preserveOwner --skipSubscriptions -e prod

Usage:
apimcli import-app (--file --environment ) [flags]

Flags:
-e, --environment string Environment from the which the Application should be imported (default "default")
-f, --file string Name of the Application to be imported
-h, --help help for import-app
-o, --owner string Name of the target owner of the Application as desired by the Importer
-p, --password string Password
-r, --preserveOwner Preserves app owner
-s, --skipSubscriptions Skip subscriptions of the Application
-u, --username string Username

Global Flags:
-k, --insecure Allow connections to SSL endpoints without certs
--verbose Enable verbose mode

[2] Scenario 2
When I run the following command, I see that -r is used to define the provider.
./apimcli export-api --help

Export APIs from an environment
Examples:
apimcli export-api -n TwitterAPI -v 1.0.0 -e dev --provider admin
apimcli export-api -n FacebookAPI -v 2.1.0 -e production --provider admin
NOTE: all three flags (--name (-n), --version (-v), --provider (-r)) are mandatory

Usage:
apimcli export-api (--name --version --environment ) [flags]

Flags:
-e, --environment string Environment to which the API should be exported (default "default")
-h, --help help for export-api
-n, --name string Name of the API to be exported
-p, --password string Password
-r, --provider string Provider of the API
-u, --username string Username
-v, --version string Version of the API to be exported

Global Flags:
-k, --insecure Allow connections to SSL endpoints without certs
--verbose Enable verbose mode
examples:apimcli export-api -n TwitterAPI -v 1.0.0 -e dev --provider adminapimcli export-api -n FacebookAPI -v 2.1.0 -e production --provider adminNOTE: all three flags (--name (-n), --version (-v), --provider (-r)) are mandatoryUsage: apimcli export-api (--name --version --environment ) [flags]Flags: -e, --environment string Environment to which the API should be exported (default "default") -h, --help help for export-api -n, --name string Name of the API to be exported -p, --password string Password -r, --provider string Provider of the API -u, --username string Username -v, --version string Version of the API to be exportedGlobal Flags: -k, --insecure Allow connections to SSL endpoints without certs --verbose Enable verbose mode

Related Issues:

APIM CLI issue when password is having special characters

Description:
The password in this case is : Admin&123#$

When try to list the APIs with the password: Admin&123#$

lakminiwwso2com:apictl lakmini$ apimcli list apis -e production1 --verbose -k
Executed ImportExportCLI (apimcli) on Wed, 30 Oct 2019 17:33:22 +0530
[INFO]: Insecure: true
[INFO]: apis called
Login to production1
Username:admin
Password:
Getting ClientID, ClientSecret: Status - 200 OK
Logged into production1 environment
WARNING: credentials are stored as a plain text in /Users/lakmini/.wso2apimcli/keys.json

[INFO]: connecting to https://localhost:8243/token
apimcli: Unable to connect. Reason: Status: 400 Bad Request
Exit status 1

And below is the keys.json file which includes base64 encoded the Admin&123#$.

lakminiwwso2com:apictl lakmini$ cat /Users/lakmini/.wso2apimcli/keys.json
{
  "environments": {
    "dev1": {
      "username": "YWRtaW4=",
      "password": "YWRtaW4=",
      "clientId": "ZWwzd19jemJjbjAxZkVEMTBmZUt2UFUzT21VYQ==",
      "clientSecret": "ME5ZbmlGNWFyTjNhbW5sRm85TkhjMmN5Z1dZYQ=="
    },
    "production1": {
      "username": "YWRtaW4=",
      "password": "QWRtaW4mMTIzIyQ=",
      "clientId": "dzY0MDV1cDJYX0hxQTk5cG9ZbVd4VmUyS2lBYQ==",
      "clientSecret": "bWhFRGFPNXVLdEJwemR1WERxbGplcldXYWljYQ=="
    }
  }
}

When try to list the APIs with the URL encoded password: Admin%26123%23%24

lakminiwwso2com:apictl lakmini$ apimcli list apis -e production1 --verbose -k
Executed ImportExportCLI (apimcli) on Wed, 30 Oct 2019 17:35:07 +0530
[INFO]: Insecure: true
[INFO]: apis called
Login to production1
Username:admin
Password:
Getting ClientID, ClientSecret: Status - 401 Unauthorized
Error: %!s(<nil>)
Body: {"code":401,"message":"","description":"Unauthenticated request","moreInfo":"","error":[]}
apimcli: Error getting credentials Reason: invalid username/password combination
Exit status 1

Suggested Labels:
APIM CLI tooling 2.6.0

Steps to reproduce:

  • Changed the admin password with special credentials.
  • Deploy and run the APIM CLI tool as in [1]
  • Try to list the APIs using CLI tool

[1] https://docs.wso2.com/display/AM260/Initializing+projects+using+the+CLI+Tool

Issue while using --preserve-provider flag

Description:
$ apimcli import-api -k -f dev/A_1.0.0.zip -e qa --preserve-provider=false --update

The above command outputs the following error:
Existing API found, attempting to update it... API ID: 13faf93f-554e-45bd-9d7d-a001adceb3bb Error importing API. Status: 500 Internal Server Error Response: Error in adding Swagger definition for the API. apimcli: Error importing API Reason: 500 Internal Server Error Exit status 1

However, when the --preserve-provider=false is omitted it's successful.
So, I believe, when preserve-provider is set to false, provider should be taken from the logged-in user of the target environment

[UX] Bulk export/import APIs through multiple environments

Description:

Not fulfilling checklist items:
Help and documentation -Is necessary documentation provided

Related task:
Move API to a different environment

Issue:
Rather than importing/exporting APIs one by one, User should have the ability to bulk import/export.
Found implementations [1][2] but it is not added to the product and documented.

[1] https://github.com/gnudeep/WSO2-AM-API-Import-Export-Tool
[2] https://github.com/nadeesha5814/APIBulkImport

Suggested Labels:
UX, Improvement

Affected Product Version:
2.1.0

addEnv empty Endpoints

Description:
If I add the admin and AppList endpoint as parameters when create a new environment, appears empty at main_config.yml

You need to add at addEnv.go

if envEndpoints.AppListEndpoint != "" {
	validatedEnvEndpoints.AppListEndpoint = envEndpoints.AppListEndpoint
}

if envEndpoints.AdminEndpoint != "" {
	validatedEnvEndpoints.AdminEndpoint = envEndpoints.AdminEndpoint
}

Steps to reproduce:

Create a new environment with admin and appList endpoints.

[APIM CLI][v1.0.0-alpha] Allow users to change to token type (JWT/OAuth2)

Description:

Current v1.0.0-alpha version's "get-keys" command supports only JWT tokens. If a user prefers to have an oauth2 opaque token, the tool should be flexible to cater to both the token types.
Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

Update Operation for API

Description:
In CI/CD flow every change has to go through as a new version of an API(adding a new resource for an API). In that case API, Import/export for API version works perfectly.

If there is an update on the business owner or other none resource metadata then doing versioning on the API and doing export/import doesn't make sense. There should be a way to update API metadata through CI/CD without doing versioning.

Suggested Labels:

Suggested Assignees:

Affected Product Version:
2.0.0

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

APIs will be imported with their states

Description:
Imported APIs will be in Created, Published or Prototyped states in the second environment according to their states in the first environment. However, according to the documentation, those APIs should be in the Created state.

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

  1. Export few APIs which are in Created, Published and Prototyped states.
  2. Import them into another environment.

Related Issues:

Error when try to import api using apimcli tool in windows

Description:
We have an API Manager 2.6.0 which is running in the Linux machine. Then we had an apimcli tool which is used in the windows machine to export and then import the api. I have exported the api successfully. When I import the API I got the following error in the apim.

[2019-11-01 17:05:03,257] WARN - CompositeValve To enable SaaS mode for the webapp, /api-import-export-2.6.0-v10, configure the CarbonTomcatRealm in META-INF/context.xml. [2019-11-01 17:05:03,286] INFO - CarbonAuthenticationUtil '[email protected] [-1234]' logged in at [2019-11-01 17:05:03,286+0530] [2019-11-01 17:05:03,289] INFO - AuthenticatorUtil admin user authenticated successfully [2019-11-01 17:05:03,315] INFO - AuthenticatorUtil admin is authorized to import and export APIs [2019-11-01 17:08:03,743] INFO - InboundDBSyncRequestEvent Running DB sync task. [2019-11-01 17:08:11,240] ERROR - APIService Error in reading API definition. java.io.IOException: Cannot find API definition. api.json or api.yaml should present at org.wso2.carbon.apimgt.importexport.utils.APIImportUtil.importAPI(APIImportUtil.java:326) at org.wso2.carbon.apimgt.importexport.APIService.importAPI(APIService.java:266) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:193) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:103) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:220) at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:603) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.wso2.carbon.identity.context.rewrite.valve.TenantContextRewriteValve.invoke(TenantContextRewriteValve.java:80) at org.wso2.carbon.identity.authz.valve.AuthorizationValve.invoke(AuthorizationValve.java:100) at org.wso2.carbon.identity.auth.valve.AuthenticationValve.invoke(AuthenticationValve.java:65) at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99) at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47) at org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:57) at org.wso2.carbon.event.receiver.core.internal.tenantmgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:48) at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47) at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62) at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:159) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025) at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1137) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1775) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1734) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)

I got the following error in the apimcli tool.
[INFO]: Import URL: https://localhost:9443/api-import-export-2.6.0-v10/import-api?preserveProvider=false Error importing API. Status: 500 Internal Server Error Response: Error occurred while adding the API. A duplicate API already exists for Rest-1.0.0 [INFO]: Deleting /var/folders/t5/wh2d7tyd18v4tswy0kc1byl80000gn/T/api-artifact280304798.zip [INFO]: Deleting /var/folders/t5/wh2d7tyd18v4tswy0kc1byl80000gn/T/apim348006267/Rest-1.0.0 apimcli: Error importing API Reason: 500 Internal Server Error Exit status 1

Affected Product Version:
WSO2 API Manager Tooling 2.0.1

Steps to reproduce:

  • Start wso2 apim 260 in a Linux operating system and create an API for the testing purpose.
  • Set up the apimcli tool for a Windows instance (need to deploy the relevant web app to the Linux instance's apim server)
  • Export the created API using the apimcli tool installed in the windows OS (instance)
  • Delete the relevant API from the apim server (using publisher)
  • Try to import the exported API using the apimcli in windows OS

This issue occurs when we have an API Manager in the Linux/Mac environment and when we try to export and import the API from the windows environment.

APIMCLI exit on errors with 0 status

Description:
When a server-side error occurred APIMCLI exit with 0 exit status.
This may lead to errors in CI/CD environments as an exit state is used to detect whether a command was successful or not

Affected Product Version:

  • apimcli 2.x

OS, DB, other environment details and versions:

  • Linux AMD64

Steps to reproduce:

  • Try to follow the import step in Migration API guide
  • When using api-import-export-2.6.0-v2.war an error is generated from the server side
  • apimcli correctly report the error and exit 0 status

Error log when deleting an environment using CLI tool

Description:
An error log will be printed on the terminal when deleting an API using the CLI tool. However, the environment will be deleted.
Screenshot from 2019-09-30 13-51-27

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

  1. Execute apimcli remove-env --name <ENV_NAME> command for an existing environment.

Related Issues:

Extract archive after export

Description:
It would be awesome if the tool itself can extract the archive on export. This could be done by adding --extract flag to export-api

Suggested Labels:
feature

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

Feature request - provide a mechanism to export all available APIs

Description:
Currently when a user creates a new environment, and want to import all available APIs from a different environment, a script or a program has to be written to get all available APIs, export those in a loop and then import all of those into the new environment.

Current output format of apimcli is not script friendly and it takes an effort to filter and sanitize the list. So an inbuilt option to export all available APIs will make life easy.

Affected Product Version:
API Manager 2.6.0

Providing an indication of pre-condition failure when the required role is absent in importing envrionment.

This is relevant to API export/import CLI tool.
When there are scopes defined based on existing roles of an environment these are exported with the API export zip file. When this is imported to the new environment it is silently imported and properly shown, but with the scopes referring to non-existing roles in the new environment.
We would expect at least an indication of the absence of the roles or an error message to indicate this lacking configuration in the new environment, to avoid future issues.

Need to have a APIM tooling release for 2.6.0

Description:
Currently, there is no APIM tooling release for API-M 2.6.0 in [1]. We need to have a release for 2.6.0, so that we can update the APIM 2.6.0 docs with the URL to this release under the "Install the plug-in on Eclipse Oxygen using the P2 URL" section [2].

[1] http://product-dist.wso2.com/p2/developer-studio-kernel/4.3.0/apim-tools/releases/
[2] https://docs.wso2.com/display/AM260/Installing+the+API+Manager+Tooling+Plug-In#InstallingtheAPIManagerToolingPlug-In-Installtheplug-inonEclipseOxygenusingtheP2URL

Suggested Labels:

Suggested Assignees:

Affected Product Version:
API-M 2.6.0

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

apimcli fails on import with confusing error msg

Importing an API using apimcli throws a confusing error
ZipFilePath: /opt/wso2/.wso2apimcli/exported/apis/opt/wso2/.wso2apimcli/exported/apis/APIM-DEV/PizzaShackAPI_1.0.0.zip
apimcli: Error creating request. Reason: open /opt/wso2/.wso2apimcli/exported/apis/opt/wso2/.wso2apimcli/exported/apis/APIM-DEV/PizzaShackAPI_1.0.0.zip: no such file or directory
Exit status 1

I am using two API environments on the same server, export the PizzaShack API and try to import it into the other one.

CA cert is added to Centos, API environments work as they should

these are the definitions

apimcli add-env -n APIM-DEV --registration https://api.blog.yenlo:9443/client-registration/v0.13/register --apim https://api.blog.yenlo:9443 --token https://api.blog.yenlo:8243/token --import-export https://api.blog.yenlo:9443/api-import-export-2.5.0-v1 --admin https://api.blog.yenlo:9443/api/am/admin/v0.13 --api_list https://api.blog.yenlo:9443/api/am/publisher/v0.13/apis --app_list https://api.blog.yenlo:9443/api/am/store/v0.13/applications

./apimcli add-env -n APIM-TEST --registration https://api.blog.yenlo:9444/client-registration/v0.13/register --apim https://api.blog.yenlo:9444 --token https://api.blog.yenlo:8244/token --import-export https://api.blog.yenlo:9444/api-import-export-2.5.0-v1 --admin https://api.blog.yenlo:9444/api/am/admin/v0.13 --api_list https://api.blog.yenlo:9444/api/am/publisher/v0.13/apis --app_list https://api.blog.yenlo:9444/api/am/store/v0.13/applications

afbeelding

Version of the CLI Tool for APIM 2.6.0 needs to be changed

Description:
The CLI Tool for APIM 2.6.0 and APIM 2.5.0 is the same at the moment. This needs to be changed.

Suggested Labels:
API-M 2.6.0

Suggested Assignees:
ChamilaA

Affected Product Version:
API-M 2.6.0

OS, DB, other environment details and versions:

Steps to reproduce:
Run the following command in with the APIM 2.5.0 CLI tool and the APIM 2.6.0 CLI tool
apimcli version
The outcome is the same as follows:
apimcli Version: 1.1.0

Related Issues:

The order of commands in the import-export-cli can be improved

The README for the import-export-cli provides the commands in the order of first exporting an API and then importing. But you actually need to setup your environments before you could do any of that. Therefore the README should have the command instructions in realistic order so that a novice user can work with this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.