This file is indexed.

/usr/share/doc/python-swiftclient-doc/html/swiftclient.html is in python-swiftclient-doc 1:3.0.0-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>swiftclient &mdash; Swiftclient 3.0.0 documentation</title>
    
    <link rel="stylesheet" href="_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="_static/tweaks.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '3.0.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="Swiftclient 3.0.0 documentation" href="index.html" />
    <link rel="prev" title="SDK" href="sdk.html" /> 
  </head>
  <body role="document">
  <div id="header">
    <h1 id="logo"><a href="http://www.openstack.org/">OpenStack</a></h1>
    <ul id="navigation">
      
      <li><a href="http://www.openstack.org/" title="Go to the Home page" class="link">Home</a></li>
      <li><a href="http://www.openstack.org/projects/" title="Go to the OpenStack Projects page">Projects</a></li>
      <li><a href="http://www.openstack.org/user-stories/" title="Go to the User Stories page" class="link">User Stories</a></li>
      <li><a href="http://www.openstack.org/community/" title="Go to the Community page" class="link">Community</a></li>
      <li><a href="http://www.openstack.org/blog/" title="Go to the OpenStack Blog">Blog</a></li>
      <li><a href="http://wiki.openstack.org/" title="Go to the OpenStack Wiki">Wiki</a></li>
      <li><a href="http://docs.openstack.org/" title="Go to OpenStack Documentation" class="current">Documentation</a></li>
      
    </ul>
  </div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="module-swiftclient">
