Configclient
ConfigClient(rucio_host=None, auth_host=None, account=None, ca_cert=None, auth_type=None, creds=None, timeout=600, user_agent='rucio-clients', vo=None, logger=LOG)
¶
Client class for working with the configuration
Constructor of the BaseClient.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rucio_host
|
Optional[str]
|
The address of the rucio server, if None it is read from the config file. |
None
|
rucio_port
|
The port of the rucio server, if None it is read from the config file. |
required | |
auth_host
|
Optional[str]
|
The address of the rucio authentication server, if None it is read from the config file. |
None
|
auth_port
|
The port of the rucio authentication server, if None it is read from the config file. |
required | |
account
|
Optional[str]
|
The account to authenticate to rucio. |
None
|
use_ssl
|
Enable or disable ssl for commucation. Default is enabled. |
required | |
ca_cert
|
Optional[str]
|
The path to the rucio server certificate. |
None
|
auth_type
|
Optional[str]
|
The type of authentication (e.g.: 'userpass', 'kerberos' ...) |
None
|
creds
|
Optional[dict[str, Any]]
|
Dictionary with credentials needed for authentication. |
None
|
user_agent
|
Optional[str]
|
Indicates the client. |
'rucio-clients'
|
vo
|
Optional[str]
|
The VO to authenticate into. |
None
|
logger
|
Logger
|
Logger object to use. If None, use the default LOG created by the module |
LOG
|
get_config(section=None, option=None)
¶
Sends the request to get the matching configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
section
|
Optional[str]
|
the optional name of the section. |
None
|
option
|
Optional[str]
|
the optional option within the section. |
None
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
dictionary containing the configuration. |
set_config_option(section, option, value, use_body_for_params=True)
¶
Sends the request to create or set an option within a section. Missing sections will be created.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
section
|
str
|
the name of the section. |
required |
option
|
str
|
the name of the option. |
required |
value
|
Any
|
the value to set on the config option |
required |
use_body_for_params
|
bool
|
send parameters in a json-encoded request body instead of url-encoded TODO: remove this parameter The format of the /config endpoint was recently changed. We migrated from performing a PUT on "/config/ |
True
|
Returns:
Type | Description |
---|---|
bool
|
True if option was removed successfully. False otherwise. |
delete_config_option(section, option)
¶
Sends the request to remove an option from a section
Parameters:
Name | Type | Description | Default |
---|---|---|---|
section
|
str
|
the name of the section. |
required |
option
|
str
|
the name of the option. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if option was removed successfully. False otherwise. |