You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by sushixiang <sh...@qq.com> on 2019/12/04 08:18:14 UTC

[ShardingScaling][Discuss] Http request APIS about shardingscaling

Hi, everybody:


Http request apis will be provided for shardingscaling to let people easily manager the scaling job.


Here are the definitions of such apis:


/shardingscaling/job/start [POST]
/shardingscaling/job/progress/${jobId} [GET]
/shardingscaling/job/stop [POST]



Above apis will be used for starting job, get job process and stop job respectively.


Here are the related issue and pr:
[1] https://github.com/apache/incubator-shardingsphere/issues/3256
[2] https://github.com/apache/incubator-shardingsphere/pull/3656


Comments or Suggestions on it are welcome!&nbsp;



Thanks!

Re: Re: [ShardingScaling][Discuss] Http request APIS about shardingscaling

Posted by Zhiyi Yan <ca...@gmail.com>.
Hi,

I think he's just suggesting a API style, restful API treat jobs as a
resource, and do something to this resource.

Sion Yang <sc...@163.com> 于2019年12月5日周四 上午9:45写道:

> Agree. [PUT] /job/<job_id> with stop status in body is not as clear as
> using `stop` on uri directly, I think.
>
>
>
>
> --
>
> Yi Yang(Sion)
> Apache ShardingSphere
>
>
>
> At 2019-12-05 09:29:20, "sushixiang" <sh...@qq.com> wrote:
> >Hi, PUT may be used for modification, but we really not modify anything.
> And I think this may be not as straightforward as putting 'stop' in the
> url.What do you think?
> >
> >
> >
> >
> >
> >
> >------------------&nbsp;Original&nbsp;------------------
> >From:&nbsp;"xia Yanick"<yanick.xia@gmail.com&gt;;
> >Date:&nbsp;Wed, Dec 4, 2019 05:10 PM
> >To:&nbsp;"dev"<dev@shardingsphere.apache.org&gt;;
> >
> >Subject:&nbsp;Re: [ShardingScaling][Discuss] Http request APIS about
> shardingscaling
> >
> >
> >
> >HI Xiang:
> >       how about that stop a job like:
> >
> >       PUT /shardingscaling/job/<job_id&gt;
> >       Content-Type: application/json
> >       Body:&nbsp; { "status": "stop" }
> >
> >
> >
> >&gt; On Dec 4, 2019, at 17:05, sushixiang <shixiangsu@qq.com&gt; wrote:
> >&gt;
> >&gt;
>


-- 
Zhiyi Yan (Zhyee)
Apache ShardingSphere

Re:Re: [ShardingScaling][Discuss] Http request APIS about shardingscaling

Posted by Sion Yang <sc...@163.com>.
Agree. [PUT] /job/<job_id> with stop status in body is not as clear as using `stop` on uri directly, I think.




--

Yi Yang(Sion)
Apache ShardingSphere



At 2019-12-05 09:29:20, "sushixiang" <sh...@qq.com> wrote:
>Hi, PUT may be used for modification, but we really not modify anything. And I think this may be not as straightforward as putting 'stop' in the url.What do you think?
>
>
>
>
>
>
>------------------&nbsp;Original&nbsp;------------------
>From:&nbsp;"xia Yanick"<yanick.xia@gmail.com&gt;;
>Date:&nbsp;Wed, Dec 4, 2019 05:10 PM
>To:&nbsp;"dev"<dev@shardingsphere.apache.org&gt;;
>
>Subject:&nbsp;Re: [ShardingScaling][Discuss] Http request APIS about shardingscaling
>
>
>
>HI Xiang:
>	how about that stop a job like:
>	
>	PUT /shardingscaling/job/<job_id&gt; 
>	Content-Type: application/json 
>	Body:&nbsp; { "status": "stop" }
>	
>
>
>&gt; On Dec 4, 2019, at 17:05, sushixiang <shixiangsu@qq.com&gt; wrote:
>&gt; 
>&gt;

Re: [ShardingScaling][Discuss] Http request APIS about shardingscaling

Posted by sushixiang <sh...@qq.com>.
Hi, PUT may be used for modification, but we really not modify anything. And I think this may be not as straightforward as putting 'stop' in the url.What do you think?






