Commit 1538d909 authored by Joao Pedro Lopes's avatar Joao Pedro Lopes
Browse files

Merge branch "develop" for release 3.11.1

parents ef714792 12a76398
Pipeline #3525057 passed with stage
in 2 minutes and 17 seconds
......@@ -1119,6 +1119,9 @@ Get a list of active jobs, or those that match the filter requirements
##### Returns
Array of [Job](#job)
##### Notes
To prevent heavy queries, only non-terminal (e.g.: ACTIVE) jobs are listed.<br/>If 'state_in' argument is requested, make sure to also provide either 'limit' or 'time_window' to get completed jobs
##### Query arguments
|Name |Type |Required|Description |
......@@ -1146,6 +1149,9 @@ Get a list of active jobs, or those that match the filter requirements
##### Returns
Array of [Job](#job)
##### Notes
To prevent heavy queries, only non-terminal (e.g.: ACTIVE) jobs are listed.<br/>If 'state_in' argument is requested, make sure to also provide either 'limit' or 'time_window' to get completed jobs
##### Query arguments
|Name |Type |Required|Description |
......@@ -1561,6 +1567,7 @@ Models
|-------------------|--------|
|cred_id |string |
|user_dn |string |
|dst_file_report |boolean |
|retry |integer |
|job_id |string |
|cancel_job |boolean |
......@@ -1586,7 +1593,7 @@ Models
|target_qos |string |
|verify_checksum |string |
|job_finished |dateTime|
|overwrite_flag |boolean |
|overwrite_flag |string |
### Job
......@@ -1595,6 +1602,7 @@ Models
|cred_id |string |
|user_dn |string |
|job_type |string |
|dst_file_report |boolean |
|retry |integer |
|job_id |string |
|cancel_job |boolean |
......@@ -1620,7 +1628,7 @@ Models
|target_qos |string |
|verify_checksum |string |
|job_finished |dateTime|
|overwrite_flag |boolean |
|overwrite_flag |string |
### File
......
......@@ -4,7 +4,7 @@
%{!?nosetest_path: %global nosetest_path "/tmp"}
Name: fts-rest
Version: 3.11.0
Version: 3.11.1
Release: 1%{?dist}
BuildArch: noarch
Summary: FTS3 Rest Interface
......@@ -350,6 +350,9 @@ EOF
%changelog
* Thu Feb 03 2022 Joao Lopes <joao.pedro.batista.lopes@cern.ch> - 3.11.1-1
- New patch release
* Wed Sep 22 2021 Mihai Patrascoiu <mihai.patrascoiu@cern.ch> - 3.11.0-1
- New Minor release
- Destination file report feature
......
......@@ -64,7 +64,7 @@ base_dir = os.path.dirname(__file__)
setup(
name='fts3-rest',
version='3.11.0',
version='3.11.1',
description='FTS3 Python Libraries',
long_description='FTS3 Python Libraries',
author='FTS3 Developers',
......
......@@ -23,7 +23,7 @@ import socket
import sys
from fts3.rest.client import Context
from fts3 import __version__ as CLIENT_VERSION
CONFIG_FILENAMES = [
'/etc/fts3/fts3client.cfg',
......@@ -138,7 +138,8 @@ class Base(object):
raise NotImplementedError('Run method not implemented in %s' % type(self).__name__)
def _create_context(self):
user_agent = "fts-rest-cli/" + CLIENT_VERSION
return Context(
self.options.endpoint, ukey=self.options.ukey, ucert=self.options.ucert, verify=self.options.verify,
access_token=self.options.access_token, capath=self.options.capath
access_token=self.options.access_token, capath=self.options.capath, user_agent=user_agent
)
......@@ -17,6 +17,8 @@
from datetime import datetime
from M2Crypto import X509, RSA, EVP, BIO
from fts3 import __version__ as CLIENT_VERSION
try:
from M2Crypto.ASN1 import UTC
except:
......@@ -145,11 +147,18 @@ class Context(object):
raise BadEndpoint("%s (%s)" % (self.endpoint, str(e))), None, sys.exc_info()[2]
return endpoint_info
def _set_user_agent(self, user_agent=None):
if user_agent is None:
self.user_agent = 'fts-python-bindings/' + CLIENT_VERSION
else:
self.user_agent = user_agent
def __init__(self, endpoint, ucert=None, ukey=None, verify=True, access_token=None, no_creds=False, capath=None,
request_class=PycurlRequest, connectTimeout=30, timeout=30):
request_class=PycurlRequest, connectTimeout=30, timeout=30, user_agent=None):
self.passwd = None
self.access_method = None
self._set_user_agent(user_agent)
self._set_endpoint(endpoint)
if no_creds:
self.ucert = self.ukey = self.access_token = None
......@@ -180,21 +189,24 @@ class Context(object):
query = '&'.join(map(lambda (k, v): "%s=%s" % (k, urllib.quote(v)), args.iteritems()))
path += '?' + query
return self._requester.method('GET',
"%s/%s" % (self.endpoint, path))
"%s/%s" % (self.endpoint, path),
headers = {'User-Agent': self.user_agent})
def put(self, path, body):
return self._requester.method('PUT',
"%s/%s" % (self.endpoint, path),
body)
body = body, headers = {'User-Agent': self.user_agent})
def delete(self, path):
return self._requester.method('DELETE',
"%s/%s" % (self.endpoint, path))
"%s/%s" % (self.endpoint, path),
headers = {'User-Agent': self.user_agent})
def post_json(self, path, body):
if not isinstance(body, str) and not isinstance(body, unicode):
body = json.dumps(body)
headers = {'Content-Type': 'application/json', 'User-Agent': self.user_agent}
return self._requester.method('POST',
"%s/%s" % (self.endpoint, path),
body,
headers={'Content-Type': 'application/json'})
body = body,
headers = headers)
......@@ -28,7 +28,7 @@ from fts3rest.lib.base import BaseController, Session
from fts3rest.lib.helpers import jsonify
from fts3rest.lib import api
API_VERSION = dict(major=3, minor=11, patch=0)
API_VERSION = dict(major=3, minor=11, patch=1)
def _get_fts_core_version():
......
......@@ -235,6 +235,7 @@ class DelegationController(BaseController):
if not cred:
return None
else:
log.info("dlg_id={} termination_time=\"{}\"".format(dlg_id, cred.termination_time))
return {
'termination_time': cred.termination_time,
'voms_attrs': cred.voms_attrs.split('\n')
......
......@@ -97,6 +97,9 @@ class JobsController(BaseController):
def index(self):
"""
Get a list of active jobs, or those that match the filter requirements
To prevent heavy queries, only non-terminal (e.g.: ACTIVE) jobs are listed.
If 'state_in' argument is requested, make sure to also provide either 'limit' or 'time_window' to get completed jobs
"""
user = request.environ['fts3.User.Credentials']
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment