IncidentUpdates

Resource

Methods

IncidentUpdate.__init__(manager, data)

Resource initializer.

Parameters
  • manager – The manager this resource belongs to

  • data – The raw json data

IncidentUpdate.update() → cachetclient.v1.incident_updates.IncidentUpdate

Update/save changes

Returns

Updated IncidentUpdate instance

IncidentUpdate.get(name) → Any

Safely obtain any attribute name for the resource

Parameters

name (str) – Key name in json response

Returns

Value from the raw json response. If the key doesn’t exist None is returned.

IncidentUpdate.delete() → None

Deletes the incident update

Attributes

IncidentUpdate.attrs

The raw json response from the server

Type

dict

IncidentUpdate.id

Resource id

Type

int

IncidentUpdate.incident_id

The incident id this update belongs to

Type

int

IncidentUpdate.status

Get or set incident status. See enums.

Type

int

IncidentUpdate.message

Get or set message

Type

str

IncidentUpdate.user_id

The user id creating the update

Type

int

IncidentUpdate.created_at

when the resource was created

Type

datetime

IncidentUpdate.updated_at

When the resource as last updated

Type

datetime

IncidentUpdate.human_status

Human readable status

Type

str

Permanent url to the incident update

Type

str

Manager

Methods

IncidentUpdatesManager.__init__(http_client: cachetclient.httpclient.HttpClient)

Manager initializer.

Parameters

http_client – The httpclient

IncidentUpdatesManager.create(*, incident_id: int, status: int, message: str) → cachetclient.v1.incident_updates.IncidentUpdate

Create an incident update

Keyword Arguments
  • incident_id (int) – The incident to update

  • status (int) – New status id

  • message (str) – Update message

Returns

IncidentUpdate instance

IncidentUpdatesManager.update(*, id: int, incident_id: int, status: int = None, message: str = None, **kwargs) → cachetclient.v1.incident_updates.IncidentUpdate

Update an incident update

Parameters
  • incident_id (int) – The incident

  • id (int) – The incident update id to update

Keyword Arguments
  • status (int) – New status id

  • message (str) – New message

Returns

The updated IncidentUpdate instance

IncidentUpdatesManager.count(incident_id) → int

Count the number of incident update for an incident

Parameters

incident_id (int) – The incident

Returns

Number of incident updates for the incident

Return type

int

IncidentUpdatesManager.list(incident_id: int, page: int = 1, per_page: int = 20) → Generator[cachetclient.v1.incident_updates.IncidentUpdate, None, None]

List updates for an issue

Parameters

incident_id – The incident to list updates

Keyword Arguments
  • page (int) – The first page to request

  • per_page (int) – Entries per page

Returns

Generator of :py:data:`IncidentUpdate`s

IncidentUpdatesManager.get(incident_id: int, update_id: int) → cachetclient.v1.incident_updates.IncidentUpdate

Get an incident update

Parameters
  • incident_id (int) – The incident

  • update_id (int) – The indicent update id to obtain

Returns

IncidentUpdate instance

IncidentUpdatesManager.delete(incident_id: int, update_id: int) → None

Delete an incident update

IncidentUpdatesManager.instance_from_dict(data: dict) → cachetclient.base.Resource

Creates a resource instance from a dictionary.

This doesn’t hit any endpoints in cachet, but rather enables us to create a resource class instance from dictionary data. This can be useful when caching data from cachet in memcache or databases.

Parameters

data (dict) – dictionary containing the instance data

Returns

The resource class instance

Return type

Resource

IncidentUpdatesManager.instance_from_json(data: str) → cachetclient.base.Resource

Creates a resource instance from a json string.

This doesn’t hit any endpoints in cachet, but rather enables us to create a resource class instance from json data. This can be useful when caching data from cachet in memcache or databases.

Parameters

data (str) – json string containing the instance data

Returns

The resource class instance

Return type

Resource

IncidentUpdatesManager.instance_list_from_json(data: str) → List[cachetclient.base.Resource]

Creates a resource instance list from a json string.

This doesn’t hit any endpoints in cachet, but rather enables us to create a resource class instances from json data. This can be useful when caching data from cachet in memcache or databases.

Parameters

data (str) – json string containing the instance data

Returns

The resource class instance

Return type

Resource

Raises

ValueError – if json data do not deserialize into a list

Attributes

IncidentUpdatesManager.path = 'incidents/{}/updates'
IncidentUpdatesManager.resource_class = <class 'cachetclient.v1.incident_updates.IncidentUpdate'>