policy

Update an existing Agent Policy

put/policies/agent/{id}

Headers

User's access token (bearer auth).

Request body

OR

Example request

{
  "name": "my-policy",
  "description": "A policy example",
  "tags": {
    "region": "eu",
    "node_type": "dns"
  },
  "policy": {
    "handlers": {
      "modules": {
        "default_dns": {
          "type": "dns"
        },
        "default_net": {
          "type": "net"
        }
      }
    }
  }
}

Response

Policy object

idstring uuid required

Unique identifier (UUID)

namestring

A unique name label

descriptionstring

User description of this Policy

tagsobject

User defined key/values for organization and searching

backendstring

The policy backend to use. Cannot change once created.

ts_createdstring date-time

Timestamp of creation

versioninteger

A monotonically increasing counter starting at 0 on creation and increasing with each policy update.

policyobject

Agent backend specific policy data in json format

formatstring

Policy text format needed to specify when a policy was created in yaml format.

policy_datastring

Agent backend specific policy data in yaml format

Example response

{
  "name": "my-policy",
  "description": "An example policy",
  "tags": {
    "region": "eu",
    "node_type": "dns"
  },
  "backend": "pktvisor",
  "policy": {
    "handlers": {
      "modules": {
        "default_dns": {
          "type": "dns"
        },
        "default_net": {
          "type": "net"
        }
      }
    },
    "input": {
      "input_type": "pcap",
      "tap": "default_pcap"
    },
    "kind": "collection"
  },
  "format": "yaml",
  "policy_data": "handlers:\n  modules:\n    default_dns:\n      type: dns\n    default_net:\n      type: net\ninput:\n  input_type: pcap\n  tap: default_pcap\nkind: collection"
}

Changes

Changed in 12 of the 25 revisions of this API.11813

  • d95ee7691efb21See the full diff
    • added the new required header request parameter Authorization to all path's operations

      new-required-request-default-parameter-to-existing-path

    • added the new required header request parameter Authorization

      new-required-request-parameter

    • deleted the header request parameter Bearer authorization

      request-parameter-removed

    • added the new required header request parameter Bearer authorization to all path's operations

      new-required-request-default-parameter-to-existing-path

    • added the new required header request parameter Bearer authorization

      new-required-request-parameter

    • deleted the header request parameter Authorization

      request-parameter-removed

    • added the new optional request property oneOf[PolicyUpdateReqSchemaJson]/policy/handlers

      new-optional-request-property

    • added the new optional request property oneOf[PolicyUpdateReqSchemaJson]/policy/input

      new-optional-request-property

    • added the new optional request property oneOf[PolicyUpdateReqSchemaJson]/policy/kind

      new-optional-request-property

    • added the optional property format to the response with the 201 status

      response-optional-property-added

    • added the optional property policy_data to the response with the 201 status

      response-optional-property-added

    • the policy response's property type/format changed from string/ to object/ for status 201

      response-property-type-changed

  • 36e163b84ec9161See the full diff
    • the request's body type/format changed from object/ to /

      request-body-type-changed

    • removed the request property description

      request-property-removed

    • removed the request property format

      request-property-removed

    • removed the request property name

      request-property-removed

    • removed the request property policy

      request-property-removed

    • removed the request property policy_data

      request-property-removed

    • removed the request property tags

      request-property-removed

    • added PolicyUpdateReqSchemaJson PolicyUpdateReqSchemaYaml to the request body oneOf list

      request-body-one-of-added

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • e0d05716908c12See the full diff
    • the policy request property type/format changed from string/ to object/

      request-property-type-changed

    • added the new optional request property format

      new-optional-request-property

    • added the new optional request property policy_data

      new-optional-request-property

    • the policy request property type/format changed from object/ to string/

      request-property-type-changed

    • the policy response's property type/format changed from object/ to string/ for status 201

      response-property-type-changed

    • added the new optional request property policy

      new-optional-request-property

    • the response optional property ts_created became read-only for the status 201

      response-optional-property-became-read-only

    • the response required property id became read-only for the status 201

      response-required-property-became-read-only

    • endpoint added

      endpoint-added

    • api path removed without deprecation

      api-path-removed-without-deprecation