Noted On Tue, 13 Aug 2019, 4:12 am Ishara Cooray, <isha...@wso2.com> wrote:
> Hi Dushan, > > *'/tenants':* > > *#--------------------------------------------------------* > > * # Retrieve all active tenants* > > * #--------------------------------------------------------* > > *get:* > > * security:* > > - *OAuth2Security:* > > - [] > > *x-wso2-curl: *"" > > *x-wso2-request: *| > > GET https://localhost:9443/api/am/store/v1.0/tenants/active-tenats > > > Since you are providing the state as a query param your request should be ' > > *x-wso2-request: *| > > GET https://localhost:9443/api/am/store/v1.0/tenants/state=active > <https://localhost:9443/api/am/store/v1.0/tenants/active-tenats> > > > > > *#-----------------------------------------------------* > *# The Tenant resource* > *#-----------------------------------------------------* > *Tenant :** title: *Tenant > > *properties:* > * description:** type: *string > *domain: *tenant domain > *example: *"wso2.com" > > *status:** type: *string > *description: *current status of the tenant active/inactive > *example: *"active" > > > I would prefer '*name*' than '*description*' since we are returning here > the tenant domain. > > > Thanks & Regards, > Ishara Cooray > Associate Technical Lead > Mobile : +9477 262 9512 > WSO2, Inc. | http://wso2.com/ > Lean . Enterprise . Middleware > > > On Mon, Aug 12, 2019 at 7:52 PM Dushan Silva <dush...@wso2.com> wrote: > >> Hi all, >> As per above suggestions i have updated the swagger. I have added state >> as a query param. @Malintha Amarasinghe <malint...@wso2.com> I have set >> the state param required as false, so by default if no parameter is passed >> we can return the active tenants and if someone requires to do it he can >> pass the parameter? WDYT ? >> >> Additionally I have added *pagination *for Tenant List resource (which >> is an existing definition). >> >> *######################################################* >>> >>> *# The tenant resource APIs* >>> >>> *######################################################* >>> >>> *'/tenants':* >>> >>> *#--------------------------------------------------------* >>> >>> * # Retrieve all active tenants* >>> >>> * #--------------------------------------------------------* >>> >>> *get:* >>> >>> * security:* >>> >>> - *OAuth2Security:* >>> >>> - [] >>> >>> *x-wso2-curl: *"" >>> >>> *x-wso2-request: *| >>> >>> GET https://localhost:9443/api/am/store/v1.0/tenants/active-tenats >>> >>> Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 >>> >>> *x-wso2-response: *"" >>> >>> *summary: *| >>> >>> Get all active tenants names >>> >>> *description: *| >>> >>> This operation is to retrieve all active tenants >>> >>> *parameters:* >>> >>> - *name: *state >>> >>> *description: *| >>> >>> The state represents the current state of the tenant >>> >>> >>> Supported states are [ active, inactive] >>> >>> >>> *in: *query >>> >>> *type: *string >>> >>> *required: *false >>> >>> *enum:* >>> >>> - active >>> >>> - inactive >>> >>> *tags:* >>> >>> - active tenants >>> >>> *responses:* >>> >>> * 200:* >>> >>> * description: *| >>> >>> OK. >>> >>> Tenant names returned. >>> >>> *headers:* >>> >>> * Content-Type:* >>> >>> * description: *| >>> >>> The content type of the body. >>> >>> *type: *string >>> >>> *schema:* >>> >>> * type: *'#/definitions/TenantList' >>> >>> *404:* >>> >>> * description: *| >>> >>> Not Found. >>> >>> Requested application does not exist. >>> >>> *schema:* >>> >>> * $ref: *'#/definitions/Error' >>> >>> *406:* >>> >>> * description: *| >>> >>> Not Acceptable. >>> >>> The requested media type is not supported >>> >>> *schema:* >>> >>> * $ref: *'#/definitions/Error' >>> >> >> >>> *#-----------------------------------------------------* >>> *# The Tenant resource* >>> *#-----------------------------------------------------* >>> *Tenant :** title: *Tenant >>> >>> *properties:* >>> * description:** type: *string >>> *domain: *tenant domain >>> *example: *"wso2.com" >>> >>> *status:** type: *string >>> *description: *current status of the tenant active/inactive >>> *example: *"active" >>> >>> >>> *#-----------------------------------------------------* >>> *# The Tenant List resource* >>> *#-----------------------------------------------------* >>> *TenantList :** title: *Tenant list >>> >>> *properties:* >>> * count:** type: *integer >>> *description: *| >>> Number of tenants returned. >>> *example: *1 >>> >>> *list:** type: *array >>> >>> *items:** $ref: *'#/definitions/Tenant' >>> >>> *pagination:** $ref: *'#/definitions/Pagination' >> >> >> >> Thanks >> >> On Mon, Aug 12, 2019 at 6:59 PM Malintha Amarasinghe <malint...@wso2.com> >> wrote: >> >>> As Sanjeewa pointed out, I also think we should support pagination >>> related parameters; eg: "count", "limit", "offset", "next", "previous", >>> "total"; where the total is the number of total "active" tenants in the >>> system. >>> >>> >>> On Mon, Aug 12, 2019 at 6:54 PM Malintha Amarasinghe <malint...@wso2.com> >>> wrote: >>> >>>> >>>> >>>> On Mon, Aug 12, 2019 at 6:38 PM Malintha Amarasinghe < >>>> malint...@wso2.com> wrote: >>>> >>>>> >>>>> >>>>> On Mon, Aug 12, 2019 at 6:17 PM Nuwan Dias <nuw...@wso2.com> wrote: >>>>> >>>>>> Ideally we would need to support getting all tenants. But for now I >>>>>> think its ok to support the active state only. Using the query param to >>>>>> pass in the state gives us the flexibility to support other (inactive) >>>>>> states in the future. >>>>>> >>>>>> I also think at this moment we do not need to support retrieving >>>>> inactive tenants. We can think of state = "active" as default and simply >>>>> omit the active param (i.e: I think we do not even need to support state >>>>> param unless we support inactive tenants because the only state we support >>>>> is "active"). Then GET /tenants will give all the active tenants. >>>>> >>>>> >>>>>> Regarding the other tenant specific APIs, I don't see a need to >>>>>> support them right now unless we have a business requirement to do so. >>>>>> >>>>> +1 >>>>> >>>>> >>>>>> On Mon, Aug 12, 2019 at 6:05 PM Dushan Silva <dush...@wso2.com> >>>>>> wrote: >>>>>> >>>>>>> Hi all, >>>>>>> >>>>>>> *Few clarifications* >>>>>>> We decide to write this rest endpoint to retrieve active-tenants, In >>>>>>> addition to this is there a requirement where we would need to get >>>>>>> inactive >>>>>>> tenants ? >>>>>>> >>>>>>> what @Thilini Shanika <thili...@wso2.com> said makes senses its >>>>>>> better if we can retrieve some important information such as tenantId, >>>>>>> domain.. anything else that we should return may seem significant for >>>>>>> this >>>>>>> api? >>>>>>> >>>>>> tenantId and tenantDomain would be the most needed ones. >>>>> >>>>> Sorry, ignore the above comment "tenantId and tenantDomain would be >>>> the most needed ones.". >>>> tenantId is an auto-incremented ID so I don't think we should expose >>>> this as it would expose the number of total tenants in the system. And, at >>>> the store, we only need tenantDomain. I think it would be enough to list >>>> only the tenantDomain. WDYT? >>>> We can add "status" : "active" at each tenant object level to >>>> explicitly say the tenant is active. >>>> >>>> >>>> >>>>> >>>>>>> On the other hand would we need to add few more tenant specific >>>>>>> APIs such as getting all tenant details, getting tenant by tenantId >>>>>>> etc ? >>>>>>> currently we only needed to get the active tenants for UI purposes. >>>>>>> WDYT @Nuwan >>>>>>> Dias <nuw...@wso2.com> @Sanjeewa Malalgoda <sanje...@wso2.com> >>>>>>> >>>>>>> Thanks >>>>>>> >>>>>>> On Mon, Aug 12, 2019 at 5:46 PM Dushan Silva <dush...@wso2.com> >>>>>>> wrote: >>>>>>> >>>>>>>> adding architecture >>>>>>>> >>>>>>>> On Mon, Aug 12, 2019 at 5:34 PM Sanjeewa Malalgoda < >>>>>>>> sanje...@wso2.com> wrote: >>>>>>>> >>>>>>>>> Yes, Nuwan is correct here. State is filter criteria and using >>>>>>>>> query parameters is recommended. Also when we fetching this sort of >>>>>>>>> resources its always good to have a way to limit and paginate number >>>>>>>>> of >>>>>>>>> results return. >>>>>>>>> @Everyone i can see many team mates need to update API and >>>>>>>>> add/modify resources. In that case schedule meeting and discuss about >>>>>>>>> all >>>>>>>>> resource is good IMO. >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> sanjeewa. >>>>>>>>> >>>>>>>>> On Mon, Aug 12, 2019 at 5:26 PM Nuwan Dias <nuw...@wso2.com> >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> We have to discuss this publicly guys. >>>>>>>>>> >>>>>>>>>> Shouldn't this be /tenants?state=active? >>>>>>>>>> >>>>>>>>>> On Mon, Aug 12, 2019 at 5:19 PM Dushan Silva <dush...@wso2.com> >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> Hi all, >>>>>>>>>>> We are planning to add a REST API endpoint to APIM 3.0 Store >>>>>>>>>>> REST API to get all the tenant active tenant domains. Shown below >>>>>>>>>>> is the >>>>>>>>>>> swagger related to the new rest api. >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> *####################################################### The >>>>>>>>>>>> tenant resource >>>>>>>>>>>> APIs######################################################'/tenants/active-tenants': >>>>>>>>>>>> #-------------------------------------------------------- # >>>>>>>>>>>> Retrieve all >>>>>>>>>>>> active tenants >>>>>>>>>>>> #-------------------------------------------------------- >>>>>>>>>>>> get: security: - OAuth2Security: - [] summary: >>>>>>>>>>>> | >>>>>>>>>>>> Get all active tenants names description: | This operation >>>>>>>>>>>> is to >>>>>>>>>>>> retrieve all active tenants tags: - active tenants >>>>>>>>>>>> responses: >>>>>>>>>>>> 200: description: | OK. Tenant names >>>>>>>>>>>> returned. >>>>>>>>>>>> headers: Content-Type: description: | >>>>>>>>>>>> The content type of the body. type: string >>>>>>>>>>>> schema: >>>>>>>>>>>> type: '#/definitions/TenantList' 404: description: >>>>>>>>>>>> | >>>>>>>>>>>> Not Found. Requested application does not exist. >>>>>>>>>>>> schema: >>>>>>>>>>>> $ref: '#/definitions/Error' 406: description: | >>>>>>>>>>>> Not Acceptable. The requested media type is not >>>>>>>>>>>> supported >>>>>>>>>>>> schema: $ref: '#/definitions/Error'* >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> *#-----------------------------------------------------# The >>>>>>>>>>>> Tenant List >>>>>>>>>>>> resource#----------------------------------------------------- >>>>>>>>>>>> TenantList : title: Tenant list properties: count: >>>>>>>>>>>> type: >>>>>>>>>>>> integer description: | Number of tenants returned. >>>>>>>>>>>> example: 1 list: type: array items: >>>>>>>>>>>> type: >>>>>>>>>>>> string* >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> I have decided to use the resource as >>>>>>>>>>> */tenants/active-tenants. * >>>>>>>>>>> >>>>>>>>>>> */**tenants *was used at the start of the path as if we are >>>>>>>>>>> planning on adding any other tenant specific rest apis we can keep >>>>>>>>>>> using >>>>>>>>>>> this path. >>>>>>>>>>> >>>>>>>>>>> Any input for this is highly appreciated. >>>>>>>>>>> >>>>>>>>>>> Thanks >>>>>>>>>>> >>>>>>>>>>> Best Regards >>>>>>>>>>> Dushan Silva >>>>>>>>>>> Software Engineer >>>>>>>>>>> >>>>>>>>>>> *WSO2, Inc. * >>>>>>>>>>> >>>>>>>>>>> lean . enterprise . middleware >>>>>>>>>>> Mob: +94 774 979042 >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> *Nuwan Dias* | Director | WSO2 Inc. >>>>>>>>>> (m) +94 777 775 729 | (e) nuw...@wso2.com >>>>>>>>>> [image: Signature.jpg] >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> *Sanjeewa Malalgoda* >>>>>>>>> Software Architect | Associate Director, Engineering - WSO2 Inc. >>>>>>>>> (m) +94 712933253 | (e) sanje...@wso2.com | (b) Blogger >>>>>>>>> <http://sanjeewamalalgoda.blogspot.com>, Medium >>>>>>>>> <https://medium.com/@sanjeewa190> >>>>>>>>> >>>>>>>>> GET INTEGRATION AGILE <https://wso2.com/signature> >>>>>>>>> Integration Agility for Digitally Driven Business >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Best Regards >>>>>>>> Dushan Silva >>>>>>>> Software Engineer >>>>>>>> >>>>>>>> *WSO2, Inc. * >>>>>>>> >>>>>>>> lean . enterprise . middleware >>>>>>>> Mob: +94 774 979042 >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Best Regards >>>>>>> Dushan Silva >>>>>>> Software Engineer >>>>>>> >>>>>>> *WSO2, Inc. * >>>>>>> >>>>>>> lean . enterprise . middleware >>>>>>> Mob: +94 774 979042 >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> *Nuwan Dias* | Director | WSO2 Inc. >>>>>> (m) +94 777 775 729 | (e) nuw...@wso2.com >>>>>> [image: Signature.jpg] >>>>>> >>>>> >>>>> >>>>> -- >>>>> Malintha Amarasinghe >>>>> *WSO2, Inc. - lean | enterprise | middleware* >>>>> http://wso2.com/ >>>>> >>>>> Mobile : +94 712383306 >>>>> >>>> >>>> >>>> -- >>>> Malintha Amarasinghe >>>> *WSO2, Inc. - lean | enterprise | middleware* >>>> http://wso2.com/ >>>> >>>> Mobile : +94 712383306 >>>> >>> >>> >>> -- >>> Malintha Amarasinghe >>> *WSO2, Inc. - lean | enterprise | middleware* >>> http://wso2.com/ >>> >>> Mobile : +94 712383306 >>> >> >> >> -- >> Best Regards >> Dushan Silva >> Software Engineer >> >> *WSO2, Inc. * >> >> lean . enterprise . middleware >> Mob: +94 774 979042 >> _______________________________________________ >> Architecture mailing list >> Architecture@wso2.org >> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >> >
_______________________________________________ Architecture mailing list Architecture@wso2.org https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture