F5 Distributed Cloud Services API for ves.io.schema.service_policy

Download OpenAPI specification:Download

A service_policy object consists of an unordered list of predicates and a list of service policy rules. The predicates are evaluated against a set of input fields that are extracted from or derived from an L7 request API. Any predicates that are not specified in a policy are implicitly considered to be true. The rules in the policy are also evaluated against the input fields. They are treated as an ordered or unordered list depending on the value of the rule combining algorithm. A request API is considered to match a policy if all predicates in the policy evaluate to true and the request API matches one of the rules in the policy.

If the configured rule combining algorithm is FIRST_MATCH, the rules in the policy are evaluated sequentially till a matching rule is identified. If the rule combining algorithm is ALLOW_OVERRIDES all rules with an ALLOW action are evaluated prior to rules with a DENY action. If it is DENY_OVERRIDES, all rules with a DENY action are evaluated prior to rules with a ALLOW action.

A service policy is part of an ordered list of policies in one or more service policy sets. If a request API matches a policy, the resulting action for the policy is the action configured in the matching rule. If a request API does not match a given policy, the next policy in the service policy set is evaluated.

Create Service Policy

Create service_policy creates a new object in the storage backend for metadata.namespace.

path Parameters
metadata.namespace
required
string

namespace

x-example: "staging" This defines the workspace within which each the configuration object is to be created. Must be a DNS_LABEL format. For a namespace object itself, namespace value will be ""

Request Body schema: application/json
required
object (ObjectCreateMetaType)

ObjectCreateMetaType is metadata that can be specified in Create request of an object.

object (Create service policy)

Create service_policy creates a new object in the storage backend for metadata.namespace.

Responses

Request samples

Content type
application/json
{
  • "metadata": {
    },
  • "spec": {
    }
}

Response samples

Content type
application/json
{
  • "metadata": {
    },
  • "spec": {
    },
  • "system_metadata": {
    }
}

Replace Service Policy

Replace service_policy replaces an existing object in the storage backend for metadata.namespace.

path Parameters
metadata.namespace
required
string

namespace

x-example: "staging" This defines the workspace within which each the configuration object is to be created. Must be a DNS_LABEL format. For a namespace object itself, namespace value will be ""

metadata.name
required
string

name

x-example: "acmecorp-web" The configuration object to be replaced will be looked up by name

Request Body schema: application/json
required
object (ObjectReplaceMetaType)

ObjectReplaceMetaType is metadata that can be specified in Replace request of an object.

object (Replace service policy)

Replace service_policy replaces an existing object in the storage backend for metadata.namespace.

Responses

Request samples

Content type
application/json
{
  • "metadata": {
    },
  • "spec": {
    }
}

Response samples

Content type
application/json
{ }

Service Policy Hits

Get the counter for Service Policy hits for a given namespace.

path Parameters
namespace
required
string

Namespace

x-example: "ns1" Namespace is used to scope Service policy hits for the given namespace.

Request Body schema: application/json
required
end_time
string (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

Example: "1570007981"

Validation Rules: ves.io.schema.rules.string.query_time: true

group_by
Array of strings (Group by)
Items Enum: "NAMESPACE" "POLICY" "POLICY_RULE" "ACTION" "SITE" "VIRTUAL_HOST" "POLICY_SET"

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 of objects (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.

namespace
string (Namespace)

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

Example: "ns1"

start_time
string (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

Example: "1570007981"

Validation Rules: ves.io.schema.rules.string.query_time: true

step
string (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>

Example: "5m"

Validation Rules: ves.io.schema.rules.string.query_step: true

Responses

Request samples

Content type
application/json
{
  • "end_time": "string",
  • "group_by": [
    ],
  • "label_filter": [
    ],
  • "namespace": "string",
  • "start_time": "string",
  • "step": "string"
}

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "step": "string"
}

Service Policy Latency

Get the average latency for Service policy evaluation.

path Parameters
namespace
required
string

Namespace

x-example: "ns1" Namespace is used to scope Service policy hits for the given namespace.

Request Body schema: application/json
required
end_time
string (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

Example: "1570007981"

Validation Rules: ves.io.schema.rules.string.query_time: true

group_by
Array of strings (Group by)
Items Enum: "NAMESPACE" "POLICY" "POLICY_RULE" "ACTION" "SITE" "VIRTUAL_HOST" "POLICY_SET"

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 of objects (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.

namespace
string (Namespace)

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

Example: "ns1"

start_time
string (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

Example: "1570007981"

Validation Rules: ves.io.schema.rules.string.query_time: true

step
string (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>

Example: "5m"

Validation Rules: ves.io.schema.rules.string.query_step: true

Responses

Request samples

Content type
application/json
{
  • "end_time": "string",
  • "group_by": [
    ],
  • "label_filter": [
    ],
  • "namespace": "string",
  • "start_time": "string",
  • "step": "string"
}

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "step": "string"
}

List Service Policy

List the set of service_policy in a namespace

path Parameters
namespace
required
string

namespace

x-example: "ns1" Namespace to scope the listing of service_policy

query Parameters
label_filter
string

x-example: "env in (staging, testing), tier in (web, db)" A LabelSelectorType expression that every item in list response will satisfy

report_fields
Array of strings

x-example: "" Extra fields to return along with summary fields

report_status_fields
Array of strings

x-example: "" Extra status fields to return along with summary fields

Responses

Response samples

Content type
application/json
{
  • "errors": [
    ],
  • "items": [
    ]
}

Get Service Policy

Get service_policy reads a given object from storage backend for metadata.namespace.

path Parameters
namespace
required
string

namespace

x-example: "ns1" The namespace in which the configuration object is present

name
required
string

name

x-example: "name" The name of the configuration object to be fetched

query Parameters
response_format
string
Default: "GET_RSP_FORMAT_DEFAULT"
Enum: "GET_RSP_FORMAT_DEFAULT" "GET_RSP_FORMAT_FOR_CREATE" "GET_RSP_FORMAT_FOR_REPLACE" "GET_RSP_FORMAT_STATUS" "GET_RSP_FORMAT_READ" "GET_RSP_FORMAT_REFERRING_OBJECTS" "GET_RSP_FORMAT_BROKEN_REFERENCES"

The format in which the configuration object is to be fetched. This could be for example - in GetSpec form for the contents of object - in CreateRequest form to create a new similar object - to ReplaceRequest form to replace changeable values

Default format of returned resource Response should be in CreateRequest format Response should be in ReplaceRequest format Response should be in StatusObject(s) format Response should be in format of GetSpecType Response should have other objects referring to this object Response should have deleted and disabled objects referrred by this object

Responses

Response samples

Content type
application/json
{
  • "create_form": {
    },
  • "deleted_referred_objects": [
    ],
  • "disabled_referred_objects": [
    ],
  • "metadata": {
    },
  • "referring_objects": [
    ],
  • "replace_form": {
    },
  • "spec": {
    },
  • "status": [
    ],
  • "system_metadata": {
    }
}

Delete Service Policy

Delete the specified service_policy

path Parameters
namespace
required
string

namespace

x-example: "ns1" Namespace in which the configuration object is present

name
required
string

name

x-example: "name" Name of the configuration object

Request Body schema: application/json
required
fail_if_referred
boolean <boolean> (fail_if_referred)

Fail the delete operation if this object is being referred by other objects

name
string (name)

Name of the configuration object

Example: "name"

namespace
string (namespace)

Namespace in which the configuration object is present

Example: "ns1"

Responses

Request samples

Content type
application/json
{
  • "fail_if_referred": true,
  • "name": "string",
  • "namespace": "string"
}

Response samples

Content type
application/json
null