Re: How to get this from the librbary?

2019-05-07 Thread Tony Herstell
I am sorry,
I probably didnt explain it very well.

I was after how I use the openshift-restclient-java library to do what the
"oc" command does.

I have managed to use this awesome library to get all the information I
require from openshift so far (e.g. for project, pods etc.).

Tony


Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Wed, 8 May 2019 at 11:44, Ben Parees  wrote:

> if you run oc with "--loglevel=8" you can see all the api calls it is
> making and the responses.
>
>
> On Tue, May 7, 2019 at 7:06 PM Tony Herstell 
> wrote:
>
>> I dont know Openshift too well but I am trying to get the details that
>> would be returned from this command:
>>
>> oc describe node -l app=sc-app
>>
>> ... (towards the bottom)...
>>
>> *Allocated resources:*
>>
>> *(Total limits may be over 100 percent, i.e., overcommitted.)*
>>
>> *CPU Requests CPU Limits Memory Requests Memory Limits*
>>
>> * -- --- -*
>>
>> *804m (50%) 1600m (100%) 1557Mi (6%) 3160Mi (12%)*
>>
>>
>> I take all the %ages for all the nodes and then average them for the
>> whole instance thereby getting a "utilization"...
>>
>> Please advise...
>>
>>
>>
>>
>> I then disregard any nodes that are not ready..
>>
>> oc get node -l app=sc-app --no-headers
>>
>>
>> and this bit seems to be available as *client.getServerReadyStatus();*
>>
>>
>>
>>
>>
>>
>> 
>>  Virus-free.
>> www.avast.com
>> 
>> <#m_407355907336110635_m_-605702793579341_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>> ___
>> dev mailing list
>> dev@lists.openshift.redhat.com
>> http://lists.openshift.redhat.com/openshiftmm/listinfo/dev
>>
>
>
> --
> Ben Parees | OpenShift
>
>

-- 
*Enterprise I.T. Consultant*
*PM, Technical BA, Architect, **Tech Lead, **Developer, Testing*
*Tony Herstell**, BSc (honours) (Microelectronics and Computing)*
*email:* tony.herst...@gmail.com
*phone:*+64 3 595 0215
*mobile:*   +64 21 302 302
*mail:   646 Grange Road, *
*  RD 7, *
*  Christchurch 7677, *
*  New Zealand*

It is not the critic who counts; not the man who points out how the strong
man stumbles, or where the doer of deeds could have done them better. The
credit belongs to the man who is actually in the arena, whose face is
marred by dust and sweat and blood; who strives valiantly; who errs, who
comes short again and again, because there is no effort without error and
shortcoming; but who does actually strive to do the deeds; who knows great
enthusiasms, the great devotions; who spends himself in a worthy cause; who
at the best knows in the end the triumph of high achievement, and who at
the worst, if he fails, at least fails while daring greatly, so that his
place shall never be with those cold and timid souls who neither know
victory nor defeat. - Theodore Roosevelt

___
dev mailing list
dev@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/dev


Re: How to get this from the librbary?

2019-05-07 Thread Ben Parees
if you run oc with "--loglevel=8" you can see all the api calls it is
making and the responses.


On Tue, May 7, 2019 at 7:06 PM Tony Herstell 
wrote:

> I dont know Openshift too well but I am trying to get the details that
> would be returned from this command:
>
> oc describe node -l app=sc-app
>
> ... (towards the bottom)...
>
> *Allocated resources:*
>
> *(Total limits may be over 100 percent, i.e., overcommitted.)*
>
> *CPU Requests CPU Limits Memory Requests Memory Limits*
>
> * -- --- -*
>
> *804m (50%) 1600m (100%) 1557Mi (6%) 3160Mi (12%)*
>
>
> I take all the %ages for all the nodes and then average them for the whole
> instance thereby getting a "utilization"...
>
> Please advise...
>
>
>
>
> I then disregard any nodes that are not ready..
>
> oc get node -l app=sc-app --no-headers
>
>
> and this bit seems to be available as *client.getServerReadyStatus();*
>
>
>
>
>
>
> 
>  Virus-free.
> www.avast.com
> 
> <#m_-605702793579341_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> ___
> dev mailing list
> dev@lists.openshift.redhat.com
> http://lists.openshift.redhat.com/openshiftmm/listinfo/dev
>


-- 
Ben Parees | OpenShift
___
dev mailing list
dev@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/dev


How to get this from the librbary?

2019-05-07 Thread Tony Herstell
I dont know Openshift too well but I am trying to get the details that
would be returned from this command:

oc describe node -l app=sc-app

... (towards the bottom)...

*Allocated resources:*

*(Total limits may be over 100 percent, i.e., overcommitted.)*

*CPU Requests CPU Limits Memory Requests Memory Limits*

* -- --- -*

*804m (50%) 1600m (100%) 1557Mi (6%) 3160Mi (12%)*


I take all the %ages for all the nodes and then average them for the whole
instance thereby getting a "utilization"...

Please advise...




I then disregard any nodes that are not ready..

oc get node -l app=sc-app --no-headers


and this bit seems to be available as *client.getServerReadyStatus();*






Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
___
dev mailing list
dev@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/dev