Skip to content

Network Policy Hits.

POST
/api/data/namespaces/{namespace}/network_policy/hits
curl --request POST \
--url https://example-corp.console.ves.volterra.io/api/v1/api/production/us-east-1/namespaces/default/api/data/namespaces/example/network_policy/hits \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "end_time": "example", "group_by": [ "NAMESPACE" ], "label_filter": [ { "label": "NAMESPACE", "op": "EQ", "value": "example" } ], "namespace": "example", "start_time": "example", "step": "example" }'

GET the counter for Network Policy hits for a given namespace.

Examples of this operation.

namespace
required
string

Namespace Namespace is used to scope network policy hits for the given namespace.

Media typeapplication/json
Network Policy Hits Request

Request to GET the network policy hits counter.

object
end_time
End time

End time of metric collection from which data will be considered. Format: unix_timestamp|RFC 3339

Optional: If not specified, then the end_time will be evaluated to start_time+10m If start_time is not specified, then the end_time will be evaluated to

string
<= 1024 characters
group_by
Group by

Aggregate data by one of more labels specified in group_by.

Optional: If not specified, then the rule hits are aggregated/grouped by POLICY.

Array<string>
Allowed values: NAMESPACE POLICY POLICY_SET POLICY_RULE ACTION SITE
label_filter
Label Filter

List of label filter expressions of the form “label” Op “value”. Response will only contain data that matches all the conditions specified in the label_filter.

Optional: If not specified, then the metrics will be filtered only based on the namespace in the request.

Array<object>
Network Policy Metric Label Filter

Label filter can be specified to filter metrics based on label match.

object
label
string
default: NAMESPACE
Allowed values: NAMESPACE POLICY POLICY_SET POLICY_RULE ACTION SITE
op
string
default: EQ
Allowed values: EQ NEQ
value
Value

Value to be compared with.

string
>= 3 characters <= 1024 characters
namespace
Namespace

Namespace is used to scope network policy hits for the given namespace.

string
>= 6 characters <= 1024 characters
start_time
Start time

Start time of metric collection from which data will be considered. Format: unix_timestamp|RFC 3339

Optional: If not specified, then the start_time will be evaluated to end_time-10m If end_time is not specified, then the start_time will be evaluated to -10m.

string
<= 1024 characters
step
Step

Step is the resolution width, which determines the number of the data points [x-axis (time)] to be returned in the response. The timestamps in the response will be t1=start_time, t2=t1+step, … Tn=tn-1+step, where tn <= end_time. Format: [0-9][smhd], where s - seconds, m - minutes, h - hours, d - days

Optional: If not specified, then step size is evaluated to <end_time - start_time>

string
<= 1024 characters

A successful response.

Media typeapplication/json
Network Policy Hits Response

Number of network policy rule hits for each unique combination of group_by labels in the request.

object
data
Network policy Hits

List of network policy hits data.

Array<object>
Network Policy Hits

NetworkPolicyHits contains the timeseries data of network policy hits.

object
id
object
action
Action

Action associated with the policy rule.

string
<= 1024 characters
namespace
Namespace

Namespace in which the policy rule was hit.

string
>= 6 characters <= 1024 characters
policy
Policy

Policy name.

string
<= 1024 characters
policy_rule
Policy Rule

Policy Rule name.

string
<= 1024 characters
policy_set
Policy Set

Policy Set name.

string
<= 1024 characters
site
Site

Site name

string
<= 1024 characters
metric
Metric

X-unit: “count” List of metric values.

Array<object>
Metric Value

Metric data contains timestamp and the value.

object
timestamp
Timestamp

Timestamp

number format: double
trend_value
object
description
Description

Description of the method used to calculate trend.

string
>= 21 characters <= 1024 characters
previous_value
Previous Value

Configuration parameter for previous value

string
<= 1024 characters
sentiment
string
default: TREND_SENTIMENT_NONE
Allowed values: TREND_SENTIMENT_NONE TREND_SENTIMENT_POSITIVE TREND_SENTIMENT_NEGATIVE
value
Value

Configuration parameter for value

string
>= 3 characters <= 1024 characters
value
Value

Configuration parameter for value

string
>= 3 characters <= 1024 characters
step
step

Actual step size used in the response. It could be higher than the requested step due to metric rollups and the query duration. Format: [0-9][smhd], where s - seconds, m - minutes, h - hours, d - days.

string
<= 1024 characters
Example
{
"data": [
{
"metric": [
{
"trend_value": {
"sentiment": "TREND_SENTIMENT_NONE"
}
}
]
}
]
}

Returned when operation is not authorized.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when there is no permission to access resource.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when resource is not found.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when operation on resource is conflicting with current value.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when operation has been rejected as it is happening too frequently.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when server encountered an error in processing API.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when service is unavailable temporarily.

Media typeapplication/json
string format: string
Examplegenerated
example

Returned when server timed out processing request.

Media typeapplication/json
string format: string
Examplegenerated
example