Return-Path: X-Original-To: apmail-stratos-dev-archive@minotaur.apache.org Delivered-To: apmail-stratos-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 440609544 for ; Thu, 11 Dec 2014 06:45:30 +0000 (UTC) Received: (qmail 13804 invoked by uid 500); 11 Dec 2014 06:45:30 -0000 Delivered-To: apmail-stratos-dev-archive@stratos.apache.org Received: (qmail 13752 invoked by uid 500); 11 Dec 2014 06:45:30 -0000 Mailing-List: contact dev-help@stratos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stratos.apache.org Delivered-To: mailing list dev@stratos.apache.org Received: (qmail 13742 invoked by uid 99); 11 Dec 2014 06:45:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Dec 2014 06:45:29 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=AC_DIV_BONANZA,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lakmal@wso2.com designates 209.85.213.176 as permitted sender) Received: from [209.85.213.176] (HELO mail-ig0-f176.google.com) (209.85.213.176) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Dec 2014 06:45:02 +0000 Received: by mail-ig0-f176.google.com with SMTP id l13so8367918iga.3 for ; Wed, 10 Dec 2014 22:44:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wso2.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=yRV/Xj7GA0lf/ohuwnwwvR0upHRWdAHaeEPV1SZpyPk=; b=VFteqUsi3VCcrXASLLWuNRhrL2pkZiyvNJtBszzltaccEzc4XMtsLqlGTZEHj5gN8p S8jpIBUZsDO6vliOxUBw/uj/lthuUSerAyoUWbN5y/+4qPFSJdiJSaxq6hrfDmfRiweR 1QnQRMUvJRwecChol/AC2FCYwK5PY7POfQshY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=yRV/Xj7GA0lf/ohuwnwwvR0upHRWdAHaeEPV1SZpyPk=; b=Ye1sOaKQtR3c6lj3ejKSxpDGsHtg0rdm7ghy6A5t5HreiKhfShQGFUgSk0aX6Sv6BM 7/i4wVnR3rx/KAbTFeWyPXyy+YsP8Lc8QvJjzUbi7pNlksgoCBkkSR+qnAnioVr/ttYK 0yEYvnNpL6JJciqf7ksiVGHZlzO1cW4hrZyH9H2d6/oLHjd432n9SJOvGipsgMw/nR74 t0HmSS774rGC0uZhp3GfqryRJYV0aTI5gBRm9lxExqdJsg0zAW1x6d60SyczUO9rQnHH gstgAH76fOTqj/UIdUIZ8RwDZN2TXsprqYCxISoFLWECJTcMrSSM7AEYZHZlz1XyhKjC Z8DA== X-Gm-Message-State: ALoCoQnM0H0fz73x35Jc55f3uwBUKtSWGPJINogWPPf4zVHaK4QjFO4YVezorGgbx6VZ8XaK2Eaz MIME-Version: 1.0 X-Received: by 10.42.146.201 with SMTP id k9mr10356664icv.54.1418280265814; Wed, 10 Dec 2014 22:44:25 -0800 (PST) Received: by 10.107.47.170 with HTTP; Wed, 10 Dec 2014 22:44:25 -0800 (PST) In-Reply-To: References: Date: Thu, 11 Dec 2014 12:14:25 +0530 Message-ID: Subject: Re: Use of create instead of deploy within Stratos From: Lakmal Warusawithana To: "dev@stratos.apache.org" Content-Type: multipart/alternative; boundary=90e6ba613b666faca90509eb1baf X-Virus-Checked: Checked by ClamAV on apache.org --90e6ba613b666faca90509eb1baf Content-Type: text/plain; charset=UTF-8 Yes, this is great, very clear now. Thanks Shiro. On Thu, Dec 11, 2014 at 11:54 AM, Reka Thirunavukkarasu wrote: > Great work Shiro..!!! The paths are very consistent now.. > > Thanks, > Reka > > On Thu, Dec 11, 2014 at 11:37 AM, Mariangela Hills > wrote: > >> I will update the wiki! >> >> Regards, >> Mariangela >> >> >> >> >> *--* >> Mariangela Hills >> Senior Technical Writer >> >> *WSO2, Inc.*lean.enterprise.middleware. >> m: +94 773 500185 >> w: http://wso2.com >> >> >> On Thu, Dec 11, 2014 at 10:59 AM, Imesh Gunaratne >> wrote: >> >>> Great work Shiro! We might need to update the Wiki with this. >>> >>> Thanks >>> >>> On Wed, Dec 10, 2014 at 4:29 PM, Nirmal Fernando >> > wrote: >>> >>>> Great work Shiro on seeing this through !! >>>> >>>> On Wed, Dec 10, 2014 at 3:14 PM, Shiroshica Kulatilake >>>> wrote: >>>> >>>>> Hi, >>>>> >>>>> The Stratos REST api has been modified as follows. >>>>> >>>>> *1. Autoscaling Policies* >>>>> >>>>> Resource pathDescriptionPOST/autoscalingPoliciesCreates a new >>>>> autoscaling policyGET/autoscalingPoliciesGets all created autoscaling >>>>> policiesGET/autoscalingPolicies/{autoscalePolicyId}Gets a specific >>>>> autoscaling policyPUT/autoscalingPoliciesUpdates an existing >>>>> autoscaling policy >>>>> >>>>> *2. Cartridges* >>>>> >>>>> Resource pathDescriptionPOST/cartridgesCreate a new cartridge >>>>> definitionGET/cartridgesGet all available cartridgesGET >>>>> /cartridges/{filter}?criteria=criteriaGet all available cartridges >>>>> for a particular filter valueGET/cartridges/{filter}/{cartrdigeType}Get >>>>> a specific cartridge within a filter valueDELETE >>>>> /cartridges/{cartridgeType}Delete a specific cartridge definition >>>>> - The filter methods in cartridge are to filter cartridges by specifc >>>>> values. >>>>> e.g. /cartridges/multiTenant would give a list of all multitenant >>>>> cartridges >>>>> Similar values which can be used are - "singleTenant", >>>>> "loadBalancer" and "provider" >>>>> - In the case of filtering cartridges by provider it is also needed to >>>>> specify the provider name - so in this case you would need to specify that >>>>> using the query parameter criteria >>>>> e.g. /cartridges/provider?criteria= >>>>> >>>>> *3. Groups* >>>>> >>>>> Resource pathDescriptionPOST/groupsCreate a new group definitionGET >>>>> /groupsGet all created group definitionsGET >>>>> /groups/{groupDefinitionName}Gets a specific group definitionDELETE >>>>> /groups/{groupDefinitionName}Delete a group definition >>>>> >>>>> *4. Applications* >>>>> >>>>> Resource pathDescriptionGET/applicationsGets all applications created >>>>> GET/applications/{applicationId}Gets a specific applicationPOST >>>>> /applicationsCreate an application definitionDELETE >>>>> /applications/{applicationId}Delete an application definition >>>>> >>>>> *5. Application Deployments* >>>>> >>>>> Resource pathDescriptionPOST/applicationDeploymentsDeploys an >>>>> application for a deployment policyDELETE >>>>> /applicationDeployments/{applicationId}Undeploys a specific >>>>> application based on application id >>>>> - The resource ApplicationDeployments were introduced to identify the >>>>> deployment of a particular application according to a deployment policy >>>>> - The deplolyment policy json is sent with the POST command >>>>> >>>>> *6. Deployment Policies* >>>>> >>>>> Resource pathDescriptionGET/deploymentPoliciesGet all deployment >>>>> policiesGET/deploymentPolicies/{deploymentPolicyId}Gets a specific >>>>> deployment policyGET >>>>> /deploymentPolicies/{deploymentPolicyId}/partitionGroupGets partition >>>>> groups for a specific deployment policy >>>>> - Deployment policies are not created separately - instead when a POST >>>>> /applicationDepoyment with the deployment policy json is sent that >>>>> deployment policy is created. >>>>> >>>>> *7. Subscriptions* >>>>> >>>>> Resource pathDescriptionGET/subscriptions/{applicationId}Gets >>>>> subscriptions for an applicationGET >>>>> /subscriptions/cartridges/groups/{serviceGroupId}Gets subscribed >>>>> cartridges for a service group >>>>> >>>>> *8. Clusters * >>>>> >>>>> Resource pathDescriptionGET/clustersGet Clusters for a tenantGET >>>>> /clusters/{cartridgeType}Get clusters for a specific cartridge typeGET >>>>> /clusters/{clusterId}Get a specifc cluster >>>>> >>>>> *9. Kubernetes clusters* >>>>> >>>>> Resource pathDescriptionPOST/kubernetesClustersDeploy a Kubernetes >>>>> cluster groupPUT/kubernetesClusters/{kubernetesClusterId}/minionDeploy >>>>> a Kubernetes Host within a cluster groupPUT >>>>> /kubernetesClusters/{kubernetesClusterId}/masterDeploy a Kubernetes >>>>> Master within a cluster groupPATCH >>>>> /kubernetesClusters/{kubernetesClusterId}/minion/{minionId} >>>>> GET/kubernetesClustersGets all Kubernetes cluster groups createdGET >>>>> /kubernetesClusters/{kubernetesClusterId}Gets a specific Kubernetes >>>>> clusterGET/kubernetesClusters/{kubernetesClusterId}/hostsGets hosts >>>>> of a specific Kubernetes clusterGET >>>>> /kubernetesClusters/{kubernetesClusterId}/masterGet master of a >>>>> specific Kubernetes clusterDELETE >>>>> /kubernetesClusters/{kubernetesClusterId}Undeploy a kubernetes >>>>> cluster groupDELETE >>>>> /kubernetesClusters/{kubernetesClusterId}/hosts/{hostId}Undeploy a >>>>> specific host within a Kubernetes cluster group >>>>> - the PATCH command is still in discussion hence it has not been >>>>> changed yet. It is still the old path "/kubernetes/update/host" - a TODO. >>>>> >>>>> *10. Tenants* >>>>> >>>>> Resource pathDescriptionPOST/tenantsAdd a new tenantGET/tenantsGet >>>>> all tenantsGET/tenants/{tenantDomain}Get a specific tenantGET >>>>> /tenants/search/{tenantDomain}Search for a tenantsPUT/tenantsUpdate a >>>>> tenantPUT/tenants/activate/{tenantDomain}Activate a tenantPUT >>>>> /tenants/deactivate/{tenantDomain}Deactivate a tenantDELETE >>>>> /tenants/{tenantDomain}Delete a tenant >>>>> >>>>> *11. Users* >>>>> >>>>> Resource pathDescriptionPOST/usersAdd a new userGET/usersGet all users >>>>> PUT/usersUpdate a userDELETE/users/{userName}Delete a user >>>>> >>>>> >>>>> *Example* : To create a single group application where the cartridges >>>>> are vms (I'm reusing the script used to test grouping) using the rest api >>>>> is as follows. >>>>> >>>>> 1. Create an autoscaling policy >>>>> - curl -X POST -H "Content-Type: application/json" -d @>>>> json file> -k -v -u admin:admin >>>>> https://localhost:9443/api/autoscalingPolicies >>>>> 2. Create cartridges >>>>> - curl -X POST -H "Content-Type: application/json" -d @>>>> json file> -k -v -u admin:admin https://localhost:9443/api/cartridges >>>>> 3. Create group >>>>> - curl -X POST -H "Content-Type: application/json" -d @>>>> file> -k -v -u admin:admin https://localhost:9443/api/groups >>>>> 4. Create application >>>>> - curl -X POST -H "Content-Type: application/json" -d @>>>> json file> -k -v -u admin:admin >>>>> https://localhost:9443/api/applications >>>>> 5. Deploy the application >>>>> - curl -X POST -H "Content-Type: application/json" -d@>>>> policy json file> -k -v -u admin:admin >>>>> https://localhost:9443/api/applicationDeployments >>>>> >>>>> *Please note :-* Referring to the above email The separation between >>>>> creation of a deployment policy and deployment of an application is not >>>>> available in the alpha version of Stratos 4.1.0. >>>>> >>>>> >>>>> Thank you, >>>>> Shiro >>>>> >>>>> On Tue, Dec 9, 2014 at 1:29 AM, Shiroshica Kulatilake >>>>> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> In order to create a flow and to figure out the required minimal set >>>>>> of REST apis for application handling thought of breaking down the actions >>>>>> up to deploying and undeploying an application in Stratos as follows. >>>>>> >>>>>> 1. Create cartridges needed >>>>>> - POST /cartridges with cartridgeDefinition.json >>>>>> 2. View created cartridges or a specific cartridge >>>>>> - GET /cartridges, /cartridges/{category}/{criteria}, >>>>>> /cartridges/{category}/{cartrdigeType} >>>>>> 3. Create an autoscaling policy >>>>>> - POST /autoscalingPolicies with autoscalingPolicyDefinition.json >>>>>> 4. Viewing created Autoscaling policies >>>>>> - GET /autoscalingPolicies, /autoscalingPolicies/{autoscalePolicyId} >>>>>> 5. Create a service group definition >>>>>> - POST /groups with groupDefinition.json >>>>>> 6. View created groups >>>>>> - GET /groups, /groups/{groupDefinitionName} >>>>>> 7. Create an application >>>>>> - POST /applications >>>>>> 8. Viewing created application >>>>>> - GET /applications/, /applications/{applicationId} >>>>>> 9. Create a deployment policy for an application >>>>>> 10. View deployment policy >>>>>> - GET /deploymentPolicies/{deploymentPolicyId} >>>>>> 11. Deploy an application with the deployment policy >>>>>> 12. Undeploy an application >>>>>> 13. Delete deploymentPolicyDefinition >>>>>> 14. Delete an applicationDefinition >>>>>> >>>>>> >>>>>> Currently what's missing from the above is another entity which >>>>>> depicts an applicationDeployment. >>>>>> >>>>>> Then /applications will simply handle the definitions and >>>>>> /applicationDeployments should handle the actual deploy and undeployment of >>>>>> an application based on a deployment policy. >>>>>> >>>>>> Since a deployment policy is directly linked to an application it >>>>>> should be possible to get all deployment policies defined for a specific >>>>>> application and then pick one of these for the actual application >>>>>> deployment. >>>>>> >>>>>> Most of this is already there in the current rest api with different >>>>>> naming. I am working on getting the terminology correct and also add the >>>>>> few missing bits. >>>>>> >>>>>> Thank you, >>>>>> Shiro >>>>>> >>>>>> >>>>>> >>>>>> On Mon, Dec 8, 2014 at 7:08 PM, Imesh Gunaratne >>>>>> wrote: >>>>>> >>>>>>> +1 We might need to clarify how we connect a deployment policy to an >>>>>>> application according to this model. >>>>>>> >>>>>>> On Mon, Dec 8, 2014 at 5:40 PM, Lakmal Warusawithana < >>>>>>> lakmal@wso2.com> wrote: >>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Mon, Dec 8, 2014 at 4:55 PM, Shiroshica Kulatilake < >>>>>>>> shiro@wso2.com> wrote: >>>>>>>> >>>>>>>>> Hi All, >>>>>>>>> >>>>>>>>> While cleaning up the REST API I noticed that we have used the >>>>>>>>> word "deploy" instead of 'create' in some places. >>>>>>>>> >>>>>>>>> We need to use these terms consistently IMO >>>>>>>>> >>>>>>>>> As a first start thought of renaming the api methods in the rest >>>>>>>>> api to reflect this. >>>>>>>>> >>>>>>>>> e.g. >>>>>>>>> Policies = create/delete instead of deploy/undelpoy >>>>>>>>> Cartridges = create/delete instead of deploy /undeploy >>>>>>>>> Groups = create/delete instead of deploy/undelpoy >>>>>>>>> Applications = create, deploy, undeploy and delete >>>>>>>>> >>>>>>>>> WDYT ? >>>>>>>>> >>>>>>>> >>>>>>>> +1 >>>>>>>> >>>>>>>> >>>>>>>>> >>>>>>>>> Thank you, >>>>>>>>> Shiro >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Lakmal Warusawithana >>>>>>>> Vice President, Apache Stratos >>>>>>>> Director - Cloud Architecture; WSO2 Inc. >>>>>>>> Mobile : +94714289692 >>>>>>>> Blog : http://lakmalsview.blogspot.com/ >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Imesh Gunaratne >>>>>>> >>>>>>> Technical Lead, WSO2 >>>>>>> Committer & PMC Member, Apache Stratos >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Shiroshica Kulatilake >>>>>> >>>>>> Architect, >>>>>> WSO2, Inc. http://wso2.com/ >>>>>> Phone: +94 776523867 >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Shiroshica Kulatilake >>>>> >>>>> Architect, >>>>> WSO2, Inc. http://wso2.com/ >>>>> Phone: +94 776523867 >>>>> >>>> >>>> >>>> >>>> -- >>>> Best Regards, >>>> Nirmal >>>> >>>> Nirmal Fernando. >>>> PPMC Member & Committer of Apache Stratos, >>>> Senior Software Engineer, WSO2 Inc. >>>> >>>> Blog: http://nirmalfdo.blogspot.com/ >>>> >>> >>> >>> >>> -- >>> Imesh Gunaratne >>> >>> Technical Lead, WSO2 >>> Committer & PMC Member, Apache Stratos >>> >> >> > > > -- > Reka Thirunavukkarasu > Senior Software Engineer, > WSO2, Inc.:http://wso2.com, > Mobile: +94776442007 > > > -- Lakmal Warusawithana Vice President, Apache Stratos Director - Cloud Architecture; WSO2 Inc. Mobile : +94714289692 Blog : http://lakmalsview.blogspot.com/ --90e6ba613b666faca90509eb1baf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Yes, this is great, very clear now. Thanks Shiro.

