apps logs


Corentin Dupont <corentin.dupont@...>
 

Still struggling...

I have already an account with CF, so I tried:

$ uaac token client get
Client ID: admin
Client secret: ************

Successfully fetched token via client credentials grant.
Target: http://uaa.172.16.0.191.xip.io
Context: admin, from client admin

Then:
$ uaac token decode

Note: no key given to validate token signature

jti: 908139b9-28be-4490-9ffd-a0e6b2f1XXXX
sub: admin
authorities: password.write scim.write clients.write clients.read
scim.read
uaa.admin clients.secret
scope: scim.read uaa.admin password.write scim.write clients.write
clients.read clients.secret
client_id: admin
cid: admin
azp: admin
grant_type: client_credentials
rev_sig: 78635a00
iat: 1455113000
exp: 1455156200
iss: https://uaa.172.16.0.191.xip.io/oauth/token
zid: uaa
aud: admin scim uaa password clients


There is nothing looking like the "Authorization: bearer" code from the
cURL command below...
Should I use the "jti" field?

Thanks a lot Hristo!!
Corentin

On Wed, Feb 10, 2016 at 12:38 AM, Hristo Iliev <hsiliev(a)gmail.com> wrote:

You should create a client with the proper permissions/authorities. For
bosh-lite this is done with:

gem install cf-uaac
uaac target uaa.bosh-lite.com --skip-ssl-validation
uaac token client get admin -s admin-secret
uaac client add id --authorized_grant_types client_credentials --authorities cloud_controller.admin --secret secret


The ones above (CC.admin) are perhaps too much for just reading the events.

2016-02-09 18:11 GMT+02:00 Corentin Dupont <corentin.dupont(a)create-net.org
:


Thanks Hristo.
I'm trying to retrieve the info from the API:

curl "https://api.[your-domain.com]/v2/app_usage_events?results-per-page=1&after_guid=5f9db08a-3e18-4b1e-a09b-14be78eb3dab" -X GET \
-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQ2MSIsImVtYWlsIjoiZW1haWwtMzMyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTQ0NTE2Mzl9.4MWgEkbhuyG21w9vyZ_p8UhkY_YU0UoiGdscbqvr5bM" \
-H "Host: example.org" \
-H "Cookie: "

But how can I get my authorization token?



---------- Forwarded message ----------
From: Hristo Iliev <hsiliev(a)gmail.com>
To: "Discussions about Cloud Foundry projects and the system overall." <
cf-dev(a)lists.cloudfoundry.org>
Cc: dc4cities-project <dc4cities-project(a)create-net-ml.org>
Date: Tue, 9 Feb 2016 17:27:42 +0200
Subject: Re: [cf-dev] apps logs
Hi,

You can check the the App Usage Events API [1]. They are discarded after
some time (default: a month), so you should move the info to a dedicated DB
if you need audit events.

Regards,
Hristo Iliev

[1]
http://apidocs.cloudfoundry.org/230/app_usage_events/list_all_app_usage_events.html

2016-02-09 16:26 GMT+02:00 Corentin Dupont <
corentin.dupont(a)create-net.org>:

Hi guys,
I would like to know if there is a log somewhere containing the number
of apps in CF (result of cf apps)? Or a log of the scale up/down commands?
I need to make an analysis of all the scaling up/down operations that
happened on the infrastructure.

Thanks a lot,
Corentin


--

Corentin Dupont
Researcher @ Create-Netwww.corentindupont.info


---------- Forwarded message ----------
From: dc4cities-project-request(a)create-net-ml.org
To:
Cc:
Date: Tue, 09 Feb 2016 16:28:08 +0100
Subject: confirm 44bfd373419fd479aecf4b351db7ff6b9772b32e
If you reply to this message, keeping the Subject: header intact,
Mailman will discard the held message. Do this if the message is
spam. If you reply to this message and include an Approved: header
with the list password in it, the message will be approved for posting
to the list. The Approved: header can also appear in the first line
of the body of the reply.


--

Corentin Dupont
Researcher @ Create-Netwww.corentindupont.info

--

Corentin Dupont
Researcher @ Create-Netwww.corentindupont.info

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.