FinOps Resource Groups
FinOps resource groups: named groups of resources that budgets and schedules target.
Access it as client.finops.resource_groups on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.
Quick start
from strongly import Strongly
client = Strongly()
# List (auto-paginates as you iterate) # filters: search, status, sort
for finop in client.finops.resource_groups.list():
print(finop.id)
Methods
Core
list
list(*, search: str | None = None, status: str | None = None, sort: str | None = None, limit: int | None = None) -> SyncPaginator[ResourceGroup]
List the resource groups you can use, newest first.
Parameters
search(str | None, optional): Case-insensitive match on the name or description.status(str | None, optional):activeorarchived.sort(str | None, optional): Comma-separated fields,-for descending:-createdAt(the API's default),name,-updatedAt.limit(int | None, optional): The most groups to return;Nonereturns every match.
Returns
SyncPaginator[ResourceGroup]: The matching groups, fetched a page at a time.
create
create(*, name: str, description: str | None = None) -> ResourceGroup
Create an empty, active resource group and return it.
Add resources to it with add_resource.
Parameters
name(str): Group name.description(str | None, optional): What the group is for; the API stores""when none is given.
Returns
ResourceGroup: The created group; you are its owner.
Raises
ValidationError:nameis empty.
retrieve
retrieve(resource_group_id: str) -> ResourceGroup
Return a resource group with its resources.
Parameters
resource_group_id(str): The group's id.
Returns
ResourceGroup: The group.
Raises
NotFoundError: No group you can use has this id.
update
update(resource_group_id: str, *, name: str | None = None, description: str | None = None, status: str | None = None) -> ResourceGroup
Change a resource group and return it; only the fields given change.
Parameters
resource_group_id(str): The group's id.name(str | None, optional): New name.description(str | None, optional): New description.status(str | None, optional):activeorarchived.
Returns
ResourceGroup: The updated group.
Raises
NotFoundError: No group has this id.PermissionDeniedError: You may not change this group.
delete
delete(resource_group_id: str) -> None
Delete a resource group.
Parameters
resource_group_id(str): The group's id.
Raises
NotFoundError: No group has this id.PermissionDeniedError: You may not change this group.UnprocessableEntityError: A budget is scoped to the group (error_coderesource-in-use); delete or re-scope the budget first.
Other
add_resource
add_resource(resource_group_id: str, *, type: str, resource_id: str, name: str) -> ResourceGroup
Add a resource to a resource group and return the group.
Parameters
resource_group_id(str): The group's id.type(str): The resource's type:app,workflow,addon,workspace,project,volume,fine_tuning,self_hosted_model,ml_modelorautoml.resource_id(str): The resource's id.name(str): The name the group shows for it.
Returns
ResourceGroup: The group, with the resource added.
Raises
ValidationError:type,resource_idornameis empty.ConflictError: The resource is already in the group.NotFoundError: No group has this id.PermissionDeniedError: You may not change this group.
remove_resource
remove_resource(resource_group_id: str, resource_id: str, *, type: str) -> ResourceGroup
Remove a resource from a resource group and return the group.
Parameters
resource_group_id(str): The group's id.resource_id(str): The resource's id.type(str): The resource's type, as it was added (seeadd_resource).
Returns
ResourceGroup: The group, without the resource.
Raises
NotFoundError: No group has this id.PermissionDeniedError: You may not change this group.