------------------&nbsp;Original&nbsp;------------------
From:&nbsp;"xia Yanick"<yanick.xia@gmail.com&gt;;
Date:&nbsp;Wed, Dec 4, 2019 05:10 PM
To:&nbsp;"dev"<dev@shardingsphere.apache.org&gt;;

Subject:&nbsp;Re: [ShardingScaling][Discuss] Http request APIS about shardingscaling



HI Xiang:
	how about that stop a job like:
	
	PUT /shardingscaling/job/<job_id&gt; 
	Content-Type: application/json 
	Body:&nbsp; { "status": "stop" }
	


&gt; On Dec 4, 2019, at 17:05, sushixiang <shixiangsu@qq.com&gt; wrote:
&gt; 
&gt;

Re: [ShardingScaling][Discuss] Http request APIS about shardingscaling

Posted by xia Yanick <ya...@gmail.com>.
HI Xiang:
	how about that stop a job like:
	
	PUT /shardingscaling/job/<job_id> 
	Content-Type: application/json 
	Body:  { "status": "stop" }
	


> On Dec 4, 2019, at 17:05, sushixiang <sh...@qq.com> wrote:
> 
> 


Re: [ShardingScaling][Discuss] Http request APIS about shardingscaling

Posted by sushixiang <sh...@qq.com>.
Now, stop only means stop the job, function of resume job will be add later.




------------------&nbsp;Original&nbsp;------------------
From:&nbsp;"zhangliang@apache.org"<zhangliang@apache.org&gt;;
Date:&nbsp;Wed, Dec 4, 2019 05:01 PM
To:&nbsp;"dev"<dev@shardingsphere.apache.org&gt;;

Subject:&nbsp;Re: [ShardingScaling][Discuss] Http request APIS about shardingscaling



Hi, Did the stop job mean we can resume the job, or just delete it forever?

------------------

Liang Zhang (John)
Apache ShardingSphere &amp; Dubbo


sushixiang <shixiangsu@qq.com&gt; 于2019年12月4日周三 下午4:42写道:

&gt; Hi, xia Yanick:
&gt;
&gt;
&gt; Stop api doesn't do a delete action, so we use [POST] and jobid will be
&gt; transferd as request body.
&gt; For others,Is it more readable to add such 'start', 'stop' or 'progress'?
&gt;
&gt;
&gt;
&gt;
&gt; ------------------&amp;nbsp;Original&amp;nbsp;------------------
&gt; From:&amp;nbsp;"xia Yanick"<yanick.xia@gmail.com&amp;gt;;
&gt; Date:&amp;nbsp;Wed, Dec 4, 2019 04:31 PM
&gt; To:&amp;nbsp;"dev"<dev@shardingsphere.apache.org&amp;gt;;
&gt;
&gt; Subject:&amp;nbsp;Re: [ShardingScaling][Discuss] Http request APIS about
&gt; shardingscaling
&gt;
&gt;
&gt;
&gt; Hi Xiang:
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; That's exactly what I needed,&amp;nbsp; otherwise, do you want like a
&gt; restful style?
&gt;
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; create a job:&amp;nbsp;&amp;nbsp;&amp;nbsp;
&gt;&nbsp; /shardingscaling/job/<job_id&amp;gt; [POST]
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; query a job status:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /shardingscaling/job/<job_id&amp;gt;
&gt; [GET]
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stop a job&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /shardingscaling/job/<job_id&amp;gt;
&gt; [DELETE]
&gt;
&gt;
&gt;
&gt;
&gt; &amp;gt; On Dec 4, 2019, at 16:18, sushixiang <shixiangsu@qq.com&amp;gt; wrote:
&gt; &amp;gt;
&gt; &amp;gt; Hi, everybody:
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt; Http request apis will be provided for shardingscaling to let people
&gt; easily manager the scaling job.
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt; Here are the definitions of such apis:
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt; /shardingscaling/job/start [POST]
&gt; &amp;gt; /shardingscaling/job/progress/${jobId} [GET]
&gt; &amp;gt; /shardingscaling/job/stop [POST]
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt; Above apis will be used for starting job, get job process and stop
&gt; job respectively.
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt; Here are the related issue and pr:
&gt; &amp;gt; [1] https://github.com/apache/incubator-shardingsphere/issues/3256
&gt; &amp;gt <https://github.com/apache/incubator-shardingsphere/issues/3256&amp;gt&gt;;
&gt; [2] https://github.com/apache/incubator-shardingsphere/pull/3656
&gt; &amp;gt <https://github.com/apache/incubator-shardingsphere/pull/3656&amp;gt&gt;;
&gt; &amp;gt;
&gt; &amp;gt; Comments or Suggestions on it are welcome!&amp;amp;nbsp;
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt; Thanks!

