WHERE DO I START?
You are here:... (Miscellaneous) > API > Policies
  • Top ↑

Policies

The policies API lets you access and manage your policies.

Tip   To explore Netuitive's REST API and test some requests, go here.

Get a list of policies

This method will automatically return a list of policies created for the tenant you are authenticated for.

Method GET URL https://api.app.netuitive.com/policies
Parameters Required/Optional Description
N/A N/A N/A

Input JSON Format for Request Header

Header Name Header Value
Content-Type application/json
Authorization: Basic (Base64 encoded authentication value)

Create a policy

This method will create a policy under your tenant.

Method POST URL https://api.app.netuitive.com/policies
Parameters Required/Optional Description
policyWrapper Required Body parameter. See below.

Input JSON Format for Request Header

Header Name Header Value
Content-Type application/json
Authorization: Basic (Base64 encoded authentication value)

Input JSON Format for Request Body

Attribute Required/Optional Description
policyWrapper Required

The policyWrapper attribute provides Netuitive with the data necessary to create a policy. It contains several attributes:

  • actions (optional)
    • The desired actions for the policy.
  • conditions (optional)
    • The desired conditions for the policy. See Conditions for help with formatting.
  • event conditions (optional)
    • The desired event conditions for the policy. See Conditions for help with formatting.
  • creatorEmail (optional)
    • The email of the person who created the policy.
  • deleted (optional)
    • Whether the policy has been deleted or not.
  • description (optional)
    • Arbitrary description text for the policy.
  • duration (optional)
    • The duration of this policy.
  • enabled (optional)
    • Whether this policy is enabled or not.
  • id (optional)
    • The unique ID for the policy.
  • lastUpdated (optional)
    • The last time the policy was updated.
  • name (optional)
    • The name of the policy.
  • originPolicyId (optional)
    • The Policy ID from which this policy originates.
  • originTenantId (optional)
    • The Tenant ID from which this policy originates.
  • scope (optional)
    • Consists of several additional attributes:
      • elementName (optional), which provides the name of the element.
      • elementNameExclude (optional), which provides a string of characters to not match element names.
      • elementTags (optional), which provides any tags on the element in the format of [{"name":"key1", "value":"value1"}, {"name":"key2", "value":"value2"}, (etc.)].
      • elementType (optional), which provides the type of element.
      • fqnExcludes (optional), which provides a string of characters to not match FQNs.
      • fqnIncludes (optional), which provides a string of characters to match FQNs.

Get the element count for all policies

This method will return the number of elements associated with a policy ID.

Method GET URL https://api.app.netuitive.com/policies/elements
Parameters Required/Optional Description
duration Optional Query parameter. Gives Netuitive an ISO 8601-formatted duration time frame to retrieve data. The duration ends at the current time and begins anytime in the past two weeks. The duration parameter will take precedence over startTime and endTime if all attributes are included in your request.
startTime Optional Query parameter. The start of the window of time from which policies will be returned. The startTime must be in ISO 8601 format. The default startTime is 12:00 AM in the authenticating user's specified time zone.
endTime Optional Query parameter. The end of the window of time from which policies will be returned. The endTime must be in ISO 8601 format. The default endTime is the current time.

Input JSON Format for Request Header

Header Name Header Value
Content-Type application/json
Authorization: Basic (Base64 encoded authentication value)

Get the event count for all policies

This method will return the number of events occurred for a policy.

Method GET URL https://api.app.netuitive.com/policies/events
Parameters Required/Optional Description
duration Optional Query parameter. Gives Netuitive an ISO 8601-formatted duration time frame to retrieve data. The duration ends at the current time and begins anytime in the past two weeks. The duration parameter will take precedence over startTime and endTime if all attributes are included in your request.
startTime Optional Query parameter. The start of the window of time from which policies will be returned. The startTime must be in ISO 8601 format. The default startTime is 12:00 AM in the authenticating user's specified time zone.
endTime Optional Query parameter. The end of the window of time from which policies will be returned. The endTime must be in ISO 8601 format. The default endTime is the current time.