On Thu, Dec 11, 2014= at 11:54 AM, Reka Thirunavukkarasu <reka@wso2.com> wrote:
Great work Shiro..!!! The pat= hs are very consistent now..

Thanks,
Reka

On Thu, Dec 11, 2014 at 11:37 AM, Mariangela Hills <maria= ngela@wso2.com> wrote:
I will update the wiki!

Regards,
Ma= riangela


--

Mariangela Hills
Senior Technical Writer
WSO2, Inc.
le= an.enterprise.middleware.
=C2= =A0
m:=C2=A0+94 773 500185<= /font>
w:=C2=A0http://wso2.com


On Thu, Dec 11, 2014 at 10:59 AM, Imesh Guna= ratne <imesh@apache.org> wrote:
Great work Shiro! We might need to update the Wiki wi= th this.

Thanks

On Wed, Dec 10, 2014 at 4:29 PM, Nir= mal Fernando <nirmal070125@gmail.com> wrote:
Great work Shiro on seeing this th= rough !!=C2=A0

On Wed, Dec 10, 2014 at 3:14 PM, Shiroshica Kulatilake <shiro@ws= o2.com> wrote:
Hi,

The Stratos REST api has been modified= as follows.

1. Autoscaling Policies
=

Resource pathDescription
POST/autoscalingPoliciesCreates a new autoscaling policy
GET/autoscalingPoliciesGets all created autoscaling policies
GET/autoscalingPo= licies/{autoscalePolicyId}PUT/autoscalingPolicies= Updates an existing auto= scaling policy