Re: [ShardingScaling][Discuss] Http request APIS about shardingscaling

Posted by "zhangliang@apache.org" <zh...@apache.org>.
Hi, Did the stop job mean we can resume the job, or just delete it forever?

------------------

Liang Zhang (John)
Apache ShardingSphere & Dubbo


sushixiang <sh...@qq.com> 于2019年12月4日周三 下午4:42写道:

> Hi, xia Yanick:
>
>
> Stop api doesn't do a delete action, so we use [POST] and jobid will be
> transferd as request body.
> For others,Is it more readable to add such 'start', 'stop' or 'progress'?
>
>
>
>
> ------------------&nbsp;Original&nbsp;------------------
> From:&nbsp;"xia Yanick"<yanick.xia@gmail.com&gt;;
> Date:&nbsp;Wed, Dec 4, 2019 04:31 PM
> To:&nbsp;"dev"<dev@shardingsphere.apache.org&gt;;
>
> Subject:&nbsp;Re: [ShardingScaling][Discuss] Http request APIS about
> shardingscaling
>
>
>
> Hi Xiang:
>         That's exactly what I needed,&nbsp; otherwise, do you want like a
> restful style?
>
>         create a job:&nbsp;&nbsp;&nbsp;
>  /shardingscaling/job/<job_id&gt; [POST]
>         query a job status:             /shardingscaling/job/<job_id&gt;
> [GET]
>         stop a job                      /shardingscaling/job/<job_id&gt;
> [DELETE]
>
>
>
>
> &gt; On Dec 4, 2019, at 16:18, sushixiang <shixiangsu@qq.com&gt; wrote:
> &gt;
> &gt; Hi, everybody:
> &gt;
> &gt;
> &gt; Http request apis will be provided for shardingscaling to let people
> easily manager the scaling job.
> &gt;
> &gt;
> &gt; Here are the definitions of such apis:
> &gt;
> &gt;
> &gt; /shardingscaling/job/start [POST]
> &gt; /shardingscaling/job/progress/${jobId} [GET]
> &gt; /shardingscaling/job/stop [POST]
> &gt;
> &gt;
> &gt;
> &gt; Above apis will be used for starting job, get job process and stop
> job respectively.
> &gt;
> &gt;
> &gt; Here are the related issue and pr:
> &gt; [1] https://github.com/apache/incubator-shardingsphere/issues/3256
> &gt <https://github.com/apache/incubator-shardingsphere/issues/3256&gt>;
> [2] https://github.com/apache/incubator-shardingsphere/pull/3656
> &gt <https://github.com/apache/incubator-shardingsphere/pull/3656&gt>;
> &gt;
> &gt; Comments or Suggestions on it are welcome!&amp;nbsp;
> &gt;
> &gt;
> &gt;
> &gt; Thanks!

Re: [ShardingScaling][Discuss] Http request APIS about shardingscaling

Posted by sushixiang <sh...@qq.com>.
Hi, xia Yanick:


Stop api doesn't do a delete action, so we use [POST] and jobid will be transferd as request body.
For others,Is it more readable to add such 'start', 'stop' or 'progress'?




------------------&nbsp;Original&nbsp;------------------
From:&nbsp;"xia Yanick"<yanick.xia@gmail.com&gt;;
Date:&nbsp;Wed, Dec 4, 2019 04:31 PM
To:&nbsp;"dev"<dev@shardingsphere.apache.org&gt;;

Subject:&nbsp;Re: [ShardingScaling][Discuss] Http request APIS about shardingscaling