<span id="swiftclient"></span><span id="swiftclient-package"></span><h1>swiftclient<a class="headerlink" href="#module-swiftclient" title="Permalink to this headline"></a></h1>
<p>OpenStack Swift Python client binding.</p>
</div>
<div class="section" id="module-swiftclient.client">
<span id="swiftclient-client"></span><h1>swiftclient.client<a class="headerlink" href="#module-swiftclient.client" title="Permalink to this headline"></a></h1>
<p>OpenStack Swift client library used internally</p>
<dl class="class">
<dt id="swiftclient.client.Connection">
<em class="property">class </em><code class="descclassname">swiftclient.client.</code><code class="descname">Connection</code><span class="sig-paren">(</span><em>authurl=None</em>, <em>user=None</em>, <em>key=None</em>, <em>retries=5</em>, <em>preauthurl=None</em>, <em>preauthtoken=None</em>, <em>snet=False</em>, <em>starting_backoff=1</em>, <em>max_backoff=64</em>, <em>tenant_name=None</em>, <em>os_options=None</em>, <em>auth_version='1'</em>, <em>cacert=None</em>, <em>insecure=False</em>, <em>ssl_compression=True</em>, <em>retry_on_ratelimit=False</em>, <em>timeout=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Convenience class to make requests that will also retry the request</p>
<p>Requests will have an X-Auth-Token header whose value is either
the preauthtoken or a token obtained from the auth service using
the user credentials provided as args to the constructor. If
os_options includes a service_username then requests will also have
an X-Service-Token header whose value is a token obtained from the
auth service using the service credentials. In this case the request
url will be set to the storage_url obtained from the auth service
for the service user, unless this is overridden by a preauthurl.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>authurl</strong> &#8211; authentication URL</li>
<li><strong>user</strong> &#8211; user name to authenticate as</li>
<li><strong>key</strong> &#8211; key/password to authenticate with</li>
<li><strong>retries</strong> &#8211; Number of times to retry the request before failing</li>
<li><strong>preauthurl</strong> &#8211; storage URL (if you have already authenticated)</li>
<li><strong>preauthtoken</strong> &#8211; authentication token (if you have already
authenticated) note authurl/user/key/tenant_name
are not required when specifying preauthtoken</li>
<li><strong>snet</strong> &#8211; use SERVICENET internal network default is False</li>
<li><strong>starting_backoff</strong> &#8211; initial delay between retries (seconds)</li>
<li><strong>max_backoff</strong> &#8211; maximum delay between retries (seconds)</li>
<li><strong>auth_version</strong> &#8211; OpenStack auth version, default is 1.0</li>
<li><strong>tenant_name</strong> &#8211; The tenant/account name, required when connecting
to an auth 2.0 system.</li>
<li><strong>os_options</strong> &#8211; The OpenStack options which can have tenant_id,
auth_token, service_type, endpoint_type,
tenant_name, object_storage_url, region_name,
service_username, service_project_name, service_key</li>
<li><strong>insecure</strong> &#8211; Allow to access servers without checking SSL certs.
The server&#8217;s certificate will not be verified.</li>
<li><strong>ssl_compression</strong> &#8211; Whether to enable compression at the SSL layer.
If set to &#8216;False&#8217; and the pyOpenSSL library is
present an attempt to disable SSL compression
will be made. This may provide a performance
increase for https upload/download operations.</li>
<li><strong>retry_on_ratelimit</strong> &#8211; by default, a ratelimited connection will
raise an exception to the caller. Setting
this parameter to True will cause a retry
after a backoff.</li>
<li><strong>timeout</strong> &#8211; The connect timeout for the HTTP connection.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="swiftclient.client.Connection.close">
<code class="descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.close" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.delete_container">
<code class="descname">delete_container</code><span class="sig-paren">(</span><em>container</em>, <em>response_dict=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.delete_container" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper for <a class="reference internal" href="#swiftclient.client.delete_container" title="swiftclient.client.delete_container"><code class="xref py py-func docutils literal"><span class="pre">delete_container()</span></code></a></p>
</dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.delete_object">
<code class="descname">delete_object</code><span class="sig-paren">(</span><em>container</em>, <em>obj</em>, <em>query_string=None</em>, <em>response_dict=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.delete_object" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper for <a class="reference internal" href="#swiftclient.client.delete_object" title="swiftclient.client.delete_object"><code class="xref py py-func docutils literal"><span class="pre">delete_object()</span></code></a></p>
</dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.get_account">
<code class="descname">get_account</code><span class="sig-paren">(</span><em>marker=None</em>, <em>limit=None</em>, <em>prefix=None</em>, <em>end_marker=None</em>, <em>full_listing=False</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.get_account" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper for <a class="reference internal" href="#swiftclient.client.get_account" title="swiftclient.client.get_account"><code class="xref py py-func docutils literal"><span class="pre">get_account()</span></code></a></p>
</dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.get_auth">
<code class="descname">get_auth</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.get_auth" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.get_capabilities">
<code class="descname">get_capabilities</code><span class="sig-paren">(</span><em>url=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.get_capabilities" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.get_container">
<code class="descname">get_container</code><span class="sig-paren">(</span><em>container</em>, <em>marker=None</em>, <em>limit=None</em>, <em>prefix=None</em>, <em>delimiter=None</em>, <em>end_marker=None</em>, <em>path=None</em>, <em>full_listing=False</em>, <em>headers=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.get_container" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper for <a class="reference internal" href="#swiftclient.client.get_container" title="swiftclient.client.get_container"><code class="xref py py-func docutils literal"><span class="pre">get_container()</span></code></a></p>
</dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.get_object">
<code class="descname">get_object</code><span class="sig-paren">(</span><em>container</em>, <em>obj</em>, <em>resp_chunk_size=None</em>, <em>query_string=None</em>, <em>response_dict=None</em>, <em>headers=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.get_object" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper for <a class="reference internal" href="#swiftclient.client.get_object" title="swiftclient.client.get_object"><code class="xref py py-func docutils literal"><span class="pre">get_object()</span></code></a></p>
</dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.get_service_auth">
<code class="descname">get_service_auth</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.get_service_auth" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.head_account">
<code class="descname">head_account</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.head_account" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper for <a class="reference internal" href="#swiftclient.client.head_account" title="swiftclient.client.head_account"><code class="xref py py-func docutils literal"><span class="pre">head_account()</span></code></a></p>
</dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.head_container">
<code class="descname">head_container</code><span class="sig-paren">(</span><em>container</em>, <em>headers=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.head_container" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper for <a class="reference internal" href="#swiftclient.client.head_container" title="swiftclient.client.head_container"><code class="xref py py-func docutils literal"><span class="pre">head_container()</span></code></a></p>
</dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.head_object">
<code class="descname">head_object</code><span class="sig-paren">(</span><em>container</em>, <em>obj</em>, <em>headers=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.head_object" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper for <a class="reference internal" href="#swiftclient.client.head_object" title="swiftclient.client.head_object"><code class="xref py py-func docutils literal"><span class="pre">head_object()</span></code></a></p>
</dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.http_connection">
<code class="descname">http_connection</code><span class="sig-paren">(</span><em>url=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.http_connection" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.post_account">
<code class="descname">post_account</code><span class="sig-paren">(</span><em>headers</em>, <em>response_dict=None</em>, <em>query_string=None</em>, <em>data=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.post_account" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper for <a class="reference internal" href="#swiftclient.client.post_account" title="swiftclient.client.post_account"><code class="xref py py-func docutils literal"><span class="pre">post_account()</span></code></a></p>
</dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.post_container">
<code class="descname">post_container</code><span class="sig-paren">(</span><em>container</em>, <em>headers</em>, <em>response_dict=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.post_container" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper for <a class="reference internal" href="#swiftclient.client.post_container" title="swiftclient.client.post_container"><code class="xref py py-func docutils literal"><span class="pre">post_container()</span></code></a></p>
</dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.post_object">
<code class="descname">post_object</code><span class="sig-paren">(</span><em>container</em>, <em>obj</em>, <em>headers</em>, <em>response_dict=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.post_object" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper for <a class="reference internal" href="#swiftclient.client.post_object" title="swiftclient.client.post_object"><code class="xref py py-func docutils literal"><span class="pre">post_object()</span></code></a></p>
</dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.put_container">
<code class="descname">put_container</code><span class="sig-paren">(</span><em>container</em>, <em>headers=None</em>, <em>response_dict=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.put_container" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper for <a class="reference internal" href="#swiftclient.client.put_container" title="swiftclient.client.put_container"><code class="xref py py-func docutils literal"><span class="pre">put_container()</span></code></a></p>
</dd></dl>

<dl class="method">
<dt id="swiftclient.client.Connection.put_object">
<code class="descname">put_object</code><span class="sig-paren">(</span><em>container</em>, <em>obj</em>, <em>contents</em>, <em>content_length=None</em>, <em>etag=None</em>, <em>chunk_size=None</em>, <em>content_type=None</em>, <em>headers=None</em>, <em>query_string=None</em>, <em>response_dict=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.Connection.put_object" title="Permalink to this definition"></a></dt>
<dd><p>Wrapper for <a class="reference internal" href="#swiftclient.client.put_object" title="swiftclient.client.put_object"><code class="xref py py-func docutils literal"><span class="pre">put_object()</span></code></a></p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="swiftclient.client.HTTPConnection">
<em class="property">class </em><code class="descclassname">swiftclient.client.</code><code class="descname">HTTPConnection</code><span class="sig-paren">(</span><em>url</em>, <em>proxy=None</em>, <em>cacert=None</em>, <em>insecure=False</em>, <em>ssl_compression=False</em>, <em>default_user_agent=None</em>, <em>timeout=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.HTTPConnection" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Make an HTTPConnection or HTTPSConnection</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; url to connect to</li>
<li><strong>proxy</strong> &#8211; proxy to connect through, if any; None by default; str
of the format &#8216;<a class="reference external" href="http://127.0.0.1:8888">http://127.0.0.1:8888</a>&#8216; to set one</li>
<li><strong>cacert</strong> &#8211; A CA bundle file to use in verifying a TLS server
certificate.</li>
<li><strong>insecure</strong> &#8211; Allow to access servers without checking SSL certs.
The server&#8217;s certificate will not be verified.</li>
<li><strong>ssl_compression</strong> &#8211; SSL compression should be disabled by default
and this setting is not usable as of now. The
parameter is kept for backward compatibility.</li>
<li><strong>default_user_agent</strong> &#8211; Set the User-Agent header on every request.
If set to None (default), the user agent
will be &#8220;python-swiftclient-&lt;version&gt;&#8221;. This
may be overridden on a per-request basis by
explicitly setting the user-agent header on
a call to request().</li>
<li><strong>timeout</strong> &#8211; socket read timeout value, passed directly to
the requests library.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><strong>ClientException</strong> &#8211; Unable to handle protocol scheme</p>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="swiftclient.client.HTTPConnection.getresponse">
<code class="descname">getresponse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.HTTPConnection.getresponse" title="Permalink to this definition"></a></dt>
<dd><p>Adapt requests response to httplib interface</p>
</dd></dl>

<dl class="method">
<dt id="swiftclient.client.HTTPConnection.putrequest">
<code class="descname">putrequest</code><span class="sig-paren">(</span><em>full_path</em>, <em>data=None</em>, <em>headers=None</em>, <em>files=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.HTTPConnection.putrequest" title="Permalink to this definition"></a></dt>
<dd><p>Use python-requests files upload</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>data</strong> &#8211; Use data generator for chunked-transfer</li>
<li><strong>files</strong> &#8211; Use files for default transfer</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swiftclient.client.HTTPConnection.request">
<code class="descname">request</code><span class="sig-paren">(</span><em>method</em>, <em>full_path</em>, <em>data=None</em>, <em>headers=None</em>, <em>files=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.HTTPConnection.request" title="Permalink to this definition"></a></dt>
<dd><p>Encode url and header, then call requests.request</p>
</dd></dl>

</dd></dl>

<dl class="data">
<dt id="swiftclient.client.LOGGER_SENSITIVE_HEADERS">
<code class="descclassname">swiftclient.client.</code><code class="descname">LOGGER_SENSITIVE_HEADERS</code><em class="property"> = ['x-auth-token', 'x-auth-key', 'x-service-token', 'x-storage-token', 'x-account-meta-temp-url-key', 'x-account-meta-temp-url-key-2', 'x-container-meta-temp-url-key', 'x-container-meta-temp-url-key-2', 'set-cookie']</em><a class="headerlink" href="#swiftclient.client.LOGGER_SENSITIVE_HEADERS" title="Permalink to this definition"></a></dt>
<dd><p>A list of sensitive headers to redact in logs. Note that when extending this
list, the header names must be added in all lower case.</p>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.delete_container">
<code class="descclassname">swiftclient.client.</code><code class="descname">delete_container</code><span class="sig-paren">(</span><em>url</em>, <em>token</em>, <em>container</em>, <em>http_conn=None</em>, <em>response_dict=None</em>, <em>service_token=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.delete_container" title="Permalink to this definition"></a></dt>
<dd><p>Delete a container</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; storage URL</li>
<li><strong>token</strong> &#8211; auth token</li>
<li><strong>container</strong> &#8211; container name to delete</li>
<li><strong>http_conn</strong> &#8211; HTTP connection object (If None, it will create the
conn object)</li>
<li><strong>response_dict</strong> &#8211; an optional dictionary into which to place
the response - status, reason and headers</li>
<li><strong>service_token</strong> &#8211; service auth token</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><strong>ClientException</strong> &#8211; HTTP DELETE request failed</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.delete_object">
<code class="descclassname">swiftclient.client.</code><code class="descname">delete_object</code><span class="sig-paren">(</span><em>url</em>, <em>token=None</em>, <em>container=None</em>, <em>name=None</em>, <em>http_conn=None</em>, <em>headers=None</em>, <em>proxy=None</em>, <em>query_string=None</em>, <em>response_dict=None</em>, <em>service_token=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.delete_object" title="Permalink to this definition"></a></dt>
<dd><p>Delete object</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; storage URL</li>
<li><strong>token</strong> &#8211; auth token; if None, no token will be sent</li>
<li><strong>container</strong> &#8211; container name that the object is in; if None, the
container name is expected to be part of the url</li>
<li><strong>name</strong> &#8211; object name to delete; if None, the object name is expected to
be part of the url</li>
<li><strong>http_conn</strong> &#8211; HTTP connection object (If None, it will create the
conn object)</li>
<li><strong>headers</strong> &#8211; additional headers to include in the request</li>
<li><strong>proxy</strong> &#8211; proxy to connect through, if any; None by default; str of the
format &#8216;<a class="reference external" href="http://127.0.0.1:8888">http://127.0.0.1:8888</a>&#8216; to set one</li>
<li><strong>query_string</strong> &#8211; if set will be appended with &#8216;?&#8217; to generated path</li>
<li><strong>response_dict</strong> &#8211; an optional dictionary into which to place
the response - status, reason and headers</li>
<li><strong>service_token</strong> &#8211; service auth token</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><strong>ClientException</strong> &#8211; HTTP DELETE request failed</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.encode_meta_headers">
<code class="descclassname">swiftclient.client.</code><code class="descname">encode_meta_headers</code><span class="sig-paren">(</span><em>headers</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.encode_meta_headers" title="Permalink to this definition"></a></dt>
<dd><p>Only encode metadata headers keys</p>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.encode_utf8">
<code class="descclassname">swiftclient.client.</code><code class="descname">encode_utf8</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.encode_utf8" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swiftclient.client.get_account">
<code class="descclassname">swiftclient.client.</code><code class="descname">get_account</code><span class="sig-paren">(</span><em>url</em>, <em>token</em>, <em>marker=None</em>, <em>limit=None</em>, <em>prefix=None</em>, <em>end_marker=None</em>, <em>http_conn=None</em>, <em>full_listing=False</em>, <em>service_token=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.get_account" title="Permalink to this definition"></a></dt>
<dd><p>Get a listing of containers for the account.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; storage URL</li>
<li><strong>token</strong> &#8211; auth token</li>
<li><strong>marker</strong> &#8211; marker query</li>
<li><strong>limit</strong> &#8211; limit query</li>
<li><strong>prefix</strong> &#8211; prefix query</li>
<li><strong>end_marker</strong> &#8211; end_marker query</li>
<li><strong>http_conn</strong> &#8211; HTTP connection object (If None, it will create the
conn object)</li>
<li><strong>full_listing</strong> &#8211; if True, return a full listing, else returns a max
of 10000 listings</li>
<li><strong>service_token</strong> &#8211; service auth token</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a tuple of (response headers, a list of containers) The response
headers will be a dict and all header names will be lowercase.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><strong>ClientException</strong> &#8211; HTTP GET request failed</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.get_auth">
<code class="descclassname">swiftclient.client.</code><code class="descname">get_auth</code><span class="sig-paren">(</span><em>auth_url</em>, <em>user</em>, <em>key</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.get_auth" title="Permalink to this definition"></a></dt>
<dd><p>Get authentication/authorization credentials.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>auth_version</strong> &#8211; the api version of the supplied auth params</li>
<li><strong>os_options</strong> &#8211; a dict, the openstack identity service options</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a tuple, (storage_url, token)</p>
</td>
</tr>
</tbody>
</table>
<p>N.B. if the optional os_options parameter includes a non-empty
&#8216;object_storage_url&#8217; key it will override the the default storage url
returned by the auth service.</p>
<p>The snet parameter is used for Rackspace&#8217;s ServiceNet internal network
implementation. In this function, it simply adds <em>snet-</em> to the beginning
of the host name for the returned storage URL. With Rackspace Cloud Files,
use of this network path causes no bandwidth charges but requires the
client to be running on Rackspace&#8217;s ServiceNet network.</p>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.get_auth_1_0">
<code class="descclassname">swiftclient.client.</code><code class="descname">get_auth_1_0</code><span class="sig-paren">(</span><em>url</em>, <em>user</em>, <em>key</em>, <em>snet</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.get_auth_1_0" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swiftclient.client.get_auth_keystone">
<code class="descclassname">swiftclient.client.</code><code class="descname">get_auth_keystone</code><span class="sig-paren">(</span><em>auth_url</em>, <em>user</em>, <em>key</em>, <em>os_options</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.get_auth_keystone" title="Permalink to this definition"></a></dt>
<dd><p>Authenticate against a keystone server.</p>
<p>We are using the keystoneclient library for authentication.</p>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.get_capabilities">
<code class="descclassname">swiftclient.client.</code><code class="descname">get_capabilities</code><span class="sig-paren">(</span><em>http_conn</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.get_capabilities" title="Permalink to this definition"></a></dt>
<dd><p>Get cluster capability infos.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>http_conn</strong> &#8211; HTTP connection</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">a dict containing the cluster capabilities</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><strong>ClientException</strong> &#8211; HTTP Capabilities GET failed</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.get_container">
<code class="descclassname">swiftclient.client.</code><code class="descname">get_container</code><span class="sig-paren">(</span><em>url</em>, <em>token</em>, <em>container</em>, <em>marker=None</em>, <em>limit=None</em>, <em>prefix=None</em>, <em>delimiter=None</em>, <em>end_marker=None</em>, <em>path=None</em>, <em>http_conn=None</em>, <em>full_listing=False</em>, <em>service_token=None</em>, <em>headers=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.get_container" title="Permalink to this definition"></a></dt>
<dd><p>Get a listing of objects for the container.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; storage URL</li>
<li><strong>token</strong> &#8211; auth token</li>
<li><strong>container</strong> &#8211; container name to get a listing for</li>
<li><strong>marker</strong> &#8211; marker query</li>
<li><strong>limit</strong> &#8211; limit query</li>
<li><strong>prefix</strong> &#8211; prefix query</li>
<li><strong>delimiter</strong> &#8211; string to delimit the queries on</li>
<li><strong>end_marker</strong> &#8211; marker query</li>
<li><strong>path</strong> &#8211; path query (equivalent: &#8220;delimiter=/&#8221; and &#8220;prefix=path/&#8221;)</li>
<li><strong>http_conn</strong> &#8211; HTTP connection object (If None, it will create the
conn object)</li>
<li><strong>full_listing</strong> &#8211; if True, return a full listing, else returns a max
of 10000 listings</li>
<li><strong>service_token</strong> &#8211; service auth token</li>
<li><strong>headers</strong> &#8211; additional headers to include in the request</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a tuple of (response headers, a list of objects) The response
headers will be a dict and all header names will be lowercase.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><strong>ClientException</strong> &#8211; HTTP GET request failed</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.get_keystoneclient_2_0">
<code class="descclassname">swiftclient.client.</code><code class="descname">get_keystoneclient_2_0</code><span class="sig-paren">(</span><em>auth_url</em>, <em>user</em>, <em>key</em>, <em>os_options</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.get_keystoneclient_2_0" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swiftclient.client.get_object">
<code class="descclassname">swiftclient.client.</code><code class="descname">get_object</code><span class="sig-paren">(</span><em>url</em>, <em>token</em>, <em>container</em>, <em>name</em>, <em>http_conn=None</em>, <em>resp_chunk_size=None</em>, <em>query_string=None</em>, <em>response_dict=None</em>, <em>headers=None</em>, <em>service_token=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.get_object" title="Permalink to this definition"></a></dt>
<dd><p>Get an object</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; storage URL</li>
<li><strong>token</strong> &#8211; auth token</li>
<li><strong>container</strong> &#8211; container name that the object is in</li>
<li><strong>name</strong> &#8211; object name to get</li>
<li><strong>http_conn</strong> &#8211; HTTP connection object (If None, it will create the
conn object)</li>
<li><strong>resp_chunk_size</strong> &#8211; if defined, chunk size of data to read. NOTE: If
you specify a resp_chunk_size you must fully read
the object&#8217;s contents before making another
request.</li>
<li><strong>query_string</strong> &#8211; if set will be appended with &#8216;?&#8217; to generated path</li>
<li><strong>response_dict</strong> &#8211; an optional dictionary into which to place
the response - status, reason and headers</li>
<li><strong>headers</strong> &#8211; an optional dictionary with additional headers to include
in the request</li>
<li><strong>service_token</strong> &#8211; service auth token</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a tuple of (response headers, the object&#8217;s contents) The response
headers will be a dict and all header names will be lowercase.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><strong>ClientException</strong> &#8211; HTTP GET request failed</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.head_account">
<code class="descclassname">swiftclient.client.</code><code class="descname">head_account</code><span class="sig-paren">(</span><em>url</em>, <em>token</em>, <em>http_conn=None</em>, <em>service_token=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.head_account" title="Permalink to this definition"></a></dt>
<dd><p>Get account stats.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; storage URL</li>
<li><strong>token</strong> &#8211; auth token</li>
<li><strong>http_conn</strong> &#8211; HTTP connection object (If None, it will create the
conn object)</li>
<li><strong>service_token</strong> &#8211; service auth token</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a dict containing the response&#8217;s headers (all header names will
be lowercase)</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><strong>ClientException</strong> &#8211; HTTP HEAD request failed</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.head_container">
<code class="descclassname">swiftclient.client.</code><code class="descname">head_container</code><span class="sig-paren">(</span><em>url</em>, <em>token</em>, <em>container</em>, <em>http_conn=None</em>, <em>headers=None</em>, <em>service_token=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.head_container" title="Permalink to this definition"></a></dt>
<dd><p>Get container stats.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; storage URL</li>
<li><strong>token</strong> &#8211; auth token</li>
<li><strong>container</strong> &#8211; container name to get stats for</li>
<li><strong>http_conn</strong> &#8211; HTTP connection object (If None, it will create the
conn object)</li>
<li><strong>headers</strong> &#8211; additional headers to include in the request</li>
<li><strong>service_token</strong> &#8211; service auth token</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a dict containing the response&#8217;s headers (all header names will
be lowercase)</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><strong>ClientException</strong> &#8211; HTTP HEAD request failed</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.head_object">
<code class="descclassname">swiftclient.client.</code><code class="descname">head_object</code><span class="sig-paren">(</span><em>url</em>, <em>token</em>, <em>container</em>, <em>name</em>, <em>http_conn=None</em>, <em>service_token=None</em>, <em>headers=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.head_object" title="Permalink to this definition"></a></dt>
<dd><p>Get object info</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; storage URL</li>
<li><strong>token</strong> &#8211; auth token</li>
<li><strong>container</strong> &#8211; container name that the object is in</li>
<li><strong>name</strong> &#8211; object name to get info for</li>
<li><strong>http_conn</strong> &#8211; HTTP connection object (If None, it will create the
conn object)</li>
<li><strong>service_token</strong> &#8211; service auth token</li>
<li><strong>headers</strong> &#8211; additional headers to include in the request</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">a dict containing the response&#8217;s headers (all header names will
be lowercase)</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><strong>ClientException</strong> &#8211; HTTP HEAD request failed</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.http_connection">
<code class="descclassname">swiftclient.client.</code><code class="descname">http_connection</code><span class="sig-paren">(</span><em>*arg</em>, <em>**kwarg</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.http_connection" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">tuple of (parsed url, connection object)</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.http_log">
<code class="descclassname">swiftclient.client.</code><code class="descname">http_log</code><span class="sig-paren">(</span><em>args</em>, <em>kwargs</em>, <em>resp</em>, <em>body</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.http_log" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="data">
<dt id="swiftclient.client.logger_settings">
<code class="descclassname">swiftclient.client.</code><code class="descname">logger_settings</code><em class="property"> = {'redact_sensitive_headers': True, 'reveal_sensitive_prefix': 16}</em><a class="headerlink" href="#swiftclient.client.logger_settings" title="Permalink to this definition"></a></dt>
<dd><p>Default behaviour is to redact header values known to contain secrets,
such as <code class="docutils literal"><span class="pre">X-Auth-Key</span></code> and <code class="docutils literal"><span class="pre">X-Auth-Token</span></code>. Up to the first 16 chars
may be revealed.</p>
<p>To disable, set the value of <code class="docutils literal"><span class="pre">redact_sensitive_headers</span></code> to <code class="docutils literal"><span class="pre">False</span></code>.</p>
<p>When header redaction is enabled, <code class="docutils literal"><span class="pre">reveal_sensitive_prefix</span></code> configures the
maximum length of any sensitive header data sent to the logs. If the header
is less than twice this length, only <code class="docutils literal"><span class="pre">int(len(value)/2)</span></code> chars will be
logged; if it is less than 15 chars long, even less will be logged.</p>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.parse_header_string">
<code class="descclassname">swiftclient.client.</code><code class="descname">parse_header_string</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.parse_header_string" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swiftclient.client.post_account">
<code class="descclassname">swiftclient.client.</code><code class="descname">post_account</code><span class="sig-paren">(</span><em>url</em>, <em>token</em>, <em>headers</em>, <em>http_conn=None</em>, <em>response_dict=None</em>, <em>service_token=None</em>, <em>query_string=None</em>, <em>data=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.post_account" title="Permalink to this definition"></a></dt>
<dd><p>Update an account&#8217;s metadata.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; storage URL</li>
<li><strong>token</strong> &#8211; auth token</li>
<li><strong>headers</strong> &#8211; additional headers to include in the request</li>
<li><strong>http_conn</strong> &#8211; HTTP connection object (If None, it will create the
conn object)</li>
<li><strong>response_dict</strong> &#8211; an optional dictionary into which to place
the response - status, reason and headers</li>
<li><strong>service_token</strong> &#8211; service auth token</li>
<li><strong>query_string</strong> &#8211; if set will be appended with &#8216;?&#8217; to generated path</li>
<li><strong>data</strong> &#8211; an optional message body for the request</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first"><strong>ClientException</strong> &#8211; HTTP POST request failed</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">resp_headers, body</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.post_container">
<code class="descclassname">swiftclient.client.</code><code class="descname">post_container</code><span class="sig-paren">(</span><em>url</em>, <em>token</em>, <em>container</em>, <em>headers</em>, <em>http_conn=None</em>, <em>response_dict=None</em>, <em>service_token=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.post_container" title="Permalink to this definition"></a></dt>
<dd><p>Update a container&#8217;s metadata.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; storage URL</li>
<li><strong>token</strong> &#8211; auth token</li>
<li><strong>container</strong> &#8211; container name to update</li>
<li><strong>headers</strong> &#8211; additional headers to include in the request</li>
<li><strong>http_conn</strong> &#8211; HTTP connection object (If None, it will create the
conn object)</li>
<li><strong>response_dict</strong> &#8211; an optional dictionary into which to place
the response - status, reason and headers</li>
<li><strong>service_token</strong> &#8211; service auth token</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><strong>ClientException</strong> &#8211; HTTP POST request failed</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.post_object">
<code class="descclassname">swiftclient.client.</code><code class="descname">post_object</code><span class="sig-paren">(</span><em>url</em>, <em>token</em>, <em>container</em>, <em>name</em>, <em>headers</em>, <em>http_conn=None</em>, <em>response_dict=None</em>, <em>service_token=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.post_object" title="Permalink to this definition"></a></dt>
<dd><p>Update object metadata</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; storage URL</li>
<li><strong>token</strong> &#8211; auth token</li>
<li><strong>container</strong> &#8211; container name that the object is in</li>
<li><strong>name</strong> &#8211; name of the object to update</li>
<li><strong>headers</strong> &#8211; additional headers to include in the request</li>
<li><strong>http_conn</strong> &#8211; HTTP connection object (If None, it will create the
conn object)</li>
<li><strong>response_dict</strong> &#8211; an optional dictionary into which to place
the response - status, reason and headers</li>
<li><strong>service_token</strong> &#8211; service auth token</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><strong>ClientException</strong> &#8211; HTTP POST request failed</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.put_container">
<code class="descclassname">swiftclient.client.</code><code class="descname">put_container</code><span class="sig-paren">(</span><em>url</em>, <em>token</em>, <em>container</em>, <em>headers=None</em>, <em>http_conn=None</em>, <em>response_dict=None</em>, <em>service_token=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.put_container" title="Permalink to this definition"></a></dt>
<dd><p>Create a container</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; storage URL</li>
<li><strong>token</strong> &#8211; auth token</li>
<li><strong>container</strong> &#8211; container name to create</li>
<li><strong>headers</strong> &#8211; additional headers to include in the request</li>
<li><strong>http_conn</strong> &#8211; HTTP connection object (If None, it will create the
conn object)</li>
<li><strong>response_dict</strong> &#8211; an optional dictionary into which to place
the response - status, reason and headers</li>
<li><strong>service_token</strong> &#8211; service auth token</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><strong>ClientException</strong> &#8211; HTTP PUT request failed</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.put_object">
<code class="descclassname">swiftclient.client.</code><code class="descname">put_object</code><span class="sig-paren">(</span><em>url</em>, <em>token=None</em>, <em>container=None</em>, <em>name=None</em>, <em>contents=None</em>, <em>content_length=None</em>, <em>etag=None</em>, <em>chunk_size=None</em>, <em>content_type=None</em>, <em>headers=None</em>, <em>http_conn=None</em>, <em>proxy=None</em>, <em>query_string=None</em>, <em>response_dict=None</em>, <em>service_token=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.put_object" title="Permalink to this definition"></a></dt>
<dd><p>Put an object</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>url</strong> &#8211; storage URL</li>
<li><strong>token</strong> &#8211; auth token; if None, no token will be sent</li>
<li><strong>container</strong> &#8211; container name that the object is in; if None, the
container name is expected to be part of the url</li>
<li><strong>name</strong> &#8211; object name to put; if None, the object name is expected to be
part of the url</li>
<li><strong>contents</strong> &#8211; a string, a file-like object or an iterable
to read object data from;
if None, a zero-byte put will be done</li>
<li><strong>content_length</strong> &#8211; value to send as content-length header; also limits
the amount read from contents; if None, it will be
computed via the contents or chunked transfer
encoding will be used</li>
<li><strong>etag</strong> &#8211; etag of contents; if None, no etag will be sent</li>
<li><strong>chunk_size</strong> &#8211; chunk size of data to write; it defaults to 65536;
used only if the contents object has a &#8216;read&#8217;
method, e.g. file-like objects, ignored otherwise</li>
<li><strong>content_type</strong> &#8211; value to send as content-type header, overriding any
value included in the headers param; if None and no
value is found in the headers param, an empty string
value will be sent</li>
<li><strong>headers</strong> &#8211; additional headers to include in the request, if any</li>
<li><strong>http_conn</strong> &#8211; HTTP connection object (If None, it will create the
conn object)</li>
<li><strong>proxy</strong> &#8211; proxy to connect through, if any; None by default; str of the
format &#8216;<a class="reference external" href="http://127.0.0.1:8888">http://127.0.0.1:8888</a>&#8216; to set one</li>
<li><strong>query_string</strong> &#8211; if set will be appended with &#8216;?&#8217; to generated path</li>
<li><strong>response_dict</strong> &#8211; an optional dictionary into which to place
the response - status, reason and headers</li>
<li><strong>service_token</strong> &#8211; service auth token</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">etag</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><strong>ClientException</strong> &#8211; HTTP PUT request failed</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.quote">
<code class="descclassname">swiftclient.client.</code><code class="descname">quote</code><span class="sig-paren">(</span><em>value</em>, <em>safe='/'</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.quote" title="Permalink to this definition"></a></dt>
<dd><p>Patched version of urllib.quote that encodes utf8 strings before quoting.
On Python 3, call directly urllib.parse.quote().</p>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.resp_header_dict">
<code class="descclassname">swiftclient.client.</code><code class="descname">resp_header_dict</code><span class="sig-paren">(</span><em>resp</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.resp_header_dict" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swiftclient.client.safe_value">
<code class="descclassname">swiftclient.client.</code><code class="descname">safe_value</code><span class="sig-paren">(</span><em>name</em>, <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.safe_value" title="Permalink to this definition"></a></dt>
<dd><p>Only show up to logger_settings[&#8216;reveal_sensitive_prefix&#8217;] characters
from a sensitive header.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> &#8211; Header name</li>
<li><strong>value</strong> &#8211; Header value</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Safe header value</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.scrub_headers">
<code class="descclassname">swiftclient.client.</code><code class="descname">scrub_headers</code><span class="sig-paren">(</span><em>headers</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.scrub_headers" title="Permalink to this definition"></a></dt>
<dd><p>Redact header values that can contain sensitive information that
should not be logged.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>headers</strong> &#8211; Either a dict or an iterable of two-element tuples</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Safe dictionary of headers with sensitive information removed</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.client.store_response">
<code class="descclassname">swiftclient.client.</code><code class="descname">store_response</code><span class="sig-paren">(</span><em>resp</em>, <em>response_dict</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.client.store_response" title="Permalink to this definition"></a></dt>
<dd><p>store information about an operation into a dict</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>resp</strong> &#8211; an http response object containing the response
headers</li>
<li><strong>response_dict</strong> &#8211; a dict into which are placed the
status, reason and a dict of lower-cased headers</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="module-swiftclient.service">
<span id="swiftclient-service"></span><h1>swiftclient.service<a class="headerlink" href="#module-swiftclient.service" title="Permalink to this headline"></a></h1>
<dl class="class">
<dt id="swiftclient.service.ResultsIterator">
<em class="property">class </em><code class="descclassname">swiftclient.service.</code><code class="descname">ResultsIterator</code><span class="sig-paren">(</span><em>futures</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.ResultsIterator" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">six.Iterator</span></code></p>
</dd></dl>

<dl class="exception">
<dt id="swiftclient.service.SwiftError">
<em class="property">exception </em><code class="descclassname">swiftclient.service.</code><code class="descname">SwiftError</code><span class="sig-paren">(</span><em>value</em>, <em>container=None</em>, <em>obj=None</em>, <em>segment=None</em>, <em>exc=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.SwiftError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></code></p>
</dd></dl>

<dl class="class">
<dt id="swiftclient.service.SwiftPostObject">
<em class="property">class </em><code class="descclassname">swiftclient.service.</code><code class="descname">SwiftPostObject</code><span class="sig-paren">(</span><em>object_name</em>, <em>options=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.SwiftPostObject" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Class for specifying an object post, allowing the headers/metadata to be
specified separately for each individual object.</p>
</dd></dl>

<dl class="class">
<dt id="swiftclient.service.SwiftService">
<em class="property">class </em><code class="descclassname">swiftclient.service.</code><code class="descname">SwiftService</code><span class="sig-paren">(</span><em>options=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.SwiftService" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Service for performing swift operations</p>
<dl class="method">
<dt id="swiftclient.service.SwiftService.capabilities">
<code class="descname">capabilities</code><span class="sig-paren">(</span><em>url=None</em>, <em>refresh_cache=False</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.SwiftService.capabilities" title="Permalink to this definition"></a></dt>
<dd><p>List the cluster capabilities.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>url</strong> &#8211; Proxy URL of the cluster to retrieve capabilities.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dictionary containing the capabilities of the cluster.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body">ClientException</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swiftclient.service.SwiftService.delete">
<code class="descname">delete</code><span class="sig-paren">(</span><em>container=None</em>, <em>objects=None</em>, <em>options=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.SwiftService.delete" title="Permalink to this definition"></a></dt>
<dd><p>Delete operations on an account, optional container and optional list
of objects.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>container</strong> &#8211; The container to delete or delete from.</li>
<li><strong>objects</strong> &#8211; The list of objects to delete.</li>
<li><strong>options</strong> &#8211; <p>A dictionary containing options to override the global
options specified during the service object creation:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span>
    <span class="s1">&#39;yes_all&#39;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
    <span class="s1">&#39;leave_segments&#39;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
    <span class="s1">&#39;prefix&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="p">}</span>
</pre></div>
</div>
</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A generator for returning the results of the delete
operations. Each result yielded from the generator is either
a &#8216;delete_container&#8217;, &#8216;delete_object&#8217;, &#8216;delete_segment&#8217;, or
&#8216;bulk_delete&#8217; dictionary containing the results of an
individual delete operation.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first">ClientException</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">SwiftError</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swiftclient.service.SwiftService.download">
<code class="descname">download</code><span class="sig-paren">(</span><em>container=None</em>, <em>objects=None</em>, <em>options=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.SwiftService.download" title="Permalink to this definition"></a></dt>
<dd><p>Download operations on an account, optional container and optional list
of objects.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>container</strong> &#8211; The container to download from.</li>
<li><strong>objects</strong> &#8211; A list of object names to download (a list of strings).</li>
<li><strong>options</strong> &#8211; <p>A dictionary containing options to override the global
options specified during the service object creation:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span>
    <span class="s1">&#39;yes_all&#39;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
    <span class="s1">&#39;marker&#39;</span><span class="p">:</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
    <span class="s1">&#39;prefix&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s1">&#39;no_download&#39;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
    <span class="s1">&#39;header&#39;</span><span class="p">:</span> <span class="p">[],</span>
    <span class="s1">&#39;skip_identical&#39;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
    <span class="s1">&#39;out_directory&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s1">&#39;out_file&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s1">&#39;remove_prefix&#39;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
    <span class="s1">&#39;shuffle&#39;</span> <span class="p">:</span> <span class="bp">False</span>
<span class="p">}</span>
</pre></div>
</div>
</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A generator for returning the results of the download
operations. Each result yielded from the generator is a
&#8216;download_object&#8217; dictionary containing the results of an
individual file download.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first">ClientException</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">SwiftError</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swiftclient.service.SwiftService.list">
<code class="descname">list</code><span class="sig-paren">(</span><em>container=None</em>, <em>options=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.SwiftService.list" title="Permalink to this definition"></a></dt>
<dd><p>List operations on an account, container.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>container</strong> &#8211; The container to make the list operation against.</li>
<li><strong>options</strong> &#8211; <p>A dictionary containing options to override the global
options specified during the service object creation:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span>
    <span class="s1">&#39;long&#39;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
    <span class="s1">&#39;prefix&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s1">&#39;delimiter&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
<span class="p">}</span>
</pre></div>
</div>
</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A generator for returning the results of the list operation
on an account or container. Each result yielded from the
generator is either a &#8216;list_account_part&#8217; or
&#8216;list_container_part&#8217;, containing part of the listing.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swiftclient.service.SwiftService.post">
<code class="descname">post</code><span class="sig-paren">(</span><em>container=None</em>, <em>objects=None</em>, <em>options=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.SwiftService.post" title="Permalink to this definition"></a></dt>
<dd><p>Post operations on an account, container or list of objects</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>container</strong> &#8211; The container to make the post operation against.</li>
<li><strong>objects</strong> &#8211; <p>A list of object names (strings) or SwiftPostObject
instances containing an object name, and an
options dict (can be None) to override the options for
that individual post operation:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">[</span>
    <span class="s1">&#39;object_name&#39;</span><span class="p">,</span>
    <span class="n">SwiftPostObject</span><span class="p">(</span><span class="s1">&#39;object_name&#39;</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="p">{</span><span class="o">...</span><span class="p">}),</span>
    <span class="o">...</span>
<span class="p">]</span>
</pre></div>
</div>
<p>The options dict is described below.</p>
</li>
<li><strong>options</strong> &#8211; <p>A dictionary containing options to override the global
options specified during the service object creation.
These options are applied to all post operations
performed by this call, unless overridden on a per
object basis. Possible options are given below:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span>
    <span class="s1">&#39;meta&#39;</span><span class="p">:</span> <span class="p">[],</span>
    <span class="s1">&#39;headers&#39;</span><span class="p">:</span> <span class="p">[],</span>
    <span class="s1">&#39;read_acl&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>   <span class="c1"># For containers only</span>
    <span class="s1">&#39;write_acl&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>  <span class="c1"># For containers only</span>
    <span class="s1">&#39;sync_to&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>    <span class="c1"># For containers only</span>
    <span class="s1">&#39;sync_key&#39;</span><span class="p">:</span> <span class="bp">None</span>    <span class="c1"># For containers only</span>
<span class="p">}</span>
</pre></div>
</div>
</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Either a single result dictionary in the case of a post to a
container/account, or an iterator for returning the results
of posts to a list of objects.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">SwiftError</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swiftclient.service.SwiftService.stat">
<code class="descname">stat</code><span class="sig-paren">(</span><em>container=None</em>, <em>objects=None</em>, <em>options=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.SwiftService.stat" title="Permalink to this definition"></a></dt>
<dd><p>Get account stats, container stats or information about a list of
objects in a container.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>container</strong> &#8211; The container to query.</li>
<li><strong>objects</strong> &#8211; A list of object paths about which to return
information (a list of strings).</li>
<li><strong>options</strong> &#8211; <p>A dictionary containing options to override the global
options specified during the service object creation.
These options are applied to all stat operations
performed by this call:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span>
    <span class="s1">&#39;human&#39;</span><span class="p">:</span> <span class="bp">False</span>
<span class="p">}</span>
</pre></div>
</div>
</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Either a single dictionary containing stats about an account
or container, or an iterator for returning the results of the
stat operations on a list of objects.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">SwiftError</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="swiftclient.service.SwiftService.upload">
<code class="descname">upload</code><span class="sig-paren">(</span><em>container</em>, <em>objects</em>, <em>options=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.SwiftService.upload" title="Permalink to this definition"></a></dt>
<dd><p>Upload a list of objects to a given container.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>container</strong> &#8211; The container (or pseudo-folder path) to put the
uploads into.</li>
<li><strong>objects</strong> &#8211; <p>A list of file/directory names (strings) or
SwiftUploadObject instances containing a source for the
created object, an object name, and an options dict
(can be None) to override the options for that
individual upload operation:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">[</span>
    <span class="s1">&#39;/path/to/file&#39;</span><span class="p">,</span>
    <span class="n">SwiftUploadObject</span><span class="p">(</span><span class="s1">&#39;/path&#39;</span><span class="p">,</span> <span class="n">object_name</span><span class="o">=</span><span class="s1">&#39;obj1&#39;</span><span class="p">),</span>
    <span class="o">...</span>
<span class="p">]</span>
</pre></div>
</div>
<p>The options dict is as described below.</p>
<p>The SwiftUploadObject source may be one of:</p>
<blockquote>
<div><ul>
<li>A file-like object (with a read method)</li>
<li>A string containing the path to a local
file or directory</li>
<li>None, to indicate that we want an empty object</li>
</ul>
</div></blockquote>
</li>
<li><strong>options</strong> &#8211; <p>A dictionary containing options to override the global
options specified during the service object creation.
These options are applied to all upload operations
performed by this call, unless overridden on a per
object basis. Possible options are given below:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">{</span>
    <span class="s1">&#39;meta&#39;</span><span class="p">:</span> <span class="p">[],</span>
    <span class="s1">&#39;header&#39;</span><span class="p">:</span> <span class="p">[],</span>
    <span class="s1">&#39;segment_size&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s1">&#39;use_slo&#39;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
    <span class="s1">&#39;segment_container&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s1">&#39;leave_segments&#39;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
    <span class="s1">&#39;changed&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
    <span class="s1">&#39;skip_identical&#39;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
    <span class="s1">&#39;fail_fast&#39;</span><span class="p">:</span> <span class="bp">False</span><span class="p">,</span>
    <span class="s1">&#39;dir_marker&#39;</span><span class="p">:</span> <span class="bp">False</span>  <span class="c1"># Only for None sources</span>
<span class="p">}</span>
</pre></div>
</div>
</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A generator for returning the results of the uploads.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first">SwiftError</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">ClientException</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="swiftclient.service.SwiftUploadObject">
<em class="property">class </em><code class="descclassname">swiftclient.service.</code><code class="descname">SwiftUploadObject</code><span class="sig-paren">(</span><em>source</em>, <em>object_name=None</em>, <em>options=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.SwiftUploadObject" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Class for specifying an object upload, allowing the object source, name and
options to be specified separately for each individual object.</p>
</dd></dl>

<dl class="function">
<dt id="swiftclient.service.get_conn">
<code class="descclassname">swiftclient.service.</code><code class="descname">get_conn</code><span class="sig-paren">(</span><em>options</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.get_conn" title="Permalink to this definition"></a></dt>
<dd><p>Return a connection building it from the options.</p>
</dd></dl>

<dl class="function">
<dt id="swiftclient.service.get_from_queue">
<code class="descclassname">swiftclient.service.</code><code class="descname">get_from_queue</code><span class="sig-paren">(</span><em>q</em>, <em>timeout=864000</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.get_from_queue" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swiftclient.service.get_future_result">
<code class="descclassname">swiftclient.service.</code><code class="descname">get_future_result</code><span class="sig-paren">(</span><em>f</em>, <em>timeout=86400</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.get_future_result" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swiftclient.service.interruptable_as_completed">
<code class="descclassname">swiftclient.service.</code><code class="descname">interruptable_as_completed</code><span class="sig-paren">(</span><em>fs</em>, <em>timeout=86400</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.interruptable_as_completed" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swiftclient.service.mkdirs">
<code class="descclassname">swiftclient.service.</code><code class="descname">mkdirs</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.mkdirs" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swiftclient.service.process_options">
<code class="descclassname">swiftclient.service.</code><code class="descname">process_options</code><span class="sig-paren">(</span><em>options</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.process_options" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swiftclient.service.split_headers">
<code class="descclassname">swiftclient.service.</code><code class="descname">split_headers</code><span class="sig-paren">(</span><em>options</em>, <em>prefix=u''</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.service.split_headers" title="Permalink to this definition"></a></dt>
<dd><p>Splits &#8216;Key: Value&#8217; strings and returns them as a dictionary.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>options</strong> &#8211; An array of &#8216;Key: Value&#8217; strings</li>
<li><strong>prefix</strong> &#8211; String to prepend to all of the keys in the dictionary.
reporting.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="module-swiftclient.exceptions">
<span id="swiftclient-exceptions"></span><h1>swiftclient.exceptions<a class="headerlink" href="#module-swiftclient.exceptions" title="Permalink to this headline"></a></h1>
<dl class="exception">
<dt id="swiftclient.exceptions.ClientException">
<em class="property">exception </em><code class="descclassname">swiftclient.exceptions.</code><code class="descname">ClientException</code><span class="sig-paren">(</span><em>msg</em>, <em>http_scheme=''</em>, <em>http_host=''</em>, <em>http_port=''</em>, <em>http_path=''</em>, <em>http_query=''</em>, <em>http_status=None</em>, <em>http_reason=''</em>, <em>http_device=''</em>, <em>http_response_content=''</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.exceptions.ClientException" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></code></p>
</dd></dl>

</div>
<div class="section" id="module-swiftclient.multithreading">
<span id="swiftclient-multithreading"></span><h1>swiftclient.multithreading<a class="headerlink" href="#module-swiftclient.multithreading" title="Permalink to this headline"></a></h1>
<dl class="class">
<dt id="swiftclient.multithreading.ConnectionThreadPoolExecutor">
<em class="property">class </em><code class="descclassname">swiftclient.multithreading.</code><code class="descname">ConnectionThreadPoolExecutor</code><span class="sig-paren">(</span><em>create_connection</em>, <em>max_workers</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.multithreading.ConnectionThreadPoolExecutor" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">concurrent.futures.thread.ThreadPoolExecutor</span></code></p>
<p>A wrapper class to maintain a pool of connections alongside the thread
pool. We start by creating a priority queue of connections, and each job
submitted takes one of those connections (initialising if necessary) and
passes it as the first arg to the executed function.</p>
<p>At the end of execution that connection is returned to the queue.</p>
<p>By using a PriorityQueue we avoid creating more connections than required.
We will only create as many connections as are required concurrently.</p>
<dl class="method">
<dt id="swiftclient.multithreading.ConnectionThreadPoolExecutor.submit">
<code class="descname">submit</code><span class="sig-paren">(</span><em>fn</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.multithreading.ConnectionThreadPoolExecutor.submit" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="swiftclient.multithreading.MultiThreadingManager">
<em class="property">class </em><code class="descclassname">swiftclient.multithreading.</code><code class="descname">MultiThreadingManager</code><span class="sig-paren">(</span><em>create_connection</em>, <em>segment_threads=10</em>, <em>object_dd_threads=10</em>, <em>object_uu_threads=10</em>, <em>container_threads=10</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.multithreading.MultiThreadingManager" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>One object to manage context for multi-threading.  This should make
bin/swift less error-prone and allow us to test this code.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>segment_threads</strong> &#8211; The number of threads allocated to segment
uploads</li>
<li><strong>object_dd_threads</strong> &#8211; The number of threads allocated to object
download/delete jobs</li>
<li><strong>object_uu_threads</strong> &#8211; The number of threads allocated to object
upload/update based jobs</li>
<li><strong>container_threads</strong> &#8211; The number of threads allocated to
container/account level jobs</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="class">
<dt id="swiftclient.multithreading.OutputManager">
<em class="property">class </em><code class="descclassname">swiftclient.multithreading.</code><code class="descname">OutputManager</code><span class="sig-paren">(</span><em>print_stream=None</em>, <em>error_stream=None</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.multithreading.OutputManager" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>One object to manage and provide helper functions for output.</p>
<p>This object is a context manager and returns itself into the context.  When
entering the context, two printing threads are created (see below) and they
are waited on and cleaned up when exiting the context.</p>
<p>Also, thread-safe printing to two streams is provided.  The
<a class="reference internal" href="#swiftclient.multithreading.OutputManager.print_msg" title="swiftclient.multithreading.OutputManager.print_msg"><code class="xref py py-meth docutils literal"><span class="pre">print_msg()</span></code></a> method will print to the supplied <code class="docutils literal"><span class="pre">print_stream</span></code>
(defaults to <code class="docutils literal"><span class="pre">sys.stdout</span></code>) and the <a class="reference internal" href="#swiftclient.multithreading.OutputManager.error" title="swiftclient.multithreading.OutputManager.error"><code class="xref py py-meth docutils literal"><span class="pre">error()</span></code></a> method will print to the
supplied <code class="docutils literal"><span class="pre">error_stream</span></code> (defaults to <code class="docutils literal"><span class="pre">sys.stderr</span></code>).  Both of these
printing methods will format the given string with any supplied <code class="docutils literal"><span class="pre">*args</span></code>
(a la printf). On Python 2, Unicode messages are encoded to utf8.</p>
<p>The attribute <code class="xref py py-attr docutils literal"><span class="pre">self.error_count</span></code> is incremented once per error
message printed, so an application can tell if any worker threads
encountered exceptions or otherwise called <a class="reference internal" href="#swiftclient.multithreading.OutputManager.error" title="swiftclient.multithreading.OutputManager.error"><code class="xref py py-meth docutils literal"><span class="pre">error()</span></code></a> on this instance.
The swift command-line tool uses this to exit non-zero if any error strings
were printed.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>print_stream</strong> &#8211; The stream to which <a class="reference internal" href="#swiftclient.multithreading.OutputManager.print_msg" title="swiftclient.multithreading.OutputManager.print_msg"><code class="xref py py-meth docutils literal"><span class="pre">print_msg()</span></code></a> sends
formatted messages.</li>
<li><strong>error_stream</strong> &#8211; The stream to which <a class="reference internal" href="#swiftclient.multithreading.OutputManager.error" title="swiftclient.multithreading.OutputManager.error"><code class="xref py py-meth docutils literal"><span class="pre">error()</span></code></a> sends formatted
messages.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>On Python 2, Unicode messages are encoded to utf8.</p>
<dl class="attribute">
<dt id="swiftclient.multithreading.OutputManager.DEFAULT_OFFSET">
<code class="descname">DEFAULT_OFFSET</code><em class="property"> = 14</em><a class="headerlink" href="#swiftclient.multithreading.OutputManager.DEFAULT_OFFSET" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swiftclient.multithreading.OutputManager.error">
<code class="descname">error</code><span class="sig-paren">(</span><em>msg</em>, <em>*fmt_args</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.multithreading.OutputManager.error" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swiftclient.multithreading.OutputManager.get_error_count">
<code class="descname">get_error_count</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.multithreading.OutputManager.get_error_count" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swiftclient.multithreading.OutputManager.print_items">
<code class="descname">print_items</code><span class="sig-paren">(</span><em>items</em>, <em>offset=14</em>, <em>skip_missing=False</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.multithreading.OutputManager.print_items" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swiftclient.multithreading.OutputManager.print_msg">
<code class="descname">print_msg</code><span class="sig-paren">(</span><em>msg</em>, <em>*fmt_args</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.multithreading.OutputManager.print_msg" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swiftclient.multithreading.OutputManager.print_raw">
<code class="descname">print_raw</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.multithreading.OutputManager.print_raw" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swiftclient.multithreading.OutputManager.warning">
<code class="descname">warning</code><span class="sig-paren">(</span><em>msg</em>, <em>*fmt_args</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.multithreading.OutputManager.warning" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-swiftclient.utils">
<span id="swiftclient-utils"></span><h1>swiftclient.utils<a class="headerlink" href="#module-swiftclient.utils" title="Permalink to this headline"></a></h1>
<p>Miscellaneous utility functions for use with Swift.</p>
<dl class="class">
<dt id="swiftclient.utils.LengthWrapper">
<em class="property">class </em><code class="descclassname">swiftclient.utils.</code><code class="descname">LengthWrapper</code><span class="sig-paren">(</span><em>readable</em>, <em>length</em>, <em>md5=False</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.LengthWrapper" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Wrap a filelike object with a maximum length.</p>
<p>Fix for <a class="reference external" href="https://github.com/kennethreitz/requests/issues/1648">https://github.com/kennethreitz/requests/issues/1648</a>.
It is recommended to use this class only on files opened in binary mode.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>readable</strong> &#8211; The filelike object to read from.</li>
<li><strong>length</strong> &#8211; The maximum amount of content that can be read from
the filelike object before it is simulated to be
empty.</li>
<li><strong>md5</strong> &#8211; Flag to enable calculating the MD5 of the content
as it is read.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="swiftclient.utils.LengthWrapper.get_md5sum">
<code class="descname">get_md5sum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.LengthWrapper.get_md5sum" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swiftclient.utils.LengthWrapper.read">
<code class="descname">read</code><span class="sig-paren">(</span><em>size=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.LengthWrapper.read" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="swiftclient.utils.LengthWrapper.reset">
<code class="descname">reset</code><a class="headerlink" href="#swiftclient.utils.LengthWrapper.reset" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="swiftclient.utils.NoopMD5">
<em class="property">class </em><code class="descclassname">swiftclient.utils.</code><code class="descname">NoopMD5</code><span class="sig-paren">(</span><em>*a</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.NoopMD5" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<dl class="method">
<dt id="swiftclient.utils.NoopMD5.hexdigest">
<code class="descname">hexdigest</code><span class="sig-paren">(</span><em>*a</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.NoopMD5.hexdigest" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swiftclient.utils.NoopMD5.update">
<code class="descname">update</code><span class="sig-paren">(</span><em>*a</em>, <em>**kw</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.NoopMD5.update" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="swiftclient.utils.ReadableToIterable">
<em class="property">class </em><code class="descclassname">swiftclient.utils.</code><code class="descname">ReadableToIterable</code><span class="sig-paren">(</span><em>content</em>, <em>chunk_size=65536</em>, <em>md5=False</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.ReadableToIterable" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Wrap a filelike object and act as an iterator.</p>
<p>It is recommended to use this class only on files opened in binary mode.
Due to the Unicode changes in Python 3, files are now opened using an
encoding not suitable for use with the md5 class and because of this
hit the exception on every call to next. This could cause problems,
especially with large files and small chunk sizes.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>content</strong> &#8211; The filelike object that is yielded from.</li>
<li><strong>chunk_size</strong> &#8211; The max size of each yielded item.</li>
<li><strong>md5</strong> &#8211; Flag to enable calculating the MD5 of the content
as it is yielded.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="swiftclient.utils.ReadableToIterable.get_md5sum">
<code class="descname">get_md5sum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.ReadableToIterable.get_md5sum" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="swiftclient.utils.ReadableToIterable.next">
<code class="descname">next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.ReadableToIterable.next" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="function">
<dt id="swiftclient.utils.config_true_value">
<code class="descclassname">swiftclient.utils.</code><code class="descname">config_true_value</code><span class="sig-paren">(</span><em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.config_true_value" title="Permalink to this definition"></a></dt>
<dd><p>Returns True if the value is either True or a string in TRUE_VALUES.
Returns False otherwise.
This function comes from swift.common.utils.config_true_value()</p>
</dd></dl>

<dl class="function">
<dt id="swiftclient.utils.generate_temp_url">
<code class="descclassname">swiftclient.utils.</code><code class="descname">generate_temp_url</code><span class="sig-paren">(</span><em>path</em>, <em>seconds</em>, <em>key</em>, <em>method</em>, <em>absolute=False</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.generate_temp_url" title="Permalink to this definition"></a></dt>
<dd><p>Generates a temporary URL that gives unauthenticated access to the
Swift object.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>path</strong> &#8211; The full path to the Swift object. Example:
/v1/AUTH_account/c/o.</li>
<li><strong>seconds</strong> &#8211; The amount of time in seconds the temporary URL will
be valid for.</li>
<li><strong>key</strong> &#8211; The secret temporary URL key set on the Swift
cluster. To set a key, run &#8216;swift post -m
&#8220;Temp-URL-Key: &lt;substitute tempurl key here&gt;&#8221;&#8217;</li>
<li><strong>method</strong> &#8211; A HTTP method, typically either GET or PUT, to allow
for this temporary URL.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first">ValueError if seconds is not a positive integer</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first">TypeError if seconds is not an integer</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the path portion of a temporary URL</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="swiftclient.utils.iter_wrapper">
<code class="descclassname">swiftclient.utils.</code><code class="descname">iter_wrapper</code><span class="sig-paren">(</span><em>iterable</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.iter_wrapper" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swiftclient.utils.n_at_a_time">
<code class="descclassname">swiftclient.utils.</code><code class="descname">n_at_a_time</code><span class="sig-paren">(</span><em>seq</em>, <em>n</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.n_at_a_time" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swiftclient.utils.n_groups">
<code class="descclassname">swiftclient.utils.</code><code class="descname">n_groups</code><span class="sig-paren">(</span><em>seq</em>, <em>n</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.n_groups" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swiftclient.utils.parse_api_response">
<code class="descclassname">swiftclient.utils.</code><code class="descname">parse_api_response</code><span class="sig-paren">(</span><em>headers</em>, <em>body</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.parse_api_response" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="swiftclient.utils.prt_bytes">
<code class="descclassname">swiftclient.utils.</code><code class="descname">prt_bytes</code><span class="sig-paren">(</span><em>num_bytes</em>, <em>human_flag</em><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.prt_bytes" title="Permalink to this definition"></a></dt>
<dd><p>convert a number &gt; 1024 to printable format, either in 4 char -h format as
with ls -lh or return as 12 char right justified string</p>
</dd></dl>

<dl class="function">
<dt id="swiftclient.utils.report_traceback">
<code class="descclassname">swiftclient.utils.</code><code class="descname">report_traceback</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#swiftclient.utils.report_traceback" title="Permalink to this definition"></a></dt>
<dd><p>Reports a timestamp and full traceback for a given exception.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Full traceback and timestamp.</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>


          </div>
        </div>
      </div>
<div class="sphinxsidebar">
    <div class="sphinxsidebarwrapper">
            <h3><a href="index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference internal" href="#">swiftclient</a></li>
<li><a class="reference internal" href="#module-swiftclient.client">swiftclient.client</a></li>
<li><a class="reference internal" href="#module-swiftclient.service">swiftclient.service</a></li>
<li><a class="reference internal" href="#module-swiftclient.exceptions">swiftclient.exceptions</a></li>
<li><a class="reference internal" href="#module-swiftclient.multithreading">swiftclient.multithreading</a></li>
<li><a class="reference internal" href="#module-swiftclient.utils">swiftclient.utils</a></li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="sdk.html"
                                  title="previous chapter">SDK</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="_sources/swiftclient.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
    </div>
</div>

      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="sdk.html" title="SDK"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Swiftclient 3.0.0 documentation</a> &raquo;</li> 
      </ul>
    </div>

    <div class="footer" role="contentinfo">
        &copy; Copyright 2013 OpenStack, LLC..
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
    </div>
<script type="text/javascript">
try {
//Tracking docs.openstack.org/developer/<projectname> only
//The URL is built from the project variable in conf.py
var pageTracker = _gat._getTracker("UA-17511903-1");
pageTracker._setCookiePath("/developer/Swiftclient");
pageTracker._trackPageview();
} catch(err) {}</script>

  </body>
</html>