Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #17435 > unrolled thread
| Started by | aroundng com <rainbow472.sri@gmail.com> |
|---|---|
| First post | 2017-05-12 16:09 -0700 |
| Last post | 2017-05-15 16:01 -0400 |
| Articles | 6 — 4 participants |
Back to article view | Back to comp.lang.php
Looking for help to create sample REST API which returns values 0(off) or 1(on) from Linux file value. aroundng com <rainbow472.sri@gmail.com> - 2017-05-12 16:09 -0700
Re: Looking for help to create sample REST API which returns values 0(off) or 1(on) from Linux file value. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-13 14:55 +0100
Re: Looking for help to create sample REST API which returns values 0(off) or 1(on) from Linux file value. aroundng com <rainbow472.sri@gmail.com> - 2017-05-13 10:25 -0700
Re: Looking for help to create sample REST API which returns values 0(off) or 1(on) from Linux file value. Luuk <luuk@invalid.lan> - 2017-05-13 20:36 +0200
Re: Looking for help to create sample REST API which returns values 0(off) or 1(on) from Linux file value. aroundng com <rainbow472.sri@gmail.com> - 2017-05-15 11:09 -0700
Re: Looking for help to create sample REST API which returns values 0(off) or 1(on) from Linux file value. Jerry Stuckle <jstucklex@attglobal.net> - 2017-05-15 16:01 -0400
| From | aroundng com <rainbow472.sri@gmail.com> |
|---|---|
| Date | 2017-05-12 16:09 -0700 |
| Subject | Looking for help to create sample REST API which returns values 0(off) or 1(on) from Linux file value. |
| Message-ID | <2bb07219-7f2d-4d9b-b7f8-193c08e83468@googlegroups.com> |
Never worked before. i wanted to learn how REST API process. Could someone please help to get values from LINUX machine with REST API which returns as in XML 0 or 1 , on or off.
[toc] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2017-05-13 14:55 +0100 |
| Message-ID | <87lgq0g8ts.fsf@bsb.me.uk> |
| In reply to | #17435 |
aroundng com <rainbow472.sri@gmail.com> writes: > Never worked before. i wanted to learn how REST API process. > Could someone please help to get values from LINUX machine with REST API > which returns as in XML 0 or 1 , on or off. Your specification is a little unclear. You should say a bit -- maybe describe the interface in abstract terms. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | aroundng com <rainbow472.sri@gmail.com> |
|---|---|
| Date | 2017-05-13 10:25 -0700 |
| Message-ID | <c4073d91-4d96-451a-9fdf-7c3b0463bdea@googlegroups.com> |
| In reply to | #17436 |
On Saturday, May 13, 2017 at 6:55:35 AM UTC-7, Ben Bacarisse wrote: > aroundng com <rainbow472.sri@gmail.com> writes: > > > Never worked before. i wanted to learn how REST API process. > > Could someone please help to get values from LINUX machine with REST API > > which returns as in XML 0 or 1 , on or off. > > Your specification is a little unclear. You should say a bit -- maybe > describe the interface in abstract terms. > > -- > Ben. I wanted to know the status of LINUX Run-level through REST API response in XML formate. Could you help how to implement in PHP.
[toc] | [prev] | [next] | [standalone]
| From | Luuk <luuk@invalid.lan> |
|---|---|
| Date | 2017-05-13 20:36 +0200 |
| Message-ID | <5917522e$0$766$e4fe514c@news.xs4all.nl> |
| In reply to | #17437 |
On 13-05-17 19:25, aroundng com wrote:
> On Saturday, May 13, 2017 at 6:55:35 AM UTC-7, Ben Bacarisse wrote:
>> aroundng com <rainbow472.sri@gmail.com> writes:
>>
>>> Never worked before. i wanted to learn how REST API process.
>>> Could someone please help to get values from LINUX machine with REST API
>>> which returns as in XML 0 or 1 , on or off.
>>
>> Your specification is a little unclear. You should say a bit -- maybe
>> describe the interface in abstract terms.
>>
>> --
>> Ben.
>
> I wanted to know the status of LINUX Run-level through REST API response in XML formate. Could you help how to implement in PHP.
>
On my system runlevel is to complex to simply return in a '0' or a '1'
luuk@opensuse:/tmp> /sbin/runlevel
N 3
But it's not had to do:
<?php
header('Content-Type: text/xml');
echo '<runlevel>'.exec('/sbin/runlevel').'</runlevel>';
And the test:
# curl -v http://www.example.com/runlevel.php
* Hostname was NOT found in DNS cache
* Trying 192.168.xxx.yyy...
* Connected to www.example.com (192.168.xxx.yyy) port 80 (#0)
> GET /runlevel.php HTTP/1.1
> User-Agent: curl/7.37.0
> Host: www.example.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Sat, 13 May 2017 18:33:14 GMT
* Server Apache is not blacklisted
< Server: Apache
< X-Powered-By: PHP/5.5.14
< Content-Length: 24
< Content-Type: text/xml
<
* Connection #0 to host www.example.com left intact
<runlevel>N 3</runlevel>
[toc] | [prev] | [next] | [standalone]
| From | aroundng com <rainbow472.sri@gmail.com> |
|---|---|
| Date | 2017-05-15 11:09 -0700 |
| Message-ID | <00f6aa96-375b-494f-954d-b11e59ff9d46@googlegroups.com> |
| In reply to | #17438 |
On Saturday, May 13, 2017 at 11:36:34 AM UTC-7, Luuk wrote:
> On 13-05-17 19:25, aroundng com wrote:
> > On Saturday, May 13, 2017 at 6:55:35 AM UTC-7, Ben Bacarisse wrote:
> >> aroundng com <rainbow472.sri@gmail.com> writes:
> >>
> >>> Never worked before. i wanted to learn how REST API process.
> >>> Could someone please help to get values from LINUX machine with REST API
> >>> which returns as in XML 0 or 1 , on or off.
> >>
> >> Your specification is a little unclear. You should say a bit -- maybe
> >> describe the interface in abstract terms.
> >>
> >> --
> >> Ben.
> >
> > I wanted to know the status of LINUX Run-level through REST API response in XML formate. Could you help how to implement in PHP.
> >
>
> On my system runlevel is to complex to simply return in a '0' or a '1'
>
> luuk@opensuse:/tmp> /sbin/runlevel
> N 3
>
>
> But it's not had to do:
> <?php
> header('Content-Type: text/xml');
> echo '<runlevel>'.exec('/sbin/runlevel').'</runlevel>';
>
>
> And the test:
> # curl -v http://www.example.com/runlevel.php
> * Hostname was NOT found in DNS cache
> * Trying 192.168.xxx.yyy...
> * Connected to www.example.com (192.168.xxx.yyy) port 80 (#0)
> > GET /runlevel.php HTTP/1.1
> > User-Agent: curl/7.37.0
> > Host: www.example.com
> > Accept: */*
> >
> < HTTP/1.1 200 OK
> < Date: Sat, 13 May 2017 18:33:14 GMT
> * Server Apache is not blacklisted
> < Server: Apache
> < X-Powered-By: PHP/5.5.14
> < Content-Length: 24
> < Content-Type: text/xml
> <
> * Connection #0 to host www.example.com left intact
> <runlevel>N 3</runlevel>
well thank you so much for response, May be its not so hard.But i'm pretty new to REST.
again i have being with status of different services in Same REST API
weather TELNET service on/off and HTTPS services enabled or not.
trying to implement give some idea about steps i should follow with XML results and PHP program
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2017-05-15 16:01 -0400 |
| Message-ID | <ofd17q$b4m$1@jstuckle.eternal-september.org> |
| In reply to | #17441 |
On 5/15/2017 2:09 PM, aroundng com wrote:
> On Saturday, May 13, 2017 at 11:36:34 AM UTC-7, Luuk wrote:
>> On 13-05-17 19:25, aroundng com wrote:
>>> On Saturday, May 13, 2017 at 6:55:35 AM UTC-7, Ben Bacarisse wrote:
>>>> aroundng com <rainbow472.sri@gmail.com> writes:
>>>>
>>>>> Never worked before. i wanted to learn how REST API process.
>>>>> Could someone please help to get values from LINUX machine with REST API
>>>>> which returns as in XML 0 or 1 , on or off.
>>>>
>>>> Your specification is a little unclear. You should say a bit -- maybe
>>>> describe the interface in abstract terms.
>>>>
>>>> --
>>>> Ben.
>>>
>>> I wanted to know the status of LINUX Run-level through REST API response in XML formate. Could you help how to implement in PHP.
>>>
>>
>> On my system runlevel is to complex to simply return in a '0' or a '1'
>>
>> luuk@opensuse:/tmp> /sbin/runlevel
>> N 3
>>
>>
>> But it's not had to do:
>> <?php
>> header('Content-Type: text/xml');
>> echo '<runlevel>'.exec('/sbin/runlevel').'</runlevel>';
>>
>>
>> And the test:
>> # curl -v http://www.example.com/runlevel.php
>> * Hostname was NOT found in DNS cache
>> * Trying 192.168.xxx.yyy...
>> * Connected to www.example.com (192.168.xxx.yyy) port 80 (#0)
>> > GET /runlevel.php HTTP/1.1
>> > User-Agent: curl/7.37.0
>> > Host: www.example.com
>> > Accept: */*
>> >
>> < HTTP/1.1 200 OK
>> < Date: Sat, 13 May 2017 18:33:14 GMT
>> * Server Apache is not blacklisted
>> < Server: Apache
>> < X-Powered-By: PHP/5.5.14
>> < Content-Length: 24
>> < Content-Type: text/xml
>> <
>> * Connection #0 to host www.example.com left intact
>> <runlevel>N 3</runlevel>
>
> well thank you so much for response, May be its not so hard.But i'm pretty new to REST.
> again i have being with status of different services in Same REST API
> weather TELNET service on/off and HTTPS services enabled or not.
> trying to implement give some idea about steps i should follow with XML results and PHP program
>
Beware the just because a service is active does not mean it is
accessible. For instance, the telnet server may be active - but access
to it may be limited by a firewall. And even though the HTTPS service
may be active, your web server may not be configured to use it.
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web