stratos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nirmal Fernando <nirmal070...@gmail.com>
Subject Re: Re-designing Stratos REST API
Date Mon, 06 Oct 2014 01:59:19 GMT
Hi Dakshika,

On Sun, Oct 5, 2014 at 11:27 PM, Dakshika Jayathilaka <dakshika@wso2.com>
wrote:

> Hi,
>
> I think we need to think about return status code and content properly.
> current return values having different approaches on different end points.
>

Thanks for bringing this up. I agree, we should clean REST API responses
too.

>
> ex:
>
> 1. GET /partition empty state return *{"partition" : []}*  and GET
> /policy/deployment empty state return *null*
>
> WDYT?
>

So, what do you prefer ? I prefer option 1 -  *{"partition" : []}*

>
> Regards,
>
> *Dakshika Jayathilaka*
> Software Engineer
> WSO2, Inc.
> lean.enterprise.middleware
> 0771100911
>
> On Sun, Oct 5, 2014 at 9:06 PM, Udara Liyanage <udara@wso2.com> wrote:
>
>> +1 for refactoring, some paths does not adhere to REST best practices
>>
>> On Sun, Oct 5, 2014 at 8:54 PM, Nirmal Fernando <nirmal070125@gmail.com>
>> wrote:
>>
>>> Hi Guys,
>>>
>>> As discussed previously, I've been going through all the API operations
>>> exposed via Stratos REST API and identified following set of APIs need to
>>> be refactored to have a RESTful design. While doing this, I've also
>>> identified sub-APIs that we have provided (under Entity column) and I
>>> suggest we could introduce sub-API classes as it makes the StratosAdmin
>>> class more readable.
>>>
>>> There're 40+ API operations ([?]), hence there could be places that I've
>>> not suggested proper refactoring. Please go through the list and provide
>>> improvements/comments, we can discuss/argue, then conclude and build a
>>> clean API for Stratos.
>>>
>>> IMO we also need to place a review process when adding a new API, it
>>> could save lot of time spending on cleaning things up. I propose, API
>>> introducer should initiate a discuss thread and a vote before committing
>>> them to the repository.
>>>
>>> I'll keep this thread open for 48hrs for comments and/or improvements.
>>>
>>> EntityHTTP OperationAPI Operation Name -> Suggested NameRequest PathProposed
>>> PathCartridgePOSTdeployCartridgeDefinition/cartridge/definition/
>>> /cartridgesDELETEunDeployCartridgeDefinition
>>> /cartridge/definition/{cartridgeType}/cartridges/{cartridgeType}GETgetValidDeploymentPolicies
>>> -> getValidDeploymentPoliciesOfCartridge
>>> {cartridgeType}/policy/deployment
>>> /cartridges/{cartridgeType}/deploymentPolicyGETgetAvailableMultiTenantCartridges
>>> -> getMultiTenantCartridges/cartridge/tenanted/list
>>> /cartridges/multiTenantGETgetAvailableSingleTenantCartridges ->
>>> getSingleTenantCartridges/cartridge/list/cartridges/singleTenantGETgetAvailableCartridges
>>> -> getCartridges/cartridge/available/list/cartridgesGETgetAvailableSingleTenantCartridgeInfo
>>> -> getAvailableSingleTenantCartridge
>>> /cartridge/available/info/{cartridgeType}
>>> /cartridges/{cartridgeType}/singleTenantGETgetAvailableLbCartridges
>>> /cartridge/lb/cartridges/loadBalancerPartitionPOSTdeployPartition
>>> /policy/deployment/partition/partitionsGETgetPartitions/partition
>>> /partitionsGETgetPartition/partition/{partitionId}
>>> /partitions/{partitionId}Autoscaling PolicyPOST
>>> deployAutoscalingPolicyDefintion/policy/autoscale/autoscalePoliciesGETgetAutoscalePolicies
>>> -> getAutoscalingPolicies/policy/autoscale/autoscalePoliciesGETgetAutoscalePolicies
>>> -> getAutoscalingPolicy/policy/autoscale/{autoscalePolicyId}
>>> /autoscalePolicies/{autoscalePolicyId}Deployment PolicyPOST
>>> deployDeploymentPolicyDefinition/policy/deployment/deploymentPoliciesGET
>>> getDeploymentPolicies/policy/deployment/deploymentPoliciesGETgetDeploymentPolicies
>>> -> getDeploymentPolicy/policy/deployment/{deploymentPolicyId}
>>> /deploymentPolicies/{deploymentPolicyId}Partition GroupGET
>>> getPartitionGroups/partition/group/{deploymentPolicyId}
>>> /deploymentPolicies/{deploymentPolicyId}/partitionGroupGETgetPartitions
>>> -> getPartitionGroup/partition/{deploymentPolicyId}/{partitionGroupId}
>>> /deploymentPolicies/{deploymentPolicyId}/partitionGroup/{partitionGroupId}
>>> GETgetPartitionsOfPolicy/partition/{deploymentPolicyId}
>>> /deploymentPolicies/{deploymentPolicyId}/partitionSubscriptionsGET
>>> getSubscribedCartridges/cartridge/list/subscribed
>>> /subscriptions/cartridgesGETgetSubscribedCartridgesForServiceGroup ->
>>> getSubscribedCartridgesOfServiceGroup
>>> /cartridge/list/subscribed/group/{serviceGroup}
>>> /subscriptions/cartridges/groups/{serviceGroup}GETgetCartridgeInfo ->
>>> getSubscribedCartridgeInfo/cartridge/info/{subscriptionAlias}
>>> /subscriptions/{subscriptionAlias}/cartridgesGETgetActiveInstances ->
>>> getActiveMembersCountOfSubscription
>>> /cartridge/active/{cartridgeType}/{subscriptionAlias}
>>> /subscriptions/{subscriptionAlias}/cartridges/{cartridgeType}/activePOST
>>> subscribe/cartridge/subscribe/subscriptionsDELETEunsubscribe
>>> /cartridge/unsubscribe/subscriptions/{subscriptionAlias}POST
>>> addSubscriptionDomains
>>> /cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domains
>>> /subscriptions/{subscriptionAlias}/domainsGETgetSubscriptionDomains
>>> /cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domains
>>> /subscriptions/{subscriptionAlias}/domainsGETgetSubscriptionDomain
>>> /cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domains/{domainName}
>>> /subscriptions/{subscriptionAlias}/domains/{domainName}DELETE
>>> removeSubscriptionDomain
>>> /cartridge/{cartridgeType}/subscription/{subscriptionAlias}/domains/{domainName}
>>> /subscriptions/{subscriptionAlias}/domains/{domainName}ClustersGETgetClustersForTenant
>>> -> getClustersOfTenant/cluster//clustersGETgetClusters ->
>>> getClustersOfCartridge/cluster/{cartridgeType}//clusters/{cartridgeType}
>>> GETgetServiceClusters (This seems to do the same job as getClusters - I
>>> suggest we deprecate this.)GETgetCluster -> getClusterOfSubscription
>>> /cluster/{cartridgeType}/{subscriptionAlias}
>>> /clusters/{subscriptionAlias}GETgetCluster/cluster/clusterId/{clusterId}
>>> /clusters/{clusterId}GETgetLoadBalancerCluster
>>> /cartridge/{cartridgeType}/subscription/{subscriptionAlias}/load-balancer-cluster
>>> /clusters/{subscriptionAlias}/loadBalancerTenantsGETretrieveTenants
>>> /tenant/list/tenants/list(All paths will be refactored to start from
>>> /tenants )Services POSTdeployService/service/definition/servicesDELETE
>>> unDeployService/service/definition/{serviceType}/services/{serviceType}(All
>>> paths will be refactored to start from /services )GIT RepositoriesPOSTgetRepoNotification
>>> -> notifyRepository/reponotification/repo/notifyPOSTsynchronizeRepository
>>> -> synchronizeRepositoryOfSubscription/cartridge/sync
>>> /repo/synchronize/{subscriptionAlias}UsersGETretrieveUsers/user/list
>>> /usersKubernetes HostsPOSTdeployKubernetesGroup ->
>>> deployKubernetesHostCluster/kubernetes/deploy/group/kubernetesClusterPUT
>>> deployKubernetesHost/kubernetes/deploy/host/{kubernetesGroupId}
>>> /kubernetesCluster/{kubernetesClusterId}/minionPUTupdateKubernetesMaster
>>> /kubernetes/update/master/kubernetesCluster/{kubernetesClusterId}/master
>>> PATCHupdateKubernetesHost/kubernetes/update/host
>>> /kubernetesCluster/{kubernetesClusterId}/minion/{minionId}GETgetKubernetesGroups
>>> -> getKubernetesHostClusters/kubernetes/group/kubernetesClusterGETgetKubernetesGroup
>>> -> getKubernetesHostCluster/kubernetes/group/{kubernetesGroupId}
>>> /kubernetesCluster/{kubernetesClusterId}GETgetKubernetesHosts ->
>>> getKubernetesHostsOfKubernetesCluster
>>> /kubernetes/hosts/{kubernetesGroupId}
>>> /kubernetesCluster/{kubernetesClusterId}/hostsGETgetKubernetesMaster ->
>>> getKubernetesMasterOfKubernetesCluster
>>> /kubernetes/master/{kubernetesGroupId}
>>> /kubernetesCluster/{kubernetesClusterId}/masterDELETEunDeployKubernetesGroup
>>> -> unDeployKubernetesHostCluster/kubernetes/group/{kubernetesGroupId}
>>> /kubernetesCluster/{kubernetesClusterId}DELETEunDeployKubernetesHost ->
>>> unDeployKubernetesHostOfKubernetesCluster
>>> /kubernetes/host/{kubernetesHostId}
>>> /kubernetesCluster/{kubernetesClusterId}/hosts/{hostId}
>>>
>>>
>>> --
>>> Best Regards,
>>> Nirmal
>>>
>>> Nirmal Fernando.
>>> PPMC Member & Committer of Apache Stratos,
>>> Senior Software Engineer, WSO2 Inc.
>>>
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>
>>
>>
>> --
>>
>> Udara Liyanage
>> Software Engineer
>> WSO2, Inc.: http://wso2.com
>> lean. enterprise. middleware
>>
>> web: http://udaraliyanage.wordpress.com
>> phone: +94 71 443 6897
>>
>
>


-- 
Best Regards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.

Blog: http://nirmalfdo.blogspot.com/

Mime
View raw message