Subscriptionclient
SubscriptionClient(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)
¶
SubscriptionClient class for working with subscriptions
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
|
add_subscription(name, account, filter_, replication_rules, comments, lifetime, retroactive, dry_run, priority=3)
¶
Adds a new subscription which will be verified against every new added file and dataset
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the subscription |
required |
account
|
str
|
Account identifier |
required |
filter_
|
dict[str, Any]
|
Dictionary of attributes by which the input data should be filtered Example: |
required |
replication_rules
|
dict[str, Any]
|
Replication rules to be set : Dictionary with keys copies, rse_expression, weight, rse_expression |
required |
comments
|
str
|
Comments for the subscription |
required |
lifetime
|
Union[int, Literal[False]]
|
Subscription's lifetime (days); False if subscription has no lifetime |
required |
retroactive
|
bool
|
Flag to know if the subscription should be applied on previous data |
required |
dry_run
|
bool
|
Just print the subscriptions actions without actually executing them (Useful if retroactive flag is set) |
required |
priority
|
int
|
The priority of the subscription (3 by default) |
3
|
list_subscriptions(name=None, account=None)
¶
Returns a dictionary with the subscription information :
Examples: {'status': 'INACTIVE/ACTIVE/BROKEN', 'last_modified_date': ...}
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
Optional[str]
|
Name of the subscription |
None
|
account
|
Optional[dict[str, Any]]
|
Account identifier |
None
|
Returns:
Type | Description |
---|---|
Union[Iterator[dict[str, Any]], list]
|
Dictionary containing subscription parameter |
update_subscription(name, account=None, filter_=None, replication_rules=None, comments=None, lifetime=None, retroactive=None, dry_run=None, priority=None)
¶
Updates a subscription
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
Name of the subscription |
required | |
account
|
Optional[str]
|
Account identifier |
None
|
filter_
|
Optional[dict[str, Any]]
|
Dictionary of attributes by which the input data should be filtered Example: |
None
|
replication_rules
|
Optional[dict[str, Any]]
|
Replication rules to be set : Dictionary with keys copies, rse_expression, weight, rse_expression |
None
|
comments
|
Optional[str]
|
Comments for the subscription |
None
|
lifetime
|
Optional[Union[int, Literal[False]]]
|
Subscription's lifetime (days); False if subscription has no lifetime |
None
|
retroactive
|
Optional[bool]
|
Flag to know if the subscription should be applied on previous data |
None
|
dry_run
|
Optional[bool]
|
Just print the subscriptions actions without actually executing them (Useful if retroactive flag is set) |
None
|
priority
|
Optional[int]
|
The priority of the subscription |
None
|
list_subscription_rules(account, name)
¶
List the associated rules of a subscription.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
account
|
str
|
Account of the subscription. |
required |
name
|
str
|
Name of the subscription. |
required |