Skip to main content

SubscriptionClient

add_subscription

Adds a new subscription which will be verified against every new added file and dataset

Arguments:

name: Name of the subscription

account (String): Account identifier

filter_ (Dict): Dictionary of attributes by which the input data should be filtered Example: {'dsn': 'data11_hi*.express_express.*,data11_hi*physics_MinBiasOverlay*', 'account': 'tzero'}

replication_rules (Dict): Replication rules to be set : Dictionary with keys copies, rse_expression, weight, rse_expression

comments (String): Comments for the subscription

lifetime (Integer or False): Subscription's lifetime (days); False if subscription has no lifetime

retroactive (Boolean): Flag to know if the subscription should be applied on previous data

dry_run (Boolean): Just print the subscriptions actions without actually executing them (Useful if retroactive flag is set)

priority (Integer): The priority of the subscription (3 by default)

list_subscriptions

Returns a dictionary with the subscription information :

Examples: {'status': 'INACTIVE/ACTIVE/BROKEN', 'last_modified_date': ...}

Arguments:

name: Name of the subscription

account (String): Account identifier

Raises:

``: exception.NotFound if subscription is not found

Returns:

Dict: Dictionary containing subscription parameter

update_subscription

Updates a subscription

Arguments:

name: Name of the subscription

account (String): Account identifier

filter_ (Dict): Dictionary of attributes by which the input data should be filtered Example: {'dsn': 'data11_hi*.express_express.*,data11_hi*physics_MinBiasOverlay*', 'account': 'tzero'}

replication_rules (Dict): Replication rules to be set : Dictionary with keys copies, rse_expression, weight, rse_expression

comments (String): Comments for the subscription

lifetime (Integer or False): Subscription's lifetime (days); False if subscription has no lifetime

retroactive (Boolean): Flag to know if the subscription should be applied on previous data

dry_run (Boolean): Just print the subscriptions actions without actually executing them (Useful if retroactive flag is set)

priority (Integer): The priority of the subscription

Raises:

``: exception.NotFound if subscription is not found

list_subscription_rules

List the associated rules of a subscription.

Arguments:

account: Account of the subscription.

name: Name of the subscription.