Skip to content

Latest commit

 

History

History
416 lines (303 loc) · 28.4 KB

MetricApi.md

File metadata and controls

416 lines (303 loc) · 28.4 KB

obp_python.MetricApi

All URIs are relative to http://test.openbankproject.com

Method HTTP request Description
o_bpv2_0_0_elastic_search_metrics GET /obp/v5.0.0/search/metrics Search API Metrics via Elasticsearch
o_bpv2_1_0_get_metrics GET /obp/v5.0.0/management/metrics Get Metrics
o_bpv2_2_0_get_connector_metrics GET /obp/v5.0.0/management/connector/metrics Get Connector Metrics
o_bpv3_0_0_get_aggregate_metrics GET /obp/v5.0.0/management/aggregate-metrics Get Aggregate Metrics
o_bpv3_1_0_get_metrics_top_consumers GET /obp/v5.0.0/management/metrics/top-consumers Get Top Consumers
o_bpv3_1_0_get_top_apis GET /obp/v5.0.0/management/metrics/top-apis Get Top APIs
o_bpv5_0_0_get_metrics_at_bank GET /obp/v5.0.0/management/metrics/banks/{BANK_ID} Get Metrics at Bank

o_bpv2_0_0_elastic_search_metrics

EmptyClassJson o_bpv2_0_0_elastic_search_metrics(body)

Search API Metrics via Elasticsearch

Search the API calls made to this API instance via Elastic Search.

Login is required.

CanSearchMetrics entitlement is required to search metrics data.

parameters:

esType - elasticsearch type

simple query:

q - plain_text_query

df - default field to search

sort - field to sort on

size - number of hits returned, default 10

from - show hits starting from

json query:

source - JSON_query_(URL-escaped)

example usage:

/search/metrics/q=findThis

or:

/search/metrics/source={"query":{"query_string":{"query":"findThis"}}}

Note!!

The whole JSON query string MUST be URL-encoded:

  • For { use %7B
  • For } use %7D
  • For : use %3A
  • For " use %22

etc..

Only q, source and esType are passed to Elastic

Elastic simple query: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-uri-request.html

Elastic JSON query: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.MetricApi(obp_python.ApiClient(configuration))
body = obp_python.EmptyClassJson() # EmptyClassJson | EmptyClassJson object that needs to be added.

