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//cartridges
DELETEunDeployCartridgeDefinition/cartridge/definition/{cartridgeType}
/cartridges/{cartridgeType}GETgetValidDeploymentPolicies ->
getValidDeploymentPoliciesOfCartridge{cartridgeType}/policy/deployment
/cartridges/{cartridgeType}/deploymentPolicyGETgetAvailableMultiTenantCartridges
-> getMultiTenantCartridges/cartridge/tenanted/list/cartridges/multiTenant
GETgetAvailableSingleTenantCartridges -> 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/partitions
GETgetPartition/partition/{partitionId}/partitions/{partitionId}Autoscaling
PolicyPOSTdeployAutoscalingPolicyDefintion/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 GroupGETgetPartitionGroups
/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/cartridges
GETgetSubscribedCartridgesForServiceGroup ->
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}GET
getCluster/cluster/clusterId/{clusterId}/clusters/{clusterId}GET
getLoadBalancerCluster
/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/kubernetesClusterPUTdeployKubernetesHost
/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/

Reply via email to