File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# foxops-client-python
22
33This repository contains the Python client for the [ foxops] ( https://github.com/roche/foxops ) templating tool.
4+
5+ ## Installation
6+
7+ ``` shell
8+ pip install foxops-client
9+ ```
10+
11+ ## Usage
12+
13+ ``` python
14+ from foxops_client import FoxOpsClient
15+
16+ client = FoxOpsClient(" http://localhost:8080" , " my-token" )
17+ client.list_incarnations()
18+ ```
Original file line number Diff line number Diff line change 11from importlib .metadata import version
22
3+ from .client import FoxOpsClient
4+
35__version__ = version ("foxops_client" )
6+
7+ __all__ = ["FoxOpsClient" ]
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ def update_incarnation(
130130 return IncarnationWithDetails (** resp .json ())
131131 case httpx .codes .NOT_FOUND :
132132 raise IncarnationDoesNotExistError (resp .json ()["message" ])
133- case httpx .codes .BAD_REQUEST | httpx .codes .CONFLICT | httpx . codes . INTERNAL_SERVER_ERROR :
133+ case httpx .codes .BAD_REQUEST | httpx .codes .CONFLICT :
134134 self .log .error (f"received error from FoxOps API: { resp .status_code } { resp .headers } { resp .text } " )
135135 raise FoxOpsApiError (resp .json ()["message" ])
136136
@@ -176,7 +176,7 @@ def create_incarnation(
176176 return True , IncarnationWithDetails (** resp .json ())
177177 case httpx .codes .CREATED :
178178 return False , IncarnationWithDetails (** resp .json ())
179- case httpx .codes .BAD_REQUEST | httpx . codes . INTERNAL_SERVER_ERROR :
179+ case httpx .codes .BAD_REQUEST :
180180 self .log .error (f"received error from FoxOps API: { resp .status_code } { resp .headers } { resp .text } " )
181181 raise FoxOpsApiError (resp .json ()["message" ])
182182
You can’t perform that action at this time.
0 commit comments