2. Cartridge= s
<= col width=3D"105"><= tr style=3D"height:21px">=

=
Resource pathDescription
POST/cartridgesCreate a new cartridge defin= ition
GET/cartridgesGet all available cartridges
GET/cartridges/{filt= er}?criteria=3DcriteriaG= et all available cartridges for a particular filter value
GET/cartridges/{filter}/{cartrdigeType}Get a specific cartridge within a filter value
DELETE/cartridges/{cartridgeType}Delete a specific cartridge definition
- The filter methods in cartridge are to filter cartridges by= specifc values.
=C2=A0=C2=A0 e.g. /cartridges/multiTenant wo= uld give a list of all multitenant cartridges
=C2=A0=C2=A0 S= imilar values which can be used are - "singleTenant", "loadB= alancer" and "provider"
- In the case of filtering cartridges by provider it is also needed to=20 specify the provider name - so in this case you would need to specify=20 that using the query parameter criteria
=C2=A0 e.g. /cartridg= es/provider?criteria=3D<value>

3. Groups
= = Resource path<= td style=3D"padding:2px 3px;border-right:1px solid rgb(0,0,0);border-bottom= :1px solid rgb(0,0,0);vertical-align:bottom">/groups/{groupDefinitionName}<= /td>

Description
POS= T/groupsCreate a new group definition
GET/groupsGet all= created group definitions
GETGets a specific group def= inition
DELETE/groups/{groupDefinitionName}Delete a group definition


