controllers_v2.patches_controller module

class controllers_v2.patches_controller.PatchesController(config=None, client=None, call_back=None)[source]

Bases: cohesity_management_sdk.controllers_v2.base_controller.BaseController

A Controller to access Endpoints in the cohesity_management_sdk API.

apply_patches(body)[source]

Does a POST request to /patch-management/available-patches.

Apply a service patch and its dependencies.

Args:

body (ApplyPatch): Request to apply patches.

Returns:

list of ServicePatchLevel: Response from the API. Success

Raises:
APIException: When an error occurs while fetching the data from

the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.

get_applied_patches(service=None, include_details=None)[source]

Does a GET request to /patch-management/applied-patches.

Returns a list of currently applied patches that are running on the cluster.

Args:
service (string, optional): Specifies optional service name whose

current patch is returned. If it is not specified, all the applied patches are returned.

include_details (bool, optional): Specifies whether to return the

details of all the fixes in the patch. By default, returns only the most recent fix made for the service in the patch.

Returns:

list of AppliedPatch: Response from the API. Success

Raises:
APIException: When an error occurs while fetching the data from

the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.

get_available_patches(service=None, include_details=None)[source]

Does a GET request to /patch-management/available-patches.

Returns a list of patches that are available and ready to apply on the cluster.

Args:
service (string, optional): Specifies optional service name whose

available patch is returned. If it is not specified, available patches for all the serivces are returned.

include_details (bool, optional): Specifies whether to return the

description of all the fixes in the patch. By default, returns only the most recent fix made for the service in the patch.

Returns:

list of AvailablePatch: Response from the API. Success

Raises:
APIException: When an error occurs while fetching the data from

the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.

get_patches_history()[source]

Does a GET request to /patch-management/patches-history.

Get the history of all the patch management operations.

Returns:

AppliedPatch1: Response from the API. Success

Raises:
APIException: When an error occurs while fetching the data from

the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.

revert_patches(body)[source]

Does a POST request to /patch-management/applied-patches.

Revert an applied service patch and its dependencies.

Args:

body (RevertPatch): Request to revert patches.

Returns:

list of ServicePatchLevel: Response from the API. Success

Raises:
APIException: When an error occurs while fetching the data from

the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.