Esempio n. 1
0
 def put(url, token, parsed, conn):
     conn.request('PUT', '%s/%s/%s' % (parsed.path, self.container,
                                       'x_delete_at_in_the_past'),
                  '', {'X-Auth-Token': token,
                       'Content-Length': '0',
                       'X-Delete-At': '0'})
     return check_response(conn)
Esempio n. 2
0
 def put(url, token, parsed, conn):
     conn.request('PUT', '%s/%s' % (
         parsed.path, shared_container), '',
         {'X-Auth-Token': token,
          'X-Container-Read': tf.swift_test_perm[2],
          'X-Container-Write': tf.swift_test_perm[2]})
     return check_response(conn)
Esempio n. 3
0
 def put(url, token, parsed, conn):
     conn.request('PUT', '%s/%s' % (parsed.path, dest), '',
                  {'X-Auth-Token': token,
                   'Content-Length': '0',
                   'X-Copy-From-Account': acct,
                   'X-Copy-From': source})
     return check_response(conn)
Esempio n. 4
0
 def copy3(url, token, parsed, conn):
     conn.request('COPY', '%s/%s/%s' % (
         parsed.path, self.container, self.obj), '',
         {'X-Auth-Token': token,
          'Destination': '%s/%s' % (shared_container,
                                    'private_object')})
     return check_response(conn)
Esempio n. 5
0
 def copy(url, token, parsed, conn):
     conn.request('PUT', '%s/%s/%s' % (
         parsed.path, shared_container, 'private_object'), '',
         {'X-Auth-Token': token,
          'Content-Length': '0',
          'X-Copy-From': '%s/%s' % (self.container, self.obj)})
     return check_response(conn)
Esempio n. 6
0
 def put(url, token, parsed, conn):
     conn.request('PUT', '%s/%s/manifest' % (
         parsed.path, self.container), '',
         {'X-Auth-Token': token,
          'X-Object-Manifest': '%s/segments3/' % acontainer,
          'Content-Length': '0'})
     return check_response(conn)
Esempio n. 7
0
 def put_copy_from(url, token, parsed, conn, container, obj, source):
     dest_path = '%s/%s/%s' % (parsed.path, container, obj)
     conn.request('PUT', dest_path, '',
                  {'X-Auth-Token': token,
                   'Content-Length': '0',
                   'X-Copy-From': source})
     return check_response(conn)
Esempio n. 8
0
 def put(url, token, parsed, conn):
     conn.request('PUT', '%s/%s/%s' % (
         parsed.path, self.container, 'if_none_match_test'), '',
         {'X-Auth-Token': token,
          'Content-Length': '0',
          'If-None-Match': 'somethingelse'})
     return check_response(conn)
Esempio n. 9
0
 def put(url, token, parsed, conn):
     conn.request('PUT', '%s/%s/%s' % (parsed.path, self.container,
                                       'non_integer_x_delete_after'),
                  '', {'X-Auth-Token': token,
                       'Content-Length': '0',
                       'X-Delete-After': '*'})
     return check_response(conn)
Esempio n. 10
0
 def copy3(url, token, parsed, conn):
     conn.request(
         "COPY",
         "%s/%s/%s" % (parsed.path, self.container, self.obj),
         "",
         {"X-Auth-Token": token, "Destination": "%s/%s" % (shared_container, "private_object")},
     )
     return check_response(conn)
Esempio n. 11
0
 def get(url, token, parsed, conn):
     conn.request(
         "GET",
         "%s/%s/manifest" % (parsed.path, self.container),
         "",
         {"X-Auth-Token": token, "Range": "bytes=5-10"},
     )
     return check_response(conn)
Esempio n. 12
0
 def delete(url, token, parsed, conn):
     conn.request(
         "DELETE",
         "%s/%s/hi" % (parsed.path, self.container),
         "",
         {"X-Auth-Token": token, "X-If-Delete-At": "bad"},
     )
     return check_response(conn)
Esempio n. 13
0
 def put_cors_cont(url, token, parsed, conn, orig):
     conn.request(
         "PUT",
         "%s/%s" % (parsed.path, self.container),
         "",
         {"X-Auth-Token": token, "X-Container-Meta-Access-Control-Allow-Origin": orig},
     )
     return check_response(conn)
