Hi Ambujaa,

As Dushani has mentioned you can find the tenant ID from the AM_SUBSCRIBER
table. You could do this by joining the AM_APPLICATION and AM_SUBSCRIBER
table and get the tenant ID.

Thanks & Regards,
Mushthaq

On Mon, Oct 1, 2018 at 1:43 PM Dushani Wellappili <[email protected]> wrote:

> Hi Ambujaa,
>
> If I understood correctly, your requirement is to find the tenant id of
> each application owner for the applications in AM_APPLICATION table. You
> could be able to use the SUBSCRIBER_ID in AM_APPLICATION table, it is the
> subscriber id of the application owner. Here the SUBSCRIBER_ID is the
> primary key of AM_SUBSCRIBER table. From AM_SUBSCRIBER table you could find
> the TENANT_ID of that application owner.
>
> Thanks
>
> *Dushani Wellappili*
> Software Engineer - WSO2
>
> Email : [email protected]
> Mobile : +94779367571
> Web : https://wso2.com/
>
>
>
>
> On Mon, Oct 1, 2018 at 11:55 AM Ambujaa Satchithananthan <[email protected]>
> wrote:
>
>> @WSO2 Engineering Group <[email protected]>
>>
>> On Mon, Oct 1, 2018 at 10:55 AM Ambujaa Satchithananthan <
>> [email protected]> wrote:
>>
>>>
>>> Hi,
>>>
>>> Currently, I am working on creating an admin UI for changing ownership
>>> of an application for APIM. For that, I have to create two jaggery APIs one
>>> to change the owner of an application by the user and the other to retrieve
>>> all the applications for each tenant domain. AM_APPLICATION table in
>>> WSO@AM_DB database does not have a separate field like tenant_Id to
>>> store the entries of tenant domains.
>>> It only has application_Id, name, subscriber_id, application_tier,
>>> callback_url, description, application_status, group_id, created_by,
>>> created_time, updated_by, updated_time, uuid and token_id. When a user
>>> login through a tenant domain the relevant applications for that particular
>>> domain should be only displayed. Here I couldn't retrieve application_ids
>>> by tenant_domain. When users login in an API store of a tenant, usernames
>>> with tenant domain get stored in created_by filed.
>>>
>>> Can you please suggest me a method to overcome this?
>>>
>>>
>>>
>>> +----------------+--------------------+---------------+------------------+--------------+-------------+--------------------+----------+---------------+---------------------+------------+---------------------+--------------------------------------+------------+
>>>
>>> | APPLICATION_ID | NAME               | SUBSCRIBER_ID |
>>> APPLICATION_TIER | CALLBACK_URL | DESCRIPTION | APPLICATION_STATUS |
>>> GROUP_ID | CREATED_BY    | CREATED_TIME        | UPDATED_BY |
>>> UPDATED_TIME        | UUID                                 | TOKEN_TYPE
>>> |
>>>
>>>
>>> +----------------+--------------------+---------------+------------------+--------------+-------------+--------------------+----------+---------------+---------------------+------------+---------------------+--------------------------------------+------------+
>>>
>>> |              4 | DefaultApplication |             4 | Unlimited
>>>   | NULL         | NULL        | APPROVED           |          |
>>> [email protected] | 2018-10-01 10:34:13 | NULL       | 2018-10-01 10:34:13
>>> | 89570a3c-f83d-409c-b48a-92ded8662811 | DEFAULT    |
>>>
>>> |              5 | DefaultApplication |             5 | Unlimited
>>>   | NULL         | NULL        | APPROVED           |          |
>>> [email protected] | 2018-10-01 10:34:52 | NULL       | 2018-10-01 10:34:52
>>> | 894d04bb-33c0-4f34-ad95-deea0e5ad76c | DEFAULT    |
>>>
>>>
>>> +----------------+--------------------+---------------+------------------+--------------+-------------+--------------------+----------+---------------+---------------------+------------+---------------------+--------------------------------------+------------+
>>>
>>> 2 rows in set (0.00 sec)
>>>
>>> Thank you.
>>> --
>>> Ambujaa Satchithananthan
>>> Associate Software Engineer | WSO2
>>>
>>> Email: [email protected]
>>> Mobile: +94768462473
>>> Web: http://Wso2.com
>>>
>>>
>>>
>>>
>>
>> --
>> Ambujaa Satchithananthan
>> Associate Software Engineer | WSO2
>>
>> Email: [email protected]
>> Mobile: +94768462473
>> Web: http://Wso2.com
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "WSO2 Engineering Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/a/wso2.com/d/optout.
>>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


-- 
Mushthaq Rumy
*Senior Software Engineer*
Mobile : +94 (0) 779 492140
Email : [email protected]
WSO2, Inc.; http://wso2.com/
lean . enterprise . middleware.

<http://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to