Re: [Architecture] Harvesting API's from AWS API Gateway to the WSO2 developers portal

2020-08-24 Thread Malintha Amarasinghe
Hi Akshitha,

On Mon, Aug 24, 2020 at 3:29 PM Akshitha Dalpethado (Intern) <
akshi...@wso2.com> wrote:

> Hi guys,
> update on this new command to the apictl.
> So we are introducing a new command *apictl aws init 
> --stage-name *
> When you execute this command on apictl it will execute the following aws
> command using awscli in the background, *aws apigateway get-rest-apis*
> This command will give us the apis a user has created in the aws gateway
> and our program will go through the apis and get the id of the api name
> provided.
> Then the program will execute another awscli command which will get the
> swagger definition of that api, *aws apigateway get-export --rest-api-id
>  --stage-name  --export-type swagger /path/file_name.json*
> This is what we are working on basically. After this we can execute the
> existing apictl commands (listed below) to create an api in the dev portal
> with the swagger we extracted from the aws.
>
>
> *./apictl init shopping --oas /home/akshitha/Documents/shopping.json*
>
I think above command also should be executed as part of *apictl aws init
 --stage-name *

*./apictl import-api -f  -e  -k*
>
>
The process looks good to me. But there are few gaps to clarify:

1. Once the API is Published, we need to point the API's gateway endpoint
as the actual AWS gateway endpoint from the devportal. The correct URL is
available in the swagger file you download from AWS.
2. We should disable subscribing users to those types of APIs from the
devportal.
3. We need to change the way we render the API Testing UI as well by
removing the application selection etc.

>From the above, such APIs should be treated a bit specially in APIM. It's
like the API is hosted in APIM for advertising purposes. Maybe rather than
going for devportal customization path, we can use a special property in
the API and render the devportal UI accordingly. This will be a common
problem when someone building a public API portal with external APIs (eg: a
marketplace).

We already have the property advertiseOnly: true that we can add to
api.yaml before importing the API which is used for external store feature
[1]. But this will not only remove subscription UI elements from the
devportal but also testing elements. We can generalize this feature and use
it for multiple use cases like this.

Or do we have any other approach to solve this?

[1]
https://apim.docs.wso2.com/en/next/learn/design-api/publish-api/publish-to-multiple-external-api-stores/
Thanks!



> On Mon, Aug 10, 2020 at 2:14 PM Akshitha Dalpethado (Intern) <
> akshi...@wso2.com> wrote:
>
>> Hi Amila,
>> That is correct
>>
>>
>> On Fri, Aug 7, 2020 at 10:30 AM Amila De Silva  wrote:
>>
>>> Hi Akshitha,
>>> Is the ultimate plan to let developers export APIs directly from AWS API
>>> Gateway and import those to APIM only using apictl (like it's done for
>>> k8s)? The steps you've described are  for how it can be achieved right now
>>> (without any changes on apictl), isn't it?
>>>
>>>
>>> On Thu, Aug 6, 2020 at 1:40 PM Akshitha Dalpethado (Intern) <
>>> akshi...@wso2.com> wrote:
>>>
 Basically what we are trying to achieve through this project is to give
 our wso2 apim users the ability to extract API's created on AWS API Gateway
 from a specific account to the WSO2 developers portal by extracting the
 swagger definition of an API created in the AWS using the AWS Command Line
 Interface (AWS CLI).

 First we will be requesting for the API's a user has created in the AWS
 APIG which will return the API's created in the AWS APIG (from a specific
 account) and their ID's and also we will be requesting for the API Stage
 names which is also required to extract the swagger definition of a API
 from AWS APIG using AWS CLI.


 *Command01: aws apigateway get-rest-apisCommand02: aws apigateway
 get-stages --rest-api-id Command03: aws apigateway get-export
 --rest-api-id  --stage-name  --export-type swagger
 /path/file_name.json*

 Then we initialize an API project using WSO2 API CTL using the swagger
 definition we extracted from the AWS APIG.
 *Command: ./apictl init  --oas path/file_name.json*

 Then we can import the initialized API project to the WSO2 Developers
 portal as an API by using the following API CTL command.
 *Command: ./apictl import-api -f  -e 
 -k*

 This is how it can be done manually but our goal is to automate this
 process and allow users to extract API's they have created in the AWS APIG
 to the WSO2 Developers portal.





 --
 *Akshitha Dalpethado* | Intern | WSO2 Inc.

 (m) :0770284542 | Email : akshi...@wso2.com

 [image: http://wso2.com/signature] 
 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

>>>
>>>
>>> --
>>> 

Re: [Architecture] Harvesting API's from AWS API Gateway to the WSO2 developers portal

2020-08-24 Thread Akshitha Dalpethado (Intern)
Hi guys,
update on this new command to the apictl.
So we are introducing a new command *apictl aws init 
--stage-name *
When you execute this command on apictl it will execute the following aws
command using awscli in the background, *aws apigateway get-rest-apis*
This command will give us the apis a user has created in the aws gateway
and our program will go through the apis and get the id of the api name
provided.
Then the program will execute another awscli command which will get the
swagger definition of that api, *aws apigateway get-export --rest-api-id
 --stage-name  --export-type swagger /path/file_name.json*
This is what we are working on basically. After this we can execute the
existing apictl commands (listed below) to create an api in the dev portal
with the swagger we extracted from the aws.


*./apictl init shopping --oas /home/akshitha/Documents/shopping.json*
*./apictl import-api -f  -e  -k*

On Mon, Aug 10, 2020 at 2:14 PM Akshitha Dalpethado (Intern) <
akshi...@wso2.com> wrote:

> Hi Amila,
> That is correct
>
>
> On Fri, Aug 7, 2020 at 10:30 AM Amila De Silva  wrote:
>
>> Hi Akshitha,
>> Is the ultimate plan to let developers export APIs directly from AWS API
>> Gateway and import those to APIM only using apictl (like it's done for
>> k8s)? The steps you've described are  for how it can be achieved right now
>> (without any changes on apictl), isn't it?
>>
>>
>> On Thu, Aug 6, 2020 at 1:40 PM Akshitha Dalpethado (Intern) <
>> akshi...@wso2.com> wrote:
>>
>>> Basically what we are trying to achieve through this project is to give
>>> our wso2 apim users the ability to extract API's created on AWS API Gateway
>>> from a specific account to the WSO2 developers portal by extracting the
>>> swagger definition of an API created in the AWS using the AWS Command Line
>>> Interface (AWS CLI).
>>>
>>> First we will be requesting for the API's a user has created in the AWS
>>> APIG which will return the API's created in the AWS APIG (from a specific
>>> account) and their ID's and also we will be requesting for the API Stage
>>> names which is also required to extract the swagger definition of a API
>>> from AWS APIG using AWS CLI.
>>>
>>>
>>> *Command01: aws apigateway get-rest-apisCommand02: aws apigateway
>>> get-stages --rest-api-id Command03: aws apigateway get-export
>>> --rest-api-id  --stage-name  --export-type swagger
>>> /path/file_name.json*
>>>
>>> Then we initialize an API project using WSO2 API CTL using the swagger
>>> definition we extracted from the AWS APIG.
>>> *Command: ./apictl init  --oas path/file_name.json*
>>>
>>> Then we can import the initialized API project to the WSO2 Developers
>>> portal as an API by using the following API CTL command.
>>> *Command: ./apictl import-api -f  -e 
>>> -k*
>>>
>>> This is how it can be done manually but our goal is to automate this
>>> process and allow users to extract API's they have created in the AWS APIG
>>> to the WSO2 Developers portal.
>>>
>>>
>>>
>>>
>>>
>>> --
>>> *Akshitha Dalpethado* | Intern | WSO2 Inc.
>>>
>>> (m) :0770284542 | Email : akshi...@wso2.com
>>>
>>> [image: http://wso2.com/signature] 
>>> ___
>>> Architecture mailing list
>>> Architecture@wso2.org
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>
>>
>> --
>> *Amila De Silva*
>> Software Architect | Associate Director, Engineering - WSO2 Inc.
>> (m) +94 775119302 | (e) ami...@wso2.com
>> 
>> ___
>> Architecture mailing list
>> Architecture@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>
>
> --
> *Akshitha Dalpethado* | Intern | WSO2 Inc.
>
> (m) :0770284542 | Email : akshi...@wso2.com
>
> [image: http://wso2.com/signature] 
>


-- 
*Akshitha Dalpethado* | Intern | WSO2 Inc.

(m) :0770284542 | Email : akshi...@wso2.com

[image: http://wso2.com/signature] 
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Harvesting API's from AWS API Gateway to the WSO2 developers portal

2020-08-10 Thread Akshitha Dalpethado (Intern)
Hi Amila,
That is correct


On Fri, Aug 7, 2020 at 10:30 AM Amila De Silva  wrote:

> Hi Akshitha,
> Is the ultimate plan to let developers export APIs directly from AWS API
> Gateway and import those to APIM only using apictl (like it's done for
> k8s)? The steps you've described are  for how it can be achieved right now
> (without any changes on apictl), isn't it?
>
>
> On Thu, Aug 6, 2020 at 1:40 PM Akshitha Dalpethado (Intern) <
> akshi...@wso2.com> wrote:
>
>> Basically what we are trying to achieve through this project is to give
>> our wso2 apim users the ability to extract API's created on AWS API Gateway
>> from a specific account to the WSO2 developers portal by extracting the
>> swagger definition of an API created in the AWS using the AWS Command Line
>> Interface (AWS CLI).
>>
>> First we will be requesting for the API's a user has created in the AWS
>> APIG which will return the API's created in the AWS APIG (from a specific
>> account) and their ID's and also we will be requesting for the API Stage
>> names which is also required to extract the swagger definition of a API
>> from AWS APIG using AWS CLI.
>>
>>
>> *Command01: aws apigateway get-rest-apisCommand02: aws apigateway
>> get-stages --rest-api-id Command03: aws apigateway get-export
>> --rest-api-id  --stage-name  --export-type swagger
>> /path/file_name.json*
>>
>> Then we initialize an API project using WSO2 API CTL using the swagger
>> definition we extracted from the AWS APIG.
>> *Command: ./apictl init  --oas path/file_name.json*
>>
>> Then we can import the initialized API project to the WSO2 Developers
>> portal as an API by using the following API CTL command.
>> *Command: ./apictl import-api -f  -e 
>> -k*
>>
>> This is how it can be done manually but our goal is to automate this
>> process and allow users to extract API's they have created in the AWS APIG
>> to the WSO2 Developers portal.
>>
>>
>>
>>
>>
>> --
>> *Akshitha Dalpethado* | Intern | WSO2 Inc.
>>
>> (m) :0770284542 | Email : akshi...@wso2.com
>>
>> [image: http://wso2.com/signature] 
>> ___
>> Architecture mailing list
>> Architecture@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>
>
> --
> *Amila De Silva*
> Software Architect | Associate Director, Engineering - WSO2 Inc.
> (m) +94 775119302 | (e) ami...@wso2.com
> 
> ___
> Architecture mailing list
> Architecture@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>


-- 
*Akshitha Dalpethado* | Intern | WSO2 Inc.

(m) :0770284542 | Email : akshi...@wso2.com

[image: http://wso2.com/signature] 
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Harvesting API's from AWS API Gateway to the WSO2 developers portal

2020-08-10 Thread Akshitha Dalpethado (Intern)
hi sorry for the delay
yes you are correct

On Fri, Aug 7, 2020 at 10:30 AM Amila De Silva  wrote:

> Hi Akshitha,
> Is the ultimate plan to let developers export APIs directly from AWS API
> Gateway and import those to APIM only using apictl (like it's done for
> k8s)? The steps you've described are  for how it can be achieved right now
> (without any changes on apictl), isn't it?
>
>
> On Thu, Aug 6, 2020 at 1:40 PM Akshitha Dalpethado (Intern) <
> akshi...@wso2.com> wrote:
>
>> Basically what we are trying to achieve through this project is to give
>> our wso2 apim users the ability to extract API's created on AWS API Gateway
>> from a specific account to the WSO2 developers portal by extracting the
>> swagger definition of an API created in the AWS using the AWS Command Line
>> Interface (AWS CLI).
>>
>> First we will be requesting for the API's a user has created in the AWS
>> APIG which will return the API's created in the AWS APIG (from a specific
>> account) and their ID's and also we will be requesting for the API Stage
>> names which is also required to extract the swagger definition of a API
>> from AWS APIG using AWS CLI.
>>
>>
>> *Command01: aws apigateway get-rest-apisCommand02: aws apigateway
>> get-stages --rest-api-id Command03: aws apigateway get-export
>> --rest-api-id  --stage-name  --export-type swagger
>> /path/file_name.json*
>>
>> Then we initialize an API project using WSO2 API CTL using the swagger
>> definition we extracted from the AWS APIG.
>> *Command: ./apictl init  --oas path/file_name.json*
>>
>> Then we can import the initialized API project to the WSO2 Developers
>> portal as an API by using the following API CTL command.
>> *Command: ./apictl import-api -f  -e 
>> -k*
>>
>> This is how it can be done manually but our goal is to automate this
>> process and allow users to extract API's they have created in the AWS APIG
>> to the WSO2 Developers portal.
>>
>>
>>
>>
>>
>> --
>> *Akshitha Dalpethado* | Intern | WSO2 Inc.
>>
>> (m) :0770284542 | Email : akshi...@wso2.com
>>
>> [image: http://wso2.com/signature] 
>> ___
>> Architecture mailing list
>> Architecture@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>
>
> --
> *Amila De Silva*
> Software Architect | Associate Director, Engineering - WSO2 Inc.
> (m) +94 775119302 | (e) ami...@wso2.com
> 
> ___
> Architecture mailing list
> Architecture@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>


-- 
*Akshitha Dalpethado* | Intern | WSO2 Inc.

(m) :0770284542 | Email : akshi...@wso2.com

[image: http://wso2.com/signature] 
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Harvesting API's from AWS API Gateway to the WSO2 developers portal

2020-08-07 Thread Nuwan Dias
The plan is to get the apictl to do this itself, using the aws cli
underneath. So for example, a command like below would export the Foo API
into the WSO2 dev portal from the AWS gateway's production stage.

:\> apictl aws import Foo --stage-name production

Thanks,
NuwanD.

On Fri, Aug 7, 2020 at 5:13 PM Uvindra Dias Jayasinha 
wrote:

> Hi Akshitha,
>
> Based on what you have said so far seems that this can easily be achieved
> by chaining these 5 commands together in a script. Cloud you give some
> details about the kind of automation you are trying to introduce with your
> project?
>
> On Thu, 6 Aug 2020 at 13:40, Akshitha Dalpethado (Intern) <
> akshi...@wso2.com> wrote:
>
>> Basically what we are trying to achieve through this project is to give
>> our wso2 apim users the ability to extract API's created on AWS API Gateway
>> from a specific account to the WSO2 developers portal by extracting the
>> swagger definition of an API created in the AWS using the AWS Command Line
>> Interface (AWS CLI).
>>
>> First we will be requesting for the API's a user has created in the AWS
>> APIG which will return the API's created in the AWS APIG (from a specific
>> account) and their ID's and also we will be requesting for the API Stage
>> names which is also required to extract the swagger definition of a API
>> from AWS APIG using AWS CLI.
>>
>>
>> *Command01: aws apigateway get-rest-apisCommand02: aws apigateway
>> get-stages --rest-api-id Command03: aws apigateway get-export
>> --rest-api-id  --stage-name  --export-type swagger
>> /path/file_name.json*
>>
>> Then we initialize an API project using WSO2 API CTL using the swagger
>> definition we extracted from the AWS APIG.
>> *Command: ./apictl init  --oas path/file_name.json*
>>
>> Then we can import the initialized API project to the WSO2 Developers
>> portal as an API by using the following API CTL command.
>> *Command: ./apictl import-api -f  -e 
>> -k*
>>
>> This is how it can be done manually but our goal is to automate this
>> process and allow users to extract API's they have created in the AWS APIG
>> to the WSO2 Developers portal.
>>
>>
>>
>>
>>
>> --
>> *Akshitha Dalpethado* | Intern | WSO2 Inc.
>>
>> (m) :0770284542 | Email : akshi...@wso2.com
>>
>> [image: http://wso2.com/signature] 
>> ___
>> Architecture mailing list
>> Architecture@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>
>
> --
> Regards,
> Uvindra
>
> Mobile: 33962
> ___
> Architecture mailing list
> Architecture@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>


-- 
*Nuwan Dias* | Senior Director | WSO2 Inc.
(m) +94 777 775 729 | (e) nuw...@wso2.com
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Harvesting API's from AWS API Gateway to the WSO2 developers portal

2020-08-07 Thread Uvindra Dias Jayasinha
Hi Akshitha,

Based on what you have said so far seems that this can easily be achieved
by chaining these 5 commands together in a script. Cloud you give some
details about the kind of automation you are trying to introduce with your
project?

On Thu, 6 Aug 2020 at 13:40, Akshitha Dalpethado (Intern) 
wrote:

> Basically what we are trying to achieve through this project is to give
> our wso2 apim users the ability to extract API's created on AWS API Gateway
> from a specific account to the WSO2 developers portal by extracting the
> swagger definition of an API created in the AWS using the AWS Command Line
> Interface (AWS CLI).
>
> First we will be requesting for the API's a user has created in the AWS
> APIG which will return the API's created in the AWS APIG (from a specific
> account) and their ID's and also we will be requesting for the API Stage
> names which is also required to extract the swagger definition of a API
> from AWS APIG using AWS CLI.
>
>
> *Command01: aws apigateway get-rest-apisCommand02: aws apigateway
> get-stages --rest-api-id Command03: aws apigateway get-export
> --rest-api-id  --stage-name  --export-type swagger
> /path/file_name.json*
>
> Then we initialize an API project using WSO2 API CTL using the swagger
> definition we extracted from the AWS APIG.
> *Command: ./apictl init  --oas path/file_name.json*
>
> Then we can import the initialized API project to the WSO2 Developers
> portal as an API by using the following API CTL command.
> *Command: ./apictl import-api -f  -e  -k*
>
> This is how it can be done manually but our goal is to automate this
> process and allow users to extract API's they have created in the AWS APIG
> to the WSO2 Developers portal.
>
>
>
>
>
> --
> *Akshitha Dalpethado* | Intern | WSO2 Inc.
>
> (m) :0770284542 | Email : akshi...@wso2.com
>
> [image: http://wso2.com/signature] 
> ___
> Architecture mailing list
> Architecture@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>


-- 
Regards,
Uvindra

Mobile: 33962
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Harvesting API's from AWS API Gateway to the WSO2 developers portal

2020-08-06 Thread Amila De Silva
Hi Akshitha,
Is the ultimate plan to let developers export APIs directly from AWS API
Gateway and import those to APIM only using apictl (like it's done for
k8s)? The steps you've described are  for how it can be achieved right now
(without any changes on apictl), isn't it?


On Thu, Aug 6, 2020 at 1:40 PM Akshitha Dalpethado (Intern) <
akshi...@wso2.com> wrote:

> Basically what we are trying to achieve through this project is to give
> our wso2 apim users the ability to extract API's created on AWS API Gateway
> from a specific account to the WSO2 developers portal by extracting the
> swagger definition of an API created in the AWS using the AWS Command Line
> Interface (AWS CLI).
>
> First we will be requesting for the API's a user has created in the AWS
> APIG which will return the API's created in the AWS APIG (from a specific
> account) and their ID's and also we will be requesting for the API Stage
> names which is also required to extract the swagger definition of a API
> from AWS APIG using AWS CLI.
>
>
> *Command01: aws apigateway get-rest-apisCommand02: aws apigateway
> get-stages --rest-api-id Command03: aws apigateway get-export
> --rest-api-id  --stage-name  --export-type swagger
> /path/file_name.json*
>
> Then we initialize an API project using WSO2 API CTL using the swagger
> definition we extracted from the AWS APIG.
> *Command: ./apictl init  --oas path/file_name.json*
>
> Then we can import the initialized API project to the WSO2 Developers
> portal as an API by using the following API CTL command.
> *Command: ./apictl import-api -f  -e  -k*
>
> This is how it can be done manually but our goal is to automate this
> process and allow users to extract API's they have created in the AWS APIG
> to the WSO2 Developers portal.
>
>
>
>
>
> --
> *Akshitha Dalpethado* | Intern | WSO2 Inc.
>
> (m) :0770284542 | Email : akshi...@wso2.com
>
> [image: http://wso2.com/signature] 
> ___
> Architecture mailing list
> Architecture@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>


-- 
*Amila De Silva*
Software Architect | Associate Director, Engineering - WSO2 Inc.
(m) +94 775119302 | (e) ami...@wso2.com

___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


[Architecture] Harvesting API's from AWS API Gateway to the WSO2 developers portal

2020-08-06 Thread Akshitha Dalpethado (Intern)
Basically what we are trying to achieve through this project is to give our
wso2 apim users the ability to extract API's created on AWS API Gateway
from a specific account to the WSO2 developers portal by extracting the
swagger definition of an API created in the AWS using the AWS Command Line
Interface (AWS CLI).

First we will be requesting for the API's a user has created in the AWS
APIG which will return the API's created in the AWS APIG (from a specific
account) and their ID's and also we will be requesting for the API Stage
names which is also required to extract the swagger definition of a API
from AWS APIG using AWS CLI.


*Command01: aws apigateway get-rest-apisCommand02: aws apigateway
get-stages --rest-api-id Command03: aws apigateway get-export
--rest-api-id  --stage-name  --export-type swagger
/path/file_name.json*

Then we initialize an API project using WSO2 API CTL using the swagger
definition we extracted from the AWS APIG.
*Command: ./apictl init  --oas path/file_name.json*

Then we can import the initialized API project to the WSO2 Developers
portal as an API by using the following API CTL command.
*Command: ./apictl import-api -f  -e  -k*

This is how it can be done manually but our goal is to automate this
process and allow users to extract API's they have created in the AWS APIG
to the WSO2 Developers portal.





-- 
*Akshitha Dalpethado* | Intern | WSO2 Inc.

(m) :0770284542 | Email : akshi...@wso2.com

[image: http://wso2.com/signature] 
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture