Component Groups

Resource

Methods

CompontentGroup.update()

Posts the values in the resource to the server.

Example:

# Change an attribute and save the resource
>> resource.value = something
>> updated_resource = resource.update()
Returns:The updated resource from the server
CompontentGroup.delete() → None

Deletes the resource from the server

Attributes

CompontentGroup.id

Id of the component group

Type:int
CompontentGroup.name

Set or get name of component group

Type:str
CompontentGroup.enabled_components

Enabled components in this group

Type:List[Component]
CompontentGroup.order

Get or set order value for group

Type:int
CompontentGroup.collapsed

Get or set collapsed status. See enums module for values.

Type:int
CompontentGroup.lowest_human_status

Lowest component status, human readable

Type:str
CompontentGroup.is_collapsed

Does the current collapsed value indicate the group is collapsed? Note that the collapsed value may also indicate the group is not operational.

Type:bool
CompontentGroup.is_open

Does the current collapsed value indicate the group is open? Note that the collapsed value may also indicate the group is not operational.

Type:bool
CompontentGroup.is_operational

Does the current collapsed value indicate the group not operational?

Type:bool
CompontentGroup.created_at

When the group was created

Type:datatime
CompontentGroup.updated_at

Last time updated

Type:datetime

Manager

CompontentGroupManager.create(*, name: str, order: int = 0, collapsed: int = 0) → cachetclient.v1.component_groups.CompontentGroup

Create a component group

Keyword Arguments:
 
  • name (str) – Name of the group
  • order (int) – group order
  • collapsed (int) – Collapse value (see enums)
Returns:

CompoentGroup instance

CompontentGroupManager.update(group_id: int, *, name: str, order: int = None, collapsed: int = None, **kwargs) → cachetclient.v1.component_groups.CompontentGroup

Update component group

Parameters:

group_id (int) – The group id to update

Keyword Arguments:
 
  • name (str) – New name for group
  • order (int) – Order value of the group
  • collapsed (int) – Collapsed value. See enums module.
CompontentGroupManager.count() → int

Count the number of component groups

Returns:Number of component groups
Return type:int
CompontentGroupManager.list(page: int = 1, per_page: int = 20) → Generator[cachetclient.v1.component_groups.CompontentGroup, None, None]

List all component groups

Keyword Arguments:
 
  • page (int) – The page to start listing
  • per_page – Number of entires per page
Returns:

Generator of ComponentGroup instances

CompontentGroupManager.get(group_id) → cachetclient.v1.component_groups.CompontentGroup

Get a component group by id

Parameters:group_id (int) – Id of the component group
Returns:ComponentGroup instance
Raises:requests.exceptions.HttpError – if not found
CompontentGroupManager.delete(group_id: int) → None

Delete a component group

Parameters:group_id (int) – Id of the component
Raises:requests.exceptions.HttpError – if not found
CompontentGroupManager.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
CompontentGroupManager.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
CompontentGroupManager.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