gfal_init_python(3) - Linux man page
Name
gfal_init - generates a 'gfal_internal' objectSynopsis
import gfal(int returncode, gfal_internal gfal, string errmsg ) gfal_init (dict req );
Description
It is very important to not modify such an object by hand, it have to be seen as a black box.
- req
- Python dictionary in which you have to put your parameters. To have the list of available parameters see the next section Parameters in req.
- gfal
- gfal_internal object to be passed to other functions.
Parameters in Req
- listOfString surls
- Is the list of SURLs on which you want to do actions. It is mandatory in all cases, except when you want to generate new file names (to create new file on a SE) (see generatesurls parameter).
- int generatesurls
- If set to '1' and surls is set to NULL, gfal_init() will generate nbfiles file names. It is useful when you want to put new files on a SE, and you don't want a specific file name. But in this case, the parameter endpoint must be set to the SE host name on which you want to create files, when to set generatesurls to '1'. In all other cases, it is ignored. Moreover, to generate file names, BDII is required to get the root path, so it is not compatible with no_bdii_check parameter.
- string relative_path
- Is used during file name generation ( generatesurls is set to '1'), to specify the default sub-directory (in the root path) in which to put files. In all other cases, it is ignored.
- int oflag
- Allows to specify if it is a get or a put action. It is only used by gfal_turlsfromsurls() function. By default, the function considers it is a get request.
- listOfInt filesizes
- It is only used and mandatory when oflag is set to '1'. It is a table of size nbfiles in which there are the sizes of the files what will be put on the SE.
- string defaultsetype
- Allows to specify the default type of the given SE to be used. The possible values are none, se, srmv1, srmv2. They respectively correspond to no default type, Classic SE, SRM v1, SRMv2. If BDII calls are not disabled, and there no entry for the given SE with this type, but for another type, the latter will be used. By default, it is set to none.
- string setype
- Allows to specify the type of the given SE to be used. The possible values are none, se, srmv1, srmv2. They respectively correspond to no default type, Classic SE, SRM v1, SRMv2. If BDII calls are not disabled, and there no entry for the given SE with this type, it will fails. By default, it is set to none.
- int no_bdii_check
- Disables call to BDII. So the SE type cannot be get from there, what means that you have to specify it either with defaultsetype or with setype. Moreover, as BDII can't be used to get SE parameters (port number, service path), at least the first SURLs has to contain the full endpoint (eg. srm://lxdpm104.cern.ch:8446/srm/managerv2?SFN=/dpm/cern.ch/home/dteam/file.test). It is not compatible with generatesurls.
- int timeout
- Specifies the time before which remote servers are considered as down. By default, there is no timeout.
- listOfString protocols
- Specifies the list of protocols to use to communicate with the SE. By defaut, it will be set to all protocols understandable by the system (the system has the corresponding library).
- NOTE
- The following parameters are SRMv2-specific, what means that specifying them will force the type of the SE to SRMv2. So it is not compatible with setting setype to another value than none or srmv2.
- char *srmv2_spacetokendesc
- Specifies the space token to used with the given SE.
- int srmv2_desiredpintime
- Specifies the desired pin life time for files on the given SE. It is only used by gfal_pin(), gfal_turlsfromsurls, gfal_get.
- int srmv2_lslevels
- It is only used by gfal_ls. Specifies the number of levels of recursion. Possible values are only '0' (no directory listing) or '1' (one level of directory listing).
- int srmv2_lsoffset
- It is only used by gfal_ls. Specifies the offset from which the listing must begin. In other words, it is the number of file entries to skip.
- int srmv2_lscount
- It is only used by gfal_ls. Specifies the maximum number of files to get. Keep in mind that SEs have also a maximum limit, so whatever you specify here, the number of files will never be higher than the SE limit.
Return Value
This routine returns 0 on a success, or -1 in case of error. In the latter case, errno is set appropriately. Moreover, you can get an error message from errbuf , if specified.Errors
errno indicates the type of error, but for detailled error message, you have to look into errbuf.- EINVAL
- One or more parameter in req have a wrong value.
- ENOMEM
- Not enough free memory.