4. Applications

Description<= td style=3D"padding:2px 3px;border-right:1px solid rgb(0,0,0);border-bottom= :1px solid rgb(0,0,0);vertical-align:bottom">/applications

5. Application Deployments
Resource path
GET/applicationsGets all applications created
GET/applic= ations/{applicationId}Ge= ts a specific application
POSTCreate an application definition
DELETE/applications/{applicationId}Delete an application definition
<= td style=3D"padding:2px 3px;vertical-align:bottom;border-right:1px solid rg= b(0,0,0);border-bottom:1px solid rgb(0,0,0)">
=
Resource pathDescription
POST/applicationDeploymentsDeploys an application for a deployment po= licy
DELETE/applicationDeployments/{applicationId}Undeploys a specific application b= ased on application id

- The resour= ce ApplicationDeployments were introduced to identify the deployment of a p= articular application according to a deployment policy
- The = deplolyment policy json is sent with the POST command

6. Deployment Policies
<= td style=3D"padding:2px 3px;border-right:1px solid rgb(0,0,0);border-bottom= :1px solid rgb(0,0,0);border-left:1px solid rgb(0,0,0);vertical-align:botto= m">GET

Resource pathDescription
GET/deploymentPoliciesGet all deployment policies
/deploymentPolicie= s/{deploymentPolicyId}Ge= ts a specific deployment policy
GET<= /td>/deploymentPolicies/{depl= oymentPolicyId}/partitionGroupGets partition groups for a specific deployment policy