Esempio n. 14
0
 def put(url, token, parsed, conn):
     conn.request(
         "PUT",
         "%s/%s/manifest" % (parsed.path, self.container),
         "",
         {"X-Auth-Token": token, "X-Object-Manifest": "%s/segments3/" % acontainer, "Content-Length": "0"},
     )
     return check_response(conn)
Esempio n. 15
0
 def post(url, token, parsed, conn):
     conn.request(
         "POST",
         "%s/%s" % (parsed.path, acontainer),
         "",
         {"X-Auth-Token": token, "X-Container-Read": tf.swift_test_perm[2]},
     )
     return check_response(conn)
Esempio n. 16
0
 def put(url, token, parsed, conn):
     conn.request(
         "PUT",
         "%s/%s/%s" % (parsed.path, self.container, "if_none_match_test"),
         "",
         {"X-Auth-Token": token, "Content-Length": "0", "If-None-Match": "somethingelse"},
     )
     return check_response(conn)
Esempio n. 17
0
 def copy2(url, token, parsed, conn):
     conn.request(
         "COPY",
         "%s/%s/%s" % (parsed.path, shared_container, "obj1"),
         "",
         {"X-Auth-Token": token, "Destination": "%s/%s" % (shared_container, "obj1")},
     )
     return check_response(conn)
Esempio n. 18
0
 def put(url, token, parsed, conn):
     conn.request(
         "PUT",
         "%s/%s" % (parsed.path, dest),
         "",
         {"X-Auth-Token": token, "Content-Length": "0", "X-Copy-From": source},
     )
     return check_response(conn)
Esempio n. 19
0
 def copy(url, token, parsed, conn):
     conn.request(
         "PUT",
         "%s/%s/%s" % (parsed.path, shared_container, "private_object"),
         "",
         {"X-Auth-Token": token, "Content-Length": "0", "X-Copy-From": "%s/%s" % (self.container, self.obj)},
     )
     return check_response(conn)
Esempio n. 20
0
 def put(url, token, parsed, conn, objnum):
     conn.request(
         "PUT",
         "%s/%s/segments3/%s" % (parsed.path, acontainer, str(objnum)),
         segments3[objnum],
         {"X-Auth-Token": token},
     )
     return check_response(conn)
Esempio n. 21
0
 def put(url, token, parsed, conn):
     conn.request(
         "PUT",
         "%s/%s" % (parsed.path, shared_container),
         "",
         {
             "X-Auth-Token": token,
             "X-Container-Read": tf.swift_test_perm[2],
             "X-Container-Write": tf.swift_test_perm[2],
         },
     )
     return check_response(conn)
