client
Client
Create a client instance.
Usage:
>>> from sfapi_client import Client
>>> with Client(client_id, client_secret) as client:
>>> # Use client
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client_id
|
Optional[str]
|
The client ID |
None
|
secret
|
Optional[str]
|
The client secret |
None
|
key
|
Optional[Union[str, Path]]
|
Full path to the client secret file, or path relative to |
None
|
api_base_url
|
Optional[str]
|
The API base URL |
SFAPI_BASE_URL
|
token_url
|
Optional[str]
|
The token URL |
SFAPI_TOKEN_URL
|
access_token
|
Optional[str]
|
An existing access token |
None
|
Returns:
Type | Description |
---|---|
Client
|
The client instance |
Source code in sfapi_client/_sync/client.py
api: Api
property
API related information.
resources: Resources
property
Resource related information.
token: str
property
Bearer token string which can be helpful for debugging through swagger UI.
close()
compute(machine)
Create a compute site to submit jobs or view jobs in the queue
Parameters:
Name | Type | Description | Default |
---|---|---|---|
machine
|
Union[Machine, str]
|
Name of the compute machine to use |
required |
Returns:
Type | Description |
---|---|
Compute
|
Compute object that can be used to start jobs, view the queue on the system, or list files and directories. |
Source code in sfapi_client/_sync/client.py
group(name)
Get a group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The group name |
required |
Returns:
Type | Description |
---|---|
Group
|
The group |