Input JSON Format for Request Header

Header Name Header Value
Content-Type application/json
Authorization: Basic (Base64 encoded authentication value)

Delete a policy

Method DELETE URL https://api.app.netuitive.com/policies/{policyId}
Important   Replace {policyId} in the above URL with a policy ID from any of your policies.
Parameters Required/Optional Description
policyId Required URL (path) parameter. Your policy ID.

Input JSON Format for Request Header

Header Name Header Value
Content-Type application/json
Authorization: Basic (Base64 encoded authentication value)

Get a policy by ID

This method will return a given policy.

Method GET URL https://api.app.netuitive.com/policies/{policyId}
Important   Replace {policyId} in the above URL with a policy ID from any of your policies.
Parameters Required/Optional Description
policyId Required URL (path) parameter. Your policy ID.

Update a policy

This method will update a given policy.

Method PUT URL https://api.app.netuitive.com/policies/{policyId}
Important   Replace {policyId} in the above URL with a policy ID from any of your policies.
Parameters Required/Optional Description
policyId Required URL (path) parameter. Your policy ID.
policyWrapper Optional Body parameter. See below.

Input JSON Format for Request Header

Header Name Header Value
Content-Type application/json
Authorization: Basic (Base64 encoded authentication value)

Input JSON Format for Request Body

Attribute Required/Optional Description
policyWrapper Required

The policyWrapper attribute provides Netuitive with the data necessary to create a policy. It contains several attributes:

  • actions (optional)
    • The desired actions for the policy.
  • conditions (optional)
    • The desired conditions for the policy. See Conditions for help with formatting.
  • event conditions (optional)
    • The desired event conditions for the policy. See Conditions for help with formatting.
  • creatorEmail (optional)
    • The email of the person who created the policy.
  • deleted (optional)
    • Whether the policy has been deleted or not.
  • description (optional)
    • Arbitrary description text for the policy.
  • duration (optional)
    • The duration of this policy.
  • enabled (optional)
    • Whether this policy is enabled or not.
  • id (optional)
    • The unique ID for the policy.
  • lastUpdated (optional)
    • The last time the policy was updated.
  • name (optional)
    • The name of the policy.
  • originPolicyId (optional)
    • The Policy ID from which this policy originates.
  • originTenantId (optional)
    • The Tenant ID from which this policy originates.
  • scope (optional)
    • Consists of several additional attributes:
      • elementName (optional), which provides the name of the element.
      • elementNameExclude (optional), which provides a string of characters to not match element names.
      • elementTags (optional), which provides any tags on the element in the format of [{"name":"key1", "value":"value1"}, {"name":"key2", "value":"value2"}, (etc.)].
      • elementType (optional), which provides the type of element.
      • fqnExcludes (optional), which provides a string of characters to not match FQNs.
      • fqnIncludes (optional), which provides a string of characters to match FQNs.

Get the number of events generated by a policy

This method will automatically return a list of events generated by the specified policy.

Method GET URL https://api.app.netuitive.com/policies/{policyId}/events
Parameters Required/Optional Description
policyId Required URL (path) parameter. The policy ID.
duration Optional Query parameter. Gives Netuitive an ISO 8601-formatted duration time frame to retrieve data. The duration ends at the current time and begins anytime in the past two weeks. The duration parameter will take precedence over startTime and endTime if all attributes are included in your request.
startTime Optional Query parameter. The start of the window of time from which events will be returned. The startTime must be in ISO 8601 format. The default startTime is 12:00 AM in the authenticating user's specified time zone.
endTime Optional Query parameter. The end of the window of time from which events will be returned. The endTime must be in ISO 8601 format. The default endTime is the current time.

Input JSON Format for Request Header

Header Name Header Value
Content-Type application/json
Authorization: Basic (Base64 encoded authentication value)