- Deployment policies are not created separately = - instead when a POST /applicationDepoyment with the deployment policy json= is sent that deployment policy is created.

<= b>7. Subscriptions
<= /colgroup>

Resource pathDescription
GETGets subscriptions for an application
GET/subscripti= ons/cartridges/groups/{serviceGroupId}Gets subscribed cartridges for a service group


8. Clusters
<= td style=3D"padding:2px 3px;border-right:1px solid rgb(0,0,0);border-bottom= :1px solid rgb(0,0,0);border-left:1px solid rgb(0,0,0);vertical-align:botto= m">GET/clusters/{clusterId}

9. Kubernetes clusters

Resource pathDe= scription
GET/clustersGet Clusters for a tenant
/clusters/{cartrid= geType}Get clusters for = a specific cartridge type
GETGet a specifc cluster
<= td style=3D"padding:2px 3px;vertical-align:bottom;border-right:1px solid rg= b(0,0,0);border-bottom:1px solid rgb(0,0,0)">
= = =
Resource pathDescription
POST/kubernetesClustersDeploy a Kubernetes cluster group
PUT/kubernetesClusters/{kubernetesClusterId}/minionDeploy a Kubernetes Host within a cluster gr= oup
PUT/kubernetesClusters/{kubernetesClusterId}/masterDeploy a Kubernetes Master wi= thin a cluster group
PATCH/kubernetesClusters/{kubernetesClusterId}= /minion/{minionId}
GET= /kubernetesClustersGets all Kubernetes cluster g= roups created
GET/kubernetesClusters/{kubernetesClusterId}Gets a specific Kubernetes= cluster
GET/kubernetesClusters/{kubernetesClusterId}/hosts<= /td>Gets hosts of a specific = Kubernetes cluster
GET/kubernetesClusters/{kubernetesCluster= Id}/masterGet master of = a specific Kubernetes cluster
DELET= E/kubernetesClusters/{ku= bernetesClusterId}Undepl= oy a kubernetes cluster group
DELET= E/kubernetesClusters/{ku= bernetesClusterId}/hosts/{hostId}Undeploy a specific host within a Kubernetes cluster group