try:
    # Search API Metrics via Elasticsearch
    api_response = api_instance.o_bpv2_0_0_elastic_search_metrics(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MetricApi->o_bpv2_0_0_elastic_search_metrics: %s\n" % e)

Parameters

Name Type Description Notes
body EmptyClassJson EmptyClassJson object that needs to be added.

Return type

EmptyClassJson

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv2_1_0_get_metrics

MetricsJson o_bpv2_1_0_get_metrics(body)

Get Metrics

Get the all metrics

require CanReadMetrics role

Filters Part 1.filtering (no wilde cards etc.) parameters to GET /management/metrics

Should be able to filter on the following metrics fields

eg: /management/metrics?from_date=1100-01-01T01:01:01.000Z&to_date=1100-01-01T01:01:01.000Z&limit=50&offset=2

1 from_date (defaults to one week before current date): eg:from_date=1100-01-01T01:01:01.000Z

2 to_date (defaults to current date) eg:to_date=1100-01-01T01:01:01.000Z

3 limit (for pagination: defaults to 50) eg:limit=200

4 offset (for pagination: zero index, defaults to 0) eg: offset=10

5 sort_by (defaults to date field) eg: sort_by=date
possible values:
"url",
"date",
"user_name",
"app_name",
"developer_email",
"implemented_by_partial_function",
"implemented_in_version",
"consumer_id",
"verb"

6 direction (defaults to date desc) eg: direction=desc

eg: /management/metrics?from_date=1100-01-01T01:01:01.000Z&to_date=1100-01-01T01:01:01.000Z&limit=10000&offset=0&anon=false&app_name=TeatApp&implemented_in_version=v2.1.0&verb=POST&user_id=c7b6cb47-cb96-4441-8801-35b57456753a&user_name=susan.uk.29@example.com&consumer_id=78

Other filters:

7 consumer_id (if null ignore)

8 user_id (if null ignore)

9 anon (if null ignore) only support two value : true (return where user_id is null.) or false (return where user_id is not null.)

10 url (if null ignore), note: can not contain '&'.

11 app_name (if null ignore)

12 implemented_by_partial_function (if null ignore),

13 implemented_in_version (if null ignore)

14 verb (if null ignore)

15 correlation_id (if null ignore)

16 duration (if null ignore) non digit chars will be silently omitted

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.MetricApi(obp_python.ApiClient(configuration))
body = obp_python.EmptyClassJson() # EmptyClassJson | EmptyClassJson object that needs to be added.

try:
    # Get Metrics
    api_response = api_instance.o_bpv2_1_0_get_metrics(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MetricApi->o_bpv2_1_0_get_metrics: %s\n" % e)

Parameters

Name Type Description Notes
body EmptyClassJson EmptyClassJson object that needs to be added.

Return type

MetricsJson

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv2_2_0_get_connector_metrics

ConnectorMetricsJson o_bpv2_2_0_get_connector_metrics(body)

Get Connector Metrics

Get the all metrics

require CanGetConnectorMetrics role

Filters Part 1.filtering (no wilde cards etc.) parameters to GET /management/connector/metrics

Should be able to filter on the following metrics fields

eg: /management/connector/metrics?from_date=1100-01-01T01:01:01.000Z&to_date=1100-01-01T01:01:01.000Z&limit=50&offset=2

1 from_date (defaults to one week before current date): eg:from_date=1100-01-01T01:01:01.000Z

2 to_date (defaults to current date) eg:to_date=1100-01-01T01:01:01.000Z

3 limit (for pagination: defaults to 1000) eg:limit=2000

4 offset (for pagination: zero index, defaults to 0) eg: offset=10

eg: /management/connector/metrics?from_date=1100-01-01T01:01:01.000Z&to_date=1100-01-01T01:01:01.000Z&limit=100&offset=300

Other filters:

5 connector_name (if null ignore)

6 function_name (if null ignore)

7 correlation_id (if null ignore)

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.MetricApi(obp_python.ApiClient(configuration))
body = obp_python.EmptyClassJson() # EmptyClassJson | EmptyClassJson object that needs to be added.

try:
    # Get Connector Metrics
    api_response = api_instance.o_bpv2_2_0_get_connector_metrics(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MetricApi->o_bpv2_2_0_get_connector_metrics: %s\n" % e)

Parameters

Name Type Description Notes
body EmptyClassJson EmptyClassJson object that needs to be added.

Return type

ConnectorMetricsJson

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv3_0_0_get_aggregate_metrics

AggregateMetricJSON o_bpv3_0_0_get_aggregate_metrics()

Get Aggregate Metrics

Returns aggregate metrics on api usage eg. total count, response time (in ms), etc.

Should be able to filter on the following fields

eg: /management/aggregate-metrics?from_date=1100-01-01T01:01:01.000Z&to_date=1100-01-01T01:01:01.000Z&consumer_id=5
&user_id=66214b8e-259e-44ad-8868-3eb47be70646&implemented_by_partial_function=getTransactionsForBankAccount
&implemented_in_version=v3.0.0&url=/obp/v3.0.0/banks/gh.29.uk/accounts/8ca8a7e4-6d02-48e3-a029-0b2bf89de9f0/owner/transactions
&verb=GET&anon=false&app_name=MapperPostman
&exclude_app_names=API-EXPLORER,API-Manager,SOFI,null

1 from_date (defaults to the day before the current date): eg:from_date=1100-01-01T01:01:01.000Z

2 to_date (defaults to the current date) eg:to_date=1100-01-01T01:01:01.000Z

3 consumer_id (if null ignore)

4 user_id (if null ignore)

5 anon (if null ignore) only support two value : true (return where user_id is null.) or false (return where user_id is not null.)

6 url (if null ignore), note: can not contain '&'.

7 app_name (if null ignore)

8 implemented_by_partial_function (if null ignore),

9 implemented_in_version (if null ignore)

10 verb (if null ignore)

11 correlation_id (if null ignore)

12 duration (if null ignore) non digit chars will be silently omitted

13 exclude_app_names (if null ignore).eg: &exclude_app_names=API-EXPLORER,API-Manager,SOFI,null

14 exclude_url_patterns (if null ignore).you can design you own SQL NOT LIKE pattern. eg: &exclude_url_patterns=%management/metrics%,%management/aggregate-metrics%

15 exclude_implemented_by_partial_functions (if null ignore).eg: &exclude_implemented_by_partial_functions=getMetrics,getConnectorMetrics,getAggregateMetrics

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.MetricApi(obp_python.ApiClient(configuration))

try:
    # Get Aggregate Metrics
    api_response = api_instance.o_bpv3_0_0_get_aggregate_metrics()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MetricApi->o_bpv3_0_0_get_aggregate_metrics: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

AggregateMetricJSON

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv3_1_0_get_metrics_top_consumers

TopConsumersJson o_bpv3_1_0_get_metrics_top_consumers()

Get Top Consumers

Get metrics about the top consumers of the API usage e.g. total count, consumer_id and app_name.

Should be able to filter on the following fields

e.g.: /management/metrics/top-consumers?from_date=1970-01-01T00:00:00.000Z&to_date=2023-02-16T16:23:47.687Z&consumer_id=5
&user_id=66214b8e-259e-44ad-8868-3eb47be70646&implemented_by_partial_function=getTransactionsForBankAccount
&implemented_in_version=v3.0.0&url=/obp/v3.0.0/banks/gh.29.uk/accounts/8ca8a7e4-6d02-48e3-a029-0b2bf89de9f0/owner/transactions
&verb=GET&anon=false&app_name=MapperPostman
&exclude_app_names=API-EXPLORER,API-Manager,SOFI,null
&limit=100

1 from_date (defaults to the one year ago): eg:from_date=1970-01-01T00:00:00.000Z

2 to_date (defaults to the current date) eg:to_date=2023-02-16T16:23:47.687Z

3 consumer_id (if null ignore)

4 user_id (if null ignore)

5 anon (if null ignore) only support two value : true (return where user_id is null.) or false (return where user_id is not null.)

6 url (if null ignore), note: can not contain '&'.

7 app_name (if null ignore)

8 implemented_by_partial_function (if null ignore),

9 implemented_in_version (if null ignore)

10 verb (if null ignore)

11 correlation_id (if null ignore)

12 duration (if null ignore) non digit chars will be silently omitted

13 exclude_app_names (if null ignore).eg: &exclude_app_names=API-EXPLORER,API-Manager,SOFI,null

14 exclude_url_patterns (if null ignore).you can design you own SQL NOT LIKE pattern. eg: &exclude_url_patterns=%management/metrics%,%management/aggregate-metrics%

15 exclude_implemented_by_partial_functions (if null ignore).eg: &exclude_implemented_by_partial_functions=getMetrics,getConnectorMetrics,getAggregateMetrics

16 limit (for pagination: defaults to 50) eg:limit=200

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.MetricApi(obp_python.ApiClient(configuration))

try:
    # Get Top Consumers
    api_response = api_instance.o_bpv3_1_0_get_metrics_top_consumers()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MetricApi->o_bpv3_1_0_get_metrics_top_consumers: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

TopConsumersJson

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv3_1_0_get_top_apis

TopApisJson o_bpv3_1_0_get_top_apis()

Get Top APIs

Get metrics about the most popular APIs. e.g.: total count, response time (in ms), etc.

Should be able to filter on the following fields

eg: /management/metrics/top-apis?from_date=1970-01-01T00:00:00.000Z&to_date=2023-02-16T16:23:47.686Z&consumer_id=5
&user_id=66214b8e-259e-44ad-8868-3eb47be70646&implemented_by_partial_function=getTransactionsForBankAccount
&implemented_in_version=v3.0.0&url=/obp/v3.0.0/banks/gh.29.uk/accounts/8ca8a7e4-6d02-48e3-a029-0b2bf89de9f0/owner/transactions
&verb=GET&anon=false&app_name=MapperPostman
&exclude_app_names=API-EXPLORER,API-Manager,SOFI,null

1 from_date (defaults to the one year ago): eg:from_date=1970-01-01T00:00:00.000Z

2 to_date (defaults to the current date) eg:to_date=2023-02-16T16:23:47.686Z

3 consumer_id (if null ignore)

4 user_id (if null ignore)

5 anon (if null ignore) only support two value : true (return where user_id is null.) or false (return where user_id is not null.)

6 url (if null ignore), note: can not contain '&'.

7 app_name (if null ignore)

8 implemented_by_partial_function (if null ignore),

9 implemented_in_version (if null ignore)

10 verb (if null ignore)

11 correlation_id (if null ignore)

12 duration (if null ignore) non digit chars will be silently omitted

13 exclude_app_names (if null ignore).eg: &exclude_app_names=API-EXPLORER,API-Manager,SOFI,null

14 exclude_url_patterns (if null ignore).you can design you own SQL NOT LIKE pattern. eg: &exclude_url_patterns=%management/metrics%,%management/aggregate-metrics%

15 exclude_implemented_by_partial_functions (if null ignore).eg: &exclude_implemented_by_partial_functions=getMetrics,getConnectorMetrics,getAggregateMetrics

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.MetricApi(obp_python.ApiClient(configuration))

try:
    # Get Top APIs
    api_response = api_instance.o_bpv3_1_0_get_top_apis()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MetricApi->o_bpv3_1_0_get_top_apis: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

TopApisJson

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

o_bpv5_0_0_get_metrics_at_bank

MetricsJson o_bpv5_0_0_get_metrics_at_bank(bank_id)

Get Metrics at Bank

Get the all metrics at the Bank specified by BANK_ID

require CanReadMetrics role

Filters Part 1.filtering (no wilde cards etc.) parameters to GET /management/metrics

Should be able to filter on the following metrics fields

eg: /management/metrics?from_date=1100-01-01T01:01:01.000Z&to_date=1100-01-01T01:01:01.000Z&limit=50&offset=2

1 from_date (defaults to one week before current date): eg:from_date=1100-01-01T01:01:01.000Z

2 to_date (defaults to current date) eg:to_date=1100-01-01T01:01:01.000Z

3 limit (for pagination: defaults to 50) eg:limit=200

4 offset (for pagination: zero index, defaults to 0) eg: offset=10

5 sort_by (defaults to date field) eg: sort_by=date
possible values:
"url",
"date",
"user_name",
"app_name",
"developer_email",
"implemented_by_partial_function",
"implemented_in_version",
"consumer_id",
"verb"

6 direction (defaults to date desc) eg: direction=desc

eg: /management/metrics?from_date=1100-01-01T01:01:01.000Z&to_date=1100-01-01T01:01:01.000Z&limit=10000&offset=0&anon=false&app_name=TeatApp&implemented_in_version=v2.1.0&verb=POST&user_id=c7b6cb47-cb96-4441-8801-35b57456753a&user_name=susan.uk.29@example.com&consumer_id=78

Other filters:

7 consumer_id (if null ignore)

8 user_id (if null ignore)

9 anon (if null ignore) only support two value : true (return where user_id is null.) or false (return where user_id is not null.)

10 url (if null ignore), note: can not contain '&'.

11 app_name (if null ignore)

12 implemented_by_partial_function (if null ignore),

13 implemented_in_version (if null ignore)

14 verb (if null ignore)

15 correlation_id (if null ignore)

16 duration (if null ignore) non digit chars will be silently omitted

Authentication is Mandatory

Example

from __future__ import print_function
import time
import obp_python
from obp_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: directLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: gatewayLogin
configuration = obp_python.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = obp_python.MetricApi(obp_python.ApiClient(configuration))
bank_id = 'bank_id_example' # str | The bank id

try:
    # Get Metrics at Bank
    api_response = api_instance.o_bpv5_0_0_get_metrics_at_bank(bank_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MetricApi->o_bpv5_0_0_get_metrics_at_bank: %s\n" % e)

Parameters

Name Type Description Notes
bank_id str The bank id

Return type

MetricsJson

Authorization

directLogin, gatewayLogin

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]