Skip to content

Latest commit

 

History

History
409 lines (285 loc) · 13.2 KB

PolicyOverrideApi.md

File metadata and controls

409 lines (285 loc) · 13.2 KB

rapid7vmconsole.PolicyOverrideApi

All URIs are relative to https://localhost:3780

Method HTTP request Description
create_policy_override POST /api/3/policy_overrides Policy Overrides
delete_policy_override DELETE /api/3/policy_overrides/{id} Policy Override
get_asset_policy_overrides GET /api/3/assets/{id}/policy_overrides Asset Policy Overrides
get_policy_override GET /api/3/policy_overrides/{id} Policy Override
get_policy_override_expiration GET /api/3/policy_overrides/{id}/expires Policy Override Expiration
get_policy_overrides GET /api/3/policy_overrides Policy Overrides
set_policy_override_expiration PUT /api/3/policy_overrides/{id}/expires Policy Override Expiration
set_policy_override_status POST /api/3/policy_overrides/{id}/{status} Policy Override Status

create_policy_override

CreatedReferencePolicyOverrideIDLink create_policy_override(policy_override=policy_override)

Policy Overrides

Submit a policy override. The policy override can be submitted or it can be submitted and approved in a single request.

Example

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

# create an instance of the API class
api_instance = rapid7vmconsole.PolicyOverrideApi()
policy_override = rapid7vmconsole.PolicyOverride() # PolicyOverride | The specification of a policy override. Allows users to override the compliance result of a policy rule. (optional)

try:
    # Policy Overrides
    api_response = api_instance.create_policy_override(policy_override=policy_override)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyOverrideApi->create_policy_override: %s\n" % e)

Parameters

Name Type Description Notes
policy_override PolicyOverride The specification of a policy override. Allows users to override the compliance result of a policy rule. [optional]

Return type

CreatedReferencePolicyOverrideIDLink

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

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

delete_policy_override

Links delete_policy_override(id)

Policy Override

Removes a policy override created for a policy rule.

Example

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

# create an instance of the API class
api_instance = rapid7vmconsole.PolicyOverrideApi()
id = 789 # int | The identifier of the policy override.

try:
    # Policy Override
    api_response = api_instance.delete_policy_override(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyOverrideApi->delete_policy_override: %s\n" % e)

Parameters

Name Type Description Notes
id int The identifier of the policy override.

Return type

Links

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

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

get_asset_policy_overrides

ResourcesPolicyOverride get_asset_policy_overrides(id)

Asset Policy Overrides

Retrieves policy overrides defined on policy rules for the specified asset.

Example

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

# create an instance of the API class
api_instance = rapid7vmconsole.PolicyOverrideApi()
id = 789 # int | The identifier of the asset.

try:
    # Asset Policy Overrides
    api_response = api_instance.get_asset_policy_overrides(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyOverrideApi->get_asset_policy_overrides: %s\n" % e)

Parameters

Name Type Description Notes
id int The identifier of the asset.

Return type

ResourcesPolicyOverride

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

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

get_policy_override

PolicyOverride get_policy_override(id)

Policy Override

Retrieve the specified policy override.

Example

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

# create an instance of the API class
api_instance = rapid7vmconsole.PolicyOverrideApi()
id = 789 # int | The identifier of the policy override.

try:
    # Policy Override
    api_response = api_instance.get_policy_override(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyOverrideApi->get_policy_override: %s\n" % e)

Parameters

Name Type Description Notes
id int The identifier of the policy override.

Return type

PolicyOverride

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

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

get_policy_override_expiration

str get_policy_override_expiration(id)

Policy Override Expiration

Get the expiration date for a policy override.

Example

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

# create an instance of the API class
api_instance = rapid7vmconsole.PolicyOverrideApi()
id = 789 # int | The identifier of the policy override.

try:
    # Policy Override Expiration
    api_response = api_instance.get_policy_override_expiration(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyOverrideApi->get_policy_override_expiration: %s\n" % e)

Parameters

Name Type Description Notes
id int The identifier of the policy override.

Return type

str

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

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

get_policy_overrides

PageOfPolicyOverride get_policy_overrides(page=page, size=size, sort=sort)

Policy Overrides

Retrieves policy overrides defined on policy rules.

Example

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

# create an instance of the API class
api_instance = rapid7vmconsole.PolicyOverrideApi()
page = 0 # int | The index of the page (zero-based) to retrieve. (optional) (default to 0)
size = 10 # int | The number of records per page to retrieve. (optional) (default to 10)
sort = ['sort_example'] # list[str] | The criteria to sort the records by, in the format: `property[,ASC|DESC]`. The default sort order is ascending. Multiple sort criteria can be specified using multiple sort query parameters. (optional)

try:
    # Policy Overrides
    api_response = api_instance.get_policy_overrides(page=page, size=size, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyOverrideApi->get_policy_overrides: %s\n" % e)

Parameters

Name Type Description Notes
page int The index of the page (zero-based) to retrieve. [optional] [default to 0]
size int The number of records per page to retrieve. [optional] [default to 10]
sort list[str] The criteria to sort the records by, in the format: `property[,ASC DESC]`. The default sort order is ascending. Multiple sort criteria can be specified using multiple sort query parameters.

Return type

PageOfPolicyOverride

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

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

set_policy_override_expiration

Links set_policy_override_expiration(id, expiration=expiration)

Policy Override Expiration

Set the expiration date for a policy override. This must be a valid date in the future.

Example

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

# create an instance of the API class
api_instance = rapid7vmconsole.PolicyOverrideApi()
id = 789 # int | The identifier of the policy override.
expiration = 'expiration_example' # str | The date the policy override is set to expire. Date is represented in ISO 8601 format. (optional)

try:
    # Policy Override Expiration
    api_response = api_instance.set_policy_override_expiration(id, expiration=expiration)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PolicyOverrideApi->set_policy_override_expiration: %s\n" % e)

Parameters

Name Type Description Notes
id int The identifier of the policy override.
expiration str The date the policy override is set to expire. Date is represented in ISO 8601 format. [optional]

Return type

Links

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

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

set_policy_override_status

set_policy_override_status(id, status, comment=comment)

Policy Override Status

Update the status of the specified policy override. The status can be one of the following: \"recall\", \"approve\", or \"reject\".

Example

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

# create an instance of the API class
api_instance = rapid7vmconsole.PolicyOverrideApi()
id = 789 # int | The identifier of the policy override.
status = 'status_example' # str | Policy Override Status
comment = 'comment_example' # str | A comment describing the change of the policy override status. (optional)

try:
    # Policy Override Status
    api_instance.set_policy_override_status(id, status, comment=comment)
except ApiException as e:
    print("Exception when calling PolicyOverrideApi->set_policy_override_status: %s\n" % e)

Parameters

Name Type Description Notes
id int The identifier of the policy override.
status str Policy Override Status
comment str A comment describing the change of the policy override status. [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

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