Hi Xiang:
	That's exactly what I needed,&nbsp; otherwise, do you want like a restful style?
	
	create a job:&nbsp;&nbsp;&nbsp; 		/shardingscaling/job/<job_id&gt; [POST]
	query a job status: 		/shardingscaling/job/<job_id&gt; [GET]
	stop a job			/shardingscaling/job/<job_id&gt; [DELETE]




&gt; On Dec 4, 2019, at 16:18, sushixiang <shixiangsu@qq.com&gt; wrote:
&gt; 
&gt; Hi, everybody:
&gt; 
&gt; 
&gt; Http request apis will be provided for shardingscaling to let people easily manager the scaling job.
&gt; 
&gt; 
&gt; Here are the definitions of such apis:
&gt; 
&gt; 
&gt; /shardingscaling/job/start [POST]
&gt; /shardingscaling/job/progress/${jobId} [GET]
&gt; /shardingscaling/job/stop [POST]
&gt; 
&gt; 
&gt; 
&gt; Above apis will be used for starting job, get job process and stop job respectively.
&gt; 
&gt; 
&gt; Here are the related issue and pr:
&gt; [1] https://github.com/apache/incubator-shardingsphere/issues/3256
&gt; [2] https://github.com/apache/incubator-shardingsphere/pull/3656
&gt; 
&gt; 
&gt; Comments or Suggestions on it are welcome!&amp;nbsp;
&gt; 
&gt; 
&gt; 
&gt; Thanks!

Re:Re: [ShardingScaling][Discuss] Http request APIS about shardingscaling

Posted by Sion Yang <sc...@163.com>.
When create job, the job_id do not generate, so can't input <job_id>.


Progress is part information of job, so I think progress word show in url is better.




--

Yi Yang(Sion)
Apache ShardingSphere



At 2019-12-04 16:31:34, "xia Yanick" <ya...@gmail.com> wrote:
>Hi Xiang:
>	That's exactly what I needed,  otherwise, do you want like a restful style?
>	
>	create a job:    		/shardingscaling/job/<job_id> [POST]
>	query a job status: 		/shardingscaling/job/<job_id> [GET]
>	stop a job			/shardingscaling/job/<job_id> [DELETE]
>
>
>
>
>> On Dec 4, 2019, at 16:18, sushixiang <sh...@qq.com> wrote:
>> 
>> Hi, everybody:
>> 
>> 
>> Http request apis will be provided for shardingscaling to let people easily manager the scaling job.
>> 
>> 
>> Here are the definitions of such apis:
>> 
>> 
>> /shardingscaling/job/start [POST]
>> /shardingscaling/job/progress/${jobId} [GET]
>> /shardingscaling/job/stop [POST]
>> 
>> 
>> 
>> Above apis will be used for starting job, get job process and stop job respectively.
>> 
>> 
>> Here are the related issue and pr:
>> [1] https://github.com/apache/incubator-shardingsphere/issues/3256
>> [2] https://github.com/apache/incubator-shardingsphere/pull/3656
>> 
>> 
>> Comments or Suggestions on it are welcome!&nbsp;
>> 
>> 
>> 
>> Thanks!
>

Re: [ShardingScaling][Discuss] Http request APIS about shardingscaling

Posted by xia Yanick <ya...@gmail.com>.
Hi Xiang:
	That's exactly what I needed,  otherwise, do you want like a restful style?
	
	create a job:    		/shardingscaling/job/<job_id> [POST]
	query a job status: 		/shardingscaling/job/<job_id> [GET]
	stop a job			/shardingscaling/job/<job_id> [DELETE]




> On Dec 4, 2019, at 16:18, sushixiang <sh...@qq.com> wrote:
> 
> Hi, everybody:
> 
> 
> Http request apis will be provided for shardingscaling to let people easily manager the scaling job.
> 
> 
> Here are the definitions of such apis:
> 
> 
> /shardingscaling/job/start [POST]
> /shardingscaling/job/progress/${jobId} [GET]
> /shardingscaling/job/stop [POST]
> 
> 
> 
> Above apis will be used for starting job, get job process and stop job respectively.
> 
> 
> Here are the related issue and pr:
> [1] https://github.com/apache/incubator-shardingsphere/issues/3256
> [2] https://github.com/apache/incubator-shardingsphere/pull/3656
> 
> 
> Comments or Suggestions on it are welcome!&nbsp;
> 
> 
> 
> Thanks!