@@ -505,37 +505,6 @@ def export_timeseries(
505505```
506506
507507
508- </Accordion >
509-
510- ### get\_ container\_ registry\_ credentials
511-
512- ``` python
513- get_container_registry_credentials() -> (
514- ContainerRegistryCredentials
515- )
516- ```
517-
518- Retrieves container registry credentials for Docker image access.
519-
520- ** Returns:**
521-
522- * ` ContainerRegistryCredentials `
523- –The container registry credentials object.
524-
525- <Accordion title = " Source code in dreadnode/api/client.py" icon = " code" >
526- ``` python
527- def get_container_registry_credentials (self ) -> ContainerRegistryCredentials:
528- """
529- Retrieves container registry credentials for Docker image access.
530-
531- Returns:
532- The container registry credentials object.
533- """
534- response = self .request(" POST" , " /platform/registry-token" )
535- return ContainerRegistryCredentials(** response.json())
536- ```
537-
538-
539508</Accordion >
540509
541510### get\_ device\_ codes
@@ -577,13 +546,44 @@ def get_github_access_token(self, repos: list[str]) -> GithubTokenResponse:
577546```
578547
579548
549+ </Accordion >
550+
551+ ### get\_ platform\_ registry\_ credentials
552+
553+ ``` python
554+ get_platform_registry_credentials() -> (
555+ ContainerRegistryCredentials
556+ )
557+ ```
558+
559+ Retrieves container registry credentials for Docker image access.
560+
561+ ** Returns:**
562+
563+ * ` ContainerRegistryCredentials `
564+ –The container registry credentials object.
565+
566+ <Accordion title = " Source code in dreadnode/api/client.py" icon = " code" >
567+ ``` python
568+ def get_platform_registry_credentials (self ) -> ContainerRegistryCredentials:
569+ """
570+ Retrieves container registry credentials for Docker image access.
571+
572+ Returns:
573+ The container registry credentials object.
574+ """
575+ response = self .request(" POST" , " /platform/registry-token" )
576+ return ContainerRegistryCredentials(** response.json())
577+ ```
578+
579+
580580</Accordion >
581581
582582### get\_ platform\_ releases
583583
584584``` python
585585get_platform_releases(
586- tag: str , services: list[str ], cli_version: str | None
586+ tag: str , services: list[str ]
587587) -> RegistryImageDetails
588588```
589589
@@ -596,35 +596,17 @@ Resolves the platform releases for the current project.
596596
597597<Accordion title = " Source code in dreadnode/api/client.py" icon = " code" >
598598``` python
599- def get_platform_releases (
600- self , tag : str , services : list[str ], cli_version : str | None
601- ) -> RegistryImageDetails:
599+ def get_platform_releases (self , tag : str , services : list[str ]) -> RegistryImageDetails:
602600 """
603601 Resolves the platform releases for the current project.
604602
605603 Returns:
606604 The resolved platform releases as a ResolveReleasesResponse object.
607605 """
608- payload = {
609- " tag" : tag,
610- " services" : services,
611- " cli_version" : cli_version,
612- }
613- try :
614- response = self .request(" POST" , " /platform/get-releases" , json_data = payload)
615-
616- except RuntimeError as e:
617- if " 403" in str (e):
618- raise RuntimeError (" You do not have access to platform releases." ) from e
619-
620- if " 404" in str (e):
621- if " Image not found" in str (e):
622- raise RuntimeError (" Image not found" ) from e
606+ from dreadnode.version import VERSION
623607
624- raise RuntimeError (
625- f " Failed to get platform releases: { e} . The feature is likely disabled on this server "
626- ) from e
627- raise
608+ payload = {" tag" : tag, " services" : services, " cli_version" : VERSION }
609+ response = self .request(" POST" , " /platform/get-releases" , json_data = payload)
628610 return RegistryImageDetails(** response.json())
629611```
630612
0 commit comments