Client
geostudio.backends.main
Client
Bases: BaseClient
A client for interacting with the Geospatial Studio APIs.
Example usage
Source code in geostudio/backends/main.py
load_classes
Dynamically load all classes from subpackages of geostudio.backends.v2
Source code in geostudio/backends/main.py
list_apikeys
list_apikeys(output: str = 'json')
Retrieves a list of API keys associated with the current user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
The format of the response. Defaults to "json". |
'json'
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
A dictionary containing the list of API keys. The format depends on the 'output' parameter. |
Source code in geostudio/backends/main.py
create_apikey
Creates a new API key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict
|
A dictionary containing the data to be sent in the request body. Defaults to an empty dictionary. |
{}
|
output
|
str
|
The desired output format. Can be either "json" or "xml". Defaults to "json". |
'json'
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
The created API key item |
Raises:
| Type | Description |
|---|---|
HTTPException
|
If user already has 2 API keys registered. |
Source code in geostudio/backends/main.py
activate_apikey
Activate and deactivate an API Key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
apikey_id
|
str
|
The ID of the API key to activate/deactivate. |
required |
output
|
str
|
The format of the response. Defaults to "json". |
'json'
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
A message of successful activation/deactivation. |
Source code in geostudio/backends/main.py
delete_apikey
Deletes an API key by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
apikey_id
|
str
|
The ID of the API key to delete. |
required |
output
|
str
|
The format of the response. Defaults to "json". |
'json'
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
A message of successful deletion. |
Raises:
| Type | Description |
|---|---|
HTTPException
|
If the API Key does not exist. |