Hi Udara,

A good point! Yes we have included all the elements in the application
hierarchy in the application runtime API method response.

However I still believe it would be better to have a separate API resource
to query the clusters.

Thanks

On Thu, Mar 19, 2015 at 4:46 PM, Udara Liyanage <ud...@wso2.com> wrote:

> Hi Imesh,
>
> I just tried Application/runtime . There all the members are listed.
>
> curl -X GET -H "Content-Type: application/json" -k  -u admin:admin
> https://localhost:9443/api/applications/single-cartridge-app/runtime |
> python -m json.tool
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time
>  Current
>                                  Dload  Upload   Total   Spent    Left
>  Speed
> 100  2181    0  2181    0     0  38082      0 --:--:-- --:--:-- --:--:--
> 38263
> {
>     "applicationInstances": [
>         {
>             "applicationId": "single-cartridge-app",
>             "clusterInstances": [
>                 {
>                     "alias": "my-php",
>                     "clusterId": "single-cartridge-app.my-php.php.domain",
>                     "hostNames": [
>                         "single-cartridge-app.my-php.php.stratos.org"
>                     ],
>                     "instanceId": "single-cartridge-app-1",
>                     "member": [
>                         {
>                             "clusterId":
> "single-cartridge-app.my-php.php.domain",
>                             "defaultPrivateIP": "10.0.0.4",
>                             "defaultPublicIP": "20.0.0.3",
>                             "memberId":
> "single-cartridge-app.my-php.php.domain949d1ac4-fd59-4e08-95a7-34702ea0aa18",
>                             "memberPrivateIPs": "10.0.0.4",
>                             "memberPublicIPs": "20.0.0.3",
>                             "networkPartitionId": "network-partition-1",
>                             "partitionId": "partition-1",
>                             "ports": [
>                                 {
>                                     "port": 22,
>                                     "protocol": "tcp",
>                                     "proxyPort": 8222
>                                 },
>                                 {
>                                     "port": 80,
>                                     "protocol": "http",
>                                     "proxyPort": 8280
>                                 }
>                             ],
>                             "property": [
>                                 {
>                                     "name": "PRIMARY",
>                                     "value": false
>                                 },
>                                 {
>                                     "name": "MIN_COUNT",
>                                     "value": 3
>                                 }
>                             ],
>                             "serviceName": "php",
>                             "status": "Active"
>                         },
>                         {
>                             "clusterId":
> "single-cartridge-app.my-php.php.domain",
>                             "defaultPrivateIP": "10.0.0.5",
>                             "defaultPublicIP": "20.0.0.4",
>                             "memberId":
> "single-cartridge-app.my-php.php.domain7f72f5b2-92df-4cb7-afbe-4c163b586d82",
>                             "memberPrivateIPs": "10.0.0.5",
>                             "memberPublicIPs": "20.0.0.4",
>                             "networkPartitionId": "network-partition-1",
>                             "partitionId": "partition-1",
>                             "ports": [
>                                 {
>                                     "port": 22,
>                                     "protocol": "tcp",
>                                     "proxyPort": 8222
>                                 },
>                                 {
>                                     "port": 80,
>                                     "protocol": "http",
>                                     "proxyPort": 8280
>                                 }
>                             ],
>                             "property": [
>                                 {
>                                     "name": "PRIMARY",
>                                     "value": false
>                                 },
>                                 {
>                                     "name": "MIN_COUNT",
>                                     "value": 3
>                                 }
>                             ],
>                             "serviceName": "php",
>                             "status": "Active"
>                         },
>                         {
>                             "clusterId":
> "single-cartridge-app.my-php.php.domain",
>                             "defaultPrivateIP": "10.0.0.6",
>                             "defaultPublicIP": "20.0.0.5",
>                             "memberId":
> "single-cartridge-app.my-php.php.domain1406197c-4dd7-47b0-9317-44589ee791eb",
>                             "memberPrivateIPs": "10.0.0.6",
>                             "memberPublicIPs": "20.0.0.5",
>                             "networkPartitionId": "network-partition-1",
>                             "partitionId": "partition-1",
>                             "ports": [
>                                 {
>                                     "port": 22,
>                                     "protocol": "tcp",
>                                     "proxyPort": 8222
>                                 },
>                                 {
>                                     "port": 80,
>                                     "protocol": "http",
>                                     "proxyPort": 8280
>                                 }
>                             ],
>                             "property": [
>                                 {
>                                     "name": "PRIMARY",
>                                     "value": false
>                                 },
>                                 {
>                                     "name": "MIN_COUNT",
>                                     "value": 3
>                                 }
>                             ],
>                             "serviceName": "php",
>                             "status": "Active"
>                         }
>                     ],
>                     "parentInstanceId": "single-cartridge-app-1",
>                     "serviceName": "php",
>                     "status": "Active",
>                     "tenantRange": "*"
>                 }
>             ],
>             "instanceId": "single-cartridge-app-1",
>             "status": "Active"
>         }
>     ],
>     "id": "single-cartridge-app",
>     "status": "Active",
>     "tenantAdminUsername": "admin",
>     "tenantDomain": "carbon.super"
> }
>
>
> On Thu, Mar 19, 2015 at 12:20 AM, Imesh Gunaratne <im...@apache.org>
> wrote:
>
>> Hi Udara,
>>
>> You have a point! However IMO cluster is a global level entity that's why
>> I did not want to use the application id to read a cluster.
>>
>> Even though the clusters are created per application, in the topology
>> clusters are listed at Topology -> Services -> Clusters. Therefore I would
>> prefer to have cluster resource URL as /api/clusters.
>>
>> Thanks
>>
>> On Wed, Mar 18, 2015 at 10:51 AM, Udara Liyanage <ud...@wso2.com> wrote:
>>
>>> Hi Imesh,
>>>
>>> Should n't we add the application id too to the API? . This is because
>>> cluster id is local to the application, even cluster id is unique it would
>>> have to traverse all the applications to fetch the cluster id
>>>
>>> *Modified API*
>>>  GET application/{applicationId}/clusters/{clusterId}
>>>
>>> On Tue, Mar 17, 2015 at 11:07 AM, Imesh Gunaratne <im...@apache.org>
>>> wrote:
>>>
>>>> Hi Isuru,
>>>>
>>>> I think we already have two api methods to get the application details:
>>>>
>>>> [1] GET /applications/{applicationId}
>>>> [2] GET /applications/{applicationId}/runtime
>>>>
>>>> The second API method would give us the cluster Ids of the given
>>>> application. Then the user could invoke a new API method to get the cluster
>>>> details:
>>>>
>>>> [3] GET /clusters/{clusterId}
>>>>
>>>> Thanks
>>>>
>>>> On Tue, Mar 17, 2015 at 10:12 AM, Isuru Haththotuwa <isu...@apache.org>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Since Stratos 4.1 is based on the Application model, shall we provide
>>>>> an API to list the details (instances) of an application? Or do we still
>>>>> need to list individual cluster instances?
>>>>>
>>>>> On Tue, Mar 17, 2015 at 9:59 AM, Imesh Gunaratne <im...@apache.org>
>>>>> wrote:
>>>>>
>>>>>> Hi Shaheed,
>>>>>>
>>>>>> Thanks for pointing this! Yes in 4.1.0 API we do not have a method to
>>>>>> query instances of a cluster. I think we need to add it. @Devs: Anyone
>>>>>> would like to contribute to this?
>>>>>>
>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> On Tue, Mar 17, 2015 at 4:59 AM, Shaheedur Haque (shahhaqu) <
>>>>>> shahh...@cisco.com> wrote:
>>>>>>
>>>>>>>  Hi,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> In Stratos 4.0.0, I could get a list of instances running against a
>>>>>>> subscription with a REST call like this:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 'GET', '/stratos/admin/cluster/clusterId/{}'.format(cluster)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> However, in 4.1.0, the commands describe-application and describe
>>>>>>> application-runtime equate to:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 'GET', 'applications/{}'.format(subscription)
>>>>>>>
>>>>>>> #
>>>>>>>
>>>>>>> # The reply looks like this:
>>>>>>>
>>>>>>> #
>>>>>>>
>>>>>>> # {u'status': u'Deployed', u'alias': u'cartridge-proxy',
>>>>>>> u'multiTenant': False, u'applicationId': u'cartridge-proxy', 
>>>>>>> u'components':
>>>>>>> {...}}
>>>>>>>
>>>>>>> #
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> And
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 'GET', 'applications/{}/runtime'.format(application)
>>>>>>>
>>>>>>> #
>>>>>>>
>>>>>>> # The reply looks like this:
>>>>>>>
>>>>>>> #
>>>>>>>
>>>>>>> # {u'status': u'Active', u'multiTenant': False}
>>>>>>>
>>>>>>> #
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Is there some other way to list the instances?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Thanks, Shaheed
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Imesh Gunaratne
>>>>>>
>>>>>> Technical Lead, WSO2
>>>>>> Committer & PMC Member, Apache Stratos
>>>>>>
>>>>>> --
>>>>>> Thanks and Regards,
>>>>>>
>>>>>> Isuru H.
>>>>>> +94 716 358 048* <http://wso2.com/>*
>>>>>>
>>>>>>
>>>>>> * <http://wso2.com/>*
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Technical Lead, WSO2
>>>> Committer & PMC Member, Apache Stratos
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> Udara Liyanage
>>> Software Engineer
>>> WSO2, Inc.: http://wso2.com
>>> lean. enterprise. middleware
>>>
>>> web: http://udaraliyanage.wordpress.com
>>> phone: +94 71 443 6897
>>>
>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>
>
> --
>
> Udara Liyanage
> Software Engineer
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Reply via email to