- the PATCH command is still in = discussion hence it has not been changed yet. It is still the old path &quo= t;/kubernetes/update/host" - a TODO.

1= 0. Tenants
<= /tr>= =

Resource pathDescription
POST/tenan= tsAdd a new tenant
GET/tenantsGet= all tenants
GET/tenants/{tenantDomain}Get a specific tenant
GET/tena= nts/search/{tenantDomain}Search for a tenants
PUT/tenantsUpdate a tenant
PUT/tenants/activate= /{tenantDomain}Activate = a tenant
PUT/tenants/deactivate/{tenantDomain}Deactivate a tenant
DELETE/tenants/{tenantDomain}

Resource pathDescription
POST/users= Add a new user
GET/usersGet all u= sers
PUT/usersUpdate a user
DELETE/users/{userName}Delete a user


Example : To create a single group application w= here the cartridges are vms (I'm reusing the script used to test groupi= ng) using the rest api is as follows.

1. Create an = autoscaling policy
=C2=A0=C2=A0 - curl -X POST -H "Content-T= ype: application/json" -d @<AS policy json file> -k -v -u admin:= admin https://localhost:9443/api/autoscalingPolicies
2= . Create cartridges
=C2=A0=C2=A0 - curl -X POST -H "Content-Type: a= pplication/json" -d @<cartridge json file> -k -v -u admin:admin = https:/= /localhost:9443/api/cartridges
3. Create group
=C2=A0= =C2=A0 - curl -X POST -H "Content-Type: application/json" -d @<= ;group json file> -k -v -u admin:admin https://localhost:9443/api/groups
4. Create application
=C2=A0 - curl -X POST -H "Content-Typ= e: application/json" -d @<application json file> -k -v -u admin:= admin https://localhost:9443/api/applications
5. Deploy the ap= plication
=C2=A0 - curl -X POST -H "Content-Type: application/json= " -d@<deployment policy json file> -k -v -u admin:admin ht= tps://localhost:9443/api/applicationDeployments

Please note :- Referring to the above email The separation bet= ween creation of a deployment policy and deployment of an application is no= t available in the alpha version of Stratos 4.1.0.


Thank you,
Shiro

On Tue, Dec 9, 201= 4 at 1:29 AM, Shiroshica Kulatilake <shiro@wso2.com> wrote:
=
Hi,

In order to create a flow and to figure out the required minimal set of=20 REST apis for application handling thought of breaking down the actions up = to=20 deploying and undeploying an application in Stratos as follows.

1. C= reate cartridges needed
=C2=A0=C2=A0=C2=A0 - POST /cartridges with cart= ridgeDefinition.json
2. View created cartridges or a specific cartridge =
=C2=A0=C2=A0=C2=A0 - GET /cartridges, /cartridges/{category}/{criteria}= , /cartridges/{category}/{cartrdigeType}
3. Create an autoscaling policy=
=C2=A0=C2=A0 - POST /autoscalingPolicies with autoscalingPolicyDefiniti= on.json
4. Viewing created Autoscaling policies
=C2=A0 - GET /autosca= lingPolicies, /autoscalingPolicies/{autoscalePolicyId}
5. Create a servi= ce group definition
=C2=A0 - POST /groups with groupDefinition.json
6= . View created groups
=C2=A0 - GET /groups, /groups/{groupDefinitionName= }
7. Create an application
=C2=A0 - POST /applications
8. Viewing = created application
=C2=A0 - GET /applications/, /applications/{a= pplicationId}
9. Create a deployment policy for an application
=
10. View deployment policy
=C2=A0 - GET /deploymentPolic= ies/{deploymentPolicyId}
11. Deploy an application with the deploy= ment policy
12. Undeploy an application
13. Delete d= eploymentPolicyDefinition
14. Delete an applicationDefinition=
=C2=A0

Currently what's mi= ssing from the above is another entity which depicts an applicationDeployme= nt.

Then /applications will simply handle the definition= s and /applicationDeployments should handle the actual deploy and undeploym= ent of an application based on a deployment policy.

Since= a deployment policy is directly linked to an application it should be poss= ible to get all deployment policies defined for a specific application and = then pick one of these for the actual application deployment.

=
Most of this is already there in the current rest api with different n= aming. I am working on getting the terminology correct and also add the few= missing bits.

Thank you,
Shiro
<= div>


On Mon, Dec 8, 2014 at 7:08 PM, Imesh Gunaratne <imesh@apache.or= g> wrote:
= +1 We might need to clarify how we connect a deployment policy to an applic= ation according to this model.
On Mon, Dec 8, 2014 at 5:40 PM, Lakmal Warusaw= ithana <lakmal@wso2.com> wrote:


On Mon, Dec 8, 2014 at 4:55 PM, Shiroshica Kulatilake <shiro@ws= o2.com> wrote:
Hi = All,

While cleaning up the REST API I noticed that we have use= d the word "deploy" instead of 'create' in some places. <= br>
We need to use these terms consistently IMO

As a= first start thought of renaming the api methods in the rest api to reflect= this.

e.g.
Policies =3D create/delete instead of de= ploy/undelpoy
Cartridges =3D create/delete instead of deploy /und= eploy
Groups =3D create/delete instead of deploy/undelpoy
Applications =3D create, deploy, undeploy and delete

WDYT ? <= br>

+1
= =C2=A0

Thank = you,
Shiro



--
Lakmal Warusawithana<= div>Vice President, Apache Stratos
Director - Cloud Architecture; W= SO2 Inc.
Mobile : +94714289692



<= span>--
Imesh Gunaratne
Technical Lead, WSO2
Committer &am= p; PMC Member, Apache Stratos



--
Shiroshica Kulatilake
<= br>Architect,
WSO2, Inc. = http://wso2.com/
Phone: +94 776523867




--
<= div>
Shiroshica Kulatilake

Architect,
WSO2, Inc. http://wso2.com/
Phone: +94= 776523867




-= -
Best Regards,
Nirmal

Nirmal Fernando.=
PPMC Member & Committer of Apache Stratos,
Senior Software Engin= eer, WSO2 Inc.

=



--
<= div dir=3D"ltr">Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos
=




--
R= eka Thirunavukkarasu
Senior Software Engineer,
WSO2, Inc.:http://wso2.com,
Mobile: +9477= 6442007




--
Lakmal Warusawithana
Vice Preside= nt, Apache Stratos
Director - Cloud Architecture; WSO2 Inc.
Mobile : +94714289692
--90e6ba613b666faca90509eb1baf--