Esempio n. 22
0
 def get(url, token, parsed, conn, container):
     conn.request('GET', parsed.path + '/' + container + '?format=json',
                  '', {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 23
0
 def clear_meta(url, token, parsed, conn, remove_metadata_keys):
     headers = {"X-Auth-Token": token}
     headers.update((k, "") for k in remove_metadata_keys)
     conn.request("POST", parsed.path, "", headers)
     return check_response(conn)
Esempio n. 24
0
 def put(url, token, parsed, conn):
     conn.request('PUT', parsed.path + '/' + acontainer, '',
                  {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 25
0
 def copy(url, token, parsed, conn):
     conn.request('COPY', '%s/%s' % (parsed.path, source), '', {
         'X-Auth-Token': token,
         'Destination': dest
     })
     return check_response(conn)
Esempio n. 26
0
 def post(url, token, parsed, conn):
     conn.request('POST', parsed.path + '/' + self.container, '', {
         'X-Auth-Token': token,
         'X-Container-Read': ''
     })
     return check_response(conn)
Esempio n. 27
0
 def delete(url, token, parsed, conn):
     conn.request('DELETE',
                  '%s/%s/%s' % (parsed.path, shared_container, 'obj1'),
                  '', {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 28
0
 def head(url, token, parsed, conn):
     conn.request("HEAD", parsed.path, "", {"X-Auth-Token": token})
     return check_response(conn)
Esempio n. 29
0
 def get(url, token, parsed, conn):
     conn.request('GET',
                  '%s/%s/manifest' % (parsed.path, self.container),
                  '', {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 30
0
 def put(url, token, parsed, conn, objnum):
     conn.request(
         'PUT',
         '%s/%s/segments3/%s' % (parsed.path, acontainer, str(objnum)),
         segments3[objnum], {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 31
0
 def post_account(url, token, parsed, conn, headers):
     new_headers = dict({'X-Auth-Token': token}, **headers)
     conn.request('POST', parsed.path, '', new_headers)
     return check_response(conn)
Esempio n. 32
0
 def delete(url, token, parsed, conn):
     conn.request('DELETE', parsed.path + '/' + shared_container, '',
                  {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 33
0
 def get_obj(url, token, parsed, conn, container, obj):
     path = '%s/%s/%s' % (parsed.path, container, obj)
     conn.request('GET', path, '', {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 34
0
 def put(url, token, parsed, conn):
     conn.request('PUT',
                  '%s/%s/%s' % (parsed.path, shared_container, 'obj1'),
                  'test', {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 35
0
 def get_dest(url, token, parsed, conn):
     conn.request('GET', '%s/%s' % (parsed.path, dest), '',
                  {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 36
0
 def get(url, token, parsed, conn):
     conn.request('GET',
                  '%s/%s/%s' % (parsed.path, self.container, self.obj))
     return check_response(conn)
Esempio n. 37
0
 def head(url, token, parsed, conn):
     conn.request('HEAD', parsed.path, '',
                  {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 38
0
 def delete(url, token, parsed, conn):
     conn.request('DELETE', '%s/%s' % (parsed.path, dest), '',
                  {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 39
0
 def delete(url, token, parsed, conn, container, obj):
     conn.request('DELETE',
                  '/'.join([parsed.path, container,
                            obj['name']]), '', {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 40
0
 def post(url, token, parsed, conn):
     conn.request('POST', parsed.path, '',
                  {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 41
0
 def post(url, token, parsed, conn, extra_headers):
     headers = {"X-Auth-Token": token}
     headers.update(extra_headers)
     conn.request("POST", parsed.path, "", headers)
     return check_response(conn)
Esempio n. 42
0
 def post(url, token, parsed, conn, headers):
     new_headers = dict({"X-Auth-Token": token}, **headers)
     conn.request("POST", parsed.path, "", new_headers)
     return check_response(conn)
Esempio n. 43
0
 def put(url, token, parsed, conn, name):
     conn.request('PUT',
                  '%s/%s/%s' % (parsed.path, self.container, name),
                  'test', {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 44
0
 def post(url, token, parsed, conn, name, value):
     conn.request("POST", parsed.path, "", {"X-Auth-Token": token, name: value})
     return check_response(conn)
Esempio n. 45
0
 def delete(url, token, parsed, conn, name):
     conn.request('DELETE',
                  '%s/%s/%s' % (parsed.path, self.container, name), '',
                  {'X-Auth-Token': token})
     return check_response(conn)
Esempio n. 46
0
 def post(url, token, parsed, conn, value):
     conn.request("POST", parsed.path, "", {"X-Auth-Token": token, "X-Account-Meta-Test": value})
     return check_response(conn)
Esempio n. 47
0
 def put(url, token, parsed, conn, name):
     new_headers = dict({'X-Auth-Token': token}, **headers)
     conn.request('PUT', parsed.path + '/' + name, '', new_headers)
     return check_response(conn)
Esempio n. 48
0
 def get(url, token, parsed, conn):
     conn.request("GET", parsed.path, "", {"X-Auth-Token": token})
     return check_response(conn)
Esempio n. 49
0
 def put_obj(url, token, parsed, conn, container, obj):
     # to keep track of things, use the original path as the body
     content = '%s/%s' % (container, obj)
     path = '%s/%s' % (parsed.path, content)
     conn.request('PUT', path, content, {'X-Auth-Token': token})
     return check_response(conn)