sfapi-client 0.3.2__tar.gz → 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/PKG-INFO +1 -1
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/__init__.py +1 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_async/client.py +9 -3
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_models/__init__.py +34 -19
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_sync/client.py +9 -3
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_groups.py +2 -9
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/.github/dependabot.yml +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/.github/workflows/black.yml +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/.github/workflows/mkdocs.yml +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/.github/workflows/pypi.yml +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/.github/workflows/pytest.yml +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/.github/workflows/ruff.yml +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/.gitignore +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/.pre-commit-config.yaml +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/LEGAL +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/LICENSE +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/README.md +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/community/contributing.md +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/examples/check_current_and_past_jobs.ipynb +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/examples/getting_bearer_token.ipynb +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/examples/run_job_and_check_status.ipynb +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/gen_examples.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/gen_sync.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/index.md +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/javascript/apiselector.js +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/quickstart/index.md +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/reference/SUMMARY.txt +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/reference/async/client/index.md +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/reference/async/compute/index.md +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/reference/async/exceptions/index.md +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/reference/async/groups/index.md +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/reference/async/jobs/index.md +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/reference/async/paths/index.md +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/reference/async/projects/index.md +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/reference/async/resources/index.md +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/docs/reference/async/users/index.md +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/mkdocs.yml +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/pyproject.toml +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/pytest.ini +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/requirements-dev.txt +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/scripts/run.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_async/__init__.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_async/compute.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_async/groups.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_async/jobs.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_async/paths.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_async/projects.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_async/users.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_compute.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_jobs.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_models/job_status_response_sacct.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_models/job_status_response_squeue.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_models/resources.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_monitor.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_sync/__init__.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_sync/compute.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_sync/groups.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_sync/jobs.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_sync/paths.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_sync/projects.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_sync/users.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_utils.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/client.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/compute.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/exceptions.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/groups.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/jobs.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/paths.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/projects.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/resources.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/users.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/conftest.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_api.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_api_async.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_client.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_client_async.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_compute.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_compute_async.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_groups_async.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_jobs.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_jobs_async.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_key.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_paths.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_paths_async.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_projects.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_projects_async.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_resources.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_resources_async.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_users.py +0 -0
- {sfapi_client-0.3.2 → sfapi_client-0.4.1}/tests/test_users_async.py +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from .client import AsyncClient # noqa: F401
|
|
2
2
|
from .client import Client # noqa: F401
|
|
3
3
|
from .exceptions import SfApiError # noqa: F401
|
|
4
|
+
from ._models import OutageStatusValue # noqa: F401
|
|
4
5
|
from ._models import StatusValue # noqa: F401
|
|
5
6
|
from ._models.resources import Resource # noqa: F401
|
|
@@ -276,9 +276,15 @@ class AsyncClient:
|
|
|
276
276
|
|
|
277
277
|
await self.__http_client.fetch_token()
|
|
278
278
|
else:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
279
|
+
if self.__http_client.token is None:
|
|
280
|
+
# We don't have a token, fetch one
|
|
281
|
+
await self.__http_client.fetch_token()
|
|
282
|
+
else:
|
|
283
|
+
# We have a session
|
|
284
|
+
# Make sure it's still active
|
|
285
|
+
await self.__http_client.ensure_active_token(
|
|
286
|
+
self.__http_client.token
|
|
287
|
+
)
|
|
282
288
|
# Use regular client, but add the access token if we have one
|
|
283
289
|
elif self.__http_client is None:
|
|
284
290
|
# We already have an access token
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by datamodel-codegen:
|
|
2
|
-
# filename: https://api
|
|
3
|
-
# timestamp:
|
|
2
|
+
# filename: https://api.nersc.gov/api/v1.2/openapi.json
|
|
3
|
+
# timestamp: 2025-01-23T19:49:01+00:00
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
@@ -85,15 +85,12 @@ class Note(BaseModel):
|
|
|
85
85
|
timestamp: Optional[datetime] = Field(None, title="Timestamp")
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
class
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
status: Optional[str] = Field(None, title="Status")
|
|
95
|
-
swo: Optional[str] = Field(None, title="Swo")
|
|
96
|
-
update_at: Optional[datetime] = Field(None, title="Update At")
|
|
88
|
+
class OutageStatusValue(str, Enum):
|
|
89
|
+
Active = "Active"
|
|
90
|
+
Cancelled = "Cancelled"
|
|
91
|
+
Completed = "Completed"
|
|
92
|
+
Extended = "Extended"
|
|
93
|
+
Planned = "Planned"
|
|
97
94
|
|
|
98
95
|
|
|
99
96
|
class PublicHost(str, Enum):
|
|
@@ -126,14 +123,11 @@ class StorageStats(BaseModel):
|
|
|
126
123
|
files_used: Optional[float] = Field(None, title="Files Used")
|
|
127
124
|
|
|
128
125
|
|
|
129
|
-
class
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
class Tasks(BaseModel):
|
|
136
|
-
tasks: Optional[List[Task]] = Field(None, title="Tasks")
|
|
126
|
+
class TaskStatus(str, Enum):
|
|
127
|
+
new = "new"
|
|
128
|
+
completed = "completed"
|
|
129
|
+
cancelled = "cancelled"
|
|
130
|
+
failed = "failed"
|
|
137
131
|
|
|
138
132
|
|
|
139
133
|
class UserInfo(BaseModel):
|
|
@@ -214,6 +208,17 @@ class JobOutput(BaseModel):
|
|
|
214
208
|
error: Optional[str] = Field(None, title="Error")
|
|
215
209
|
|
|
216
210
|
|
|
211
|
+
class Outage(BaseModel):
|
|
212
|
+
name: str = Field(..., title="Name")
|
|
213
|
+
start_at: Optional[datetime] = Field(None, title="Start At")
|
|
214
|
+
end_at: Optional[datetime] = Field(None, title="End At")
|
|
215
|
+
description: Optional[str] = Field(None, title="Description")
|
|
216
|
+
notes: Optional[str] = Field(None, title="Notes")
|
|
217
|
+
status: Optional[OutageStatusValue] = None
|
|
218
|
+
swo: Optional[str] = Field(None, title="Swo")
|
|
219
|
+
update_at: Optional[datetime] = Field(None, title="Update At")
|
|
220
|
+
|
|
221
|
+
|
|
217
222
|
class ProjectStats(BaseModel):
|
|
218
223
|
id: int = Field(..., title="Id")
|
|
219
224
|
description: str = Field(..., title="Description")
|
|
@@ -250,6 +255,16 @@ class QueueOutput(BaseModel):
|
|
|
250
255
|
error: Optional[str] = Field(None, title="Error")
|
|
251
256
|
|
|
252
257
|
|
|
258
|
+
class Task(BaseModel):
|
|
259
|
+
id: str = Field(..., title="Id")
|
|
260
|
+
status: Optional[TaskStatus]
|
|
261
|
+
result: Optional[str] = Field(..., title="Result")
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
class Tasks(BaseModel):
|
|
265
|
+
tasks: Optional[List[Task]] = Field(..., title="Tasks")
|
|
266
|
+
|
|
267
|
+
|
|
253
268
|
class TransferResult(BaseModel):
|
|
254
269
|
task_id: str = Field(..., title="Task Id")
|
|
255
270
|
status: AppRoutersStorageModelsStatus
|
|
@@ -276,9 +276,15 @@ class Client:
|
|
|
276
276
|
|
|
277
277
|
self.__http_client.fetch_token()
|
|
278
278
|
else:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
279
|
+
if self.__http_client.token is None:
|
|
280
|
+
# We don't have a token, fetch one
|
|
281
|
+
self.__http_client.fetch_token()
|
|
282
|
+
else:
|
|
283
|
+
# We have a session
|
|
284
|
+
# Make sure it's still active
|
|
285
|
+
self.__http_client.ensure_active_token(
|
|
286
|
+
self.__http_client.token
|
|
287
|
+
)
|
|
282
288
|
# Use regular client, but add the access token if we have one
|
|
283
289
|
elif self.__http_client is None:
|
|
284
290
|
# We already have an access token
|
|
@@ -3,15 +3,8 @@ from sfapi_client import Client
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
@pytest.mark.api_dev
|
|
6
|
-
def test_group(
|
|
7
|
-
|
|
8
|
-
):
|
|
9
|
-
with Client(
|
|
10
|
-
client_id=dev_client_id,
|
|
11
|
-
secret=dev_client_secret,
|
|
12
|
-
api_base_url=dev_api_url,
|
|
13
|
-
token_url=dev_token_url,
|
|
14
|
-
) as client:
|
|
6
|
+
def test_group(authenticated_client, test_group):
|
|
7
|
+
with authenticated_client as client:
|
|
15
8
|
group = client.group(test_group)
|
|
16
9
|
assert group is not None
|
|
17
10
|
assert group.name == test_group
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_models/job_status_response_sacct.py
RENAMED
|
File without changes
|
{sfapi_client-0.3.2 → sfapi_client-0.4.1}/src/sfapi_client/_models/job_status_response_squeue.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|