Skip to content

Commit 5ba0926

Browse files
updated onelens backend python client
1 parent a93a010 commit 5ba0926

4 files changed

Lines changed: 652 additions & 4 deletions

File tree

onelens_backend_client_v2/models.py

Lines changed: 122 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: <stdin>
3-
# timestamp: 2026-01-19T10:11:23+00:00
3+
# timestamp: 2026-01-21T10:22:35+00:00
44

55
from __future__ import annotations
66

@@ -1981,6 +1981,18 @@ class GetAgentRunConfigRequest(BaseModel):
19811981
)
19821982

19831983

1984+
class GetAggregatedPolicyStatsAPIRequest(BaseModel):
1985+
pass
1986+
1987+
1988+
class GetAggregatedPolicyStatsRequest(BaseModel):
1989+
tenant_id: UUID = Field(..., title="Tenant Id")
1990+
1991+
1992+
class GetAggregatedPolicyStatsResponse(BaseModel):
1993+
stats: Dict[str, Any] = Field(..., title="Stats")
1994+
1995+
19841996
class GetAggregatedTicketsStatsResponse(BaseModel):
19851997
stat_name: str = Field(..., title="Stat Name")
19861998
total: float = Field(..., title="Total")
@@ -4182,6 +4194,11 @@ class PolicyTicketStatus(str, Enum):
41824194
DEPRECATED = "DEPRECATED"
41834195

41844196

4197+
class PolicyType(str, Enum):
4198+
POLICY = "POLICY"
4199+
INSIGHTS = "INSIGHTS"
4200+
4201+
41854202
class PostNaviraLogsRequest(BaseModel):
41864203
pagination: Optional[PaginationParams] = Field(
41874204
{"page": 1, "page_size": 10},
@@ -5289,6 +5306,12 @@ class ResponseEnableTenantPolicyResponse(BaseModel):
52895306
status_code: Optional[int] = Field(200, title="Status Code")
52905307

52915308

5309+
class ResponseGetAggregatedPolicyStatsResponse(BaseModel):
5310+
data: GetAggregatedPolicyStatsResponse
5311+
message: Optional[str] = Field(None, title="Message")
5312+
status_code: Optional[int] = Field(200, title="Status Code")
5313+
5314+
52925315
class ResponseGetAggregatedTicketsStatsResponse(BaseModel):
52935316
data: GetAggregatedTicketsStatsResponse
52945317
message: Optional[str] = Field(None, title="Message")
@@ -5907,6 +5930,27 @@ class SyncRecommendationUnitFromRepoResponse(BaseModel):
59075930
)
59085931

59095932

5933+
class SyncTenantPoliciesDataRequest(BaseModel):
5934+
policy_ids: List[UUID4] = Field(
5935+
..., description="The ids of the policies.", title="Policy Ids"
5936+
)
5937+
tenant_id: UUID4 = Field(..., title="Tenant Id")
5938+
5939+
5940+
class SyncTenantPoliciesDataResponse(BaseModel):
5941+
policies_synced: bool = Field(
5942+
..., description="Whether the policies were synced", title="Policies Synced"
5943+
)
5944+
policies_synced_count: int = Field(
5945+
..., description="The number of policies synced", title="Policies Synced Count"
5946+
)
5947+
policies_not_synced_count: int = Field(
5948+
...,
5949+
description="The number of policies not synced",
5950+
title="Policies Not Synced Count",
5951+
)
5952+
5953+
59105954
class SyncTicketDataRequest(BaseModel):
59115955
ticket_ids: List[UUID] = Field(
59125956
..., description="The unique identifiers of the tickets", title="Ticket Ids"
@@ -7274,6 +7318,10 @@ class UploadedFileDetails(BaseModel):
72747318
)
72757319

72767320

7321+
class UpsertAggregatedPoliciesResponse(BaseModel):
7322+
pass
7323+
7324+
72777325
class UpsertAggregatedTicketsResponse(BaseModel):
72787326
pass
72797327

@@ -8076,6 +8124,33 @@ class AggregatedBucketMetrics(BaseModel):
80768124
total_objects_sum: int = Field(..., title="Total Objects Sum")
80778125

80788126

8127+
class AggregatedPoliciesMixin(BaseModel):
8128+
policy_ol_id: UUID = Field(
8129+
..., description="The unique identifier of the policy", title="Policy Ol Id"
8130+
)
8131+
title: str = Field(..., description="The title of the policy", title="Title")
8132+
alias: str = Field(..., description="The alias of the policy", title="Alias")
8133+
description: str = Field(
8134+
..., description="The description of the policy", title="Description"
8135+
)
8136+
category: PolicyCategory = Field(..., description="The category of the policy")
8137+
subcategory: OnelensModelsServiceInterfacesPoliciesCommonsSubcategory = Field(
8138+
..., description="The subcategory of the policy"
8139+
)
8140+
system_state: TenantPolicySystemState = Field(
8141+
..., description="The system state of the policy"
8142+
)
8143+
state: TenantPolicyState = Field(..., description="The state of the policy")
8144+
service: Union[AwsService, GcpService] = Field(
8145+
..., description="The service of the policy", title="Service"
8146+
)
8147+
provider: Provider = Field(..., description="The provider of the policy")
8148+
policy_type: PolicyType = Field(..., description="The type of the policy")
8149+
last_run_on: Optional[datetime] = Field(
8150+
None, description="The last run on date of the policy", title="Last Run On"
8151+
)
8152+
8153+
80798154
class AggregatedStorageMetrics(BaseModel):
80808155
ol_id: str = Field(..., title="Ol Id")
80818156
metrics_by_storage: List[StorageMetrics] = Field(..., title="Metrics By Storage")
@@ -9907,6 +9982,11 @@ class GetActionTypeResponse(BaseModel):
99079982
pagination: PaginationFields = Field(..., description="Pagination fields")
99089983

