Skip to content

Metaconventionsclient

MetaConventionClient(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)

Metadata client class for working with data identifier attributes

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_key(key, key_type, value_type=None, value_regexp=None)

Sends the request to add an allowed key for DID metadata (update the DID Metadata Conventions table with a new key).

Parameters:

Name Type Description Default
key str

the name for the new key.

required
key_type Union[KeyType, str]

the type of the key: all(container, dataset, file), collection(dataset or container), file, derived(compute from file for collection).

required
value_type Optional[str]

the type of the value, if defined.

None
value_regexp Optional[str]

the regular expression that values should match, if defined.

None

Returns:

Type Description
Optional[bool]

True if key was created successfully.

Raises:

Type Description
Duplicate

if key already exists.

list_keys()

Sends the request to list all keys for DID Metadata Conventions.

Returns:

Type Description
Optional[list[str]]

a list containing the names of all keys.

list_values(key)

    Sends the request to lists all allowed values for a DID key (all values for a key in DID Metadata Conventions).

.

    :return: a list containing the names of all values for a key.

add_value(key, value)

Sends the request to add a value for a key in DID Metadata Convention.

Parameters:

Name Type Description Default
key str

the name for key.

required
value str

the value.

required

Returns:

Type Description
Optional[bool]

True if value was created successfully.

Raises:

Type Description
Duplicate

if valid already exists.

del_value(key, value)

Delete a key in the DID Metadata Conventions table.

Parameters:

Name Type Description Default
key

the name for key.

required
value

the value.

required

del_key(key)

Delete an allowed key.

Parameters:

Name Type Description Default
key

the name for key.

required

update_key(key, type_=None, regexp=None)

Update a key.

Parameters:

Name Type Description Default
key

the name for key.

required
type_

the type of the value, if defined.

None
regexp

the regular expression that values should match, if defined.

None