Skip to content

Commit e4a02d8

Browse files
committed
Update sdk for saved dashboards and searches
1 parent 43e8da8 commit e4a02d8

7 files changed

Lines changed: 125 additions & 18 deletions

File tree

cli/polyaxon/_sdk/api/project_dashboards_v1_api.py

Lines changed: 70 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
from clipped.compact.pydantic import Field, StrictInt, StrictStr, validate_call
55

66
from polyaxon._sdk.base_api import BaseApi
7+
from polyaxon._sdk.schemas.v1_owner_sub_entity_resource_promote_request import (
8+
V1OwnerSubEntityResourcePromoteRequest,
9+
)
710
from polyaxon._sdk.schemas.v1_dashboard import V1Dashboard
811
from polyaxon._sdk.schemas.v1_list_dashboards_response import V1ListDashboardsResponse
912
from polyaxon.exceptions import ApiTypeError
@@ -557,6 +560,7 @@ def list_project_dashboard_names(
557560
name: Annotated[
558561
StrictStr, Field(..., description="Entity managing the resource")
559562
],
563+
run: Annotated[Optional[StrictStr], Field(description="Run.")] = None,
560564
offset: Annotated[
561565
Optional[StrictInt], Field(description="Pagination offset.")
562566
] = None,
@@ -581,13 +585,15 @@ def list_project_dashboard_names(
581585
This method makes a synchronous HTTP request by default. To make an
582586
asynchronous HTTP request, please pass async_req=True
583587
584-
>>> thread = api.list_project_dashboard_names(owner, name, offset, limit, sort, query, bookmarks, mode, no_page, async_req=True)
588+
>>> thread = api.list_project_dashboard_names(owner, name, run, offset, limit, sort, query, bookmarks, mode, no_page, async_req=True)
585589
>>> result = thread.get()
586590
587591
:param owner: Owner of the namespace (required)
588592
:type owner: str
589593
:param name: Entity managing the resource (required)
590594
:type name: str
595+
:param run: Run.
596+
:type run: str
591597
:param offset: Pagination offset.
592598
:type offset: int
593599
:param limit: Limit size.
@@ -619,7 +625,17 @@ def list_project_dashboard_names(
619625
"""
620626
kwargs["_return_http_data_only"] = True
621627
return self.list_project_dashboard_names_with_http_info(
622-
owner, name, offset, limit, sort, query, bookmarks, mode, no_page, **kwargs
628+
owner,
629+
name,
630+
run,
631+
offset,
632+
limit,
633+
sort,
634+
query,
635+
bookmarks,
636+
mode,
637+
no_page,
638+
**kwargs,
623639
) # noqa: E501
624640

625641
@validate_call
@@ -629,6 +645,7 @@ def list_project_dashboard_names_with_http_info(
629645
name: Annotated[
630646
StrictStr, Field(..., description="Entity managing the resource")
631647
],
648+
run: Annotated[Optional[StrictStr], Field(description="Run.")] = None,
632649
offset: Annotated[
633650
Optional[StrictInt], Field(description="Pagination offset.")
634651
] = None,
@@ -653,13 +670,15 @@ def list_project_dashboard_names_with_http_info(
653670
This method makes a synchronous HTTP request by default. To make an
654671
asynchronous HTTP request, please pass async_req=True
655672
656-
>>> thread = api.list_project_dashboard_names_with_http_info(owner, name, offset, limit, sort, query, bookmarks, mode, no_page, async_req=True)
673+
>>> thread = api.list_project_dashboard_names_with_http_info(owner, name, run, offset, limit, sort, query, bookmarks, mode, no_page, async_req=True)
657674
>>> result = thread.get()
658675
659676
:param owner: Owner of the namespace (required)
660677
:type owner: str
661678
:param name: Entity managing the resource (required)
662679
:type name: str
680+
:param run: Run.
681+
:type run: str
663682
:param offset: Pagination offset.
664683
:type offset: int
665684
:param limit: Limit size.
@@ -703,6 +722,7 @@ def list_project_dashboard_names_with_http_info(
703722
_all_params = [
704723
"owner",
705724
"name",
725+
"run",
706726
"offset",
707727
"limit",
708728
"sort",
@@ -745,6 +765,9 @@ def list_project_dashboard_names_with_http_info(
745765

746766
# process the query parameters
747767
_query_params = []
768+
if _params.get("run") is not None: # noqa: E501
769+
_query_params.append(("run", _params["run"]))
770+
748771
if _params.get("offset") is not None: # noqa: E501
749772
_query_params.append(("offset", _params["offset"]))
750773

@@ -814,6 +837,7 @@ def list_project_dashboards(
814837
name: Annotated[
815838
StrictStr, Field(..., description="Entity managing the resource")
816839
],
840+
run: Annotated[Optional[StrictStr], Field(description="Run.")] = None,
817841
offset: Annotated[
818842
Optional[StrictInt], Field(description="Pagination offset.")
819843
] = None,
@@ -838,13 +862,15 @@ def list_project_dashboards(
838862
This method makes a synchronous HTTP request by default. To make an
839863
asynchronous HTTP request, please pass async_req=True
840864
841-
>>> thread = api.list_project_dashboards(owner, name, offset, limit, sort, query, bookmarks, mode, no_page, async_req=True)
865+
>>> thread = api.list_project_dashboards(owner, name, run, offset, limit, sort, query, bookmarks, mode, no_page, async_req=True)
842866
>>> result = thread.get()
843867
844868
:param owner: Owner of the namespace (required)
845869
:type owner: str
846870
:param name: Entity managing the resource (required)
847871
:type name: str
872+
:param run: Run.
873+
:type run: str
848874
:param offset: Pagination offset.
849875
:type offset: int
850876
:param limit: Limit size.
@@ -876,7 +902,17 @@ def list_project_dashboards(
876902
"""
877903
kwargs["_return_http_data_only"] = True
878904
return self.list_project_dashboards_with_http_info(
879-
owner, name, offset, limit, sort, query, bookmarks, mode, no_page, **kwargs
905+
owner,
906+
name,
907+
run,
908+
offset,
909+
limit,
910+
sort,
911+
query,
912+
bookmarks,
913+
mode,
914+
no_page,
915+
**kwargs,
880916
) # noqa: E501
881917

882918
@validate_call
@@ -886,6 +922,7 @@ def list_project_dashboards_with_http_info(
886922
name: Annotated[
887923
StrictStr, Field(..., description="Entity managing the resource")
888924
],
925+
run: Annotated[Optional[StrictStr], Field(description="Run.")] = None,
889926
offset: Annotated[
890927
Optional[StrictInt], Field(description="Pagination offset.")
891928
] = None,
@@ -910,13 +947,15 @@ def list_project_dashboards_with_http_info(
910947
This method makes a synchronous HTTP request by default. To make an
911948
asynchronous HTTP request, please pass async_req=True
912949
913-
>>> thread = api.list_project_dashboards_with_http_info(owner, name, offset, limit, sort, query, bookmarks, mode, no_page, async_req=True)
950+
>>> thread = api.list_project_dashboards_with_http_info(owner, name, run, offset, limit, sort, query, bookmarks, mode, no_page, async_req=True)
914951
>>> result = thread.get()
915952
916953
:param owner: Owner of the namespace (required)
917954
:type owner: str
918955
:param name: Entity managing the resource (required)
919956
:type name: str
957+
:param run: Run.
958+
:type run: str
920959
:param offset: Pagination offset.
921960
:type offset: int
922961
:param limit: Limit size.
@@ -960,6 +999,7 @@ def list_project_dashboards_with_http_info(
960999
_all_params = [
9611000
"owner",
9621001
"name",
1002+
"run",
9631003
"offset",
9641004
"limit",
9651005
"sort",
@@ -1002,6 +1042,9 @@ def list_project_dashboards_with_http_info(
10021042

10031043
# process the query parameters
10041044
_query_params = []
1045+
if _params.get("run") is not None: # noqa: E501
1046+
_query_params.append(("run", _params["run"]))
1047+
10051048
if _params.get("offset") is not None: # noqa: E501
10061049
_query_params.append(("offset", _params["offset"]))
10071050

@@ -1267,14 +1310,15 @@ def promote_project_dashboard(
12671310
uuid: Annotated[
12681311
StrictStr, Field(..., description="Uuid identifier of the sub-entity")
12691312
],
1313+
body: V1OwnerSubEntityResourcePromoteRequest,
12701314
**kwargs,
12711315
) -> None: # noqa: E501
12721316
"""Promote project dashboard # noqa: E501
12731317
12741318
This method makes a synchronous HTTP request by default. To make an
12751319
asynchronous HTTP request, please pass async_req=True
12761320
1277-
>>> thread = api.promote_project_dashboard(owner, entity, uuid, async_req=True)
1321+
>>> thread = api.promote_project_dashboard(owner, entity, uuid, body, async_req=True)
12781322
>>> result = thread.get()
12791323
12801324
:param owner: Owner of the namespace (required)
@@ -1283,6 +1327,8 @@ def promote_project_dashboard(
12831327
:type entity: str
12841328
:param uuid: Uuid identifier of the sub-entity (required)
12851329
:type uuid: str
1330+
:param body: (required)
1331+
:type body: V1OwnerSubEntityResourcePromoteRequest
12861332
:param async_req: Whether to execute the request asynchronously.
12871333
:type async_req: bool, optional
12881334
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -1300,7 +1346,7 @@ def promote_project_dashboard(
13001346
"""
13011347
kwargs["_return_http_data_only"] = True
13021348
return self.promote_project_dashboard_with_http_info(
1303-
owner, entity, uuid, **kwargs
1349+
owner, entity, uuid, body, **kwargs
13041350
) # noqa: E501
13051351

13061352
@validate_call
@@ -1316,14 +1362,15 @@ def promote_project_dashboard_with_http_info(
13161362
uuid: Annotated[
13171363
StrictStr, Field(..., description="Uuid identifier of the sub-entity")
13181364
],
1365+
body: V1OwnerSubEntityResourcePromoteRequest,
13191366
**kwargs,
13201367
): # noqa: E501
13211368
"""Promote project dashboard # noqa: E501
13221369
13231370
This method makes a synchronous HTTP request by default. To make an
13241371
asynchronous HTTP request, please pass async_req=True
13251372
1326-
>>> thread = api.promote_project_dashboard_with_http_info(owner, entity, uuid, async_req=True)
1373+
>>> thread = api.promote_project_dashboard_with_http_info(owner, entity, uuid, body, async_req=True)
13271374
>>> result = thread.get()
13281375
13291376
:param owner: Owner of the namespace (required)
@@ -1332,6 +1379,8 @@ def promote_project_dashboard_with_http_info(
13321379
:type entity: str
13331380
:param uuid: Uuid identifier of the sub-entity (required)
13341381
:type uuid: str
1382+
:param body: (required)
1383+
:type body: V1OwnerSubEntityResourcePromoteRequest
13351384
:param async_req: Whether to execute the request asynchronously.
13361385
:type async_req: bool, optional
13371386
:param _return_http_data_only: response data without head status code
@@ -1358,7 +1407,7 @@ def promote_project_dashboard_with_http_info(
13581407

13591408
_params = locals()
13601409

1361-
_all_params = ["owner", "entity", "uuid"]
1410+
_all_params = ["owner", "entity", "uuid", "body"]
13621411
_all_params.extend(
13631412
[
13641413
"async_req",
@@ -1403,11 +1452,22 @@ def promote_project_dashboard_with_http_info(
14031452
_files = {}
14041453
# process the body parameter
14051454
_body_params = None
1455+
if _params["body"]:
1456+
_body_params = _params["body"]
1457+
14061458
# set the HTTP header `Accept`
14071459
_header_params["Accept"] = self.api_client.select_header_accept(
14081460
["application/json"]
14091461
) # noqa: E501
14101462

1463+
# set the HTTP header `Content-Type`
1464+
_content_types_list = _params.get(
1465+
"_content_type",
1466+
self.api_client.select_header_content_type(["application/json"]),
1467+
)
1468+
if _content_types_list:
1469+
_header_params["Content-Type"] = _content_types_list
1470+
14111471
# authentication setting
14121472
_auth_settings = ["ApiKey"] # noqa: E501
14131473

cli/polyaxon/_sdk/api/project_searches_v1_api.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
from clipped.compact.pydantic import Field, StrictInt, StrictStr, validate_call
55

66
from polyaxon._sdk.base_api import BaseApi
7+
from polyaxon._sdk.schemas.v1_owner_sub_entity_resource_promote_request import (
8+
V1OwnerSubEntityResourcePromoteRequest,
9+
)
710
from polyaxon._sdk.schemas.v1_list_searches_response import V1ListSearchesResponse
811
from polyaxon._sdk.schemas.v1_search import V1Search
912
from polyaxon.exceptions import ApiTypeError
@@ -1263,14 +1266,15 @@ def promote_project_search(
12631266
uuid: Annotated[
12641267
StrictStr, Field(..., description="Uuid identifier of the sub-entity")
12651268
],
1269+
body: V1OwnerSubEntityResourcePromoteRequest,
12661270
**kwargs,
12671271
) -> None: # noqa: E501
12681272
"""Promote project search # noqa: E501
12691273
12701274
This method makes a synchronous HTTP request by default. To make an
12711275
asynchronous HTTP request, please pass async_req=True
12721276
1273-
>>> thread = api.promote_project_search(owner, entity, uuid, async_req=True)
1277+
>>> thread = api.promote_project_search(owner, entity, uuid, body, async_req=True)
12741278
>>> result = thread.get()
12751279
12761280
:param owner: Owner of the namespace (required)
@@ -1279,6 +1283,8 @@ def promote_project_search(
12791283
:type entity: str
12801284
:param uuid: Uuid identifier of the sub-entity (required)
12811285
:type uuid: str
1286+
:param body: (required)
1287+
:type body: V1OwnerSubEntityResourcePromoteRequest
12821288
:param async_req: Whether to execute the request asynchronously.
12831289
:type async_req: bool, optional
12841290
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -1295,7 +1301,9 @@ def promote_project_search(
12951301
:rtype: None
12961302
"""
12971303
kwargs["_return_http_data_only"] = True
1298-
return self.promote_project_search_with_http_info(owner, entity, uuid, **kwargs) # noqa: E501
1304+
return self.promote_project_search_with_http_info(
1305+
owner, entity, uuid, body, **kwargs
1306+
) # noqa: E501
12991307

13001308
@validate_call
13011309
def promote_project_search_with_http_info(
@@ -1310,14 +1318,15 @@ def promote_project_search_with_http_info(
13101318
uuid: Annotated[
13111319
StrictStr, Field(..., description="Uuid identifier of the sub-entity")
13121320
],
1321+
body: V1OwnerSubEntityResourcePromoteRequest,
13131322
**kwargs,
13141323
): # noqa: E501
13151324
"""Promote project search # noqa: E501
13161325
13171326
This method makes a synchronous HTTP request by default. To make an
13181327
asynchronous HTTP request, please pass async_req=True
13191328
1320-
>>> thread = api.promote_project_search_with_http_info(owner, entity, uuid, async_req=True)
1329+
>>> thread = api.promote_project_search_with_http_info(owner, entity, uuid, body, async_req=True)
13211330
>>> result = thread.get()
13221331
13231332
:param owner: Owner of the namespace (required)
@@ -1326,6 +1335,8 @@ def promote_project_search_with_http_info(
13261335
:type entity: str
13271336
:param uuid: Uuid identifier of the sub-entity (required)
13281337
:type uuid: str
1338+
:param body: (required)
1339+
:type body: V1OwnerSubEntityResourcePromoteRequest
13291340
:param async_req: Whether to execute the request asynchronously.
13301341
:type async_req: bool, optional
13311342
:param _return_http_data_only: response data without head status code
@@ -1352,7 +1363,7 @@ def promote_project_search_with_http_info(
13521363

13531364
_params = locals()
13541365

1355-
_all_params = ["owner", "entity", "uuid"]
1366+
_all_params = ["owner", "entity", "uuid", "body"]
13561367
_all_params.extend(
13571368
[
13581369
"async_req",
@@ -1397,11 +1408,22 @@ def promote_project_search_with_http_info(
13971408
_files = {}
13981409
# process the body parameter
13991410
_body_params = None
1411+
if _params["body"]:
1412+
_body_params = _params["body"]
1413+
14001414
# set the HTTP header `Accept`
14011415
_header_params["Accept"] = self.api_client.select_header_accept(
14021416
["application/json"]
14031417
) # noqa: E501
14041418

1419+
# set the HTTP header `Content-Type`
1420+
_content_types_list = _params.get(
1421+
"_content_type",
1422+
self.api_client.select_header_content_type(["application/json"]),
1423+
)
1424+
if _content_types_list:
1425+
_header_params["Content-Type"] = _content_types_list
1426+
14051427
# authentication setting
14061428
_auth_settings = ["ApiKey"] # noqa: E501
14071429

cli/polyaxon/_sdk/schemas/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
from polyaxon._sdk.schemas.v1_dashboard import V1Dashboard
4040
from polyaxon._sdk.schemas.v1_dashboard_spec import V1DashboardSpec
4141
from polyaxon._sdk.schemas.v1_entities_tags import V1EntitiesTags
42+
from polyaxon._sdk.schemas.v1_owner_sub_entity_resource_promote_request import (
43+
V1OwnerSubEntityResourcePromoteRequest,
44+
)
4245
from polyaxon._sdk.schemas.v1_list_automation_executions_response import (
4346
V1ListAutomationExecutionsResponse,
4447
)
@@ -87,6 +90,7 @@
8790
from polyaxon._sdk.schemas.v1_list_team_members_response import (
8891
V1ListTeamMembersResponse,
8992
)
93+
from polyaxon._sdk.schemas.v1_entity_level import V1EntityLevel
9094
from polyaxon._sdk.schemas.v1_list_teams_response import V1ListTeamsResponse
9195
from polyaxon._sdk.schemas.v1_list_token_response import V1ListTokenResponse
9296
from polyaxon._sdk.schemas.v1_operation_body import V1OperationBody

0 commit comments

Comments
 (0)