99099984

9985+
class GetAggregatedPoliciesAPIResponse(BaseModel):
9986+
pagination: PaginationFields = Field(..., description="Pagination fields.")
9987+
data: List[Dict[str, Any]] = Field(..., title="Data")
9988+
9989+
99109990
class GetAggregatedTicketsAPIResponse(BaseModel):
99119991
pagination: PaginationFields = Field(..., description="Pagination fields.")
99129992
data: List[Dict[str, Any]] = Field(..., title="Data")
@@ -12596,6 +12676,12 @@ class ResponseFetchTenantUsersResponse(BaseModel):
1259612676
status_code: Optional[int] = Field(200, title="Status Code")
1259712677

1259812678

12679+
class ResponseGetAggregatedPoliciesAPIResponse(BaseModel):
12680+
data: GetAggregatedPoliciesAPIResponse
12681+
message: Optional[str] = Field(None, title="Message")
12682+
status_code: Optional[int] = Field(200, title="Status Code")
12683+
12684+
1259912685
class ResponseGetAggregatedTicketsAPIResponse(BaseModel):
1260012686
data: GetAggregatedTicketsAPIResponse
1260112687
message: Optional[str] = Field(None, title="Message")
@@ -14234,6 +14320,15 @@ class UpdateUserResponse(BaseModel):
1423414320
id: UUID4 = Field(..., description="Unique identifier for the user", title="Id")
1423514321

1423614322

14323+
class UpsertAggregatedPoliciesRequest(BaseModel):
14324+
tenant_id: UUID = Field(
14325+
..., description="The unique identifier of the tenant", title="Tenant Id"
14326+
)
14327+
aggregated_policies: List[AggregatedPoliciesMixin] = Field(
14328+
..., description="The aggregated policies", title="Aggregated Policies"
14329+
)
14330+
14331+
1423714332
class UpsertAggregatedTicketsRequest(BaseModel):
1423814333
tenant_id: UUID = Field(
1423914334
..., description="The unique identifier of the tenant", title="Tenant Id"
@@ -15223,6 +15318,29 @@ class GetAgentRunConfigResponse(BaseModel):
1522315318
)
1522415319

1522515320

15321+
class GetAggregatedPoliciesAPIRequest(BaseModel):
15322+
pagination: Optional[PaginationParams] = Field(
15323+
{"page": 1, "page_size": 10},
15324+
description="Pagination parameters for the request.",
15325+
)
15326+
filters: Optional[
15327+
List[OnelensDomainUtilitiesRepositoriesDynamicFiltersFilterCriteria]
15328+
] = Field(None, title="Filters")
15329+
sort_criteria: Optional[SortCriteria] = None
15330+
15331+
15332+
class GetAggregatedPoliciesRequest(BaseModel):
15333+
pagination: Optional[PaginationParams] = Field(
15334+
{"page": 1, "page_size": 10},
15335+
description="Pagination parameters for the request.",
15336+
)
15337+
filters: Optional[
15338+
List[OnelensDomainUtilitiesRepositoriesDynamicFiltersFilterCriteria]
15339+
] = Field(None, title="Filters")
15340+
sort_criteria: Optional[SortCriteria] = None
15341+
tenant_id: UUID = Field(..., title="Tenant Id")
15342+
15343+
1522615344
class GetAggregatedTicketsAPIRequest(BaseModel):
1522715345
pagination: Optional[PaginationParams] = Field(
1522815346
{"page": 1, "page_size": 10},
@@ -19904,17 +20022,17 @@ class CreateCustomTenantTicketRequestMixin(BaseModel):
1990420022
title="Post Policy Execution Last Run",
1990520023
)
1990620024
last_run_id: Optional[UUID4] = Field(
19907-
"d42994fb-4730-48ec-93b3-8c53da91553d",
20025+
"36acc280-dc7a-44a5-90e1-b6812172b7ab",
1990820026
description="Id of the last policy violation/anomaly run",
1990920027
title="Last Run Id",
1991020028
)
1991120029
last_run_at: Optional[datetime] = Field(
19912-
"2026-01-19T15:40:47.753395",
20030+
"2026-01-21T15:52:05.844398",
1991320031
description="Datetime of the last policy violation/anomaly run",
1991420032
title="Last Run At",
1991520033
)
1991620034
first_run_at: Optional[datetime] = Field(
19917-
"2026-01-19T15:40:47.753410",
20035+
"2026-01-21T15:52:05.844412",
1991820036
description="Datetime of the first policy violation/anomaly run",
1991920037
title="First Run At",
1992020038
)

onelens_backend_client_v2/rpc/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@
208208
AggregatedTicketsServiceRpcHandler,
209209
)
210210

211+
from onelens_backend_client_v2.rpc.aggregated_policies_service_rpc_handler import (
212+
AggregatedPoliciesServiceRpcHandler,
213+
)
214+
211215

212216
__all__ = [
213217
"TenantVerifyServiceRpcHandler",
@@ -263,4 +267,5 @@
263267
"AuthServiceRpcHandler",
264268
"TenantOnboardingServiceRpcHandler",
265269
"AggregatedTicketsServiceRpcHandler",
270+
"AggregatedPoliciesServiceRpcHandler",
266271
]

0 commit comments

Comments
 (0)